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
|
|
|
|
}:
|
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-05-06 08:01:34 +01:00
|
|
|
;
|
2007-08-09 01:35:23 +01:00
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2008-03-03 23:15:15 +00:00
|
|
|
name = "python-2.5.2";
|
2007-08-09 01:35:23 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2008-03-03 23:15:15 +00:00
|
|
|
url = http://www.python.org/ftp/python/2.5.2/Python-2.5.2.tar.bz2;
|
|
|
|
sha256 = "0gh8bvs56vdv8qmlfmiwyczjpldj0y3zbzd0zyhyjfd0c8m0xy7j";
|
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
|
|
|
|
|
|
|
preConfigure = "
|
|
|
|
# Purity.
|
|
|
|
for i in /usr /sw /opt /pkg; do
|
|
|
|
substituteInPlace ./setup.py --replace $i /no-such-path
|
|
|
|
done
|
2008-05-26 12:39:08 +01:00
|
|
|
" + (if readline != null then ''
|
|
|
|
export NIX_LDFLAGS="$NIX_LDFLAGS -lncurses"
|
|
|
|
'' else "");
|
2007-08-09 01:35:23 +01:00
|
|
|
|
|
|
|
postInstall = "
|
|
|
|
ensureDir $out/nix-support
|
|
|
|
cp ${./setup-hook.sh} $out/nix-support/setup-hook
|
|
|
|
rm -rf $out/lib/python2.5/test
|
|
|
|
";
|
|
|
|
|
|
|
|
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;
|
2007-08-09 01:35:23 +01:00
|
|
|
libPrefix = "python2.5";
|
|
|
|
};
|
|
|
|
}
|