Nixpkgs/Create and debug packages: Difference between revisions

imported>Asbachb
m Link to chapter to nixpkgs quickstart chapter for writing nixpkgs
imported>Nh2
Explain how to best invoke individual phase, see https://logs.nix.samueldr.com/nixos/2019-07-21#2408818;
Line 183: Line 183:
</syntaxhighlight>
</syntaxhighlight>


or while developing your own package, you need to individually run these phases in order:
To only run some specific phases:
 
<syntaxhighlight lang="bash">
$ phases="buildPhase checkPhase" genericBuild
</syntaxhighlight>
 
While developing your own package, you need to run these phases in order:
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
unpackPhase
unpackPhase
Line 196: Line 202:
</syntaxhighlight>
</syntaxhighlight>


Any overridden phases should be invoked using '''eval''' instead:
Phases can be both bash functions, or environment of identical name (when they are overridden). <code>genericBuild</code> takes care of that distinction for you, invoking them appropriately. You can of course drop down to evaluating them yourself, for example to invoke an overridden phase (an environment variable) using '''eval''' instead:
 
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
eval "$checkPhase"
eval "$checkPhase"