2008-06-13 10:44:43 +01:00
|
|
|
{ stdenv, fetchurl, zlib ? null, zlibSupport ? true, bzip2
|
|
|
|
, gdbmSupport ? true, gdbm ? null
|
|
|
|
, sqlite ? null
|
|
|
|
, db4 ? null
|
|
|
|
, readline ? null
|
|
|
|
, openssl ? null
|
2008-12-01 00:02:25 +00:00
|
|
|
, tk ? null
|
|
|
|
, tcl ? null
|
|
|
|
, libX11 ? null
|
|
|
|
, xproto ? null
|
2008-06-13 10:44:43 +01:00
|
|
|
}:
|
2007-08-09 01:35:23 +01:00
|
|
|
|
|
|
|
assert zlibSupport -> zlib != null;
|
2008-04-08 08:37:49 +01:00
|
|
|
assert gdbmSupport -> gdbm != null;
|
2007-08-09 01:35:23 +01:00
|
|
|
|
|
|
|
with stdenv.lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
buildInputs =
|
|
|
|
optional (stdenv ? gcc && stdenv.gcc.libc != null) stdenv.gcc.libc ++
|
2008-04-08 08:37:49 +01:00
|
|
|
[bzip2]
|
|
|
|
++ optional zlibSupport zlib
|
2008-05-06 08:01:34 +01:00
|
|
|
++ optional gdbmSupport gdbm
|
|
|
|
++ optional (sqlite != null) sqlite
|
2008-05-26 08:47:07 +01:00
|
|
|
++ optional (db4 != null) db4
|
2008-05-26 12:39:08 +01:00
|
|
|
++ optional (readline != null) readline
|
2008-05-26 13:27:17 +01:00
|
|
|
++ optional (openssl != null) openssl
|
2008-12-01 00:02:25 +00:00
|
|
|
++ optional (tk != null) tk
|
|
|
|
++ optional (tcl != null) tcl
|
|
|
|
++ optional (libX11 != null) libX11
|
|
|
|
++ optional (xproto != null) xproto
|
2008-05-06 08:01:34 +01:00
|
|
|
;
|
2007-08-09 01:35:23 +01:00
|
|
|
|
|
|
|
in
|
|
|
|
|
2009-06-10 10:18:51 +01:00
|
|
|
stdenv.mkDerivation ( {
|
2009-04-30 15:01:25 +01:00
|
|
|
name = "python-2.5.4";
|
2007-08-09 01:35:23 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2009-04-30 15:01:25 +01:00
|
|
|
url = http://www.python.org/ftp/python/2.5.4/Python-2.5.4.tar.bz2;
|
|
|
|
sha256 = "0401g346ixng1im6gp11rgkfhx3v05qrpn5qjfx26mgy5dm8k3dw";
|
2007-08-09 01:35:23 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
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);
|
2008-02-06 19:00:36 +00:00
|
|
|
configureFlags = "--enable-shared --with-wctype-functions";
|
2007-08-09 01:35:23 +01:00
|
|
|
|
2009-04-23 14:31:10 +01:00
|
|
|
preConfigure = ''
|
2007-08-09 01:35:23 +01:00
|
|
|
# Purity.
|
|
|
|
for i in /usr /sw /opt /pkg; do
|
|
|
|
substituteInPlace ./setup.py --replace $i /no-such-path
|
|
|
|
done
|
2009-04-23 14:31:10 +01:00
|
|
|
'' + (if readline != null then ''
|
2008-05-26 12:39:08 +01:00
|
|
|
export NIX_LDFLAGS="$NIX_LDFLAGS -lncurses"
|
|
|
|
'' else "");
|
2009-04-23 14:31:10 +01:00
|
|
|
|
|
|
|
setupHook = ./setup-hook.sh;
|
2007-08-09 01:35:23 +01:00
|
|
|
|
2009-04-23 14:31:10 +01:00
|
|
|
postInstall = ''
|
2007-08-09 01:35:23 +01:00
|
|
|
rm -rf $out/lib/python2.5/test
|
2009-04-23 14:31:10 +01:00
|
|
|
'';
|
2007-08-09 01:35:23 +01:00
|
|
|
|
|
|
|
passthru = {
|
|
|
|
inherit zlibSupport;
|
2008-05-26 08:47:07 +01:00
|
|
|
sqliteSupport = sqlite != null;
|
|
|
|
db4Support = db4 != null;
|
2008-05-26 12:39:08 +01:00
|
|
|
readlineSupport = readline != null;
|
2008-05-26 13:27:17 +01:00
|
|
|
opensslSupport = openssl != null;
|
2008-12-01 00:02:25 +00:00
|
|
|
tkSupport = (tk != null) && (tcl != null);
|
2007-08-09 01:35:23 +01:00
|
|
|
libPrefix = "python2.5";
|
2009-10-13 10:39:27 +01:00
|
|
|
};
|
2009-09-16 15:42:56 +01:00
|
|
|
|
2009-10-13 10:39:27 +01:00
|
|
|
meta = {
|
2009-09-16 15:42:56 +01:00
|
|
|
# List of supported platforms.
|
|
|
|
# - On Darwin, `python.exe' fails with "Bus Error".
|
|
|
|
platforms = stdenv.lib.platforms.allBut "i686-darwin";
|
2009-10-13 10:39:27 +01:00
|
|
|
};
|
2009-11-27 10:16:42 +00:00
|
|
|
} // (if stdenv.isDarwin then { NIX_CFLAGS_COMPILE = "-msse2" ; patches = [./search-path.patch ./nolongdouble.patch]; } else {} ) )
|