mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-28 22:32:58 +03:00
0f33b9f7f1
Instead, the cross stdenv will patch up the override field -- the complexity is now confined to the one place it matters.
50 lines
1.5 KiB
Nix
50 lines
1.5 KiB
Nix
{ lib
|
|
, system, platform, crossSystem, config
|
|
}:
|
|
|
|
let
|
|
bootStages = import ../. {
|
|
inherit lib system platform;
|
|
crossSystem = null;
|
|
# Ignore custom stdenvs when cross compiling for compatability
|
|
config = builtins.removeAttrs config [ "replaceStdenv" ];
|
|
};
|
|
|
|
in bootStages ++ [
|
|
|
|
# Build Packages.
|
|
#
|
|
# For now, this is just used to build the native stdenv. Eventually, it
|
|
# should be used to build compilers and other such tools targeting the cross
|
|
# platform. Then, `forceNativeDrv` can be removed.
|
|
(vanillaPackages: {
|
|
inherit system platform crossSystem config;
|
|
# It's OK to change the built-time dependencies
|
|
allowCustomOverrides = true;
|
|
stdenv = vanillaPackages.stdenv // {
|
|
# Needed elsewhere as a hacky way to pass the target
|
|
cross = crossSystem;
|
|
overrides = _: _: {};
|
|
};
|
|
})
|
|
|
|
# Run packages
|
|
(buildPackages: {
|
|
inherit system platform crossSystem config;
|
|
stdenv = if crossSystem.useiOSCross or false
|
|
then let
|
|
inherit (buildPackages.darwin.ios-cross {
|
|
prefix = crossSystem.config;
|
|
inherit (crossSystem) arch;
|
|
simulator = crossSystem.isiPhoneSimulator or false; })
|
|
cc binutils;
|
|
in buildPackages.makeStdenvCross
|
|
buildPackages.stdenv crossSystem
|
|
binutils cc
|
|
else buildPackages.makeStdenvCross
|
|
buildPackages.stdenv crossSystem
|
|
buildPackages.binutilsCross buildPackages.gccCrossStageFinal;
|
|
})
|
|
|
|
]
|