Author: eelco
Date: Tue Jan 4 14:47:36 2011
New Revision: 25385
URL: https://svn.nixos.org/websvn/nix/?rev=25385&sc=1
Log:
* Python 2.7: get rid of most dependencies.
Modified:
nixpkgs/branches/modular-python/pkgs/development/interpreters/python/2.7/default.nix
nixpkgs/branches/modular-python/pkgs/top-level/all-packages.nix
Modified:
nixpkgs/branches/modular-python/pkgs/development/interpreters/python/2.7/default.nix
==============================================================================
---
nixpkgs/branches/modular-python/pkgs/development/interpreters/python/2.7/default.nix
Tue Jan 4 13:37:42 2011 (r25384)
+++
nixpkgs/branches/modular-python/pkgs/development/interpreters/python/2.7/default.nix
Tue Jan 4 14:47:36 2011 (r25385)
@@ -1,22 +1,10 @@
{ stdenv, fetchurl, zlib ? null, zlibSupport ? true, bzip2
-, gdbmSupport ? true, gdbm ? null
-, sqlite ? null
-, db4 ? null
-, readline ? null
-, openssl ? null
-, tk ? null
-, tcl ? null
-, libX11 ? null
-, xproto ? null
-, arch ? null
-, sw_vers ? null
-, ncurses ? null
+, darwinArchUtility ? null, darwinSwVersUtility ? null
}:
assert zlibSupport -> zlib != null;
-assert gdbmSupport -> gdbm != null;
-assert stdenv.isDarwin -> arch != null;
-assert stdenv.isDarwin -> sw_vers != null;
+assert stdenv.isDarwin -> darwinArchUtility != null;
+assert stdenv.isDarwin -> darwinSwVersUtility != null;
with stdenv.lib;
@@ -27,25 +15,13 @@
buildInputs =
optional (stdenv ? gcc && stdenv.gcc.libc != null) stdenv.gcc.libc ++
- [bzip2]
+ [ bzip2 ]
++ optional zlibSupport zlib
- ++ optional gdbmSupport gdbm
- ++ optional (sqlite != null) sqlite
- ++ optional (db4 != null) db4
- ++ optional (readline != null) readline
- ++ optional (openssl != null) openssl
- ++ optional (tk != null) tk
- ++ optional (tcl != null) tcl
- ++ optional (libX11 != null) libX11
- ++ optional (xproto != null) xproto
- ++ optional (arch != null) arch
- ++ optional (sw_vers != null) sw_vers
- ++ optional (ncurses != null) ncurses
- ;
+ ++ optionals stdenv.isDarwin [ darwinArchUtility darwinSwVersUtility ];
in
-stdenv.mkDerivation ( {
+stdenv.mkDerivation {
name = "python-${version}";
inherit majorVersion version;
@@ -54,38 +30,37 @@
sha256 = "14i2c7yqa7ljmx2i2bb827n61q33zn23ax96czi8rbkyyny8gqw0";
};
- patches = [
- # Look in C_INCLUDE_PATH and LIBRARY_PATH for stuff.
- ./search-path.patch
- ];
+ 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);
+
configureFlags = "--enable-shared --with-threads --enable-unicode
--with-wctype-functions";
- preConfigure = ''
- # Purity.
- for i in /usr /sw /opt /pkg; do
- substituteInPlace ./setup.py --replace $i /no-such-path
- done
- '' + (if readline != null then ''
- export NIX_LDFLAGS="$NIX_LDFLAGS -lncurses"
- '' else "");
+ preConfigure =
+ ''
+ # Purity.
+ for i in /usr /sw /opt /pkg; do
+ substituteInPlace ./setup.py --replace $i /no-such-path
+ done
+ '';
+
+ NIX_CFLAGS_COMPILE = optionalString stdenv.isDarwin "-msse2";
setupHook = ./setup-hook.sh;
- postInstall = ''
- rm -rf "$out/lib/python${majorVersion}/test"
- '';
+ postInstall =
+ ''
+ rm -rf "$out/lib/python${majorVersion}/test"
+ '';
passthru = {
inherit zlibSupport;
- sqliteSupport = sqlite != null;
- db4Support = db4 != null;
- readlineSupport = readline != null;
- opensslSupport = openssl != null;
- tkSupport = (tk != null) && (tcl != null);
libPrefix = "python${majorVersion}";
};
@@ -107,4 +82,4 @@
platforms = stdenv.lib.platforms.all;
maintainers = [ stdenv.lib.maintainers.simons ];
};
-} // (if stdenv.isDarwin then { NIX_CFLAGS_COMPILE = "-msse2" ; patches =
[./search-path.patch]; } else {} ) )
+}
Modified: nixpkgs/branches/modular-python/pkgs/top-level/all-packages.nix
==============================================================================
--- nixpkgs/branches/modular-python/pkgs/top-level/all-packages.nix Tue Jan
4 13:37:42 2011 (r25384)
+++ nixpkgs/branches/modular-python/pkgs/top-level/all-packages.nix Tue Jan
4 14:47:36 2011 (r25385)
@@ -2267,7 +2267,6 @@
python = if getConfig ["python" "full"] false then pythonFull else
pythonBase;
python26 = if getConfig ["python" "full"] false then python26Full else
python26Base;
- python27 = if getConfig ["python" "full"] false then python27Full else
python27Base;
pythonBase = python26Base;
pythonFull = python26Full;
@@ -2294,19 +2293,10 @@
ncurses = if getConfig ["python" "curses"] true then ncurses else null;
});
- python27Base = lowPrio (makeOverridable (import
../development/interpreters/python/2.7) {
- inherit (pkgs) fetchurl stdenv zlib bzip2 gdbm;
- arch = if stdenv.isDarwin then darwinArchUtility else null;
- sw_vers = if stdenv.isDarwin then darwinSwVersUtility else null;
- });
-
- python27Full = lowPrio (python27Base.override {
- inherit (pkgs) db4 sqlite readline openssl tcl tk ncurses;
- inherit (pkgs.xlibs) libX11 xproto;
- });
+ python27 = callPackage ../development/interpreters/python/2.7 { };
- pythonModules = callPackage
../development/interpreters/python/2.7/modules.nix {
- python = python27Base;
+ python27Modules = callPackage
../development/interpreters/python/2.7/modules.nix {
+ python = python27;
};
python31Base = lowPrio (makeOverridable (import
../development/interpreters/python/3.1) {
_______________________________________________
nix-commits mailing list
[email protected]
http://mail.cs.uu.nl/mailman/listinfo/nix-commits