summary refs log tree commit diff
path: root/pkgs/development/libraries/zlib
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2015-05-03 13:35:58 +0200
committerVladimír Čunát <vcunat@gmail.com>2015-05-05 11:56:30 +0200
commit2be435422c06849c092a3660c8d3ec430753f425 (patch)
treeb347ba9127cd3c589de770e343e4c47add5e3b8c /pkgs/development/libraries/zlib
parent4949d5ec4a34eee070daa4b28cd3d22343f708e8 (diff)
downloadnixpkgs-2be435422c06849c092a3660c8d3ec430753f425.tar
nixpkgs-2be435422c06849c092a3660c8d3ec430753f425.tar.gz
nixpkgs-2be435422c06849c092a3660c8d3ec430753f425.tar.bz2
nixpkgs-2be435422c06849c092a3660c8d3ec430753f425.tar.lz
nixpkgs-2be435422c06849c092a3660c8d3ec430753f425.tar.xz
nixpkgs-2be435422c06849c092a3660c8d3ec430753f425.tar.zst
nixpkgs-2be435422c06849c092a3660c8d3ec430753f425.zip
zlib: refactor (and darwin fix), add meta.platforms
Diffstat (limited to 'pkgs/development/libraries/zlib')
-rw-r--r--pkgs/development/libraries/zlib/default.nix26
1 files changed, 13 insertions, 13 deletions
diff --git a/pkgs/development/libraries/zlib/default.nix b/pkgs/development/libraries/zlib/default.nix
index e19d8cdfcb2..38b1d70cc86 100644
--- a/pkgs/development/libraries/zlib/default.nix
+++ b/pkgs/development/libraries/zlib/default.nix
@@ -2,7 +2,7 @@
 
 let version = "1.2.8"; in
 
-stdenv.mkDerivation (rec {
+stdenv.mkDerivation rec {
   name = "zlib-${version}";
 
   src = fetchurl {
@@ -16,16 +16,24 @@ stdenv.mkDerivation (rec {
   outputs = [ "dev" "out" "static" "man" ];
   setOutputFlags = false;
 
-  configureFlags = stdenv.lib.optional (!static) "--shared";
-
   preConfigure = ''
     if test -n "$crossConfig"; then
       export CC=$crossConfig-gcc
     fi
   '';
 
+  configureFlags = stdenv.lib.optional (!static) "--shared";
+
   postInstall = ''
     _moveToOutput lib/libz.a "$static"
+  ''
+    # jww (2015-01-06): Sometimes this library install as a .so, even on
+    # Darwin; others time it installs as a .dylib.  I haven't yet figured out
+    # what causes this difference.
+  + stdenv.lib.optionalString stdenv.isDarwin ''
+    for file in $out/lib/*.so* $out/lib/*.dylib* ; do
+      install_name_tool -id "$file" $file
+    done
   '';
 
   # As zlib takes part in the stdenv building, we don't want references
@@ -56,13 +64,5 @@ stdenv.mkDerivation (rec {
     license = licenses.zlib;
     platforms = platforms.all;
   };
-} // (if stdenv.isDarwin then {
-  postInstall = ''
-    # jww (2015-01-06): Sometimes this library install as a .so, even on
-    # Darwin; others time it installs as a .dylib.  I haven't yet figured out
-    # what causes this difference.
-    for file in $out/lib/*.so* $out/lib/*.dylib* ; do
-      install_name_tool -id "$file" $file
-    done
-  '';
-} else {}))
+}
+