594d264205
Packages get --host and --target by default, but can explicitly request any subset to be passed as needed. See docs for more info. rustc: Avoid hash breakage by using the old (ignored) dontSetConfigureCross when not cross building
45 lines
1.1 KiB
Nix
45 lines
1.1 KiB
Nix
{ lib
|
|
, localSystem, crossSystem, config, overlays
|
|
}:
|
|
|
|
let
|
|
bootStages = import ../. {
|
|
inherit lib localSystem overlays;
|
|
crossSystem = null;
|
|
# Ignore custom stdenvs when cross compiling for compatability
|
|
config = builtins.removeAttrs config [ "replaceStdenv" ];
|
|
};
|
|
|
|
in bootStages ++ [
|
|
|
|
# Build Packages
|
|
(vanillaPackages: {
|
|
buildPlatform = localSystem;
|
|
hostPlatform = localSystem;
|
|
targetPlatform = crossSystem;
|
|
inherit config overlays;
|
|
selfBuild = false;
|
|
# It's OK to change the built-time dependencies
|
|
allowCustomOverrides = true;
|
|
inherit (vanillaPackages) stdenv;
|
|
})
|
|
|
|
# Run Packages
|
|
(buildPackages: {
|
|
buildPlatform = localSystem;
|
|
hostPlatform = crossSystem;
|
|
targetPlatform = crossSystem;
|
|
inherit config overlays;
|
|
selfBuild = false;
|
|
stdenv = buildPackages.makeStdenvCross {
|
|
inherit (buildPackages) stdenv;
|
|
buildPlatform = localSystem;
|
|
hostPlatform = crossSystem;
|
|
targetPlatform = crossSystem;
|
|
cc = if crossSystem.useiOSCross or false
|
|
then buildPackages.darwin.ios-cross
|
|
else buildPackages.gccCrossStageFinal;
|
|
};
|
|
})
|
|
|
|
]
|