mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-11 00:36:20 +02:00
run: use pname as a fallback for main program
This commit is contained in:
parent
5a160171d0
commit
a2473823d7
2 changed files with 7 additions and 3 deletions
|
@ -83,11 +83,14 @@ UnresolvedApp Installable::toApp(EvalState & state)
|
||||||
auto outPath = cursor->getAttr(state.sOutPath)->getString();
|
auto outPath = cursor->getAttr(state.sOutPath)->getString();
|
||||||
auto outputName = cursor->getAttr(state.sOutputName)->getString();
|
auto outputName = cursor->getAttr(state.sOutputName)->getString();
|
||||||
auto name = cursor->getAttr(state.sName)->getString();
|
auto name = cursor->getAttr(state.sName)->getString();
|
||||||
|
auto aPname = cursor->maybeGetAttr("pname");
|
||||||
auto aMeta = cursor->maybeGetAttr("meta");
|
auto aMeta = cursor->maybeGetAttr("meta");
|
||||||
auto aMainProgram = aMeta ? aMeta->maybeGetAttr("mainProgram") : nullptr;
|
auto aMainProgram = aMeta ? aMeta->maybeGetAttr("mainProgram") : nullptr;
|
||||||
auto mainProgram =
|
auto mainProgram =
|
||||||
aMainProgram
|
aMainProgram
|
||||||
? aMainProgram->getString()
|
? aMainProgram->getString()
|
||||||
|
: aPname
|
||||||
|
? aPname->getString()
|
||||||
: DrvName(name).name;
|
: DrvName(name).name;
|
||||||
auto program = outPath + "/bin/" + mainProgram;
|
auto program = outPath + "/bin/" + mainProgram;
|
||||||
return UnresolvedApp { App {
|
return UnresolvedApp { App {
|
||||||
|
|
|
@ -44,9 +44,10 @@ program specified by the app definition.
|
||||||
If *installable* evaluates to a derivation, it will try to execute the
|
If *installable* evaluates to a derivation, it will try to execute the
|
||||||
program `<out>/bin/<name>`, where *out* is the primary output store
|
program `<out>/bin/<name>`, where *out* is the primary output store
|
||||||
path of the derivation and *name* is the `meta.mainProgram` attribute
|
path of the derivation and *name* is the `meta.mainProgram` attribute
|
||||||
of the derivation if it exists, and otherwise the name part of the
|
of the derivation if it exists, and otherwise the `pname` attribute of
|
||||||
value of the `name` attribute of the derivation (e.g. if `name` is set
|
the derivation or the name part of the value of the `name` attribute of
|
||||||
to `hello-1.10`, it will run `$out/bin/hello`).
|
the derivation (e.g. if `name` is set to `hello-1.10`, it will run
|
||||||
|
`$out/bin/hello`).
|
||||||
|
|
||||||
# Flake output attributes
|
# Flake output attributes
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue