1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-09-11 15:08:33 +01:00
nixpkgs/pkgs/stdenv/cross/default.nix
John Ericson e22346c35e top-level: Make stdenvCross which appears at first glance normal...
...but actually is weird just like the original
2016-11-06 21:27:38 -08:00

28 lines
1 KiB
Nix

{ system, allPackages, platform, crossSystem, config, ... } @ args:
rec {
vanillaStdenv = (import ../. (args // {
crossSystem = null;
allPackages = args: allPackages ({ crossSystem = null; } // args);
})).stdenv;
# Yeah this isn't so cleanly just build-time packages yet. Notice the
# buildPackages <-> stdenvCross cycle. Yup, it's very weird.
#
# This works because the derivation used to build `stdenvCross` are in
# fact using `forceNativeDrv` to use the `nativeDrv` attribute of the resulting
# derivation built with `vanillaStdenv` (second argument of `makeStdenvCross`).
#
# Eventually, `forceNativeDrv` should be removed and the cycle broken.
buildPackages = allPackages {
# It's OK to change the built-time dependencies
allowCustomOverrides = true;
bootStdenv = stdenvCross;
inherit system platform crossSystem config;
};
stdenvCross = buildPackages.makeStdenvCross
vanillaStdenv crossSystem
buildPackages.binutilsCross buildPackages.gccCrossStageFinal;
}