lib: Create `makeScopeWithSplicing`
It's ugly as hell, but I suppose it is needed to codify how to make spliced package sets.
This commit is contained in:
parent
f01bfd6843
commit
a6218c058b
|
@ -217,4 +217,31 @@ rec {
|
||||||
};
|
};
|
||||||
in self;
|
in self;
|
||||||
|
|
||||||
|
/* 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:
|
||||||
|
let
|
||||||
|
spliced = splicePackages {
|
||||||
|
pkgsBuildBuild = otherSplices.selfBuildBuild;
|
||||||
|
pkgsBuildHost = otherSplices.selfBuildHost;
|
||||||
|
pkgsBuildTarget = otherSplices.selfBuildTarget;
|
||||||
|
pkgsHostHost = otherSplices.selfHostHost;
|
||||||
|
pkgsHostTarget = self; # Not `otherSplices.selfHostTarget`;
|
||||||
|
pkgsTargetTarget = otherSplices.selfTargetTarget;
|
||||||
|
} // keep self;
|
||||||
|
self = f self // {
|
||||||
|
newScope = scope: newScope (spliced // scope);
|
||||||
|
callPackage = newScope spliced; # == self.newScope {};
|
||||||
|
# N.B. the other stages of the package set spliced in are *not*
|
||||||
|
# overridden.
|
||||||
|
overrideScope = g: makeScopeWithSplicing
|
||||||
|
splicePackages
|
||||||
|
newScope
|
||||||
|
otherSplices
|
||||||
|
keep
|
||||||
|
(lib.fixedPoints.extends g f);
|
||||||
|
packages = f;
|
||||||
|
};
|
||||||
|
in self;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,7 +101,7 @@ let
|
||||||
noDepEntry fullDepEntry packEntry stringAfter;
|
noDepEntry fullDepEntry packEntry stringAfter;
|
||||||
inherit (self.customisation) overrideDerivation makeOverridable
|
inherit (self.customisation) overrideDerivation makeOverridable
|
||||||
callPackageWith callPackagesWith extendDerivation hydraJob
|
callPackageWith callPackagesWith extendDerivation hydraJob
|
||||||
makeScope;
|
makeScope makeScopeWithSplicing;
|
||||||
inherit (self.meta) addMetaAttrs dontDistribute setName updateName
|
inherit (self.meta) addMetaAttrs dontDistribute setName updateName
|
||||||
appendToName mapDerivationAttrset setPrio lowPrio lowPrioSet hiPrio
|
appendToName mapDerivationAttrset setPrio lowPrio lowPrioSet hiPrio
|
||||||
hiPrioSet;
|
hiPrioSet;
|
||||||
|
|
Loading…
Reference in New Issue