diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index 9ec6d468ecd5..a13f2d626886 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -3,14 +3,22 @@ assert zlibSupport -> zlib != null; stdenv.mkDerivation { - name = "python-2.4.3"; + name = "python-2.4.4"; src = fetchurl { - url = http://nix.cs.uu.nl/dist/tarballs/Python-2.4.3.tar.bz2; - md5 = "141c683447d5e76be1d2bd4829574f02"; + url = http://www.python.org/ftp/python/2.4.4/Python-2.4.4.tar.bz2; + md5 = "0ba90c79175c017101100ebf5978e906"; }; buildInputs = [ (if zlibSupport then zlib else null) ]; inherit zlibSupport; configureFlags = "--enable-shared"; + + libPrefix = "python2.4"; + + postInstall = " + ensureDir $out/nix-support + cp ${./setup-hook.sh} $out/nix-support/setup-hook + rm -rf $out/lib/python2.4/test + "; } diff --git a/pkgs/development/interpreters/python/setup-hook.sh b/pkgs/development/interpreters/python/setup-hook.sh new file mode 100644 index 000000000000..3bc86c582298 --- /dev/null +++ b/pkgs/development/interpreters/python/setup-hook.sh @@ -0,0 +1,18 @@ +addPythonPath() { + local p=$1/lib/python2.4/site-packages + if test -d $p; then + export PYTHONPATH="${PYTHONPATH}${PYTHONPATH:+:}$p" + fi +} + +toPythonPath() { + local paths="$1" + local result= + for i in $paths; do + p="$i/lib/python2.4/site-packages" + result="${result}${result:+:}$p" + done + echo $result +} + +envHooks=(${envHooks[@]} addPythonPath)