diff options
author | Peter Simons <simons@cryp.to> | 2009-10-19 23:10:09 +0000 |
---|---|---|
committer | Peter Simons <simons@cryp.to> | 2009-10-19 23:10:09 +0000 |
commit | 0b25624891b1045953aed021fb649952fbfb1fc0 (patch) | |
tree | a72c022bbaaeb9ba3f5546029a974c8d70d59edb /pkgs/development/interpreters/python/2.6 | |
parent | 3b3ee13b9d33362d980b65ce09be1ae79fd7905d (diff) | |
download | nixlib-0b25624891b1045953aed021fb649952fbfb1fc0.tar nixlib-0b25624891b1045953aed021fb649952fbfb1fc0.tar.gz nixlib-0b25624891b1045953aed021fb649952fbfb1fc0.tar.bz2 nixlib-0b25624891b1045953aed021fb649952fbfb1fc0.tar.lz nixlib-0b25624891b1045953aed021fb649952fbfb1fc0.tar.xz nixlib-0b25624891b1045953aed021fb649952fbfb1fc0.tar.zst nixlib-0b25624891b1045953aed021fb649952fbfb1fc0.zip |
python 2.6.3: initial version of python 2.6 support
The build succeeds on i686-linux. Other platforms look good, too, because there were hardly any changes necessary to update the expression from 2.5. svn path=/nixpkgs/trunk/; revision=17889
Diffstat (limited to 'pkgs/development/interpreters/python/2.6')
4 files changed, 148 insertions, 0 deletions
diff --git a/pkgs/development/interpreters/python/2.6/default.nix b/pkgs/development/interpreters/python/2.6/default.nix new file mode 100644 index 000000000000..fc1323234ab4 --- /dev/null +++ b/pkgs/development/interpreters/python/2.6/default.nix @@ -0,0 +1,86 @@ +{ stdenv, fetchurl, zlib ? null, zlibSupport ? true, bzip2 +, gdbmSupport ? true, gdbm ? null +, sqlite ? null +, db4 ? null +, readline ? null +, openssl ? null +, tk ? null +, tcl ? null +, libX11 ? null +, xproto ? null +}: + +assert zlibSupport -> zlib != null; +assert gdbmSupport -> gdbm != null; + +with stdenv.lib; + +let + + buildInputs = + optional (stdenv ? gcc && stdenv.gcc.libc != null) stdenv.gcc.libc ++ + [bzip2] + ++ optional zlibSupport zlib + ++ optional gdbmSupport gdbm + ++ optional (sqlite != null) sqlite + ++ optional (db4 != null) db4 + ++ optional (readline != null) readline + ++ optional (openssl != null) openssl + ++ optional (tk != null) tk + ++ optional (tcl != null) tcl + ++ optional (libX11 != null) libX11 + ++ optional (xproto != null) xproto + ; + +in + +stdenv.mkDerivation ( { + name = "python-2.6.3"; + + src = fetchurl { + url = http://www.python.org/ftp/python/2.6.3/Python-2.6.3.tar.bz2; + sha256 = "096wxhibhss3clgcj5n3xx5wmdsqmywk3h3bp68sicp7sy4y6rs3"; + }; + + patches = [ + # Look in C_INCLUDE_PATH and LIBRARY_PATH for stuff. + ./search-path.patch + ]; + + 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"; + + preConfigure = '' + # Purity. + for i in /usr /sw /opt /pkg; do + substituteInPlace ./setup.py --replace $i /no-such-path + done + '' + (if readline != null then '' + export NIX_LDFLAGS="$NIX_LDFLAGS -lncurses" + '' else ""); + + setupHook = ./setup-hook.sh; + + postInstall = '' + rm -rf $out/lib/python2.6/test + ''; + + passthru = { + inherit zlibSupport; + sqliteSupport = sqlite != null; + db4Support = db4 != null; + readlineSupport = readline != null; + opensslSupport = openssl != null; + tkSupport = (tk != null) && (tcl != null); + libPrefix = "python2.6"; + }; + + meta = { + # List of supported platforms. + # - On Darwin, `python.exe' fails with "Bus Error". + # 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 {} ) ) diff --git a/pkgs/development/interpreters/python/2.6/nolongdouble.patch b/pkgs/development/interpreters/python/2.6/nolongdouble.patch new file mode 100644 index 000000000000..8fb53da3d49d --- /dev/null +++ b/pkgs/development/interpreters/python/2.6/nolongdouble.patch @@ -0,0 +1,20 @@ +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 diff --git a/pkgs/development/interpreters/python/2.6/search-path.patch b/pkgs/development/interpreters/python/2.6/search-path.patch new file mode 100644 index 000000000000..2e7b7526c0ce --- /dev/null +++ b/pkgs/development/interpreters/python/2.6/search-path.patch @@ -0,0 +1,27 @@ +diff -rc Python-2.4.4-orig/setup.py Python-2.4.4/setup.py +*** Python-2.4.4-orig/setup.py 2006-10-08 19:41:25.000000000 +0200 +--- Python-2.4.4/setup.py 2007-05-27 16:04:54.000000000 +0200 +*************** +*** 279,288 **** + # Check for AtheOS which has libraries in non-standard locations + if platform == 'atheos': + lib_dirs += ['/system/libs', '/atheos/autolnk/lib'] +- lib_dirs += os.getenv('LIBRARY_PATH', '').split(os.pathsep) + inc_dirs += ['/system/include', '/atheos/autolnk/include'] +- inc_dirs += os.getenv('C_INCLUDE_PATH', '').split(os.pathsep) + + # OSF/1 and Unixware have some stuff in /usr/ccs/lib (like -ldb) + if platform in ['osf1', 'unixware7', 'openunix8']: + lib_dirs += ['/usr/ccs/lib'] +--- 279,289 ---- + # Check for AtheOS which has libraries in non-standard locations + if platform == 'atheos': + lib_dirs += ['/system/libs', '/atheos/autolnk/lib'] + inc_dirs += ['/system/include', '/atheos/autolnk/include'] + ++ lib_dirs += os.getenv('LIBRARY_PATH', '').split(os.pathsep) ++ inc_dirs += os.getenv('C_INCLUDE_PATH', '').split(os.pathsep) ++ + # OSF/1 and Unixware have some stuff in /usr/ccs/lib (like -ldb) + if platform in ['osf1', 'unixware7', 'openunix8']: + lib_dirs += ['/usr/ccs/lib'] diff --git a/pkgs/development/interpreters/python/2.6/setup-hook.sh b/pkgs/development/interpreters/python/2.6/setup-hook.sh new file mode 100644 index 000000000000..290525c35713 --- /dev/null +++ b/pkgs/development/interpreters/python/2.6/setup-hook.sh @@ -0,0 +1,15 @@ +addPythonPath() { + addToSearchPathWithCustomDelimiter : PYTHONPATH $1/lib/python2.6/site-packages +} + +toPythonPath() { + local paths="$1" + local result= + for i in $paths; do + p="$i/lib/python2.6/site-packages" + result="${result}${result:+:}$p" + done + echo $result +} + +envHooks=(${envHooks[@]} addPythonPath) |