From e4033547a3b9f2fe93e3a27de18c948771bb76f0 Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Thu, 5 May 2011 14:41:15 +0000 Subject: [PATCH] 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. svn path=/nixpkgs/trunk/; revision=27164 --- .../interpreters/python/2.7/default.nix | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/pkgs/development/interpreters/python/2.7/default.nix b/pkgs/development/interpreters/python/2.7/default.nix index 3b95c1d246c..483a7e5fc00 100644 --- a/pkgs/development/interpreters/python/2.7/default.nix +++ b/pkgs/development/interpreters/python/2.7/default.nix @@ -36,6 +36,13 @@ let ++ 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 @@ let 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 @@ let C_INCLUDE_PATH = concatStringsSep ":" (map (p: "${p}/include") buildInputs); LIBRARY_PATH = concatStringsSep ":" (map (p: "${p}/lib") buildInputs); - configurePhase = "true"; + configurePhase = "${ensurePurity}"; buildPhase = ''