Python: remove pythonSmall
In #19309 a separate output for tkinter was added. Several dependencies of Python depend indirectly on Python. We have the following two paths: ``` ‘python-2.7.12’ - ‘tk-8.6.6’ - ‘libXft-2.3.2’ - ‘libXrender-0.9.10’ - ‘libX11-1.6.4’ - ‘libxcb-1.12’ - ‘libxslt-1.1.29’- ‘libxml2-2.9.4’ - ‘python-2.7.12’ ‘python-2.7.12’ - ‘tk-8.6.6’ - ‘libXft-2.3.2’ - ‘fontconfig-2.12.1’ - ‘dejavu-fonts-2.37’ - ‘fontforge-20160404’ - ‘python-2.7.12’ ``` Because only `tkinter` needs this, I added ``` pythonSmall = python.override {x11Support = false;}; ``` to break the infinite recursion. We also still have the output `tkinter`. However, we might as well build without x11Support by default. Then we build with x11Support as well so we get the tkinter module and put that in a separate package.
This commit is contained in:
parent
80433e7030
commit
107c035bf0
@ -422,7 +422,7 @@ exists.
|
|||||||
|
|
||||||
#### Missing `tkinter` module standard library
|
#### Missing `tkinter` module standard library
|
||||||
|
|
||||||
To reduce closure size the `Tkinter`/`tkinter` is put in a separate output. The `tkinter` is available as `python35Packages.tkinter`.
|
To reduce closure size the `Tkinter`/`tkinter` is available as a separate package, `pythonPackages.tkinter`.
|
||||||
|
|
||||||
#### Attributes on interpreters packages
|
#### Attributes on interpreters packages
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
, openssl
|
, openssl
|
||||||
, readline
|
, readline
|
||||||
, sqlite
|
, sqlite
|
||||||
, tcl ? null, tk ? null, xlibsWrapper ? null, libX11 ? null, x11Support ? !stdenv.isCygwin
|
, tcl ? null, tk ? null, xlibsWrapper ? null, libX11 ? null, x11Support ? false
|
||||||
, zlib
|
, zlib
|
||||||
, callPackage
|
, callPackage
|
||||||
, self
|
, self
|
||||||
@ -170,14 +170,6 @@ in stdenv.mkDerivation {
|
|||||||
rm "$out"/lib/python*/plat-*/regen # refers to glibc.dev
|
rm "$out"/lib/python*/plat-*/regen # refers to glibc.dev
|
||||||
'';
|
'';
|
||||||
|
|
||||||
postFixup = optionalString x11Support ''
|
|
||||||
# tkinter goes in a separate output
|
|
||||||
mkdir -p $tkinter/${sitePackages}
|
|
||||||
mv $out/lib/${libPrefix}/lib-dynload/_tkinter* $tkinter/${sitePackages}/
|
|
||||||
'';
|
|
||||||
|
|
||||||
outputs = ["out"] ++ optional x11Support "tkinter";
|
|
||||||
|
|
||||||
passthru = rec {
|
passthru = rec {
|
||||||
inherit libPrefix sitePackages x11Support;
|
inherit libPrefix sitePackages x11Support;
|
||||||
executable = libPrefix;
|
executable = libPrefix;
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
, openssl
|
, openssl
|
||||||
, readline
|
, readline
|
||||||
, sqlite
|
, sqlite
|
||||||
, tcl ? null, tk ? null, libX11 ? null, xproto ? null, x11Support ? !stdenv.isCygwin
|
, tcl ? null, tk ? null, libX11 ? null, xproto ? null, x11Support ? false
|
||||||
, zlib
|
, zlib
|
||||||
, callPackage
|
, callPackage
|
||||||
, self
|
, self
|
||||||
@ -92,14 +92,8 @@ in stdenv.mkDerivation {
|
|||||||
# FIXME: should regenerate this.
|
# FIXME: should regenerate this.
|
||||||
rm $out/lib/python${majorVersion}/__pycache__/_sysconfigdata.cpython*
|
rm $out/lib/python${majorVersion}/__pycache__/_sysconfigdata.cpython*
|
||||||
|
|
||||||
'' + optionalString x11Support ''
|
|
||||||
# tkinter goes in a separate output
|
|
||||||
mkdir -p $tkinter/${sitePackages}
|
|
||||||
mv $out/lib/${libPrefix}/lib-dynload/_tkinter* $tkinter/${sitePackages}/
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
outputs = ["out"] ++ optional x11Support "tkinter";
|
|
||||||
|
|
||||||
passthru = rec {
|
passthru = rec {
|
||||||
inherit libPrefix sitePackages x11Support;
|
inherit libPrefix sitePackages x11Support;
|
||||||
executable = "${libPrefix}m";
|
executable = "${libPrefix}m";
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
, openssl
|
, openssl
|
||||||
, readline
|
, readline
|
||||||
, sqlite
|
, sqlite
|
||||||
, tcl ? null, tk ? null, libX11 ? null, xproto ? null, x11Support ? !stdenv.isCygwin
|
, tcl ? null, tk ? null, libX11 ? null, xproto ? null, x11Support ? false
|
||||||
, zlib
|
, zlib
|
||||||
, callPackage
|
, callPackage
|
||||||
, self
|
, self
|
||||||
@ -101,14 +101,8 @@ in stdenv.mkDerivation {
|
|||||||
# FIXME: should regenerate this.
|
# FIXME: should regenerate this.
|
||||||
rm $out/lib/python${majorVersion}/__pycache__/_sysconfigdata.cpython*
|
rm $out/lib/python${majorVersion}/__pycache__/_sysconfigdata.cpython*
|
||||||
|
|
||||||
'' + optionalString x11Support ''
|
|
||||||
# tkinter goes in a separate output
|
|
||||||
mkdir -p $tkinter/${sitePackages}
|
|
||||||
mv $out/lib/${libPrefix}/lib-dynload/_tkinter* $tkinter/${sitePackages}/
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
outputs = ["out"] ++ optional x11Support "tkinter";
|
|
||||||
|
|
||||||
passthru = rec {
|
passthru = rec {
|
||||||
inherit libPrefix sitePackages x11Support;
|
inherit libPrefix sitePackages x11Support;
|
||||||
executable = "${libPrefix}m";
|
executable = "${libPrefix}m";
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
, openssl
|
, openssl
|
||||||
, readline
|
, readline
|
||||||
, sqlite
|
, sqlite
|
||||||
, tcl ? null, tk ? null, libX11 ? null, xproto ? null, x11Support ? !stdenv.isCygwin
|
, tcl ? null, tk ? null, libX11 ? null, xproto ? null, x11Support ? false
|
||||||
, zlib
|
, zlib
|
||||||
, callPackage
|
, callPackage
|
||||||
, self
|
, self
|
||||||
@ -100,15 +100,8 @@ in stdenv.mkDerivation {
|
|||||||
|
|
||||||
# FIXME: should regenerate this.
|
# FIXME: should regenerate this.
|
||||||
rm $out/lib/python${majorVersion}/__pycache__/_sysconfigdata.cpython*
|
rm $out/lib/python${majorVersion}/__pycache__/_sysconfigdata.cpython*
|
||||||
|
|
||||||
'' + optionalString x11Support ''
|
|
||||||
# tkinter goes in a separate output
|
|
||||||
mkdir -p $tkinter/${sitePackages}
|
|
||||||
mv $out/lib/${libPrefix}/lib-dynload/_tkinter* $tkinter/${sitePackages}/
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
outputs = ["out"] ++ optional x11Support "tkinter";
|
|
||||||
|
|
||||||
passthru = rec {
|
passthru = rec {
|
||||||
inherit libPrefix sitePackages x11Support;
|
inherit libPrefix sitePackages x11Support;
|
||||||
executable = "${libPrefix}m";
|
executable = "${libPrefix}m";
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
, openssl
|
, openssl
|
||||||
, readline
|
, readline
|
||||||
, sqlite
|
, sqlite
|
||||||
, tcl ? null, tk ? null, libX11 ? null, xproto ? null, x11Support ? !stdenv.isCygwin
|
, tcl ? null, tk ? null, libX11 ? null, xproto ? null, x11Support ? false
|
||||||
, zlib
|
, zlib
|
||||||
, callPackage
|
, callPackage
|
||||||
, self
|
, self
|
||||||
@ -91,14 +91,6 @@ in stdenv.mkDerivation {
|
|||||||
echo "manylinux1_compatible=False" >> $out/lib/${libPrefix}/_manylinux.py
|
echo "manylinux1_compatible=False" >> $out/lib/${libPrefix}/_manylinux.py
|
||||||
'';
|
'';
|
||||||
|
|
||||||
postFixup = optionalString x11Support ''
|
|
||||||
# tkinter goes in a separate output
|
|
||||||
mkdir -p $tkinter/${sitePackages}
|
|
||||||
mv $out/lib/${libPrefix}/lib-dynload/_tkinter* $tkinter/${sitePackages}/
|
|
||||||
'';
|
|
||||||
|
|
||||||
outputs = ["out"] ++ optional x11Support "tkinter";
|
|
||||||
|
|
||||||
passthru = rec {
|
passthru = rec {
|
||||||
inherit libPrefix sitePackages x11Support;
|
inherit libPrefix sitePackages x11Support;
|
||||||
executable = "${libPrefix}m";
|
executable = "${libPrefix}m";
|
||||||
|
@ -1663,7 +1663,6 @@ in
|
|||||||
|
|
||||||
fontforge = lowPrio (callPackage ../tools/misc/fontforge {
|
fontforge = lowPrio (callPackage ../tools/misc/fontforge {
|
||||||
inherit (darwin.apple_sdk.frameworks) Carbon Cocoa;
|
inherit (darwin.apple_sdk.frameworks) Carbon Cocoa;
|
||||||
python = pythonSmall;
|
|
||||||
});
|
});
|
||||||
fontforge-gtk = callPackage ../tools/misc/fontforge {
|
fontforge-gtk = callPackage ../tools/misc/fontforge {
|
||||||
withGTK = true;
|
withGTK = true;
|
||||||
@ -5494,11 +5493,6 @@ in
|
|||||||
python2 = python27;
|
python2 = python27;
|
||||||
python3 = python35;
|
python3 = python35;
|
||||||
|
|
||||||
# Python uses multiple outputs, and by default `python` is without X11/tkinter.
|
|
||||||
# This package only exists to prevent an infinite recursion and should only be used
|
|
||||||
# for packages Python itself depends on.
|
|
||||||
pythonSmall = python.override {x11Support = false;};
|
|
||||||
|
|
||||||
# pythonPackages further below, but assigned here because they need to be in sync
|
# pythonPackages further below, but assigned here because they need to be in sync
|
||||||
pythonPackages = python2Packages;
|
pythonPackages = python2Packages;
|
||||||
python2Packages = python27Packages;
|
python2Packages = python27Packages;
|
||||||
@ -7144,7 +7138,6 @@ in
|
|||||||
gtkmathview = callPackage ../development/libraries/gtkmathview { };
|
gtkmathview = callPackage ../development/libraries/gtkmathview { };
|
||||||
|
|
||||||
glib = callPackage ../development/libraries/glib {
|
glib = callPackage ../development/libraries/glib {
|
||||||
python = pythonSmall;
|
|
||||||
};
|
};
|
||||||
glib-tested = glib.override { # checked version separate to break cycles
|
glib-tested = glib.override { # checked version separate to break cycles
|
||||||
doCheck = true;
|
doCheck = true;
|
||||||
@ -8269,7 +8262,6 @@ in
|
|||||||
libxmi = callPackage ../development/libraries/libxmi { };
|
libxmi = callPackage ../development/libraries/libxmi { };
|
||||||
|
|
||||||
libxml2 = callPackage ../development/libraries/libxml2 {
|
libxml2 = callPackage ../development/libraries/libxml2 {
|
||||||
python = pythonSmall;
|
|
||||||
};
|
};
|
||||||
libxml2Python = pkgs.buildEnv { # slightly hacky
|
libxml2Python = pkgs.buildEnv { # slightly hacky
|
||||||
name = "libxml2+py-${self.libxml2.version}";
|
name = "libxml2+py-${self.libxml2.version}";
|
||||||
@ -10364,7 +10356,6 @@ in
|
|||||||
inherit (darwin) apple_sdk cf-private libobjc;
|
inherit (darwin) apple_sdk cf-private libobjc;
|
||||||
bootstrap_cmds = if stdenv.isDarwin then darwin.bootstrap_cmds else null;
|
bootstrap_cmds = if stdenv.isDarwin then darwin.bootstrap_cmds else null;
|
||||||
mesa = mesa_noglu;
|
mesa = mesa_noglu;
|
||||||
python = pythonSmall;
|
|
||||||
udev = if stdenv.isLinux then udev else null;
|
udev = if stdenv.isLinux then udev else null;
|
||||||
libdrm = if stdenv.isLinux then libdrm else null;
|
libdrm = if stdenv.isLinux then libdrm else null;
|
||||||
fglrxCompat = config.xorg.fglrxCompat or false; # `config` because we have no `xorg.override`
|
fglrxCompat = config.xorg.fglrxCompat or false; # `config` because we have no `xorg.override`
|
||||||
@ -11516,9 +11507,7 @@ in
|
|||||||
|
|
||||||
bgnet = callPackage ../data/documentation/bgnet { };
|
bgnet = callPackage ../data/documentation/bgnet { };
|
||||||
|
|
||||||
cacert = callPackage ../data/misc/cacert {
|
cacert = callPackage ../data/misc/cacert { };
|
||||||
python = pythonSmall;
|
|
||||||
};
|
|
||||||
|
|
||||||
caladea = callPackage ../data/fonts/caladea {};
|
caladea = callPackage ../data/fonts/caladea {};
|
||||||
|
|
||||||
|
@ -24675,20 +24675,24 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
# Tkinter/tkinter is part of the Python standard library.
|
# Tkinter/tkinter is part of the Python standard library.
|
||||||
# To reduce closure size its put in a separate output, `python.tkinter`.
|
# The Python interpreters in Nixpkgs come without tkinter by default.
|
||||||
# This alias was added to make this output work like any other Python package.
|
# To make the module available, we make it available as any other
|
||||||
tkinter = mkPythonDerivation rec {
|
# Python package.
|
||||||
|
tkinter = let
|
||||||
|
py = python.override{x11Support=true;};
|
||||||
|
in mkPythonDerivation rec {
|
||||||
name = "tkinter-${python.version}";
|
name = "tkinter-${python.version}";
|
||||||
src = python.tkinter;
|
src = py;
|
||||||
|
|
||||||
disabled = isPy26 || isPyPy;
|
disabled = isPy26 || isPyPy;
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p $out
|
mkdir -p $out/${py.sitePackages}
|
||||||
cp -R ${python.tkinter}/* $out
|
ls -Al lib/${py.libPrefix}/lib-dynload/ | grep tkinter
|
||||||
|
mv lib/${py.libPrefix}/lib-dynload/_tkinter* $out/${py.sitePackages}/
|
||||||
'';
|
'';
|
||||||
|
|
||||||
inherit (python) meta;
|
inherit (py) meta;
|
||||||
};
|
};
|
||||||
|
|
||||||
tlslite = buildPythonPackage rec {
|
tlslite = buildPythonPackage rec {
|
||||||
|
Loading…
Reference in New Issue
Block a user