Skip to content

Commit

Permalink
Updated Python 3.x.
Browse files Browse the repository at this point in the history
 - updated to version 3.2.3
 - fixed version numbers in setup-hook.sh
 - sort input variable list alphabetically
 - tk support needs x11 support as well
 - deleted obsolete version 3.1

Furthermore, all CPPFLAGS and LDFLAGS required to find the build inputs are now
explicitly passed to ./configure. The python 3.x build systems tries to ignore
the environment as much as possible to provide deterministic builds. This means
that our magic environment variable stuff won't work, and previously built
python3 binaries lacked all kinds of extensions, such as zlib, etc.

git-svn-id: https://nixos.org/repos/nix/nixpkgs/trunk@33937 70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb
  • Loading branch information
simons committed Apr 27, 2012
1 parent 501c716 commit e83aa1b
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 147 deletions.
85 changes: 0 additions & 85 deletions pkgs/development/interpreters/python/3.1/default.nix

This file was deleted.

27 changes: 0 additions & 27 deletions pkgs/development/interpreters/python/3.1/search-path.patch

This file was deleted.

15 changes: 0 additions & 15 deletions pkgs/development/interpreters/python/3.1/setup-hook.sh

This file was deleted.

31 changes: 15 additions & 16 deletions pkgs/development/interpreters/python/3.2/default.nix
@@ -1,14 +1,14 @@
{ stdenv, fetchurl
, zlib
, bzip2
, gdbm
, sqlite
, db4
, gdbm
, libX11, xproto
, ncurses
, readline
, openssl
, readline
, sqlite
, tcl, tk
, libX11, xproto
, zlib
}:

assert readline != null -> ncurses != null;
Expand All @@ -17,7 +17,7 @@ with stdenv.lib;

let
majorVersion = "3.2";
version = "${majorVersion}";
version = "${majorVersion}.3";

buildInputs = filter (p: p != null) [
zlib bzip2 gdbm sqlite db4 readline ncurses openssl tcl tk libX11 xproto
Expand All @@ -29,21 +29,20 @@ stdenv.mkDerivation {

src = fetchurl {
url = "http://www.python.org/ftp/python/${version}/Python-${version}.tar.bz2";
sha256 = "06awxchnv8gai6415pgzz2x8f1xi38v8a4anz6n39ciwq7v5zzbv";
sha256 = "5648ec81f93870fde2f0aa4ed45c8718692b15ce6fd9ed309bfb827ae12010aa";
};

inherit buildInputs;

C_INCLUDE_PATH = concatStringsSep ":" (map (p: "${p}/include") buildInputs);
LIBRARY_PATH = concatStringsSep ":" (map (p: "${p}/lib") buildInputs);
configureFlags = "--enable-shared --with-threads --enable-unicode --with-wctype-functions";

preConfigure = ''
for i in /usr /sw /opt /pkg; do # improve purity
substituteInPlace ./setup.py --replace $i /no-such-path
done
${optionalString (ncurses != null) ''export NIX_LDFLAGS="$NIX_LDFLAGS -lncurses"''}
${optionalString stdenv.isDarwin ''export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -msse2"''}
${optionalString stdenv.isDarwin ''export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -msse2"''}
configureFlagsArray=( --enable-shared --with-threads
CPPFLAGS="${concatStringsSep " " (map (p: "-I${p}/include") buildInputs)}"
LDFLAGS="${concatStringsSep " " (map (p: "-L${p}/lib") buildInputs)}"
LIBS="-lcrypt ${optionalString (ncurses != null) "-lncurses"}"
)
'';

setupHook = ./setup-hook.sh;
Expand All @@ -58,7 +57,7 @@ stdenv.mkDerivation {
db4Support = db4 != null;
readlineSupport = readline != null;
opensslSupport = openssl != null;
tkSupport = (tk != null) && (tcl != null);
tkSupport = (tk != null) && (tcl != null) && (libX11 != null) && (xproto != null);
libPrefix = "python${majorVersion}";
};

Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/interpreters/python/3.2/setup-hook.sh
@@ -1,12 +1,12 @@
addPythonPath() {
addToSearchPathWithCustomDelimiter : PYTHONPATH $1/lib/python3.1/site-packages
addToSearchPathWithCustomDelimiter : PYTHONPATH $1/lib/python3.2/site-packages
}

toPythonPath() {
local paths="$1"
local result=
for i in $paths; do
p="$i/lib/python3.1/site-packages"
p="$i/lib/python3.2/site-packages"
result="${result}${result:+:}$p"
done
echo $result
Expand Down
2 changes: 0 additions & 2 deletions pkgs/top-level/all-packages.nix
Expand Up @@ -2757,8 +2757,6 @@ let

python27 = callPackage ../development/interpreters/python/2.7 { };

python31 = callPackage ../development/interpreters/python/3.1 { };

python32 = callPackage ../development/interpreters/python/3.2 { };

pythonFull = python27Full;
Expand Down

0 comments on commit e83aa1b

Please sign in to comment.