diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-10-16 15:16:50 +0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-10-16 15:16:50 +0200 |
commit | 09dc132e04c8a69581becb56a1c5e1bfee3aef7e (patch) | |
tree | 186745725ff42ea953572f38eaca71161fee9406 /pkgs/development/interpreters/python/2.6 | |
parent | 3c6efec2c09e9389eb973ec5e45cb8e04b35f8aa (diff) | |
parent | e39bf7a7043a466761754c423b3d5783a320a6ce (diff) | |
download | nixlib-09dc132e04c8a69581becb56a1c5e1bfee3aef7e.tar nixlib-09dc132e04c8a69581becb56a1c5e1bfee3aef7e.tar.gz nixlib-09dc132e04c8a69581becb56a1c5e1bfee3aef7e.tar.bz2 nixlib-09dc132e04c8a69581becb56a1c5e1bfee3aef7e.tar.lz nixlib-09dc132e04c8a69581becb56a1c5e1bfee3aef7e.tar.xz nixlib-09dc132e04c8a69581becb56a1c5e1bfee3aef7e.tar.zst nixlib-09dc132e04c8a69581becb56a1c5e1bfee3aef7e.zip |
Merge remote-tracking branch 'origin/master' into staging
Conflicts: pkgs/development/libraries/poppler/default.nix
Diffstat (limited to 'pkgs/development/interpreters/python/2.6')
-rw-r--r-- | pkgs/development/interpreters/python/2.6/default.nix | 55 |
1 files changed, 29 insertions, 26 deletions
diff --git a/pkgs/development/interpreters/python/2.6/default.nix b/pkgs/development/interpreters/python/2.6/default.nix index 64e21b755691..cbdb55f4cc35 100644 --- a/pkgs/development/interpreters/python/2.6/default.nix +++ b/pkgs/development/interpreters/python/2.6/default.nix @@ -1,13 +1,11 @@ -{ stdenv, fetchurl, zlib ? null, zlibSupport ? true, bzip2 -, sqlite, tcl, tk, x11, openssl, readline, db, ncurses, gdbm -}: +{ stdenv, fetchurl, zlib ? null, zlibSupport ? true, bzip2, includeModules ? false +, sqlite, tcl, tk, x11, openssl, readline, db, ncurses, gdbm}: assert zlibSupport -> zlib != null; with stdenv.lib; let - majorVersion = "2.6"; version = "${majorVersion}.9"; @@ -27,37 +25,42 @@ let # the Nix store to 1. So treat that as a special case. ./nix-store-mtime.patch ]; + + preConfigure = '' + # Purity. + for i in /usr /sw /opt /pkg; do + substituteInPlace ./setup.py --replace $i /no-such-path + done + '' + optionalString (stdenv ? gcc && stdenv.gcc.libc != null) '' + for i in Lib/plat-*/regen; do + substituteInPlace $i --replace /usr/include/ ${stdenv.gcc.libc}/include/ + done + '' + optionalString stdenv.isCygwin '' + # On Cygwin, `make install' tries to read this Makefile. + mkdir -p $out/lib/python${majorVersion}/config + touch $out/lib/python${majorVersion}/config/Makefile + mkdir -p $out/include/python${majorVersion} + touch $out/include/python${majorVersion}/pyconfig.h + ''; buildInputs = optional (stdenv ? gcc && stdenv.gcc.libc != null) stdenv.gcc.libc ++ - [ bzip2 openssl ] + [ bzip2 openssl ]++ optionals includeModules [ db openssl ncurses gdbm readline x11 tcl tk sqlite ] ++ optional zlibSupport zlib; # Build the basic Python interpreter without modules that have # external dependencies. python = stdenv.mkDerivation { - name = "python-${version}"; + name = "python${if includeModules then "" else "-minimal"}-${version}"; - inherit majorVersion version src patches buildInputs; + inherit majorVersion version src patches buildInputs preConfigure; C_INCLUDE_PATH = concatStringsSep ":" (map (p: "${p}/include") buildInputs); LIBRARY_PATH = concatStringsSep ":" (map (p: "${p}/lib") buildInputs); configureFlags = "--enable-shared --with-threads --enable-unicode"; - preConfigure = - '' - # Purity. - for i in /usr /sw /opt /pkg; do - substituteInPlace ./setup.py --replace $i /no-such-path - done - '' + optionalString (stdenv ? gcc && stdenv.gcc.libc != null) '' - for i in Lib/plat-*/regen; do - substituteInPlace $i --replace /usr/include/ ${stdenv.gcc.libc}/include/ - done - ''; - NIX_CFLAGS_COMPILE = optionalString stdenv.isDarwin "-msse2"; setupHook = ./setup-hook.sh; @@ -69,6 +72,10 @@ let ln -s $out/lib/python${majorVersion}/pdb.py $out/bin/pdb${majorVersion} mv $out/share/man/man1/{python.1,python2.6.1} ln -s $out/share/man/man1/{python2.6.1,python.1} + + paxmark E $out/bin/python${majorVersion} + + ${ optionalString includeModules "$out/bin/python ./setup.py build_ext"} ''; passthru = rec { @@ -96,7 +103,7 @@ let ''; license = stdenv.lib.licenses.psfl; platforms = stdenv.lib.platforms.all; - maintainers = with stdenv.lib.maintainers; [ simons chaoflow ]; + maintainers = with stdenv.lib.maintainers; [ simons chaoflow iElectric ]; }; }; @@ -108,18 +115,16 @@ let , internalName ? "_" + moduleName , deps }: - stdenv.mkDerivation rec { + if includeModules then null else stdenv.mkDerivation rec { name = "python-${moduleName}-${python.version}"; - inherit src patches; + inherit src patches preConfigure; buildInputs = [ python ] ++ deps; C_INCLUDE_PATH = concatStringsSep ":" (map (p: "${p}/include") buildInputs); LIBRARY_PATH = concatStringsSep ":" (map (p: "${p}/lib") buildInputs); - configurePhase = "true"; - buildPhase = '' # Fake the build environment that setup.py expects. @@ -178,8 +183,6 @@ let deps = [ sqlite ]; }; - ssl = null; - tkinter = buildInternalPythonModule { moduleName = "tkinter"; deps = [ tcl tk x11 ]; |