Packaging/Tutorial: Difference between revisions

imported>Makefu
initial batch of nixos-users
 
imported>Fadenb
m syntaxhighlight changes
Line 13: Line 13:
<li><p>Modify source URL and sha256. Don't forget about that sha256 stuff! What I do, I change last symbol of sha256, let the package fail, and then paste correct sha256 again into expression. There are also various prefetch techniques</p></li>
<li><p>Modify source URL and sha256. Don't forget about that sha256 stuff! What I do, I change last symbol of sha256, let the package fail, and then paste correct sha256 again into expression. There are also various prefetch techniques</p></li>
<li><p>Run <code>nix-shell</code> on this expression. Then run in order:</p>
<li><p>Run <code>nix-shell</code> on this expression. Then run in order:</p>
<source lang="bash">  $ unpackPhase
<syntaxhighlight lang="bash">  $ unpackPhase
   $ cd DIR_AFTER_UNPACK
   $ cd DIR_AFTER_UNPACK
   $ patchPhase
   $ patchPhase
   $ configurePhase
   $ configurePhase
   $ buildPhase</source>
   $ buildPhase</syntaxhighlight>
<p>(visit [https://nixos.org/nixpkgs/manual/#sec-stdenv-phases stdenv-phases] chapter to learn more about phases)</p></li></ol>
<p>(visit [https://nixos.org/nixpkgs/manual/#sec-stdenv-phases stdenv-phases] chapter to learn more about phases)</p></li></ol>


Line 53: Line 53:
In first case, you can run
In first case, you can run


<source lang="bash">  $ installPhase</source>
<syntaxhighlight lang="bash">  $ installPhase</syntaxhighlight>
directly and examine using <code>tree $out</code> your package files. If something is missing or too many, fix the <code>postInstallPhase</code> or <code>preInstallPhase</code> or <code>installPhase</code> in your expression.
directly and examine using <code>tree $out</code> your package files. If something is missing or too many, fix the <code>postInstallPhase</code> or <code>preInstallPhase</code> or <code>installPhase</code> in your expression.