about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorArtturi <Artturin@artturin.com>2023-11-07 03:49:21 +0200
committerGitHub <noreply@github.com>2023-11-07 03:49:21 +0200
commitfbb3ff5e1228d8d54c4cdf40302e4193a15e8648 (patch)
treedc760d6b247405074c8fc3b7c604917ec3844775 /pkgs
parent5a803b4198b59d6bd6f983f77307618e4f25af12 (diff)
parentef4c88d1f67efe6a36b40119ebf11ff134f40724 (diff)
Merge pull request #243161 from nh2/more-enableStatic
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/stdenv/darwin/make-bootstrap-tools.nix2
-rw-r--r--pkgs/tools/compression/bzip2/default.nix11
-rw-r--r--pkgs/tools/compression/zstd/default.nix5
3 files changed, 12 insertions, 6 deletions
diff --git a/pkgs/stdenv/darwin/make-bootstrap-tools.nix b/pkgs/stdenv/darwin/make-bootstrap-tools.nix
index 448d6ecd9f179..deda9b052e53d 100644
--- a/pkgs/stdenv/darwin/make-bootstrap-tools.nix
+++ b/pkgs/stdenv/darwin/make-bootstrap-tools.nix
@@ -28,7 +28,7 @@ in rec {
   cctools_ = darwin.cctools;
 
   # Avoid debugging larger changes for now.
-  bzip2_ = bzip2.override (args: { linkStatic = true; });
+  bzip2_ = bzip2.override (args: { enableStatic = true; enableShared = false; });
 
   # Avoid messing with libkrb5 and libnghttp2.
   curl_ = curlMinimal.override (args: { gssSupport = false; http2Support = false; });
diff --git a/pkgs/tools/compression/bzip2/default.nix b/pkgs/tools/compression/bzip2/default.nix
index be456cf594427..bfab2dbb94670 100644
--- a/pkgs/tools/compression/bzip2/default.nix
+++ b/pkgs/tools/compression/bzip2/default.nix
@@ -1,5 +1,6 @@
 { lib, stdenv, fetchurl
-, linkStatic ? with stdenv.hostPlatform; isStatic || isCygwin
+, enableStatic ? with stdenv.hostPlatform; isStatic || isCygwin
+, enableShared ? true
 , autoreconfHook
 , testers
 }:
@@ -47,8 +48,12 @@ in {
 
   outputs = [ "bin" "dev" "out" "man" ];
 
-  configureFlags =
-    lib.optionals linkStatic [ "--enable-static" "--disable-shared" ];
+  configureFlags = lib.concatLists [
+    (lib.optional enableStatic "--enable-static")
+    (lib.optional (!enableShared) "--disable-shared")
+  ];
+
+  dontDisableStatic = enableStatic;
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/tools/compression/zstd/default.nix b/pkgs/tools/compression/zstd/default.nix
index 791dda4f11ef3..75b306b368aa3 100644
--- a/pkgs/tools/compression/zstd/default.nix
+++ b/pkgs/tools/compression/zstd/default.nix
@@ -2,7 +2,8 @@
 , fixDarwinDylibNames
 , file
 , legacySupport ? false
-, static ? stdenv.hostPlatform.isStatic
+, static ? stdenv.hostPlatform.isStatic # generates static libraries *only*
+, enableStatic ? static
 # these need to be ran on the host, thus disable when cross-compiling
 , buildContrib ? stdenv.hostPlatform == stdenv.buildPlatform
 , doCheck ? stdenv.hostPlatform == stdenv.buildPlatform
@@ -54,7 +55,7 @@ stdenv.mkDerivation rec {
   cmakeFlags = lib.attrsets.mapAttrsToList
     (name: value: "-DZSTD_${name}:BOOL=${if value then "ON" else "OFF"}") {
       BUILD_SHARED = !static;
-      BUILD_STATIC = static;
+      BUILD_STATIC = enableStatic;
       BUILD_CONTRIB = buildContrib;
       PROGRAMS_LINK_SHARED = !static;
       LEGACY_SUPPORT = legacySupport;