nixpkgs/pkgs/stdenv/cross/default.nix
John Ericson 49c99b70cf cross-stdenv: Only prune most overrides in the final stage
Before all overrides were also pruned in the previous stage, now
only gcc and binutils are, because they alone care about about the
target platform. The rest of the overrides don't, so it's better to
preserve them in order to avoid spurious rebuilds.
2017-04-24 16:31:53 -04:00

46 lines
1.2 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 = if crossSystem.useiOSCross or false
then let
inherit (buildPackages.darwin.ios-cross) cc binutils;
in buildPackages.makeStdenvCross
buildPackages.stdenv crossSystem
binutils cc
else buildPackages.makeStdenvCross
buildPackages.stdenv crossSystem
buildPackages.binutilsCross buildPackages.gccCrossStageFinal;
})
]