nixpkgs/pkgs/stdenv/cross/default.nix

36 lines
1.3 KiB
Nix
Raw Normal View History

{ system, allPackages, platform, crossSystem, config, ... } @ args:
rec {
argClobber = {
crossSystem = null;
# 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
})) // {
# Needed elsewhere as a hacky way to pass the target
cross = crossSystem;
};
# 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.
buildPackages = allPackages {
inherit system platform crossSystem config;
# It's OK to change the built-time dependencies
allowCustomOverrides = true;
stdenv = vanillaStdenv;
};
stdenvCross = buildPackages.makeStdenvCross
buildPackages.stdenv crossSystem
buildPackages.binutilsCross buildPackages.gccCrossStageFinal;
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;
}