summaryrefslogtreecommitdiffstats
path: root/graphics/picturebook
diff options
context:
space:
mode:
authorknu <knu@FreeBSD.org>2001-09-18 07:47:54 +0000
committerknu <knu@FreeBSD.org>2001-09-18 07:47:54 +0000
commitdf1ff1a87e9567debc47f589bc27abf88e2ec333 (patch)
treed995f0658df96a2a62324b41ea9c60fc7f298990 /graphics/picturebook
parenta41925010f645cc60ee19b6310205403add90164 (diff)
downloadFreeBSD-ports-df1ff1a87e9567debc47f589bc27abf88e2ec333.zip
FreeBSD-ports-df1ff1a87e9567debc47f589bc27abf88e2ec333.tar.gz
Compile and install setbrightness and vaiobat applying patches
contributed by Hiroshi TOKUDA <tokudah@nttdata.co.jp>. PR: ports/29591 Submitted by: Yoichi NAKAYAMA <yoichi@eken.phys.nagoya-u.ac.jp> Approved by: MAINTAINER's silence (timeout)
Diffstat (limited to 'graphics/picturebook')
-rw-r--r--graphics/picturebook/Makefile21
-rw-r--r--graphics/picturebook/files/patch-ba92
-rw-r--r--graphics/picturebook/files/patch-bb79
-rw-r--r--graphics/picturebook/pkg-descr6
-rw-r--r--graphics/picturebook/pkg-plist2
5 files changed, 194 insertions, 6 deletions
diff --git a/graphics/picturebook/Makefile b/graphics/picturebook/Makefile
index 5e0e650..d2ad63d 100644
--- a/graphics/picturebook/Makefile
+++ b/graphics/picturebook/Makefile
@@ -7,20 +7,29 @@
PORTNAME= picturebook
PORTVERSION= 20010422
+PORTREVISION= 1
CATEGORIES= graphics
MASTER_SITES= http://samba.org/picturebook/
DISTNAME= capture
EXTRACT_SUFX= .tgz
-MAINTAINER= alan@clegg.com
+MAINTAINER= alan@clegg.com
+
+WRKSRC= ${WRKDIR}/${PORTNAME}
+USE_IMLIB= yes
+
+post-build:
+ cd ${WRKSRC}; \
+ ${CC} ${CFLAGS} -o setbrightness setbrightness.c; \
+ ${CC} ${CFLAGS} -o vaiobat vaiobat.c
-WRKSRC= ${WRKDIR}/picturebook
-USE_IMLIB=yes
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/capture ${PREFIX}/bin/capture
- ${MKDIR} ${PREFIX}/share/doc/picturebook
- ${INSTALL_MAN} ${WRKSRC}/README ${PREFIX}/share/doc/picturebook/README
+ ${INSTALL_PROGRAM} ${WRKSRC}/setbrightness ${PREFIX}/sbin/setbrightness
+ ${INSTALL_PROGRAM} ${WRKSRC}/vaiobat ${PREFIX}/sbin/vaiobat
+ ${MKDIR} ${DOCSDIR}
+ ${INSTALL_MAN} ${WRKSRC}/README ${DOCSDIR}/README
.if!defined(NOPORTDOCS)
- ${INSTALL_MAN} ${PATCHDIR}/README.FreeBSD ${PREFIX}/share/doc/picturebook/README.FreeBSD
+ ${INSTALL_MAN} ${PATCHDIR}/README.FreeBSD ${DOCSDIR}/README.FreeBSD
.endif
.include <bsd.port.mk>
diff --git a/graphics/picturebook/files/patch-ba b/graphics/picturebook/files/patch-ba
new file mode 100644
index 0000000..0bae753
--- /dev/null
+++ b/graphics/picturebook/files/patch-ba
@@ -0,0 +1,92 @@
+--- setbrightness.c.orig Tue Dec 12 09:42:20 2000
++++ setbrightness.c Mon Jul 30 14:29:54 2001
+@@ -4,17 +4,47 @@
+ #include <unistd.h>
+ #include <fcntl.h>
+ #include <errno.h>
++#ifdef LINUX
+ #include <sys/io.h>
++#endif
+ #include <sys/mman.h>
+ #include <dirent.h>
+ #include <ctype.h>
++#ifdef LINUX
+ #include <malloc.h>
++#endif
+ #include <string.h>
+ #include <signal.h>
++#ifdef HAVE_GETOPT_H
+ #include <getopt.h>
++#endif
++#ifdef LINUX
+ #include <linux/pci.h>
++#endif
+ #include <sys/time.h>
+
++#ifdef __FreeBSD__
++#include <machine/cpufunc.h>
++static int deviofd=-1;
++static int iopl(int lvl)
++{
++ if(lvl==0){
++ if(deviofd!=-1){
++ close(deviofd);
++ deviofd=-1;
++ }
++ return 0;
++ }else if(lvl==3){
++ if(deviofd==-1){
++ deviofd=open("/dev/io",0);
++ }
++ return deviofd;
++ }
++ return -1;
++}
++
++#endif
++
+
+ #define DATA_REG 0x62
+ #define CST_REG 0x66
+@@ -24,28 +54,35 @@
+ static void ecr_set(u16 addr, u16 value)
+ {
+ while (inw(CST_REG) & 3) usleep(1);
+- outw(0x81, CST_REG);
++ outw(CST_REG, 0x81);
+ while (inw(CST_REG) & 2) usleep(1);
+- outw(addr, DATA_REG);
++ outw(DATA_REG, addr);
+ while (inw(CST_REG) & 2) usleep(1);
+- outw(value, DATA_REG);
++ outw(DATA_REG, value);
+ while (inw(CST_REG) & 2) usleep(1);
+ }
+
+ static u16 ecr_get(u16 addr)
+ {
+ while (inw(CST_REG) & 3) usleep(1);
+- outb(0x80, CST_REG);
++ outb(CST_REG, 0x80);
+ while (inw(CST_REG) & 2) usleep(1);
+- outb(addr, DATA_REG);
++ outb(DATA_REG, addr);
+ while (inw(CST_REG) & 2) usleep(1);
+ return inw(DATA_REG);
+ }
+
+ int main(int argc, char *argv[])
+ {
++ if(open("/dev/io", O_RDWR, 0) < 0)
++ {
++ perror("/dev/io");
++ return 1;
++ }
+ iopl(3);
+ printf("currently %x\n", ecr_get(0x96));
+- ecr_set(0x96, atoi(argv[1]));
++ if ( argv[1] != NULL ){
++ ecr_set(0x96, atoi(argv[1]));
++ }
+ return 0;
+ }
diff --git a/graphics/picturebook/files/patch-bb b/graphics/picturebook/files/patch-bb
new file mode 100644
index 0000000..d682f9b
--- /dev/null
+++ b/graphics/picturebook/files/patch-bb
@@ -0,0 +1,79 @@
+--- vaiobat.c Tue Dec 12 09:42:20 2000
++++ vaiobat.c Wed Mar 21 20:16:59 2001
+@@ -4,18 +4,50 @@
+ #include <unistd.h>
+ #include <fcntl.h>
+ #include <errno.h>
++#ifdef LINUX
+ #include <sys/io.h>
++#endif
+ #include <sys/mman.h>
+ #include <dirent.h>
+ #include <ctype.h>
++#ifdef LINUX
+ #include <malloc.h>
++#endif
+ #include <string.h>
+ #include <signal.h>
++#ifdef HAVE_GETOPT_H
+ #include <getopt.h>
++#endif
++#ifdef LINUX
+ #include <linux/pci.h>
++#endif
+ #include <sys/time.h>
+
+
++
++#ifdef __FreeBSD__
++#include <machine/cpufunc.h>
++static int deviofd=-1;
++static int iopl(int lvl)
++{
++ if(lvl==0){
++ if(deviofd!=-1){
++ close(deviofd);
++ deviofd=-1;
++ }
++ return 0;
++ }else if(lvl==3){
++ if(deviofd==-1){
++ deviofd=open("/dev/io",0);
++ }
++ return deviofd;
++ }
++ return -1;
++}
++
++#endif
++
++
+ #define DATA_REG 0x62
+ #define CST_REG 0x66
+
+@@ -25,20 +57,20 @@
+ static void ecr_set(u8 addr, u8 value)
+ {
+ while (inb(CST_REG) & 3) usleep(1);
+- outb(0x81, CST_REG);
++ outb(CST_REG, 0x81);
+ while (inb(CST_REG) & 2) usleep(1);
+- outb(addr, DATA_REG);
++ outb(DATA_REG, addr);
+ while (inb(CST_REG) & 2) usleep(1);
+- outb(value, DATA_REG);
++ outb(DATA_REG, value);
+ while (inb(CST_REG) & 2) usleep(1);
+ }
+
+ static u8 ecr_get(u8 addr)
+ {
+ while (inb(CST_REG) & 3) usleep(1);
+- outb(0x80, CST_REG);
++ outb(CST_REG, 0x80);
+ while (inb(CST_REG) & 2) usleep(1);
+- outb(addr, DATA_REG);
++ outb(DATA_REG, addr);
+ while (inb(CST_REG) & 2) usleep(1);
+ return inb(DATA_REG);
+ }
diff --git a/graphics/picturebook/pkg-descr b/graphics/picturebook/pkg-descr
index a3f4ca7..fa8396e 100644
--- a/graphics/picturebook/pkg-descr
+++ b/graphics/picturebook/pkg-descr
@@ -1,2 +1,8 @@
Picturebook is an experimental utility for capturing from SONY VAIO camera.
+This port includes following binaries
+ capture / capture utility for VAIO camera
+ setbrightness / LCD brightness control tool
+ (usage: setbrightness [0-255])
+ vaiobat / get battery status
+
WWW: http://samba.org/picturebook/
diff --git a/graphics/picturebook/pkg-plist b/graphics/picturebook/pkg-plist
index 66dd861..d2495e6 100644
--- a/graphics/picturebook/pkg-plist
+++ b/graphics/picturebook/pkg-plist
@@ -1,4 +1,6 @@
bin/capture
+sbin/setbrightness
+sbin/vaiobat
share/doc/picturebook/README
share/doc/picturebook/README.FreeBSD
@dirrm share/doc/picturebook
OpenPOWER on IntegriCloud