Author: simons
Date: Thu May  5 14:41:15 2011
New Revision: 27164
URL: https://svn.nixos.org/websvn/nix/?rev=27164&sc=1

Log:
python-2.7: fix sqlite3 impurity

The build expression for python contains code that patches all occurrences of
impure paths like "/usr" and "/opt" out of "setup.py". The same code must be
run when building a python module, too.

Modified:
   nixpkgs/trunk/pkgs/development/interpreters/python/2.7/default.nix

Modified: nixpkgs/trunk/pkgs/development/interpreters/python/2.7/default.nix
==============================================================================
--- nixpkgs/trunk/pkgs/development/interpreters/python/2.7/default.nix  Thu May 
 5 14:41:08 2011        (r27163)
+++ nixpkgs/trunk/pkgs/development/interpreters/python/2.7/default.nix  Thu May 
 5 14:41:15 2011        (r27164)
@@ -36,6 +36,13 @@
     ++ optional zlibSupport zlib
     ++ optionals stdenv.isDarwin [ darwinArchUtility darwinSwVersUtility ];
 
+  ensurePurity =
+    ''
+      # Purity.
+      for i in /usr /sw /opt /pkg; do
+        substituteInPlace ./setup.py --replace $i /no-such-path
+      done
+    '';
 
   # Build the basic Python interpreter without modules that have
   # external dependencies.
@@ -49,13 +56,8 @@
 
     configureFlags = "--enable-shared --with-threads --enable-unicode 
--with-wctype-functions";
 
-    preConfigure =
+    preConfigure = "${ensurePurity}" + optionalString stdenv.isCygwin
       ''
-        # Purity.
-        for i in /usr /sw /opt /pkg; do
-          substituteInPlace ./setup.py --replace $i /no-such-path
-        done
-      '' + optionalString stdenv.isCygwin ''
         # On Cygwin, `make install' tries to read this Makefile.
         mkdir -p $out/lib/python${majorVersion}/config
         touch $out/lib/python${majorVersion}/config/Makefile
@@ -115,7 +117,7 @@
       C_INCLUDE_PATH = concatStringsSep ":" (map (p: "${p}/include") 
buildInputs);
       LIBRARY_PATH = concatStringsSep ":" (map (p: "${p}/lib") buildInputs);
 
-      configurePhase = "true";
+      configurePhase = "${ensurePurity}";
 
       buildPhase =
         ''
_______________________________________________
nix-commits mailing list
[email protected]
http://mail.cs.uu.nl/mailman/listinfo/nix-commits

Reply via email to