Packaging/Quirks and Caveats: Difference between revisions
imported>Melkor333 No edit summary |
imported>PicoGeyer m Minor readability fix |
||
| Line 32: | Line 32: | ||
== Package simple python scripts == | == Package simple python scripts == | ||
For scripts like a single Python file, it is not necessary to specify <code>src</code> in <code>mkDerivation</code>. When you want to use <code>buildPythonPackage</code> the sources need to provide a <code>setup.py</code> file which also is overkill for a lot of projects. The default <code>mkDerivation</code> will attempt to unpack your source code. This can be prevented | For scripts like a single Python file, it is not necessary to specify <code>src</code> in <code>mkDerivation</code>. When you want to use <code>buildPythonPackage</code> the sources need to provide a <code>setup.py</code> file which also is overkill for a lot of projects. The default <code>mkDerivation</code> will attempt to unpack your source code. This can be prevented by applying <code>unpackPhase = ":";</code> (<code>:</code> is a no-op in shell scripts). | ||
<syntaxhighlight lang="nix">myscript-package = pkgs.stdenv.mkDerivation { | <syntaxhighlight lang="nix">myscript-package = pkgs.stdenv.mkDerivation { | ||