2016-11-07 06:27:38 +01:00
|
|
|
{ system, allPackages, platform, crossSystem, config, ... } @ args:
|
|
|
|
|
|
|
|
rec {
|
2016-04-27 18:09:27 +02:00
|
|
|
argClobber = {
|
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" ];
|
|
|
|
};
|
|
|
|
vanillaStdenv = (import ../. (args // argClobber // {
|
|
|
|
allPackages = args: allPackages (argClobber // args);
|
2016-11-11 15:34:24 +01:00
|
|
|
})).stdenv // {
|
|
|
|
# Needed elsewhere as a hacky way to pass the target
|
|
|
|
cross = crossSystem;
|
|
|
|
};
|
2016-11-07 06:27:38 +01:00
|
|
|
|
2016-11-11 15:34:24 +01:00
|
|
|
# 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.
|
2016-11-07 06:27:38 +01:00
|
|
|
buildPackages = allPackages {
|
|
|
|
# It's OK to change the built-time dependencies
|
|
|
|
allowCustomOverrides = true;
|
2016-11-11 15:34:24 +01:00
|
|
|
bootStdenv = vanillaStdenv;
|
2016-11-07 06:27:38 +01:00
|
|
|
inherit system platform crossSystem config;
|
|
|
|
};
|
|
|
|
|
|
|
|
stdenvCross = buildPackages.makeStdenvCross
|
2016-11-11 15:34:24 +01:00
|
|
|
buildPackages.stdenv crossSystem
|
2016-11-07 06:27:38 +01:00
|
|
|
buildPackages.binutilsCross buildPackages.gccCrossStageFinal;
|
2016-11-15 22:31:55 +01:00
|
|
|
|
|
|
|
stdenvCrossiOS = 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;
|
2016-11-07 06:27:38 +01:00
|
|
|
}
|