stdenv: set meta.outputsToInstall unless overridden
This commit is contained in:
parent
d6b46ecb30
commit
3342f717da
@ -220,12 +220,22 @@ let
|
|||||||
# The meta attribute is passed in the resulting attribute set,
|
# The meta attribute is passed in the resulting attribute set,
|
||||||
# but it's not part of the actual derivation, i.e., it's not
|
# but it's not part of the actual derivation, i.e., it's not
|
||||||
# passed to the builder and is not a dependency. But since we
|
# passed to the builder and is not a dependency. But since we
|
||||||
# include it in the result, it *is* available to nix-env for
|
# include it in the result, it *is* available to nix-env for queries.
|
||||||
# queries. We also a meta.position attribute here to
|
meta = { }
|
||||||
# identify the source location of the package.
|
# If the packager hasn't specified `outputsToInstall`, choose a default,
|
||||||
meta = meta // (if pos' != null then {
|
# namely `p.bin or p.out or p`;
|
||||||
position = pos'.file + ":" + toString pos'.line;
|
# if he has specified it, it will be overridden below in `// meta`.
|
||||||
} else {});
|
// { outputsToInstall =
|
||||||
|
let
|
||||||
|
outs = outputs'; # the value passed to derivation primitive
|
||||||
|
hasOutput = out: builtins.elem out outs;
|
||||||
|
in [( lib.findFirst hasOutput null (["bin" "out"] ++ outs) )];
|
||||||
|
}
|
||||||
|
// meta
|
||||||
|
# Fill `meta.position` to identify the source location of the package.
|
||||||
|
// lib.optionalAttrs (pos' != null)
|
||||||
|
{ position = pos'.file + ":" + toString pos'.line; }
|
||||||
|
;
|
||||||
inherit passthru;
|
inherit passthru;
|
||||||
} //
|
} //
|
||||||
# Pass through extra attributes that are not inputs, but
|
# Pass through extra attributes that are not inputs, but
|
||||||
|
Loading…
Reference in New Issue
Block a user