Wed Jul 18 22:10:21 2012 UTC ()
emulators/ucon64: Fix for libz >= 1.2.6

As previously predicted, the horrible code in archive.c wouldn't last long
before breaking.  There were a few dozen errors erupting when libz 1.2.7
header was used.  The previous patch-af was appended, but the previous fix
for linux was changed because that was broken too.

Info: typedef of gzFile changed from void* at version 1.2.6, so its use
is no longer optional with libz versions >= 1.2.6.


(marino)
diff -r1.8 -r1.9 pkgsrc/emulators/ucon64/Makefile
diff -r1.5 -r1.6 pkgsrc/emulators/ucon64/distinfo
diff -r1.2 -r1.3 pkgsrc/emulators/ucon64/patches/patch-af

cvs diff -r1.8 -r1.9 pkgsrc/emulators/ucon64/Makefile (expand / switch to unified diff)

--- pkgsrc/emulators/ucon64/Makefile 2008/04/07 18:18:01 1.8
+++ pkgsrc/emulators/ucon64/Makefile 2012/07/18 22:10:21 1.9
@@ -1,19 +1,19 @@ @@ -1,19 +1,19 @@
1# $NetBSD: Makefile,v 1.8 2008/04/07 18:18:01 joerg Exp $ 1# $NetBSD: Makefile,v 1.9 2012/07/18 22:10:21 marino Exp $
2# 2#
3 3
4DISTNAME= ucon64-2.0.0-src 4DISTNAME= ucon64-2.0.0-src
5PKGNAME= ${DISTNAME:S/-src//} 5PKGNAME= ${DISTNAME:S/-src//}
6PKGREVISION= 1 6PKGREVISION= 2
7CATEGORIES= emulators 7CATEGORIES= emulators
8MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=ucon64/} 8MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=ucon64/}
9 9
10MAINTAINER= pkgsrc-users@NetBSD.org 10MAINTAINER= pkgsrc-users@NetBSD.org
11HOMEPAGE= http://ucon64.sourceforge.net/ 11HOMEPAGE= http://ucon64.sourceforge.net/
12COMMENT= Emulator ROM and disk image converter and inspector 12COMMENT= Emulator ROM and disk image converter and inspector
13 13
14PKG_DESTDIR_SUPPORT= user-destdir 14PKG_DESTDIR_SUPPORT= user-destdir
15 15
16WRKSRC= ${WRKDIR}/${DISTNAME}/src 16WRKSRC= ${WRKDIR}/${DISTNAME}/src
17 17
18CONFIGURE_ARGS+= --disable-discmage # requires some work 18CONFIGURE_ARGS+= --disable-discmage # requires some work
19CONFIGURE_ARGS+= --disable-dload 19CONFIGURE_ARGS+= --disable-dload

cvs diff -r1.5 -r1.6 pkgsrc/emulators/ucon64/distinfo (expand / switch to unified diff)

--- pkgsrc/emulators/ucon64/distinfo 2012/05/10 22:11:20 1.5
+++ pkgsrc/emulators/ucon64/distinfo 2012/07/18 22:10:21 1.6
@@ -1,11 +1,11 @@ @@ -1,11 +1,11 @@
1$NetBSD: distinfo,v 1.5 2012/05/10 22:11:20 dholland Exp $ 1$NetBSD: distinfo,v 1.6 2012/07/18 22:10:21 marino Exp $
2 2
3SHA1 (ucon64-2.0.0-src.tar.gz) = 8782bbc2bf5760fafe3fa4cd02b67991d984a973 3SHA1 (ucon64-2.0.0-src.tar.gz) = 8782bbc2bf5760fafe3fa4cd02b67991d984a973
4RMD160 (ucon64-2.0.0-src.tar.gz) = c28921cfae1a010db917b96be542c089690b374c 4RMD160 (ucon64-2.0.0-src.tar.gz) = c28921cfae1a010db917b96be542c089690b374c
5Size (ucon64-2.0.0-src.tar.gz) = 1188488 bytes 5Size (ucon64-2.0.0-src.tar.gz) = 1188488 bytes
6SHA1 (patch-aa) = fd1543314b6ca6d432c6d88b8b7590085dfc51e9 6SHA1 (patch-aa) = fd1543314b6ca6d432c6d88b8b7590085dfc51e9
7SHA1 (patch-ab) = 25f5311844511674d5e64efe7c35cf86dacc34a9 7SHA1 (patch-ab) = 25f5311844511674d5e64efe7c35cf86dacc34a9
8SHA1 (patch-ac) = 9c7febe59e1c8e6959f56e34ced83a31fa54c294 8SHA1 (patch-ac) = 9c7febe59e1c8e6959f56e34ced83a31fa54c294
9SHA1 (patch-ad) = c41895de15bc2a48bf5de1535f03d070ade79ea3 9SHA1 (patch-ad) = c41895de15bc2a48bf5de1535f03d070ade79ea3
10SHA1 (patch-ae) = bfb38ecec2408deaaef881fa33943e2c45bccd4d 10SHA1 (patch-ae) = bfb38ecec2408deaaef881fa33943e2c45bccd4d
11SHA1 (patch-af) = 84476b894a34bb1d7074526340eaa97fcbcfd0aa 11SHA1 (patch-af) = 2f53d87dd40dfdfd90580161444d956df32207df

cvs diff -r1.2 -r1.3 pkgsrc/emulators/ucon64/patches/Attic/patch-af (expand / switch to unified diff)

--- pkgsrc/emulators/ucon64/patches/Attic/patch-af 2012/05/10 22:11:20 1.2
+++ pkgsrc/emulators/ucon64/patches/Attic/patch-af 2012/07/18 22:10:21 1.3
@@ -1,31 +1,146 @@ @@ -1,31 +1,146 @@
1$NetBSD: patch-af,v 1.2 2012/05/10 22:11:20 dholland Exp $ 1$NetBSD: patch-af,v 1.3 2012/07/18 22:10:21 marino Exp $
2 2
3- don't declare own errno 3- don't declare own errno
4- fix build failure where gzgetc() is a macro (seen in a recent Linux 4- fix build failure where gzgetc() is a macro (seen in a recent Linux
5 bulk build) 5 bulk build)
6 6
7XXX: what this code is doing (mixing gzFile* and FILE* indiscriminately 7XXX: what this code is doing (mixing gzFile* and FILE* indiscriminately
8XXX: without even casting) is vile and will probably stop compiling at 8XXX: without even casting) is vile and will probably stop compiling at
9XXX: some point. 9XXX: some point.
10 10
 11JRM: That point arrived. The garbage spewed when compiled with
 12JRM: zlib >= 1.2.6. Cast gzFile everywhere to fix it.
 13JRM: David's gzgetc fix was changed; it broke too.
 14
11--- misc/archive.c.orig 2004-12-12 01:16:54.000000000 +0000 15--- misc/archive.c.orig 2004-12-12 01:16:54.000000000 +0000
12+++ misc/archive.c 16+++ misc/archive.c
13@@ -48,9 +48,6 @@ Foundation, Inc., 675 Mass Ave, Cambridg 17@@ -48,9 +48,6 @@ Foundation, Inc., 675 Mass Ave, Cambridg
14 #define MAXBUFSIZE 32768 18 #define MAXBUFSIZE 32768
15  19
16  20
17-extern int errno; 21-extern int errno;
18- 22-
19- 23-
20 int 24 int
21 fsizeof (const char *filename) 25 fsizeof (const char *filename)
22 // If USE_ZLIB is defined this function is very slow. Please avoid to use 26 // If USE_ZLIB is defined this function is very slow. Please avoid to use
 27@@ -84,15 +81,15 @@ fsizeof (const char *filename)
 28 }
 29 #if 1
 30 // This is not much faster than the other method
 31- while (!gzeof (file))
 32- gzseek (file, 1024 * 1024, SEEK_CUR);
 33- size = gztell (file);
 34+ while (!gzeof ((gzFile)file))
 35+ gzseek ((gzFile)file, 1024 * 1024, SEEK_CUR);
 36+ size = gztell ((gzFile)file);
 37 #else
 38 // Is there a more efficient way to determine the uncompressed size?
 39 while ((bytesread = gzread (file, buf, MAXBUFSIZE)) > 0)
 40 size += bytesread;
 41 #endif
 42- gzclose (file);
 43+ gzclose ((gzFile)file);
 44 return size;
 45 }
 46 else if (magic[0] == 'P' && magic[1] == 'K' && magic[2] == 0x03 && magic[3] == 0x04)
 47@@ -384,7 +381,7 @@ fclose2 (FILE *file)
 48 if (fmode == FM_NORMAL)
 49 return fclose (file);
 50 else if (fmode == FM_GZIP)
 51- return gzclose (file);
 52+ return gzclose ((gzFile)file);
 53 else if (fmode == FM_ZIP)
 54 {
 55 unzCloseCurrentFile (file);
 56@@ -416,12 +413,12 @@ fseek2 (FILE *file, long offset, int mod
 57 if (mode == SEEK_END) // zlib doesn't support SEEK_END
 58 {
 59 // Note that this is _slow_...
 60- while (!gzeof (file))
 61+ while (!gzeof ((gzFile)file))
 62 {
 63- gzgetc (file); // necessary for _uncompressed_ files in order to set EOF
 64- gzseek (file, 1024 * 1024, SEEK_CUR);
 65+ gzgetc ((gzFile)file); // necessary for _uncompressed_ files in order to set EOF
 66+ gzseek ((gzFile)file, 1024 * 1024, SEEK_CUR);
 67 }
 68- offset += gztell (file);
 69+ offset += gztell ((gzFile)file);
 70 mode = SEEK_SET;
 71 }
 72 /*
 73@@ -433,8 +430,8 @@ fseek2 (FILE *file, long offset, int mod
 74 DJGPP, Cygwin & GNU/Linux). It clears the EOF indicator.
 75 */
 76 if (!finfo->compressed)
 77- gzrewind (file);
 78- return gzseek (file, offset, mode) == -1 ? -1 : 0;
 79+ gzrewind ((gzFile)file);
 80+ return gzseek ((gzFile)file, offset, mode) == -1 ? -1 : 0;
 81 }
 82 else if (finfo->fmode == FM_ZIP)
 83 {
 84@@ -476,7 +473,7 @@ fread2 (void *buffer, size_t size, size_
 85 return fread (buffer, size, number, file);
 86 else if (fmode == FM_GZIP)
 87 {
 88- int n = gzread (file, buffer, number * size);
 89+ int n = gzread ((gzFile)file, buffer, number * size);
 90 return n / size;
 91 }
 92 else if (fmode == FM_ZIP)
23@@ -498,7 +495,7 @@ fgetc2 (FILE *file) 93@@ -498,7 +495,7 @@ fgetc2 (FILE *file)
24 if (fmode == FM_NORMAL) 94 if (fmode == FM_NORMAL)
25 return fgetc (file); 95 return fgetc (file);
26 else if (fmode == FM_GZIP) 96 else if (fmode == FM_GZIP)
27- return gzgetc (file); 97- return gzgetc (file);
28+ return gzgetc ((struct gzFile *)file); 98+ return gzgetc ((gzFile)file);
29 else if (fmode == FM_ZIP) 99 else if (fmode == FM_ZIP)
30 { 100 {
31 char c; 101 char c;
 102@@ -521,7 +518,7 @@ fgets2 (char *buffer, int maxlength, FIL
 103 return fgets (buffer, maxlength, file);
 104 else if (fmode == FM_GZIP)
 105 {
 106- char *retval = gzgets (file, buffer, maxlength);
 107+ char *retval = gzgets ((gzFile)file, buffer, maxlength);
 108 return retval == Z_NULL ? NULL : retval;
 109 }
 110 else if (fmode == FM_ZIP)
 111@@ -556,7 +553,7 @@ feof2 (FILE *file)
 112 if (fmode == FM_NORMAL)
 113 return feof (file);
 114 else if (fmode == FM_GZIP)
 115- return gzeof (file);
 116+ return gzeof ((gzFile)file);
 117 else if (fmode == FM_ZIP)
 118 return unzeof (file); // returns feof() of the "current file"
 119 else
 120@@ -578,7 +575,7 @@ fwrite2 (const void *buffer, size_t size
 121 return fwrite (buffer, size, number, file);
 122 else if (fmode == FM_GZIP)
 123 {
 124- int n = gzwrite (file, (void *) buffer, number * size);
 125+ int n = gzwrite ((gzFile)file, (void *) buffer, number * size);
 126 return n / size;
 127 }
 128 else
 129@@ -596,7 +593,7 @@ fputc2 (int character, FILE *file)
 130 if (fmode == FM_NORMAL)
 131 return fputc (character, file);
 132 else if (fmode == FM_GZIP)
 133- return gzputc (file, character);
 134+ return gzputc ((gzFile)file, character);
 135 else
 136 return EOF; // writing to zip files is not supported
 137 #define fputc fputc2
 138@@ -612,7 +609,7 @@ ftell2 (FILE *file)
 139 if (fmode == FM_NORMAL)
 140 return ftell (file);
 141 else if (fmode == FM_GZIP)
 142- return gztell (file);
 143+ return gztell ((gzFile)file);
 144 else if (fmode == FM_ZIP)
 145 return unztell (file); // returns ftell() of the "current file"
 146 else