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