2016-12-16 13:22:02 +00:00
|
|
|
{ lib
|
2016-12-17 18:05:21 +00:00
|
|
|
, system, platform, crossSystem, config, overlays
|
2016-11-27 20:37:45 +00:00
|
|
|
}:
|
2016-11-07 05:27:38 +00:00
|
|
|
|
2016-12-16 13:22:02 +00:00
|
|
|
let
|
|
|
|
bootStages = import ../. {
|
2016-12-17 18:05:21 +00:00
|
|
|
inherit lib system platform overlays;
|
2016-11-07 05:27:38 +00:00
|
|
|
crossSystem = null;
|
2016-04-27 17:09:27 +01:00
|
|
|
# Ignore custom stdenvs when cross compiling for compatability
|
|
|
|
config = builtins.removeAttrs config [ "replaceStdenv" ];
|
2016-11-11 14:34:24 +00:00
|
|
|
};
|
2016-11-07 05:27:38 +00:00
|
|
|
|
2016-12-16 13:22:02 +00:00
|
|
|
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
|
2016-11-11 14:34:24 +00:00
|
|
|
# platform. Then, `forceNativeDrv` can be removed.
|
2016-12-16 13:22:02 +00:00
|
|
|
(vanillaPackages: {
|
2016-12-17 18:05:21 +00:00
|
|
|
inherit system platform crossSystem config overlays;
|
2016-11-07 05:27:38 +00:00
|
|
|
# It's OK to change the built-time dependencies
|
|
|
|
allowCustomOverrides = true;
|
2016-12-16 13:22:02 +00:00
|
|
|
stdenv = vanillaPackages.stdenv // {
|
|
|
|
# Needed elsewhere as a hacky way to pass the target
|
|
|
|
cross = crossSystem;
|
2016-12-22 02:42:53 +00:00
|
|
|
overrides = _: _: {};
|
2016-12-16 13:22:02 +00:00
|
|
|
};
|
|
|
|
})
|
2016-11-07 05:27:38 +00:00
|
|
|
|
2016-12-16 13:22:02 +00:00
|
|
|
# Run packages
|
|
|
|
(buildPackages: {
|
2016-12-17 18:05:21 +00:00
|
|
|
inherit system platform crossSystem config overlays;
|
2016-12-16 13:22:02 +00:00
|
|
|
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;
|
|
|
|
})
|
2016-11-15 21:31:55 +00:00
|
|
|
|
2016-12-16 13:22:02 +00:00
|
|
|
]
|