[update] graphics/dcraw - 8.80

2007-11-23 Thread Stuart Henderson
tested with canon CR2 files on amd64 and sparc64.

I kept the patches for strcpy and friends since some web-server
scripts use dcraw with maybe dodgy files.

ok to commit?

(btw, mbalmer, there's a new ufraw which uses this version too)

Index: Makefile
===
RCS file: /cvs/ports/graphics/dcraw/Makefile,v
retrieving revision 1.9
diff -u -p -r1.9 Makefile
--- Makefile15 Sep 2007 20:09:40 -  1.9
+++ Makefile23 Nov 2007 10:26:23 -
@@ -2,18 +2,15 @@
 
 COMMENT=   digital camera RAW format conversion tool
 
-DISTNAME=  dcraw-8.19
-PKGNAME=   ${DISTNAME}p0
+DISTNAME=  dcraw-8.80
 CATEGORIES=graphics
 
 HOMEPAGE=  http://www.cybercom.net/~dcoffin/dcraw/
 
-MASTER_SITES=  http://www.oxide.org/dcraw/${DISTNAME}/
+MASTER_SITES=  http://cybercom.net/~dcoffin/dcraw/archive/

-DISTFILES= dcraw.c dcraw.1
-DIST_SUBDIR=   ${DISTNAME}
-
-LIB_DEPENDS=   jpeg.=6::graphics/jpeg
+LIB_DEPENDS=   jpeg.=6::graphics/jpeg \
+   lcms::graphics/lcms
 
 # Some code is completely free, some is under the GPL
 PERMIT_PACKAGE_CDROM=  Yes
@@ -26,18 +23,16 @@ WANTLIB=c m
 NO_REGRESS=Yes
 SEPARATE_BUILD=simple
 
-do-extract:
-   mkdir ${WRKSRC}
-   cp ${DISTDIR}/${DIST_SUBDIR}/dcraw.c ${WRKSRC}
+WRKDIST=   ${WRKDIR}/dcraw
 
 do-build:
${CC} ${CFLAGS} -c -o ${WRKBUILD}/dcraw.o -I${PREFIX}/include \
-   -DNO_LCMS ${WRKSRC}/dcraw.c
-   ${CC} ${CFLAGS} -o ${WRKBUILD}/dcraw -ljpeg -lm -L${PREFIX}/lib \
+   ${WRKSRC}/dcraw.c
+   ${CC} ${CFLAGS} -o ${WRKBUILD}/dcraw -ljpeg -lm -llcms -L${PREFIX}/lib \
${WRKBUILD}/dcraw.o
 
 do-install:
${INSTALL_PROGRAM} ${WRKBUILD}/dcraw ${PREFIX}/bin
-   ${INSTALL_MAN} ${DISTDIR}/${DIST_SUBDIR}/dcraw.1 ${PREFIX}/man/man1
+   ${INSTALL_MAN} ${WRKSRC}/dcraw.1 ${PREFIX}/man/man1
 
 .include bsd.port.mk
Index: distinfo
===
RCS file: /cvs/ports/graphics/dcraw/distinfo,v
retrieving revision 1.6
diff -u -p -r1.6 distinfo
--- distinfo5 Apr 2007 16:19:55 -   1.6
+++ distinfo23 Nov 2007 10:26:23 -
@@ -1,10 +1,5 @@
-MD5 (dcraw-8.19/dcraw.1) = vNJLfCgJKmpMW5aHmHExuA==
-MD5 (dcraw-8.19/dcraw.c) = JAhe31ArDu8C2h+fcvP9rw==
-RMD160 (dcraw-8.19/dcraw.1) = AFQx9NoxPpLSRofpwnuSbmX/0XQ=
-RMD160 (dcraw-8.19/dcraw.c) = /2Z77HaYmxPXJ8+zF6DzTya3n9c=
-SHA1 (dcraw-8.19/dcraw.1) = HNar9Dg0M9pDJKzDvAtwmbv4k58=
-SHA1 (dcraw-8.19/dcraw.c) = LyFfZOzLKhHWyZlZTygSDu3F+Yo=
-SHA256 (dcraw-8.19/dcraw.1) = A2lue9u2/etqVWv+aGRXQWbuGOIMeCpkRbw0afvDuE0=
-SHA256 (dcraw-8.19/dcraw.c) = A5TagJRdF2SQSgTuvsI2hIthErjz0Mbc07pQgg7qYC8=
-SIZE (dcraw-8.19/dcraw.1) = 4587
-SIZE (dcraw-8.19/dcraw.c) = 198498
+MD5 (dcraw-8.80.tar.gz) = 7wXaXZSPCXXAkJExSu+t2A==
+RMD160 (dcraw-8.80.tar.gz) = SKVQ0CUrz0UWn0bA8nSFtocFvT8=
+SHA1 (dcraw-8.80.tar.gz) = vHk/JTzuTmKpQpUIWUsiQP1nDI0=
+SHA256 (dcraw-8.80.tar.gz) = oLqxxGSVC/CbMrV8WyEXhqzlTGCplan88ZbIr6PpxNY=
+SIZE (dcraw-8.80.tar.gz) = 133592
Index: patches/patch-dcraw_c
===
RCS file: /cvs/ports/graphics/dcraw/patches/patch-dcraw_c,v
retrieving revision 1.5
diff -u -p -r1.5 patch-dcraw_c
--- patches/patch-dcraw_c   11 Jun 2006 04:12:48 -  1.5
+++ patches/patch-dcraw_c   23 Nov 2007 10:26:23 -
@@ -1,15 +1,26 @@
 dcraw.c.orig   Thu May 25 21:08:17 2006
-+++ dcraw.cThu May 25 21:09:19 2006
-@@ -2482,7 +2482,7 @@
- for (j=0; j  3; j++)
-   FORC3 last[i][j] += correct[i][c] * cam_xyz[c][j];
+--- dcraw.c.orig   Fri Nov 16 15:24:52 2007
 dcraw.cFri Nov 23 10:24:37 2007
+@@ -1249,8 +1249,8 @@ void CLASS nikon_3700()
+   bits = (dp[8]  3)  4 | (dp[20]  3);
+   for (i=0; i  sizeof table / sizeof *table; i++)
+ if (bits == table[i].bits) {
+-  strcpy (make,  table[i].make );
+-  strcpy (model, table[i].model);
++  strlcpy (make,  table[i].make,  sizeof make);
++  strlcpy (model, table[i].model, sizeof model);
+ }
+ }
  
+@@ -2971,7 +2971,7 @@ void CLASS foveon_interpolate()
+ FORC3 diag[c][i] = LAST(1,1)*LAST(2,2) - LAST(1,2)*LAST(2,1);
+   #undef LAST
+   FORC3 div[c] = diag[c][0]*0.3127 + diag[c][1]*0.329 + diag[c][2]*0.3583;
 -  sprintf (str, %sRGBNeutral, model2);
 +  snprintf (str, sizeof str, %sRGBNeutral, model2);
if (foveon_camf_param (IncludeBlocks, str))
  foveon_fixed (div, 3, str);
-   else {
-@@ -2853,9 +2853,9 @@
+   num = 0;
+@@ -3335,9 +3335,9 @@ void CLASS bad_pixels()
  if (*cp == '\\') *cp = '/';
  #endif
cp = fname + strlen(fname);
@@ -21,43 +32,25 @@
  if ((fp = fopen (fname, r))) break;
  if (cp == fname) break;
  while (*--cp != '/');
-@@ -3902,7 +3902,7 @@
-   while (1) {
- fread (data, 1, 8, ifp);
- if (strcmp(data,PKTS)) break;
--if (!make[0]) strcpy(make,Leaf);
-+if (!make[0]) strlcpy (make, Leaf, sizeof make);
- 

Re: [update] graphics/dcraw - 8.80

2007-11-23 Thread Okan Demirmen
On Fri 2007.11.23 at 21:49 +, Stuart Henderson wrote:
 tested with canon CR2 files on amd64 and sparc64.
 
 I kept the patches for strcpy and friends since some web-server
 scripts use dcraw with maybe dodgy files.
 
 ok to commit?

tested with a nikon d70 on i386 - ok.

cheers,
okan