about summary refs log tree commit diff
path: root/pkgs/development/interpreters/python/2.6
diff options
context:
space:
mode:
authorPeter Simons <simons@cryp.to>2009-10-20 12:13:49 +0000
committerPeter Simons <simons@cryp.to>2009-10-20 12:13:49 +0000
commit90dd9d14bf6d3763852bb983270e73e7275cd09f (patch)
tree7069928e6ea391f988b4fc64e16707fb982bca23 /pkgs/development/interpreters/python/2.6
parent97166d8a20b4282e3eeebc57a5891a311e1a12a0 (diff)
downloadnixlib-90dd9d14bf6d3763852bb983270e73e7275cd09f.tar
nixlib-90dd9d14bf6d3763852bb983270e73e7275cd09f.tar.gz
nixlib-90dd9d14bf6d3763852bb983270e73e7275cd09f.tar.bz2
nixlib-90dd9d14bf6d3763852bb983270e73e7275cd09f.tar.lz
nixlib-90dd9d14bf6d3763852bb983270e73e7275cd09f.tar.xz
nixlib-90dd9d14bf6d3763852bb983270e73e7275cd09f.tar.zst
nixlib-90dd9d14bf6d3763852bb983270e73e7275cd09f.zip
python-2.6: fixed build on Darwin
 * Dropped "nolongdouble.patch". The patch no longer applies to Python 2.6, and
   apparently isn't required anymore either.

 * Added access to native Darwin arch utility. Python tries to run 'arch' in
   the configure stage, but that binary reside in /usr/bin. To make it
   available to the expression, the small wrapper darwinArchUtility is added as
   a buildInput if appropriate.

 * Don't pass --enable-shared. The build fails if we try to enable building of
   shared libraries, apparently because some required libraries aren't linked,
   i.e. the linker call isn't right.

TODO:

 * Figure out how to enable shared linking.

 * The resulting binary on Darwin seem to lack the binascii module.

svn path=/nixpkgs/trunk/; revision=17894
Diffstat (limited to 'pkgs/development/interpreters/python/2.6')
-rw-r--r--pkgs/development/interpreters/python/2.6/default.nix7
-rw-r--r--pkgs/development/interpreters/python/2.6/nolongdouble.patch20
2 files changed, 5 insertions, 22 deletions
diff --git a/pkgs/development/interpreters/python/2.6/default.nix b/pkgs/development/interpreters/python/2.6/default.nix
index fc1323234ab4..ba60f6057c67 100644
--- a/pkgs/development/interpreters/python/2.6/default.nix
+++ b/pkgs/development/interpreters/python/2.6/default.nix
@@ -8,10 +8,12 @@
 , tcl ? null
 , libX11 ? null
 , xproto ? null
+, arch ? null
 }:
 
 assert zlibSupport -> zlib != null;
 assert gdbmSupport -> gdbm != null;
+assert stdenv.isDarwin -> arch != null;
 
 with stdenv.lib;
 
@@ -30,6 +32,7 @@ let
     ++ optional (tcl != null) tcl
     ++ optional (libX11 != null) libX11
     ++ optional (xproto != null) xproto
+    ++ optional (arch != null) arch
     ;
 
 in
@@ -50,7 +53,7 @@ stdenv.mkDerivation ( {
   inherit buildInputs;
   C_INCLUDE_PATH = concatStringsSep ":" (map (p: "${p}/include") buildInputs);
   LIBRARY_PATH = concatStringsSep ":" (map (p: "${p}/lib") buildInputs);
-  configureFlags = "--enable-shared --with-wctype-functions";
+  configureFlags = ''${if stdenv.isDarwin then "" else " --enable-shared"} --with-wctype-functions'';
 
   preConfigure = ''
     # Purity.
@@ -83,4 +86,4 @@ stdenv.mkDerivation ( {
     # platforms = stdenv.lib.platforms.allBut "i686-darwin";
     # Re-enabled for 2.6 to see whether the problem still occurs.
   };
-} // (if stdenv.system == "i686-darwin" then { NIX_CFLAGS_COMPILE = "-msse2" ; patches = [./search-path.patch ./nolongdouble.patch]; } else {} ) )
+} // (if stdenv.system == "i686-darwin" then { NIX_CFLAGS_COMPILE = "-msse2" ; patches = [./search-path.patch]; } else {} ) )
diff --git a/pkgs/development/interpreters/python/2.6/nolongdouble.patch b/pkgs/development/interpreters/python/2.6/nolongdouble.patch
deleted file mode 100644
index 8fb53da3d49d..000000000000
--- a/pkgs/development/interpreters/python/2.6/nolongdouble.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-diff -rc Python-2.5.4/configure Python-2.5.4-new/configure
-*** Python-2.5.4/configure	Sat Dec 13 15:13:52 2008
---- Python-2.5.4-new/configure	Fri Jul 24 16:38:05 2009
-***************
-*** 4534,4540 ****
-  	    ;;
-  	# is there any other compiler on Darwin besides gcc?
-  	Darwin*)
-! 	    BASECFLAGS="$BASECFLAGS -Wno-long-double -no-cpp-precomp -mno-fused-madd"
-  	    if test "${enable_universalsdk}"; then
-  		BASECFLAGS="-arch ppc -arch i386 -isysroot ${UNIVERSALSDK} ${BASECFLAGS}"
-  	    fi
---- 4534,4540 ----
-  	    ;;
-  	# is there any other compiler on Darwin besides gcc?
-  	Darwin*)
-! 	    BASECFLAGS="$BASECFLAGS -no-cpp-precomp -mno-fused-madd"
-  	    if test "${enable_universalsdk}"; then
-  		BASECFLAGS="-arch ppc -arch i386 -isysroot ${UNIVERSALSDK} ${BASECFLAGS}"
-  	    fi