Merge pull request #269461 from Artturin/addcrossreplace

config.replaceCrossStdenv: add
This commit is contained in:
Artturin 2024-05-03 01:25:05 +03:00 committed by GitHub
commit 124c828155
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -10,6 +10,7 @@ let
crossOverlays = [];
# Ignore custom stdenvs when cross compiling for compatibility
# Use replaceCrossStdenv instead.
config = builtins.removeAttrs config [ "replaceStdenv" ];
};
@ -44,7 +45,8 @@ in lib.init bootStages ++ [
inherit config;
overlays = overlays ++ crossOverlays;
selfBuild = false;
stdenv = adaptStdenv (buildPackages.stdenv.override (old: rec {
stdenv = let
baseStdenv = adaptStdenv (buildPackages.stdenv.override (old: rec {
buildPlatform = localSystem;
hostPlatform = crossSystem;
targetPlatform = crossSystem;
@ -85,6 +87,7 @@ in lib.init bootStages ++ [
buildPackages.updateAutotoolsGnuConfigScriptsHook
;
}));
in if config ? replaceCrossStdenv then config.replaceCrossStdenv { inherit buildPackages baseStdenv; } else baseStdenv;
})
]