unzip: no-lchmod build flag

This commit is contained in:
PedroHLC ☭ 2022-07-04 18:57:43 -03:00
parent 0083a683d7
commit 5bb06a6970
No known key found for this signature in database
GPG key ID: F5BFC029DA9A28CE

View file

@ -60,7 +60,10 @@ stdenv.mkDerivation rec {
"generic" "generic"
"D_USE_BZ2=-DUSE_BZIP2" "D_USE_BZ2=-DUSE_BZIP2"
"L_BZ2=-lbz2" "L_BZ2=-lbz2"
]; ]
# `lchmod` is not available on Linux, so we remove it to fix "not supported" errors (when the zip file contains symlinks).
# Alpine (musl) and Debian (glibc) also add this flag.
++ lib.optionals stdenv.isLinux [ "LOCAL_UNZIP=-DNO_LCHMOD" ];
preConfigure = '' preConfigure = ''
sed -i -e 's@CF="-O3 -Wall -I. -DASM_CRC $(LOC)"@CF="-O3 -Wall -I. -DASM_CRC -DLARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $(LOC)"@' unix/Makefile sed -i -e 's@CF="-O3 -Wall -I. -DASM_CRC $(LOC)"@CF="-O3 -Wall -I. -DASM_CRC -DLARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $(LOC)"@' unix/Makefile