@@ -2,7 +2,7 @@
22
33let version = "1.2.8"; in
44
5−stdenv.mkDerivation rec {
5+stdenv.mkDerivation (rec {
66 name = "zlib-${version}";
77
88 src = fetchurl {
@@ -26,15 +26,6 @@ stdenv.mkDerivation rec {
2626 # to the bootstrap-tools libgcc (as uses to happen on arm/mips)
2727 NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (!stdenv.isDarwin) "-static-libgcc";
2828
29− postInstall = stdenv.lib.optionalString stdenv.isDarwin ''
30− # jww (2015-01-06): Sometimes this library install as a .so, even on
31− # Darwin; others time it installs as a .dylib. I haven't yet figured out
32− # what causes this difference.
33− for file in $out/lib/*.so* $out/lib/*.dylib* ; do
34− install_name_tool -id "$file" $file
35− done
36− '';
37−
3829 crossAttrs = {
3930 dontStrip = static;
4031 } // stdenv.lib.optionalAttrs (stdenv.cross.libc == "msvcrt") {
@@ -58,4 +49,13 @@ stdenv.mkDerivation rec {
5849 description = "Lossless data-compression library";
5950 license = licenses.zlib;
6051 };
61−}
52+} // (if stdenv.isDarwin then {
53+ postInstall = ''
54+ # jww (2015-01-06): Sometimes this library install as a .so, even on
55+ # Darwin; others time it installs as a .dylib. I haven't yet figured out
56+ # what causes this difference.
57+ for file in $out/lib/*.so* $out/lib/*.dylib* ; do
58+ install_name_tool -id "$file" $file
59+ done
60+ '';
61+} else {}))