diff options
author | Tobias Mayer <tobim@fastmail.fm> | 2019-07-24 16:04:51 +0200 |
---|---|---|
committer | Tobias Mayer <tobim@fastmail.fm> | 2019-07-24 16:04:51 +0200 |
commit | bb71bb15ce30dfc453648ac8979f938b9b3aeed7 (patch) | |
tree | 2a83b9aed39b4bf7614f1684b486db6a2fc57892 | |
parent | e06b7d9638e7547cc43af9149348d0ebf90d2763 (diff) | |
download | nixpkgs-bb71bb15ce30dfc453648ac8979f938b9b3aeed7.tar nixpkgs-bb71bb15ce30dfc453648ac8979f938b9b3aeed7.tar.gz nixpkgs-bb71bb15ce30dfc453648ac8979f938b9b3aeed7.tar.bz2 nixpkgs-bb71bb15ce30dfc453648ac8979f938b9b3aeed7.tar.lz nixpkgs-bb71bb15ce30dfc453648ac8979f938b9b3aeed7.tar.xz nixpkgs-bb71bb15ce30dfc453648ac8979f938b9b3aeed7.tar.zst nixpkgs-bb71bb15ce30dfc453648ac8979f938b9b3aeed7.zip |
pkgsStatic: propagate all buildInputs
-rw-r--r-- | pkgs/stdenv/adapters.nix | 12 | ||||
-rw-r--r-- | pkgs/top-level/static.nix | 5 |
2 files changed, 15 insertions, 2 deletions
diff --git a/pkgs/stdenv/adapters.nix b/pkgs/stdenv/adapters.nix index 0409bf1104b..8f62bd24dda 100644 --- a/pkgs/stdenv/adapters.nix +++ b/pkgs/stdenv/adapters.nix @@ -65,6 +65,18 @@ rec { static = true; }; + + /* Modify a stdenv so that all buildInputs are implicitly propagated to + consuming derivations + */ + propagateBuildInputs = stdenv: stdenv // + { mkDerivation = args: stdenv.mkDerivation (args // { + propagatedBuildInputs = (args.propagatedBuildInputs or []) ++ (args.buildInputs or []); + buildInputs = []; + }); + }; + + /* Modify a stdenv so that the specified attributes are added to every derivation returned by its mkDerivation function. diff --git a/pkgs/top-level/static.nix b/pkgs/top-level/static.nix index 193356a61ec..108c6006fb6 100644 --- a/pkgs/top-level/static.nix +++ b/pkgs/top-level/static.nix @@ -12,7 +12,8 @@ self: super: let inherit (super.stdenvAdapters) makeStaticBinaries - makeStaticLibraries; + makeStaticLibraries + propagateBuildInputs; inherit (super.lib) foldl optional flip id composeExtensions; inherit (super) makeSetupHook; @@ -30,7 +31,7 @@ self: super: let }); }; - staticAdapters = [ makeStaticLibraries ] + staticAdapters = [ makeStaticLibraries propagateBuildInputs ] # Apple does not provide a static version of libSystem or crt0.o # So we can’t build static binaries without extensive hacks. |