python 2.7: add x11Support option

This commit is contained in:
Jan Malakhovski 2015-03-19 00:50:56 +00:00
parent eb22e54243
commit a3e00bf6c4

View file

@ -1,7 +1,19 @@
{ stdenv, fetchurl, zlib ? null, zlibSupport ? true, bzip2, includeModules ? false
, sqlite, tcl, tk, x11, openssl, readline, db, ncurses, gdbm, libX11, self, callPackage }:
{ stdenv, fetchurl, self, callPackage
, bzip2, openssl
, includeModules ? false
, db, gdbm, ncurses, sqlite, readline
, tcl ? null, tk ? null, x11 ? null, libX11 ? null, x11Support ? true
, zlib ? null, zlibSupport ? true
}:
assert zlibSupport -> zlib != null;
assert x11Support -> tcl != null
&& tk != null
&& x11 != null
&& libX11 != null;
with stdenv.lib;
@ -28,7 +40,7 @@ let
# if DETERMINISTIC_BUILD env var is set
./deterministic-build.patch
];
preConfigure = ''
# Purity.
for i in /usr /sw /opt /pkg; do
@ -48,7 +60,11 @@ let
buildInputs =
optional (stdenv ? cc && stdenv.cc.libc != null) stdenv.cc.libc ++
[ bzip2 openssl ] ++ optionals includeModules [ db openssl ncurses gdbm libX11 readline x11 tcl tk sqlite ]
[ bzip2 openssl ]
++ optionals includeModules (
[ db gdbm ncurses sqlite readline
] ++ optionals x11Support [ tcl tk x11 libX11 ]
)
++ optional zlibSupport zlib;
# Build the basic Python interpreter without modules that have
@ -87,7 +103,7 @@ 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"}
'';
@ -192,11 +208,15 @@ let
deps = [ sqlite ];
};
} // optionalAttrs x11Support {
tkinter = buildInternalPythonModule {
moduleName = "tkinter";
deps = [ tcl tk x11 libX11 ];
};
} // {
readline = buildInternalPythonModule {
moduleName = "readline";
internalName = "readline";