mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-29 06:45:54 +03:00
a302d7360f
See #27069 for a discussion of this
43 lines
1.1 KiB
Nix
43 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: {
|
|
inherit config overlays;
|
|
selfBuild = false;
|
|
stdenv =
|
|
assert vanillaPackages.hostPlatform == localSystem;
|
|
assert vanillaPackages.targetPlatform == localSystem;
|
|
vanillaPackages.stdenv.override { targetPlatform = crossSystem; };
|
|
# It's OK to change the built-time dependencies
|
|
allowCustomOverrides = true;
|
|
})
|
|
|
|
# Run Packages
|
|
(buildPackages: {
|
|
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;
|
|
};
|
|
})
|
|
|
|
]
|