summary refs log tree commit diff
path: root/pkgs/development/libraries/zlib
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/libraries/zlib')
-rw-r--r--pkgs/development/libraries/zlib/default.nix12
1 files changed, 10 insertions, 2 deletions
diff --git a/pkgs/development/libraries/zlib/default.nix b/pkgs/development/libraries/zlib/default.nix
index 38b1d70cc86..2d3b10974f7 100644
--- a/pkgs/development/libraries/zlib/default.nix
+++ b/pkgs/development/libraries/zlib/default.nix
@@ -13,9 +13,17 @@ stdenv.mkDerivation rec {
     sha256 = "039agw5rqvqny92cpkrfn243x2gd4xn13hs3xi6isk55d2vqqr9n";
   };
 
+  postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
+    substituteInPlace configure \
+      --replace '/usr/bin/libtool' 'ar' \
+      --replace 'AR="libtool"' 'AR="ar"' \
+      --replace 'ARFLAGS="-o"' 'ARFLAGS="-r"'
+  '';
+
   outputs = [ "dev" "out" "static" "man" ];
   setOutputFlags = false;
 
+
   preConfigure = ''
     if test -n "$crossConfig"; then
       export CC=$crossConfig-gcc
@@ -54,8 +62,8 @@ stdenv.mkDerivation rec {
     makeFlags = [ "RANLIB=${stdenv.cross.config}-ranlib" ];
   };
 
-  # zlib doesn't like the automatic --disable-shared from the Cygwin stdenv.
-  cygwinConfigureEnableShared = true;
+  # CYGXXX: This is not needed anymore and non-functional, but left not to trigger rebuilds
+  cygwinConfigureEnableShared = if (!stdenv.isCygwin) then true else null;
 
   passthru.version = version;