Merge branch 'fix-splice' into ericson2314-cross-base
This commit is contained in:
commit
79816cd64b
@ -37,12 +37,15 @@ let
|
|||||||
inherit name;
|
inherit name;
|
||||||
value = let
|
value = let
|
||||||
defaultValue = mash.${name};
|
defaultValue = mash.${name};
|
||||||
buildValue = buildPkgs.${name} or {};
|
buildValue = buildPkgs.${name};
|
||||||
runValue = runPkgs.${name} or {};
|
runValue = runPkgs.${name};
|
||||||
augmentedValue = defaultValue
|
augmentedValue = defaultValue
|
||||||
// (lib.optionalAttrs (buildPkgs ? ${name}) { nativeDrv = buildValue; })
|
// (lib.optionalAttrs (buildPkgs ? ${name}) { nativeDrv = buildValue; })
|
||||||
// (lib.optionalAttrs (runPkgs ? ${name}) { crossDrv = runValue; });
|
// (lib.optionalAttrs (runPkgs ? ${name}) { crossDrv = runValue; });
|
||||||
# Get the set of outputs of a derivation
|
# Get the set of outputs of a derivation
|
||||||
|
tryGetOutputs = value0: let
|
||||||
|
eval = builtins.tryEval value0;
|
||||||
|
in getOutputs (if eval.success then eval.value else {});
|
||||||
getOutputs = value: lib.genAttrs
|
getOutputs = value: lib.genAttrs
|
||||||
(value.outputs or (lib.optional (value ? out) "out"))
|
(value.outputs or (lib.optional (value ? out) "out"))
|
||||||
(output: value.${output});
|
(output: value.${output});
|
||||||
@ -54,7 +57,7 @@ let
|
|||||||
# The derivation along with its outputs, which we recur
|
# The derivation along with its outputs, which we recur
|
||||||
# on to splice them together.
|
# on to splice them together.
|
||||||
else if lib.isDerivation defaultValue then augmentedValue
|
else if lib.isDerivation defaultValue then augmentedValue
|
||||||
// splicer (getOutputs buildValue) (getOutputs runValue)
|
// splicer (tryGetOutputs buildValue) (getOutputs runValue)
|
||||||
# Just recur on plain attrsets
|
# Just recur on plain attrsets
|
||||||
else if lib.isAttrs defaultValue then splicer buildValue runValue
|
else if lib.isAttrs defaultValue then splicer buildValue runValue
|
||||||
# Don't be fancy about non-derivations. But we could have used used
|
# Don't be fancy about non-derivations. But we could have used used
|
||||||
|
Loading…
Reference in New Issue
Block a user