summary refs log tree commit diff
path: root/pkgs/development/libraries/zlib/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/libraries/zlib/default.nix')
-rw-r--r--pkgs/development/libraries/zlib/default.nix11
1 files changed, 9 insertions, 2 deletions
diff --git a/pkgs/development/libraries/zlib/default.nix b/pkgs/development/libraries/zlib/default.nix
index 0938e2a17a79..5f9a01208d84 100644
--- a/pkgs/development/libraries/zlib/default.nix
+++ b/pkgs/development/libraries/zlib/default.nix
@@ -13,15 +13,22 @@ stdenv.mkDerivation rec {
     sha256 = "039agw5rqvqny92cpkrfn243x2gd4xn13hs3xi6isk55d2vqqr9n";
   };
 
-  configureFlags = if static then "" else "--shared";
+  outputs = [ "dev" "out" "static" "man" ];
+  buildInputs = [ stdenv.hookLib.multiout ];
+  setOutputFlags = false;
+
+  configureFlags = stdenv.lib.optional (!static) "--shared";
 
   preConfigure = ''
     if test -n "$crossConfig"; then
       export CC=$crossConfig-gcc
-      configureFlags=${if static then "" else "--shared"}
     fi
   '';
 
+  postInstall = ''
+    _moveToOutput lib/libz.a "$static"
+  '';
+
   # As zlib takes part in the stdenv building, we don't want references
   # to the bootstrap-tools libgcc (as uses to happen on arm/mips)
   NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (!stdenv.isDarwin) "-static-libgcc";