stdenv cross adapter: Use extraNativeBuildInputs

This means we don't need to hackily avoid overwriting `mkDerivation`.
This commit is contained in:
John Ericson 2018-07-24 16:32:40 -04:00
parent 87b4a5d6a7
commit c12b50b267

View File

@ -63,33 +63,24 @@ rec {
# with this run on a different platform, so disable by # with this run on a different platform, so disable by
# default. # default.
overrides ? _: _: {} overrides ? _: _: {}
} @ overrideArgs: let } @ overrideArgs:
stdenv = overrideArgs.stdenv.override { overrideArgs.stdenv.override (old: {
inherit inherit
buildPlatform hostPlatform targetPlatform buildPlatform hostPlatform targetPlatform
cc overrides; cc overrides;
allowedRequisites = null; allowedRequisites = null;
extraNativeBuildInputs = old.extraNativeBuildInputs
# without proper `file` command, libtool sometimes fails
# to recognize 64-bit DLLs
++ stdenv.lib.optional (hostPlatform.config == "x86_64-w64-mingw32") pkgs.file
++ stdenv.lib.optional
(hostPlatform.isAarch64 || hostPlatform.isMips || hostPlatform.libc == "musl")
pkgs.updateAutotoolsGnuConfigScriptsHook
;
extraBuildInputs = [ ]; # Old ones run on wrong platform extraBuildInputs = [ ]; # Old ones run on wrong platform
}; });
in stdenv // {
mkDerivation =
{ nativeBuildInputs ? []
, ...
} @ args:
stdenv.mkDerivation (args // {
nativeBuildInputs = nativeBuildInputs
# without proper `file` command, libtool sometimes fails
# to recognize 64-bit DLLs
++ stdenv.lib.optional (hostPlatform.config == "x86_64-w64-mingw32") pkgs.file
++ stdenv.lib.optional
(hostPlatform.isAarch64 || hostPlatform.isMips || hostPlatform.libc == "musl")
pkgs.updateAutotoolsGnuConfigScriptsHook
;
});
};
/* Modify a stdenv so that the specified attributes are added to /* Modify a stdenv so that the specified attributes are added to
every derivation returned by its mkDerivation function. every derivation returned by its mkDerivation function.