nixpkgs/pkgs/stdenv/cross/default.nix
John Ericson 594d264205 cross stdenv adaptor: Support --host --build --target across the board
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
2017-06-22 17:52:28 -04:00

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;
};
})
]