summary refs log tree commit diff
path: root/pkgs/development/libraries/zlib
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2016-04-21 16:12:50 +0200
committerVladimír Čunát <vcunat@gmail.com>2016-04-23 10:52:03 +0200
commit321ecde8a163cdde9e39df277288e9ff3817f4df (patch)
tree93bf60fc0329c4c4b06da44218bff043f1f66a86 /pkgs/development/libraries/zlib
parent80509ab287687591ba179535bfc1cec88013a0d9 (diff)
zlib: on mingw, add another DLL link
Also clean up the expression a little.
It fixes at least libpng's DLL.
Diffstat (limited to 'pkgs/development/libraries/zlib')
-rw-r--r--pkgs/development/libraries/zlib/default.nix15
1 files changed, 11 insertions, 4 deletions
diff --git a/pkgs/development/libraries/zlib/default.nix b/pkgs/development/libraries/zlib/default.nix
index 59713bb8d205e..f7a72a7673a15 100644
--- a/pkgs/development/libraries/zlib/default.nix
+++ b/pkgs/development/libraries/zlib/default.nix
@@ -52,14 +52,21 @@ stdenv.mkDerivation rec {
 
   crossAttrs = {
     dontStrip = static;
+    dontSetConfigureCross = true;
   } // stdenv.lib.optionalAttrs (stdenv.cross.libc == "msvcrt") {
-    configurePhase=''
-      installFlags="BINARY_PATH=$out/bin INCLUDE_PATH=$out/include LIBRARY_PATH=$out/lib"
-    '';
+    installFlags = [
+      "BINARY_PATH=$(out)/bin"
+      "INCLUDE_PATH=$(dev)/include"
+      "LIBRARY_PATH=$(out)/lib"
+    ];
     makeFlags = [
       "-f" "win32/Makefile.gcc"
       "PREFIX=${stdenv.cross.config}-"
-    ] ++ (if static then [] else [ "SHARED_MODE=1" ]);
+    ] ++ stdenv.lib.optional (!static) "SHARED_MODE=1";
+
+    # Non-typical naming confuses libtool which then refuses to use zlib's DLL
+    # in some cases, e.g. when compiling libpng.
+    postInstall = postInstall + "ln -s zlib1.dll $out/bin/libz.dll";
   } // stdenv.lib.optionalAttrs (stdenv.cross.libc == "libSystem") {
     makeFlags = [ "RANLIB=${stdenv.cross.config}-ranlib" ];
   };