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