diff --git a/pkgs/development/interpreters/python/cpython/2.7/default.nix b/pkgs/development/interpreters/python/cpython/2.7/default.nix index 5842f6fb309..15b21b5bed9 100644 --- a/pkgs/development/interpreters/python/cpython/2.7/default.nix +++ b/pkgs/development/interpreters/python/cpython/2.7/default.nix @@ -6,7 +6,7 @@ , openssl , readline , sqlite -, tcl ? null, tk ? null, xlibsWrapper ? null, libX11 ? null, x11Support ? false +, tcl ? null, tk ? null, tix ? null, xlibsWrapper ? null, libX11 ? null, x11Support ? false , zlib , callPackage , self @@ -150,6 +150,10 @@ in stdenv.mkDerivation { setupHook = ./setup-hook.sh; + postPatch = optionalString (x11Support && (tix != null)) '' + substituteInPlace "Lib/lib-tk/Tix.py" --replace "os.environ.get('TIX_LIBRARY')" "os.environ.get('TIX_LIBRARY') or '${tix}/lib'" + ''; + postInstall = '' # needed for some packages, especially packages that backport diff --git a/pkgs/development/interpreters/python/cpython/3.3/default.nix b/pkgs/development/interpreters/python/cpython/3.3/default.nix index 6a543a8a0ee..3ab0de96704 100644 --- a/pkgs/development/interpreters/python/cpython/3.3/default.nix +++ b/pkgs/development/interpreters/python/cpython/3.3/default.nix @@ -6,7 +6,7 @@ , openssl , readline , sqlite -, tcl ? null, tk ? null, libX11 ? null, xproto ? null, x11Support ? false +, tcl ? null, tk ? null, tix ? null, libX11 ? null, xproto ? null, x11Support ? false , zlib , callPackage , self @@ -50,6 +50,10 @@ in stdenv.mkDerivation { NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isLinux "-lgcc_s"; + postPatch = optionalString (x11Support && (tix != null)) '' + substituteInPlace "Lib/tkinter/tix.py" --replace "os.environ.get('TIX_LIBRARY')" "os.environ.get('TIX_LIBRARY') or '${tix}/lib'" + ''; + preConfigure = '' for i in /usr /sw /opt /pkg; do # improve purity substituteInPlace ./setup.py --replace $i /no-such-path diff --git a/pkgs/development/interpreters/python/cpython/3.4/default.nix b/pkgs/development/interpreters/python/cpython/3.4/default.nix index 623fa5d74f6..e081a60c6bc 100644 --- a/pkgs/development/interpreters/python/cpython/3.4/default.nix +++ b/pkgs/development/interpreters/python/cpython/3.4/default.nix @@ -6,7 +6,7 @@ , openssl , readline , sqlite -, tcl ? null, tk ? null, libX11 ? null, xproto ? null, x11Support ? false +, tcl ? null, tk ? null, tix ? null, libX11 ? null, xproto ? null, x11Support ? false , zlib , callPackage , self @@ -55,6 +55,10 @@ in stdenv.mkDerivation { substituteInPlace configure --replace '-Wl,-stack_size,1000000' ' ' ''; + postPatch = optionalString (x11Support && (tix != null)) '' + substituteInPlace "Lib/tkinter/tix.py" --replace "os.environ.get('TIX_LIBRARY')" "os.environ.get('TIX_LIBRARY') or '${tix}/lib'" + ''; + preConfigure = '' for i in /usr /sw /opt /pkg; do # improve purity substituteInPlace ./setup.py --replace $i /no-such-path diff --git a/pkgs/development/interpreters/python/cpython/3.5/default.nix b/pkgs/development/interpreters/python/cpython/3.5/default.nix index 7172e429f23..92f9d66ea52 100644 --- a/pkgs/development/interpreters/python/cpython/3.5/default.nix +++ b/pkgs/development/interpreters/python/cpython/3.5/default.nix @@ -6,7 +6,7 @@ , openssl , readline , sqlite -, tcl ? null, tk ? null, libX11 ? null, xproto ? null, x11Support ? false +, tcl ? null, tk ? null, tix ? null, libX11 ? null, xproto ? null, x11Support ? false , zlib , callPackage , self @@ -55,6 +55,10 @@ in stdenv.mkDerivation { substituteInPlace configure --replace '-Wl,-stack_size,1000000' ' ' ''; + postPatch = optionalString (x11Support && (tix != null)) '' + substituteInPlace "Lib/tkinter/tix.py" --replace "os.environ.get('TIX_LIBRARY')" "os.environ.get('TIX_LIBRARY') or '${tix}/lib'" + ''; + preConfigure = '' for i in /usr /sw /opt /pkg; do # improve purity substituteInPlace ./setup.py --replace $i /no-such-path diff --git a/pkgs/development/interpreters/python/cpython/3.6/default.nix b/pkgs/development/interpreters/python/cpython/3.6/default.nix index 8892b0f5c71..795bd746725 100644 --- a/pkgs/development/interpreters/python/cpython/3.6/default.nix +++ b/pkgs/development/interpreters/python/cpython/3.6/default.nix @@ -7,7 +7,7 @@ , openssl , readline , sqlite -, tcl ? null, tk ? null, libX11 ? null, xproto ? null, x11Support ? false +, tcl ? null, tk ? null, tix ? null, libX11 ? null, xproto ? null, x11Support ? false , zlib , callPackage , self @@ -55,6 +55,10 @@ in stdenv.mkDerivation { substituteInPlace configure --replace '-Wl,-stack_size,1000000' ' ' ''; + postPatch = optionalString (x11Support && (tix != null)) '' + substituteInPlace "Lib/tkinter/tix.py" --replace "os.environ.get('TIX_LIBRARY')" "os.environ.get('TIX_LIBRARY') or '${tix}/lib'" + ''; + preConfigure = '' for i in /usr /sw /opt /pkg; do # improve purity substituteInPlace ./setup.py --replace $i /no-such-path diff --git a/pkgs/development/interpreters/python/pypy/2.7/default.nix b/pkgs/development/interpreters/python/pypy/2.7/default.nix index 1fd9eaee430..1cc2f95791f 100644 --- a/pkgs/development/interpreters/python/pypy/2.7/default.nix +++ b/pkgs/development/interpreters/python/pypy/2.7/default.nix @@ -1,5 +1,5 @@ { stdenv, fetchurl, zlib ? null, zlibSupport ? true, bzip2, pkgconfig, libffi -, sqlite, openssl, ncurses, python, expat, tcl, tk, xlibsWrapper, libX11 +, sqlite, openssl, ncurses, python, expat, tcl, tk, tix, xlibsWrapper, libX11 , makeWrapper, callPackage, self, gdbm, db # For the Python package set , pkgs, packageOverrides ? (self: super: {}) @@ -35,6 +35,7 @@ let }; in '' patch lib-python/2.7/test/test_pyexpat.py < '${expatch}' + substituteInPlace "lib-python/2.7/lib-tk/Tix.py" --replace "os.environ.get('TIX_LIBRARY')" "os.environ.get('TIX_LIBRARY') or '${tix}/lib'" ''; buildInputs = [ bzip2 openssl pkgconfig python libffi ncurses expat sqlite tk tcl xlibsWrapper libX11 makeWrapper gdbm db ]