lol

zip: include patch to fix build with GCC 14

Co-authored-by: Emily <hello@emily.moe>

+64 -19
+56
pkgs/by-name/zi/zip/12-fix-build-with-gcc-14.patch
···
··· 1 + From: Santiago Vila <sanvila@debian.org> 2 + Subject: Fix build with gcc-14 3 + Bug-Debian: https://bugs.debian.org/1075706 4 + X-Debian-version: 3.0-14 5 + 6 + --- a/unix/configure 7 + +++ b/unix/configure 8 + @@ -514,14 +514,16 @@ 9 + echo Check for $func 10 + echo "int main(){ $func(); return 0; }" > conftest.c 11 + $CC $BFLAG -o conftest conftest.c >/dev/null 2>/dev/null 12 + - [ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNO_`echo $func | tr '[a-z]' '[A-Z]'`" 13 + +# glibc-based systems do not need this 14 + +# [ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNO_`echo $func | tr '[a-z]' '[A-Z]'`" 15 + done 16 + 17 + 18 + echo Check for memset 19 + echo "int main(){ char k; memset(&k,0,0); return 0; }" > conftest.c 20 + $CC -o conftest conftest.c >/dev/null 2>/dev/null 21 + -[ $? -ne 0 ] && CFLAGS="${CFLAGS} -DZMEM" 22 + +# glibc-based systems do not need this 23 + +# [ $? -ne 0 ] && CFLAGS="${CFLAGS} -DZMEM" 24 + 25 + 26 + echo Check for memmove 27 + @@ -551,7 +553,8 @@ 28 + } 29 + _EOF_ 30 + $CC $CFLAGS -c conftest.c >/dev/null 2>/dev/null 31 + -[ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNO_ERRNO" 32 + +# glibc-based systems do not need this 33 + +# [ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNO_ERRNO" 34 + 35 + 36 + echo Check for directory libraries 37 + @@ -567,7 +570,8 @@ 38 + $CC -o conftest conftest.c -l$lib >/dev/null 2>/dev/null 39 + [ $? -eq 0 ] && OPT=-l$lib && break 40 + done 41 + - if [ ${OPT} ]; then 42 + + # glibc-based systems do not need this 43 + + if true; then 44 + LFLAGS2="${LFLAGS2} ${OPT}" 45 + else 46 + CFLAGS="${CFLAGS} -DNO_DIR" 47 + @@ -629,7 +633,8 @@ 48 + } 49 + _EOF_ 50 + $CC ${CFLAGS} -c conftest.c > /dev/null 2>/dev/null 51 + -[ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNO_VALLOC" 52 + +# glibc-based systems do not need this 53 + +# [ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNO_VALLOC" 54 + 55 + 56 + echo Check for /usr/local/bin and /usr/local/man
-15
pkgs/by-name/zi/zip/fix-memset-detection.patch
··· 1 - diff -ur a/unix/configure b/unix/configure 2 - --- a/unix/configure 2008-06-19 21:32:20.000000000 -0600 3 - +++ b/unix/configure 2023-07-11 10:02:57.809867694 -0600 4 - @@ -519,7 +519,10 @@ 5 - 6 - 7 - echo Check for memset 8 - -echo "int main(){ char k; memset(&k,0,0); return 0; }" > conftest.c 9 - +cat > conftest.c << _EOF_ 10 - +#include <string.h> 11 - +int main(){ char k; memset(&k,0,0); return 0; } 12 - +_EOF_ 13 - $CC -o conftest conftest.c >/dev/null 2>/dev/null 14 - [ $? -ne 0 ] && CFLAGS="${CFLAGS} -DZMEM" 15 -
···
+8 -4
pkgs/by-name/zi/zip/package.nix
··· 27 ]; 28 29 patches = [ 30 - # Trying to use `memset` without declaring it is flagged as an error with clang 16, causing 31 - # the `configure` script to incorrectly define `ZMEM`. That causes the build to fail due to 32 - # incompatible redeclarations of `memset`, `memcpy`, and `memcmp` in `zip.h`. 33 - ./fix-memset-detection.patch 34 # Implicit declaration of `closedir` and `opendir` cause dirent detection to fail with clang 16. 35 ./fix-implicit-declarations.patch 36 # Fixes forward declaration errors with timezone.c 37 ./fix-time.h-not-included.patch 38 (fetchpatch { 39 url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/app-arch/zip/files/zip-3.0-pic.patch?id=d37d095fc7a2a9e4a8e904a7bf0f597fe99df85a"; 40 hash = "sha256-OXgC9KqiOpH/o/bSabt3LqtoT/xifqfkvpLLPfPz+1c=";
··· 27 ]; 28 29 patches = [ 30 # Implicit declaration of `closedir` and `opendir` cause dirent detection to fail with clang 16. 31 ./fix-implicit-declarations.patch 32 # Fixes forward declaration errors with timezone.c 33 ./fix-time.h-not-included.patch 34 + # Without this patch, we get a runtime failures with GCC 14 when building OpenJDK 8: 35 + # 36 + # zip I/O error: No such file or directory 37 + # zip error: Could not create output file (was replacing the original zip file) 38 + # make[2]: *** [CreateJars.gmk:659: /build/source/build/linux-x86_64-normal-server-release/images/src.zip] Error 1 39 + # 40 + # Source: Debian 41 + ./12-fix-build-with-gcc-14.patch 42 (fetchpatch { 43 url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/app-arch/zip/files/zip-3.0-pic.patch?id=d37d095fc7a2a9e4a8e904a7bf0f597fe99df85a"; 44 hash = "sha256-OXgC9KqiOpH/o/bSabt3LqtoT/xifqfkvpLLPfPz+1c=";