2016-11-07 05:27:38 +00:00
|
|
|
{ system, allPackages, platform, crossSystem, config, ... } @ args:
|
|
|
|
|
|
|
|
rec {
|
2016-04-27 16:09:27 +00:00
|
|
|
argClobber = {
|
2016-11-07 05:27:38 +00:00
|
|
|
crossSystem = null;
|
2016-04-27 16:09:27 +00: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-13 18:38:41 +00:00
|
|
|
})) // {
|
2016-11-11 14:34:24 +00:00
|
|
|
# Needed elsewhere as a hacky way to pass the target
|
|
|
|
cross = crossSystem;
|
|
|
|
};
|
2016-11-07 05:27:38 +00:00
|
|
|
|
2016-11-11 14:34:24 +00: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 05:27:38 +00:00
|
|
|
buildPackages = allPackages {
|
2016-12-01 00:03:22 +00:00
|
|
|
inherit system platform crossSystem config;
|
2016-11-07 05:27:38 +00:00
|
|
|
# It's OK to change the built-time dependencies
|
|
|
|
allowCustomOverrides = true;
|
2016-11-27 20:35:58 +00:00
|
|
|
stdenv = vanillaStdenv;
|
2016-11-07 05:27:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
stdenvCross = buildPackages.makeStdenvCross
|
2016-11-11 14:34:24 +00:00
|
|
|
buildPackages.stdenv crossSystem
|
2016-11-07 05:27:38 +00:00
|
|
|
buildPackages.binutilsCross buildPackages.gccCrossStageFinal;
|
2016-11-15 21:31:55 +00: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 05:27:38 +00:00
|
|
|
}
|