git.iko.soy/typeable/nixpkgs
on master help sign in
fixes #5394
ef8aaa5Domen Kožar
doc/language-support.xml+45−46
@@ -283,24 +283,24 @@ are provided with all modules included.</para>
283 <filename>pkgs/development/python-modules/generic/default.nix</filename></link>.
283 <filename>pkgs/development/python-modules/generic/default.nix</filename></link>.
284 Example usage:
284 Example usage:
285
285
286− <programlisting language="nix">
286+<programlisting language="nix">
287− twisted = buildPythonPackage {
287+twisted = buildPythonPackage {
288− name = "twisted-8.1.0";
288+ name = "twisted-8.1.0";
289−
289+
290− src = pkgs.fetchurl {
290+ src = pkgs.fetchurl {
291− url = http://tmrc.mit.edu/mirror/twisted/Twisted/8.1/Twisted-8.1.0.tar.bz2;
291+ url = http://tmrc.mit.edu/mirror/twisted/Twisted/8.1/Twisted-8.1.0.tar.bz2;
292− sha256 = "0q25zbr4xzknaghha72mq57kh53qw1bf8csgp63pm9sfi72qhirl";
292+ sha256 = "0q25zbr4xzknaghha72mq57kh53qw1bf8csgp63pm9sfi72qhirl";
293− };
293+ };
294−
294+
295− propagatedBuildInputs = [ self.ZopeInterface ];
295+ propagatedBuildInputs = [ self.ZopeInterface ];
296−
296+
297− meta = {
297+ meta = {
298− homepage = http://twistedmatrix.com/;
298+ homepage = http://twistedmatrix.com/;
299− description = "Twisted, an event-driven networking engine written in Python";
299+ description = "Twisted, an event-driven networking engine written in Python";
300− license = stdenv.lib.licenses.mit;
300+ license = stdenv.lib.licenses.mit;
301− };
301+ };
302− };
302+};
303− </programlisting>
303+</programlisting>
304
304
305 Most of Python packages that use <varname>buildPythonPackage</varname> are defined
305 Most of Python packages that use <varname>buildPythonPackage</varname> are defined
306 in <link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/python-packages.nix"><filename>pkgs/top-level/python-packages.nix</filename></link>
306 in <link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/python-packages.nix"><filename>pkgs/top-level/python-packages.nix</filename></link>
@@ -428,16 +428,14 @@ are provided with all modules included.</para>
428 <para>
428 <para>
429 Create Python environments using low-level <function>pkgs.buildEnv</function> function. Example <filename>default.nix</filename>:
429 Create Python environments using low-level <function>pkgs.buildEnv</function> function. Example <filename>default.nix</filename>:
430
430
431− <programlisting language="nix">
431+<programlisting language="nix">
432− <![CDATA[
433− with import <nixpkgs> {};
432+<![CDATA[with import <nixpkgs> {};
434−
433+
435− python.buildEnv.override {
434+python.buildEnv.override {
436− extraLibs = [ pkgs.pythonPackages.pyramid ];
435+ extraLibs = [ pkgs.pythonPackages.pyramid ];
437− ignoreCollisions = true;
436+ ignoreCollisions = true;
438− }
439− ]]>
437+}]]>
440− </programlisting>
438+</programlisting>
441
439
442 Running <command>nix-build</command> will create
440 Running <command>nix-build</command> will create
443 <filename>/nix/store/cf1xhjwzmdki7fasgr4kz6di72ykicl5-python-2.7.8-env</filename>
441 <filename>/nix/store/cf1xhjwzmdki7fasgr4kz6di72ykicl5-python-2.7.8-env</filename>
@@ -507,22 +505,23 @@ exist in community to help save time. No tool is preferred at the moment.
507 <command>${python.interpreter} setup.py develop</command> for the package.
505 <command>${python.interpreter} setup.py develop</command> for the package.
508 </para>
506 </para>
509
507
508+ <warning><para><varname>shellPhase</varname> is executed only if <filename>setup.py</filename>
509+ exists.</para></warning>
510+
510 <para>
511 <para>
511 Given a <filename>default.nix</filename>:
512 Given a <filename>default.nix</filename>:
512
513
513− <programlisting language="nix">
514+<programlisting language="nix">
514− <![CDATA[
515− with import <nixpkgs> {};
515+<![CDATA[with import <nixpkgs> {};
516−
516+
517− buildPythonPackage {
517+buildPythonPackage {
518− name = "myproject";
518+ name = "myproject";
519−
519+
520− buildInputs = with pkgs.pythonPackages; [ pyramid ];
520+ buildInputs = with pkgs.pythonPackages; [ pyramid ];
521−
521+
522− src = ./.;
522+ src = ./.;
523− }
524− ]]>
523+}]]>
525− </programlisting>
524+</programlisting>
526
525
527 Running <command>nix-shell</command> with no arguments should give you
526 Running <command>nix-shell</command> with no arguments should give you
528 the environment in which the package would be build with
527 the environment in which the package would be build with
@@ -615,11 +614,11 @@ sed -i '/ = data_files/d' setup.py</programlisting>
615<section xml:id="ssec-language-ruby"><title>Ruby</title>
614<section xml:id="ssec-language-ruby"><title>Ruby</title>
616 <para>For example, to package yajl-ruby package, use gem-nix:</para>
615 <para>For example, to package yajl-ruby package, use gem-nix:</para>
617
616
618− <screen>
617+<screen>
619− $ nix-env -i gem-nix
618+$ nix-env -i gem-nix
620− $ gem-nix --no-user-install --nix-file=pkgs/development/interpreters/ruby/generated.nix yajl-ruby
619+$ gem-nix --no-user-install --nix-file=pkgs/development/interpreters/ruby/generated.nix yajl-ruby
621− $ nix-build -A rubyPackages.yajl-ruby
620+$ nix-build -A rubyPackages.yajl-ruby
622− </screen>
621+</screen>
623</section>
622</section>
624
623
625
624