pkgsStatic: propagate all buildInputs

This commit is contained in:
Tobias Mayer 2019-07-24 16:04:51 +02:00
parent e06b7d9638
commit bb71bb15ce
2 changed files with 15 additions and 2 deletions

View file

@ -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.

View file

@ -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 cant build static binaries without extensive hacks.