treewide: Do a number of no-op cleanups for cross and darwin

I am taking the non-invasive parts of #110914 to hopefully help out with #111988.

In particular:

 - Use `lib.makeScopeWithSplicing` to make the `darwin` package set have
   a proper `callPackage`.

 - Adjust Darwin `stdenv`'s overlays keeping things from the previous
   stage to not stick around too much.

 - Expose `binutilsNoLibc` / `darwin.binutilsNoLibc` to hopefully get us
   closer to a unified LLVM and GCC bootstrap.
This commit is contained in:
John Ericson
2021-05-06 11:17:26 -04:00
parent b418e17a4c
commit 470640e7fe
7 changed files with 111 additions and 83 deletions
+5 -3
View File
@@ -219,16 +219,17 @@ rec {
/* Like the above, but aims to support cross compilation. It's still ugly, but
hopefully it helps a little bit. */
makeScopeWithSplicing = splicePackages: newScope: otherSplices: keep: f:
makeScopeWithSplicing = splicePackages: newScope: otherSplices: keep: extra: f:
let
spliced = splicePackages {
spliced0 = splicePackages {
pkgsBuildBuild = otherSplices.selfBuildBuild;
pkgsBuildHost = otherSplices.selfBuildHost;
pkgsBuildTarget = otherSplices.selfBuildTarget;
pkgsHostHost = otherSplices.selfHostHost;
pkgsHostTarget = self; # Not `otherSplices.selfHostTarget`;
pkgsTargetTarget = otherSplices.selfTargetTarget;
} // keep self;
};
spliced = extra spliced0 // spliced0 // keep self;
self = f self // {
newScope = scope: newScope (spliced // scope);
callPackage = newScope spliced; # == self.newScope {};
@@ -239,6 +240,7 @@ rec {
newScope
otherSplices
keep
extra
(lib.fixedPoints.extends g f);
packages = f;
};