about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/zlib
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-01-15 10:30:44 +0000
committerAlyssa Ross <hi@alyssa.is>2021-01-15 10:30:44 +0000
commite0794be8a0d11e90461e5a9c85012a36b93ec976 (patch)
treeefd9cbc55ea3322867bf601c4d536758a3dd5fcc /nixpkgs/pkgs/development/libraries/zlib
parent3538874082ded7647b1ccec0343c7c1e882cfef3 (diff)
parent1a57d96edd156958b12782e8c8b6a374142a7248 (diff)
downloadnixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar.gz
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar.bz2
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar.lz
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar.xz
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar.zst
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.zip
Merge commit '1a57d96edd156958b12782e8c8b6a374142a7248'
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/zlib')
-rw-r--r--nixpkgs/pkgs/development/libraries/zlib/default.nix10
1 files changed, 6 insertions, 4 deletions
diff --git a/nixpkgs/pkgs/development/libraries/zlib/default.nix b/nixpkgs/pkgs/development/libraries/zlib/default.nix
index 98746968146d..b780fcda3930 100644
--- a/nixpkgs/pkgs/development/libraries/zlib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/zlib/default.nix
@@ -1,17 +1,19 @@
 { stdenv
 , fetchurl
-# Note: If `{ static = false; shared = false; }`, upstream's default is used
-#       (which is building both static and shared as of zlib 1.2.11).
-, shared ? true
+, shared ? !stdenv.hostPlatform.isStatic
 , static ? true
 # If true, a separate .static ouput is created and the .a is moved there.
 # In this case `pkg-config` auto detection does not currently work if the
 # .static output is given as `buildInputs` to another package (#66461), because
 # the `.pc` file lists only the main output's lib dir.
 # If false, and if `{ static = true; }`, the .a stays in the main output.
-, splitStaticOutput ? static
+, splitStaticOutput ? shared && static
 }:
 
+# Without either the build will actually still succeed because the build
+# system makes an arbitrary choice, but we shouldn't be so indecisive.
+assert shared || static;
+
 # Note: this package is used for bootstrapping fetchurl, and thus
 # cannot use fetchpatch! All mutable patches (generated by GitHub or
 # cgit) that are needed here should be included directly in Nixpkgs as