summary refs log tree commit diff
path: root/pkgs/development/libraries
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2016-05-05 08:30:19 +0200
committerVladimír Čunát <vcunat@gmail.com>2016-05-05 08:30:19 +0200
commit1dc36904d8cefa8188c785efd03274637c838e31 (patch)
tree0cf37f0803f1e9c6985d09f2870e5ec61229d2ca /pkgs/development/libraries
parent75f1cc61b86b002f551529f1cafa30b4f4010bd9 (diff)
parent7a005601d48f760864258e369364b3b847d4e9fd (diff)
downloadnixpkgs-1dc36904d8cefa8188c785efd03274637c838e31.tar
nixpkgs-1dc36904d8cefa8188c785efd03274637c838e31.tar.gz
nixpkgs-1dc36904d8cefa8188c785efd03274637c838e31.tar.bz2
nixpkgs-1dc36904d8cefa8188c785efd03274637c838e31.tar.lz
nixpkgs-1dc36904d8cefa8188c785efd03274637c838e31.tar.xz
nixpkgs-1dc36904d8cefa8188c785efd03274637c838e31.tar.zst
nixpkgs-1dc36904d8cefa8188c785efd03274637c838e31.zip
Merge #14920: windows improvements, mainly mingw
Diffstat (limited to 'pkgs/development/libraries')
-rw-r--r--pkgs/development/libraries/boost/generic.nix40
-rw-r--r--pkgs/development/libraries/dbus-glib/default.nix4
-rw-r--r--pkgs/development/libraries/freetype/default.nix7
-rw-r--r--pkgs/development/libraries/gettext/default.nix7
-rw-r--r--pkgs/development/libraries/imlib2/default.nix6
-rw-r--r--pkgs/development/libraries/libiconv/default.nix8
-rw-r--r--pkgs/development/libraries/libjpeg-turbo/default.nix4
-rw-r--r--pkgs/development/libraries/libjpeg-turbo/mingw-boolean.patch19
-rw-r--r--pkgs/development/libraries/libpng/default.nix4
-rw-r--r--pkgs/development/libraries/libxml2/default.nix36
-rw-r--r--pkgs/development/libraries/libxslt/default.nix6
-rw-r--r--pkgs/development/libraries/poppler/default.nix20
-rw-r--r--pkgs/development/libraries/spdlog/default.nix36
-rw-r--r--pkgs/development/libraries/zlib/default.nix15
14 files changed, 163 insertions, 49 deletions
diff --git a/pkgs/development/libraries/boost/generic.nix b/pkgs/development/libraries/boost/generic.nix
index 931a2ad8db6..73499a42497 100644
--- a/pkgs/development/libraries/boost/generic.nix
+++ b/pkgs/development/libraries/boost/generic.nix
@@ -1,11 +1,11 @@
-{ stdenv, icu, expat, zlib, bzip2, python, fixDarwinDylibNames
+{ stdenv, fetchurl, icu, expat, zlib, bzip2, python, fixDarwinDylibNames, libiconv
 , toolset ? if stdenv.cc.isClang then "clang" else null
 , enableRelease ? true
 , enableDebug ? false
 , enableSingleThreaded ? false
 , enableMultiThreaded ? true
-, enableShared ? true
-, enableStatic ? false
+, enableShared ? !(stdenv.cross.libc or null == "msvcrt") # problems for now
+, enableStatic ? !enableShared
 , enablePIC ? false
 , enableExceptions ? false
 , taggedLayout ? ((enableRelease && enableDebug) || (enableSingleThreaded && enableMultiThreaded) || (enableShared && enableStatic))
@@ -76,8 +76,14 @@ let
     "--user-config=user-config.jam"
     "toolset=gcc-cross"
     "--without-python"
+  ] ++ optionals (stdenv.cross.libc == "msvcrt") [
+    "target-os=windows"
+    "threadapi=win32"
+    "binary-format=pe"
+    "address-model=${if hasPrefix "x86_64-" stdenv.cross.config then "64" else "32"}"
+    "architecture=x86"
   ];
-  crossB2Args = concatMapStringsSep " " (genericB2Flags ++ crossB2Flags);
+  crossB2Args = concatStringsSep " " (genericB2Flags ++ crossB2Flags);
 
   builder = b2Args: ''
     ./b2 ${b2Args}
@@ -104,6 +110,8 @@ let
       find include \( -name '*.hpp' -or -name '*.h' -or -name '*.ipp' \) \
         -exec sed '1i#line 1 "{}"' -i '{}' \;
     )
+  '' + optionalString (stdenv.cross.libc or null == "msvcrt") ''
+    ${stdenv.cross.config}-ranlib "$lib"/lib/*.a
   '';
 
 in
@@ -138,14 +146,15 @@ stdenv.mkDerivation {
 
   enableParallelBuilding = true;
 
-  buildInputs = [ icu expat zlib bzip2 python ]
+  buildInputs = [ expat zlib bzip2 libiconv ]
+    ++ stdenv.lib.optionals (! stdenv ? cross) [ python icu ]
     ++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
 
   configureScript = "./bootstrap.sh";
-  configureFlags = commonConfigureFlags ++ [
-    "--with-icu=${icu.dev}"
-    "--with-python=${python.interpreter}"
-  ] ++ optional (toolset != null) "--with-toolset=${toolset}";
+  configureFlags = commonConfigureFlags
+    ++ [ "--with-python=${python.interpreter}" ]
+    ++ optional (! stdenv ? cross) "--with-icu=${icu.dev}"
+    ++ optional (toolset != null) "--with-toolset=${toolset}";
 
   buildPhase = builder nativeB2Args;
 
@@ -157,15 +166,10 @@ stdenv.mkDerivation {
   setOutputFlags = false;
 
   crossAttrs = rec {
-    buildInputs = [ expat.crossDrv zlib.crossDrv bzip2.crossDrv ];
-    # all buildInputs set previously fell into propagatedBuildInputs, as usual, so we have to
-    # override them.
-    propagatedBuildInputs = buildInputs;
     # We want to substitute the contents of configureFlags, removing thus the
     # usual --build and --host added on cross building.
     preConfigure = ''
       export configureFlags="--without-icu ${concatStringsSep " " commonConfigureFlags}"
-      set -x
       cat << EOF > user-config.jam
       using gcc : cross : $crossConfig-g++ ;
       EOF
@@ -173,5 +177,13 @@ stdenv.mkDerivation {
     buildPhase = builder crossB2Args;
     installPhase = installer crossB2Args;
     postFixup = fixup;
+  } // optionalAttrs (stdenv.cross.libc == "msvcrt") {
+    patches = fetchurl {
+      url = "https://svn.boost.org/trac/boost/raw-attachment/ticket/7262/"
+          + "boost-mingw.patch";
+      sha256 = "0s32kwll66k50w6r5np1y5g907b7lcpsjhfgr7rsw7q5syhzddyj";
+    };
+
+    patchFlags = "-p0";
   };
 }
diff --git a/pkgs/development/libraries/dbus-glib/default.nix b/pkgs/development/libraries/dbus-glib/default.nix
index 59d227f0e86..d06a919cada 100644
--- a/pkgs/development/libraries/dbus-glib/default.nix
+++ b/pkgs/development/libraries/dbus-glib/default.nix
@@ -17,6 +17,10 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [ dbus glib ];
 
+  preConfigure = ''
+    configureFlagsArray+=("--exec-prefix=$dev")
+  '';
+
   doCheck = true;
 
   passthru = { inherit dbus glib; };
diff --git a/pkgs/development/libraries/freetype/default.nix b/pkgs/development/libraries/freetype/default.nix
index 81e98056e90..0548d1433b7 100644
--- a/pkgs/development/libraries/freetype/default.nix
+++ b/pkgs/development/libraries/freetype/default.nix
@@ -26,7 +26,8 @@ stdenv.mkDerivation rec {
   };
 
   patches = []
-    ++ optionals useEncumberedCode [
+    # mingw: these patches use `strcasestr` which isn't available on windows
+    ++ optionals (useEncumberedCode && stdenv.cross.libc or null != "msvcrt" ) [
       (fetchbohoomil "01-freetype-2.6.2-enable-valid.patch"
         "1szq0zha7n41f4pq179wgfkam034mp2xn0xc36sdl5sjp9s9hv08")
       (fetchbohoomil "02-upstream-2015.12.05.patch"
@@ -39,7 +40,7 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [ zlib bzip2 libpng ]; # needed when linking against freetype
   # dependence on harfbuzz is looser than the reverse dependence
-  buildInputs = [ pkgconfig which ]
+  nativeBuildInputs = [ pkgconfig which ]
     # FreeType requires GNU Make, which is not part of stdenv on FreeBSD.
     ++ optional (!stdenv.isLinux) gnumake;
 
@@ -56,7 +57,7 @@ stdenv.mkDerivation rec {
 
   postInstall = glib.flattenInclude;
 
-  crossAttrs = {
+  crossAttrs = stdenv.lib.optionalAttrs (stdenv.cross.libc or null != "msvcrt") {
     # Somehow it calls the unwrapped gcc, "i686-pc-linux-gnu-gcc", instead
     # of gcc. I think it's due to the unwrapped gcc being in the PATH. I don't
     # know why it's on the PATH.
diff --git a/pkgs/development/libraries/gettext/default.nix b/pkgs/development/libraries/gettext/default.nix
index 940df56c03c..78a8756b59b 100644
--- a/pkgs/development/libraries/gettext/default.nix
+++ b/pkgs/development/libraries/gettext/default.nix
@@ -54,13 +54,6 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  crossAttrs = {
-    buildInputs = lib.optional (stdenv ? ccCross && stdenv.ccCross.libc ? libiconv)
-      stdenv.ccCross.libc.libiconv.crossDrv;
-    # Gettext fails to guess the cross compiler
-    configureFlags = "CXX=${stdenv.cross.config}-g++";
-  };
-
   meta = {
     description = "Well integrated set of translation tools and documentation";
 
diff --git a/pkgs/development/libraries/imlib2/default.nix b/pkgs/development/libraries/imlib2/default.nix
index 8d79fcc50a8..85e9979ebb0 100644
--- a/pkgs/development/libraries/imlib2/default.nix
+++ b/pkgs/development/libraries/imlib2/default.nix
@@ -1,17 +1,19 @@
 { stdenv, fetchurl, xlibsWrapper, libjpeg, libtiff, giflib, libpng, bzip2, pkgconfig }:
 
 stdenv.mkDerivation rec {
-  name = "imlib2-1.4.8";
+  name = "imlib2-1.4.9";
 
   src = fetchurl {
     url = "mirror://sourceforge/enlightenment/${name}.tar.bz2";
-    sha256 = "0xxhgkd1axlcmf3kp1d7naiygparpg8l3sg3d263rhl2z0gm7aw9";
+    sha256 = "08809xxk2555yj6glixzw9a0x3x8cx55imd89kj3r0h152bn8a3x";
   };
 
   buildInputs = [ xlibsWrapper libjpeg libtiff giflib libpng bzip2 ];
 
   nativeBuildInputs = [ pkgconfig ];
 
+  enableParallelBuilding = true;
+
   preConfigure = ''
     substituteInPlace imlib2-config.in \
       --replace "@my_libs@" ""
diff --git a/pkgs/development/libraries/libiconv/default.nix b/pkgs/development/libraries/libiconv/default.nix
index f5818c3bf4c..9b62436ae08 100644
--- a/pkgs/development/libraries/libiconv/default.nix
+++ b/pkgs/development/libraries/libiconv/default.nix
@@ -1,6 +1,6 @@
 { fetchurl, stdenv, lib }:
 
-assert (!stdenv.isLinux);
+assert !stdenv.isLinux || stdenv ? cross; # TODO: improve on cross
 
 stdenv.mkDerivation rec {
   name = "libiconv-1.14";
@@ -15,6 +15,12 @@ stdenv.mkDerivation rec {
     ./libiconv-1.14-wchar.patch
   ];
 
+  postPatch =
+    lib.optionalString (stdenv.cross.libc or null == "msvcrt")
+      ''
+        sed '/^_GL_WARN_ON_USE (gets/d' -i srclib/stdio.in.h
+      '';
+
   configureFlags =
   # On Cygwin, Libtool produces a `.dll.a', which is not a "real" DLL
   # (Windows' linker would need to be used somehow to produce an actual
diff --git a/pkgs/development/libraries/libjpeg-turbo/default.nix b/pkgs/development/libraries/libjpeg-turbo/default.nix
index da4d3a9822f..c326e630bd0 100644
--- a/pkgs/development/libraries/libjpeg-turbo/default.nix
+++ b/pkgs/development/libraries/libjpeg-turbo/default.nix
@@ -8,6 +8,10 @@ stdenv.mkDerivation rec {
     sha256 = "0gi349hp1x7mb98s4mf66sb2xay2kjjxj9ihrriw0yiy0k9va6sj";
   };
 
+  patches =
+    stdenv.lib.optional (stdenv.cross.libc or null == "msvcrt")
+      ./mingw-boolean.patch;
+
   outputs = [ "dev" "out" "doc" "bin" ];
 
   nativeBuildInputs = [ nasm ];
diff --git a/pkgs/development/libraries/libjpeg-turbo/mingw-boolean.patch b/pkgs/development/libraries/libjpeg-turbo/mingw-boolean.patch
new file mode 100644
index 00000000000..9b9483d6398
--- /dev/null
+++ b/pkgs/development/libraries/libjpeg-turbo/mingw-boolean.patch
@@ -0,0 +1,19 @@
+Ported to updated libjpeg-turbo from
+https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-libjpeg-turbo/jpeg-typedefs.patch
+--- a/jmorecfg.h	2012-02-10 06:47:55 +0300
++++ b/jmorecfg.h	2012-05-03 10:29:13 +0400
+@@ -224,7 +224,13 @@
+  * Defining HAVE_BOOLEAN before including jpeglib.h should make it work.
+  */
+ 
+-#ifndef HAVE_BOOLEAN
++#if defined(_WIN32) && !defined(HAVE_BOOLEAN)
++#ifndef __RPCNDR_H__
++typedef unsigned char boolean;
++#endif
++#define HAVE_BOOLEAN
++#endif
++#if !defined(HAVE_BOOLEAN) && !defined(__RPCNDR_H__)
+ typedef int boolean;
+ #endif
+ #ifndef FALSE			/* in case these macros already exist */
diff --git a/pkgs/development/libraries/libpng/default.nix b/pkgs/development/libraries/libpng/default.nix
index 6faed97aaee..a5a0e1d42a3 100644
--- a/pkgs/development/libraries/libpng/default.nix
+++ b/pkgs/development/libraries/libpng/default.nix
@@ -26,7 +26,9 @@ in stdenv.mkDerivation rec {
 
   preConfigure = "export bin=$dev";
 
-  doCheck = true;
+  # it's hard to cross-run tests and some check programs didn't compile anyway
+  makeFlags = stdenv.lib.optional (!doCheck) "check_PROGRAMS=";
+  doCheck = ! stdenv ? cross;
 
   postInstall = ''mv "$out/bin" "$dev/bin"'';
 
diff --git a/pkgs/development/libraries/libxml2/default.nix b/pkgs/development/libraries/libxml2/default.nix
index 8eedf50c9ca..7229b10e01c 100644
--- a/pkgs/development/libraries/libxml2/default.nix
+++ b/pkgs/development/libraries/libxml2/default.nix
@@ -1,4 +1,5 @@
-{ stdenv, fetchurl, zlib, xz, python, findXMLCatalogs }:
+{ stdenv, lib, fetchurl, zlib, xz, python, findXMLCatalogs, libiconv
+, supportPython ? (! stdenv ? cross) }:
 
 stdenv.mkDerivation rec {
   name = "libxml2-${version}";
@@ -9,23 +10,36 @@ stdenv.mkDerivation rec {
     sha256 = "0bd17g6znn2r98gzpjppsqjg33iraky4px923j3k8kdl8qgy7sad";
   };
 
-  outputs = [ "dev" "out" "bin" "doc" "py" ];
-  propagatedBuildOutputs = "out bin py";
+  outputs = [ "dev" "out" "bin" "doc" ]
+    ++ lib.optional supportPython "py";
+  propagatedBuildOutputs = "out bin" + lib.optionalString supportPython " py";
 
-  buildInputs = [ python ]
+  buildInputs = lib.optional supportPython python
     # Libxml2 has an optional dependency on liblzma.  However, on impure
     # platforms, it may end up using that from /usr/lib, and thus lack a
     # RUNPATH for that, leading to undefined references for its users.
-    ++ stdenv.lib.optional stdenv.isFreeBSD xz;
+    ++ lib.optional stdenv.isFreeBSD xz;
 
   propagatedBuildInputs = [ zlib findXMLCatalogs ];
 
-  configureFlags = "--with-python=${python} --exec_prefix=$dev";
+  configureFlags = lib.optional supportPython "--with-python=${python}"
+    ++ [ "--exec_prefix=$dev" ];
 
   enableParallelBuilding = true;
 
-  preInstall = ''substituteInPlace python/libxml2mod.la --replace "${python}" "$py"'';
-  installFlags = ''pythondir="$(py)/lib/${python.libPrefix}/site-packages"'';
+  crossAttrs = lib.optionalAttrs (stdenv.cross.libc == "msvcrt") {
+    # creating the DLL is broken ATM
+    dontDisableStatic = true;
+    configureFlags = configureFlags ++ [ "--disable-shared" ];
+
+    # libiconv is a header dependency - propagating is enough
+    propagatedBuildInputs =  [ findXMLCatalogs libiconv ];
+  };
+
+  preInstall = lib.optionalString supportPython
+    ''substituteInPlace python/libxml2mod.la --replace "${python}" "$py"'';
+  installFlags = lib.optionalString supportPython
+    ''pythondir="$(py)/lib/${python.libPrefix}/site-packages"'';
 
   postFixup = ''
     moveToOutput bin/xml2-config "$dev"
@@ -33,13 +47,13 @@ stdenv.mkDerivation rec {
     moveToOutput share/man/man1 "$bin"
   '';
 
-  passthru = { inherit version; pythonSupport = true; };
+  passthru = { inherit version; pythonSupport = supportPython; };
 
   meta = {
     homepage = http://xmlsoft.org/;
     description = "An XML parsing library for C";
     license = "bsd";
-    platforms = stdenv.lib.platforms.unix;
-    maintainers = [ stdenv.lib.maintainers.eelco ];
+    platforms = lib.platforms.unix;
+    maintainers = [ lib.maintainers.eelco ];
   };
 }
diff --git a/pkgs/development/libraries/libxslt/default.nix b/pkgs/development/libraries/libxslt/default.nix
index 0eda42879ec..c76f2824604 100644
--- a/pkgs/development/libraries/libxslt/default.nix
+++ b/pkgs/development/libraries/libxslt/default.nix
@@ -9,6 +9,12 @@ stdenv.mkDerivation rec {
   };
 
   patches = stdenv.lib.optional stdenv.isSunOS ./patch-ah.patch
+    ++ stdenv.lib.optional (stdenv.cross.libc or null == "msvcrt")
+        (fetchpatch {
+          name = "mingw.patch";
+          url = "http://git.gnome.org/browse/libxslt/patch/?id=ab5810bf27cd63";
+          sha256 = "0kkqq3fv2k3q86al38vp6zwxazpvp5kslcjnmrq4ax5cm2zvsjk3";
+        })
     ++ [
       (fetchpatch {
         name = "CVE-2015-7995.patch";
diff --git a/pkgs/development/libraries/poppler/default.nix b/pkgs/development/libraries/poppler/default.nix
index bb3458d62dd..51b5ac5981e 100644
--- a/pkgs/development/libraries/poppler/default.nix
+++ b/pkgs/development/libraries/poppler/default.nix
@@ -5,8 +5,8 @@
 }:
 
 let # beware: updates often break cups_filters build
-  version = "0.36.0"; # even major numbers are stable
-  sha256 = "13i440kv873wgmw50rs4d1v05cj0r7bqnghd70hp9vy44dxhdk4k";
+  version = "0.43.0"; # even major numbers are stable
+  sha256 = "0mi4zf0pz3x3fx3ir7szz1n57nywgbpd4mp2r7mvf47f4rmf4867";
 in
 stdenv.mkDerivation rec {
   name = "poppler-${suffix}-${version}";
@@ -22,8 +22,8 @@ stdenv.mkDerivation rec {
 
   # TODO: reduce propagation to necessary libs
   propagatedBuildInputs = with lib;
-    [ zlib freetype fontconfig libjpeg lcms curl openjpeg ]
-    ++ optional (!minimal) cairo
+    [ zlib freetype fontconfig libjpeg ]
+    ++ optionals (!minimal) [ cairo lcms curl openjpeg ]
     ++ optional qt4Support qt4
     ++ optional qt5Support qtbase;
 
@@ -38,11 +38,19 @@ stdenv.mkDerivation rec {
       "--enable-zlib"
       "--enable-build-type=release"
     ]
-    ++ optionals minimal [ "--disable-poppler-glib" "--disable-poppler-cpp" ]
-    ++ optional (!utils) "--disable-utils";
+    ++ optionals minimal [
+      "--disable-poppler-glib" "--disable-poppler-cpp"
+      "--disable-libopenjpeg" "--disable-libcurl"
+    ]
+    ++ optional (!utils) "--disable-utils" ;
 
   enableParallelBuilding = true;
 
+  crossAttrs.postPatch =
+    # there are tests using `strXXX_s` functions that are missing apparently
+    stdenv.lib.optionalString (stdenv.cross.libc or null == "msvcrt")
+      "sed '/^SUBDIRS =/s/ test / /' -i Makefile.in";
+
   meta = with lib; {
     homepage = http://poppler.freedesktop.org/;
     description = "A PDF rendering library";
diff --git a/pkgs/development/libraries/spdlog/default.nix b/pkgs/development/libraries/spdlog/default.nix
new file mode 100644
index 00000000000..1c3952e7adf
--- /dev/null
+++ b/pkgs/development/libraries/spdlog/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  name = "spdlog-${version}";
+  version = stdenv.lib.strings.substring 0 7 rev;
+  rev = "292bdc5eb4929f183c78d2c67082b715306f81c9";
+
+  src = fetchFromGitHub {
+    owner = "gabime";
+    repo = "spdlog";
+    inherit rev;
+    sha256 = "1b6b0c81a8hisaibqlzj5mrk3snrfl8p5sqa056q2f02i62zksbn";
+  };
+
+  buildInputs = [ cmake ];
+
+  # cmakeFlags = [ "-DSPDLOG_BUILD_EXAMPLES=ON" ];
+
+  outputs = [ "out" "doc" ];
+
+  postInstall = ''
+    mkdir -p $out/share/doc/spdlog
+    cp -rv ../example $out/share/doc/spdlog
+  '';
+
+  meta = with stdenv.lib; {
+    description    = "Very fast, header only, C++ logging library.";
+    homepage       = https://github.com/gabime/spdlog;
+    license        = licenses.mit;
+    maintainers    = with maintainers; [ obadz ];
+    platforms      = platforms.all;
+
+    # This is a header-only library, no point in hydra building it:
+    hydraPlatforms = [];
+  };
+}
diff --git a/pkgs/development/libraries/zlib/default.nix b/pkgs/development/libraries/zlib/default.nix
index 92bde5deb97..2176fa6f31c 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" ];
   };