zlib: always apply all substitutions

And use `--replace-fail` for Darwin substitutions.

Make it easier to find wrong substitutions relevant for platforms other
then your own.
This commit is contained in:
Doron Behar
2026-02-19 13:37:51 +02:00
parent efffbc1e8f
commit 286186b380
+8 -11
View File
@@ -40,17 +40,14 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-uzKaCizQJ00FUZ1hxmfAYuBpkNcuEl7i36jeZPARnRY=";
};
postPatch =
lib.optionalString stdenv.hostPlatform.isDarwin ''
substituteInPlace configure \
--replace '/usr/bin/libtool' '${stdenv.cc.targetPrefix}ar' \
--replace 'AR="libtool"' 'AR="${stdenv.cc.targetPrefix}ar"' \
--replace 'ARFLAGS="-o"' 'ARFLAGS="-r"'
''
+ lib.optionalString stdenv.hostPlatform.isCygwin ''
substituteInPlace win32/zlib.def \
--replace-fail 'gzopen_w' ""
'';
postPatch = ''
substituteInPlace configure \
--replace-fail '/usr/bin/libtool' '${stdenv.cc.targetPrefix}ar' \
--replace-fail 'AR="libtool"' 'AR="${stdenv.cc.targetPrefix}ar"' \
--replace-fail 'ARFLAGS="-o"' 'ARFLAGS="-r"'
substituteInPlace win32/zlib.def \
--replace-fail 'gzopen_w' ""
'';
strictDeps = true;
outputs = [