Re: textproc/swish-e: fix upcoming build failure
On 2021/07/02 19:01, Theo Buehler wrote: > On Fri, Jul 02, 2021 at 04:47:27PM +0100, Stuart Henderson wrote: > > On 2021/07/02 16:46, Theo Buehler wrote: > > > zlib 1.2.9 added an uncompress2 function that clashes with swish's > > > internal compress2 function. The build is fixed by the following > > > mechanical diff that renames the internal function to swish_uncompress2 > > > as was done in alpine: > > > > > > https://git.alpinelinux.org/aports/tree/main/swish-e/zlib-shadowing.patch?h=3.14-stable > > > > > > I couldn't come up with a preprocessor trick that would allow avoiding > > > the bulk rename, but hopefully there's something cleverer that would > > > avoid a big diff. > > > > > > HOMEPAGE is broken, so I removed it. > > > > here's the trick :) the actual symbol in libz is z_uncompress2, we can > > just get rid of the macro then there's no more conflict. > > Unfortunately that doesn't work. > > It's not a linking problem (which your trick could have solved > potentially) but a problem of conflicting prototypes in "compress.h" > and : > > In file included from compress.c:54: > /usr/include/zlib.h:1283:21: error: conflicting types for 'uncompress2' > ZEXTERN int ZEXPORT uncompress2 OF((Bytef *dest, uLongf *destLen, > ^ > ./compress.h:39:5: note: previous declaration is here sigh, for some reason I though 'make install' would install headers.. > Unless you have another clever idea, I suggest to go with my original > diff, pointing to your hosted tarball and with 'make update-plist'. OK.
Re: textproc/swish-e: fix upcoming build failure
On Fri, Jul 02, 2021 at 04:47:27PM +0100, Stuart Henderson wrote: > On 2021/07/02 16:46, Theo Buehler wrote: > > zlib 1.2.9 added an uncompress2 function that clashes with swish's > > internal compress2 function. The build is fixed by the following > > mechanical diff that renames the internal function to swish_uncompress2 > > as was done in alpine: > > > > https://git.alpinelinux.org/aports/tree/main/swish-e/zlib-shadowing.patch?h=3.14-stable > > > > I couldn't come up with a preprocessor trick that would allow avoiding > > the bulk rename, but hopefully there's something cleverer that would > > avoid a big diff. > > > > HOMEPAGE is broken, so I removed it. > > here's the trick :) the actual symbol in libz is z_uncompress2, we can > just get rid of the macro then there's no more conflict. Unfortunately that doesn't work. It's not a linking problem (which your trick could have solved potentially) but a problem of conflicting prototypes in "compress.h" and : In file included from compress.c:54: /usr/include/zlib.h:1283:21: error: conflicting types for 'uncompress2' ZEXTERN int ZEXPORT uncompress2 OF((Bytef *dest, uLongf *destLen, ^ ./compress.h:39:5: note: previous declaration is here int uncompress2(unsigned char **buffer); (The second problem is that I wrote compress2 by accident. You'd need "#undef uncompress2" in your compress.c patch, and the patch for docprop_write.c is not necessary) Unless you have another clever idea, I suggest to go with my original diff, pointing to your hosted tarball and with 'make update-plist'.
Re: textproc/swish-e: fix upcoming build failure
On 2021/07/02 16:46, Theo Buehler wrote: > zlib 1.2.9 added an uncompress2 function that clashes with swish's > internal compress2 function. The build is fixed by the following > mechanical diff that renames the internal function to swish_uncompress2 > as was done in alpine: > > https://git.alpinelinux.org/aports/tree/main/swish-e/zlib-shadowing.patch?h=3.14-stable > > I couldn't come up with a preprocessor trick that would allow avoiding > the bulk rename, but hopefully there's something cleverer that would > avoid a big diff. > > HOMEPAGE is broken, so I removed it. here's the trick :) the actual symbol in libz is z_uncompress2, we can just get rid of the macro then there's no more conflict. I mirrored the distfile too. Index: Makefile === RCS file: /cvs/ports/textproc/swish-e/Makefile,v retrieving revision 1.14 diff -u -p -r1.14 Makefile --- Makefile12 Jul 2019 20:50:15 - 1.14 +++ Makefile2 Jul 2021 15:45:45 - @@ -3,12 +3,11 @@ COMMENT = web/text search engine DISTNAME = swish-e-2.4.7 -REVISION = 4 +REVISION = 5 SHARED_LIBS = swish-e 2.1 CATEGORIES = textproc www -HOMEPAGE = http://swish-e.org/ -MASTER_SITES = ${HOMEPAGE}distribution/ +MASTER_SITES = https://spacehopper.org/mirrors/ # GPLv2 PERMIT_PACKAGE = Yes Index: patches/patch-src_compress_c === RCS file: /cvs/ports/textproc/swish-e/patches/patch-src_compress_c,v retrieving revision 1.1 diff -u -p -r1.1 patch-src_compress_c --- patches/patch-src_compress_c2 Dec 2014 11:59:42 - 1.1 +++ patches/patch-src_compress_c2 Jul 2021 15:45:45 - @@ -1,7 +1,17 @@ $OpenBSD: patch-src_compress_c,v 1.1 2014/12/02 11:59:42 naddy Exp $ src/compress.c.origSun Apr 5 03:58:32 2009 -+++ src/compress.c Tue Dec 2 05:06:54 2014 -@@ -995,7 +995,7 @@ voidremove_worddata_longs(unsigned char *worddata, + +Index: src/compress.c +--- src/compress.c.orig src/compress.c +@@ -53,6 +53,7 @@ $Id: compress.c 1945 2007-10-22 14:54:07Z karpet $ + #ifdef HAVE_ZLIB + #include + #define Z_BUFSIZE 16384 ++#undef compress2 + #endif + + /* Surfing the web I found this: +@@ -995,7 +996,7 @@ voidremove_worddata_longs(unsigned char *worddata, progerr("Internal error in remove_worddata_longs"); /* dst may be smaller than src. So move the data */ Index: patches/patch-src_docprop_write_c === RCS file: patches/patch-src_docprop_write_c diff -N patches/patch-src_docprop_write_c --- /dev/null 1 Jan 1970 00:00:00 - +++ patches/patch-src_docprop_write_c 2 Jul 2021 15:45:45 - @@ -0,0 +1,13 @@ +$OpenBSD$ + +Index: src/docprop_write.c +--- src/docprop_write.c.orig src/docprop_write.c +@@ -38,6 +38,7 @@ + #include "db.h" + #ifdef HAVE_ZLIB + #include ++#undef compress2 + #endif + + Index: pkg/PLIST === RCS file: /cvs/ports/textproc/swish-e/pkg/PLIST,v retrieving revision 1.3 diff -u -p -r1.3 PLIST --- pkg/PLIST 16 Mar 2015 18:07:57 - 1.3 +++ pkg/PLIST 2 Jul 2021 15:45:45 - @@ -3,7 +3,7 @@ bin/swish-config @bin bin/swish-e bin/swish-filter-test include/swish-e.h -lib/libswish-e.a +@static-lib lib/libswish-e.a lib/libswish-e.la @lib lib/libswish-e.so.${LIBswish-e_VERSION} lib/pkgconfig/swish-e.pc