aboutsummaryrefslogtreecommitdiff
path: root/graphics/picturebook
diff options
context:
space:
mode:
authorAkinori MUSHA <knu@FreeBSD.org>2001-09-18 07:47:54 +0000
committerAkinori MUSHA <knu@FreeBSD.org>2001-09-18 07:47:54 +0000
commite89f3be3bd7b09ef152b0670c58b38fa6727d2f2 (patch)
treeec9f09acee32c5d78268fb8b3a771cac972b3a4e /graphics/picturebook
parent3c2bd91eb296c5737e4661f64732230ee5072515 (diff)
downloadports-e89f3be3bd7b09ef152b0670c58b38fa6727d2f2.tar.gz
ports-e89f3be3bd7b09ef152b0670c58b38fa6727d2f2.zip
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)
Notes
Notes: svn path=/head/; revision=47946
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 5e0e650b96f4..d2ad63de4ad3 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 000000000000..0bae7539b563
--- /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 000000000000..d682f9b0e0f5
--- /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 a3f4ca72c417..fa8396ec178c 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 66dd861c6011..d2495e61557c 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