From 286186b380ff98684c2d34974331c253512c596f Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Sun, 15 Feb 2026 10:13:56 +0200 Subject: [PATCH] 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. --- pkgs/development/libraries/zlib/default.nix | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/pkgs/development/libraries/zlib/default.nix b/pkgs/development/libraries/zlib/default.nix index 28a45600a66b..5f20237d49b5 100644 --- a/pkgs/development/libraries/zlib/default.nix +++ b/pkgs/development/libraries/zlib/default.nix @@ -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 = [