about summary refs log tree commit diff
path: root/pkgs/top-level/static.nix
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2020-12-09 00:39:29 +0000
committerGitHub <noreply@github.com>2020-12-09 00:39:29 +0000
commit7d6630d7dbd5a9022cd26afa486d15aaddad5fdd (patch)
tree667aa87a2d067bb2663601a4aec8da80eb5b474e /pkgs/top-level/static.nix
parente729ab0408010e79d6acee2988c2d418d990818f (diff)
parent4e5fc1ed865139d585ecb92e5091e736cdae3a4e (diff)
Merge master into staging-next
Diffstat (limited to 'pkgs/top-level/static.nix')
-rw-r--r--pkgs/top-level/static.nix15
1 files changed, 10 insertions, 5 deletions
diff --git a/pkgs/top-level/static.nix b/pkgs/top-level/static.nix
index 7fb5aef5f1c5d..6720a019cbced 100644
--- a/pkgs/top-level/static.nix
+++ b/pkgs/top-level/static.nix
@@ -34,14 +34,18 @@ self: super: let
     });
   };
 
-  staticAdapters = [ makeStaticLibraries propagateBuildInputs ]
+  staticAdapters =
+    # makeStaticDarwin must go first so that the extraBuildInputs
+    # override does not recreate mkDerivation, removing subsequent
+    # adapters.
+    optional super.stdenv.hostPlatform.isDarwin makeStaticDarwin
+
+    ++ [ makeStaticLibraries propagateBuildInputs ]
 
     # Apple does not provide a static version of libSystem or crt0.o
     # So we can’t build static binaries without extensive hacks.
     ++ optional (!super.stdenv.hostPlatform.isDarwin) makeStaticBinaries
 
-    ++ optional super.stdenv.hostPlatform.isDarwin makeStaticDarwin
-
     # Glibc doesn’t come with static runtimes by default.
     # ++ optional (super.stdenv.hostPlatform.libc == "glibc") ((flip overrideInStdenv) [ self.stdenv.glibc.static ])
   ;
@@ -163,6 +167,7 @@ in {
   };
   mkl = super.mkl.override { enableStatic = true; };
   nix = super.nix.override { enableStatic = true; };
+  nixUnstable = super.nixUnstable.override { enableStatic = true; };
   openssl = (super.openssl_1_1.override { static = true; }).overrideAttrs (o: {
     # OpenSSL doesn't like the `--enable-static` / `--disable-shared` flags.
     configureFlags = (removeUnknownConfigureFlags o.configureFlags);
@@ -281,8 +286,8 @@ in {
   python39 = super.python39.override { static = true; };
   python3Minimal = super.python3Minimal.override { static = true; };
 
-
-  libev = super.libev.override { static = true; };
+  # Note: -static doesn’t work on darwin
+  libev = super.libev.override { static = !super.stdenv.hostPlatform.isDarwin; };
 
   libexecinfo = super.libexecinfo.override { enableShared = false; };