Merge remote-tracking branch 'origin/master' into staging

Conflicts:
	pkgs/development/libraries/poppler/default.nix
This commit is contained in:
Eelco Dolstra
2014-10-16 15:16:50 +02:00
826 changed files with 8930 additions and 7226 deletions

View File

@@ -1,4 +1,4 @@
{ stdenv, fetchurl, zlib ? null, zlibSupport ? true, bzip2
{ stdenv, fetchurl, zlib ? null, zlibSupport ? true, bzip2, includeModules ? false
, sqlite, tcl, tk, x11, openssl, readline, db, ncurses, gdbm, libX11 }:
assert zlibSupport -> zlib != null;
@@ -6,7 +6,6 @@ assert zlibSupport -> zlib != null;
with stdenv.lib;
let
majorVersion = "2.7";
version = "${majorVersion}.8";
@@ -28,33 +27,39 @@ let
# patch python to put zero timestamp into pyc
# if DETERMINISTIC_BUILD env var is set
./deterministic-build.patch
# http://bugs.python.org/issue21963
./remove-avoid-daemon-thread-shutdown.patch
];
postPatch = stdenv.lib.optionalString (stdenv.gcc.libc != null) ''
substituteInPlace ./Lib/plat-generic/regen \
--replace /usr/include/netinet/in.h \
${stdenv.gcc.libc}/include/netinet/in.h
'';
buildInputs =
optional (stdenv ? gcc && stdenv.gcc.libc != null) stdenv.gcc.libc ++
[ bzip2 openssl ]
++ optional zlibSupport zlib;
ensurePurity =
''
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 ] ++ optionals includeModules [ db openssl ncurses gdbm libX11 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}";
inherit majorVersion version src patches postPatch buildInputs;
inherit majorVersion version src patches buildInputs preConfigure;
LDFLAGS = stdenv.lib.optionalString (!stdenv.isDarwin) "-lgcc_s";
C_INCLUDE_PATH = concatStringsSep ":" (map (p: "${p}/include") buildInputs);
@@ -62,15 +67,6 @@ let
configureFlags = "--enable-shared --with-threads --enable-unicode";
preConfigure = "${ensurePurity}" + 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
'';
NIX_CFLAGS_COMPILE = optionalString stdenv.isDarwin "-msse2";
DETERMINISTIC_BUILD = 1;
@@ -84,6 +80,8 @@ let
ln -s $out/share/man/man1/{python2.7.1.gz,python.1.gz}
paxmark E $out/bin/python${majorVersion}
${ optionalString includeModules "$out/bin/python ./setup.py build_ext"}
'';
passthru = rec {
@@ -111,7 +109,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 ];
};
};
@@ -123,25 +121,17 @@ let
, internalName ? "_" + moduleName
, deps
}:
stdenv.mkDerivation rec {
if includeModules then null else stdenv.mkDerivation rec {
name = "python-${moduleName}-${python.version}";
inherit src patches postPatch;
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 = "${ensurePurity}";
buildPhase =
''
# Fake the build environment that setup.py expects.
ln -s ${python}/include/python*/pyconfig.h .
ln -s ${python}/lib/python*/config/Setup Modules/
ln -s ${python}/lib/python*/config/Setup.local Modules/
buildPhase = ''
substituteInPlace setup.py --replace 'self.extensions = extensions' \
'self.extensions = [ext for ext in self.extensions if ext.name in ["${internalName}"]]'
@@ -193,8 +183,6 @@ let
deps = [ sqlite ];
};
ssl = null;
tkinter = buildInternalPythonModule {
moduleName = "tkinter";
deps = [ tcl tk x11 libX11 ];