@@ -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:
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";
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";
295− propagatedBuildInputs = [ self.ZopeInterface ];
295+ propagatedBuildInputs = [ self.ZopeInterface ];
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;
303− </programlisting>
303+</programlisting>
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>
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>:
431− <programlisting language="nix">
431+<programlisting language="nix">
433− with import <nixpkgs> {};
432+<![CDATA[with import <nixpkgs> {};
435− python.buildEnv.override {
434+python.buildEnv.override {
436− extraLibs = [ pkgs.pythonPackages.pyramid ];
435+ extraLibs = [ pkgs.pythonPackages.pyramid ];
437− ignoreCollisions = true;
436+ ignoreCollisions = true;
440− </programlisting>
438+</programlisting>
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+ <warning><para><varname>shellPhase</varname> is executed only if <filename>setup.py</filename>
509+ exists.</para></warning>
511 Given a <filename>default.nix</filename>:
512 Given a <filename>default.nix</filename>:
513− <programlisting language="nix">
514+<programlisting language="nix">
515− with import <nixpkgs> {};
515+<![CDATA[with import <nixpkgs> {};
517− buildPythonPackage {
517+buildPythonPackage {
518− name = "myproject";
518+ name = "myproject";
520− buildInputs = with pkgs.pythonPackages; [ pyramid ];
520+ buildInputs = with pkgs.pythonPackages; [ pyramid ];
522− src = ./.;
522+ src = ./.;
525− </programlisting>
524+</programlisting>
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>
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>