pkgsStatic: propagate all buildInputs
commitbb71bb15ce30dfc453648ac8979f938b9b3aeed7
authorTobias Mayer <tobim@fastmail.fm>
dateWed 24 Jul 2019, 16:04 (7 years ago)
parente06b7d9
pkgs/stdenv/adapters.nix+12
@@ -65,6 +65,18 @@ rec {
6565 static = true;
6666 };
6767
68+
69+ /* Modify a stdenv so that all buildInputs are implicitly propagated to
70+ consuming derivations
71+ */
72+ propagateBuildInputs = stdenv: stdenv //
73+ { mkDerivation = args: stdenv.mkDerivation (args // {
74+ propagatedBuildInputs = (args.propagatedBuildInputs or []) ++ (args.buildInputs or []);
75+ buildInputs = [];
76+ });
77+ };
78+
79+
6880 /* Modify a stdenv so that the specified attributes are added to
6981 every derivation returned by its mkDerivation function.
7082
pkgs/top-level/static.nix+3−2
@@ -12,7 +12,8 @@
1212
1313self: super: let
1414 inherit (super.stdenvAdapters) makeStaticBinaries
15− makeStaticLibraries;
15+ makeStaticLibraries
16+ propagateBuildInputs;
1617 inherit (super.lib) foldl optional flip id composeExtensions;
1718 inherit (super) makeSetupHook;
1819
@@ -30,7 +31,7 @@ self: super: let
3031 });
3132 };
3233
33− staticAdapters = [ makeStaticLibraries ]
34+ staticAdapters = [ makeStaticLibraries propagateBuildInputs ]
3435
3536 # Apple does not provide a static version of libSystem or crt0.o
3637 # So we can’t build static binaries without extensive hacks.