From 87ef971478ec8814370cc59f75301e7dc38869cd Mon Sep 17 00:00:00 2001 From: Symphorien Gibol Date: Sun, 25 Dec 2016 20:35:51 +0100 Subject: [PATCH 1/3] tk: add private headers to /include those are necessary to build some extensions like tix --- pkgs/development/libraries/tk/generic.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/libraries/tk/generic.nix b/pkgs/development/libraries/tk/generic.nix index 87a2edee3ca2..2258f28b9c48 100644 --- a/pkgs/development/libraries/tk/generic.nix +++ b/pkgs/development/libraries/tk/generic.nix @@ -16,6 +16,7 @@ stdenv.mkDerivation { postInstall = '' ln -s $out/bin/wish* $out/bin/wish + cp ../{unix,generic}/*.h $out/include ''; configureFlags = [ From 3f499d3fb9d4ad9aac71925a813f2bbefa167ae0 Mon Sep 17 00:00:00 2001 From: Symphorien Gibol Date: Sun, 25 Dec 2016 20:37:06 +0100 Subject: [PATCH 2/3] tix: init at 8.4.1 --- pkgs/development/libraries/tix/default.nix | 55 ++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 57 insertions(+) create mode 100644 pkgs/development/libraries/tix/default.nix diff --git a/pkgs/development/libraries/tix/default.nix b/pkgs/development/libraries/tix/default.nix new file mode 100644 index 000000000000..7e18e7402273 --- /dev/null +++ b/pkgs/development/libraries/tix/default.nix @@ -0,0 +1,55 @@ +{ stdenv, fetchurl, tcl, tk, fetchpatch } : + +stdenv.mkDerivation rec { + version = "8.4.3"; + name = "tix-${version}"; + src = fetchurl { + url = "mirror://sourceforge/tix/tix/8.4.3/Tix8.4.3-src.tar.gz"; + sha256 = "1jq3dkyk9mqkj4cg7mdk5r0cclqsby9l2b7wrysi0zk5yw7h8bsn"; + }; + patches = [ + (fetchpatch { + name = "tix-8.4.3-tcl8.5.patch"; + url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/dev-tcltk/tix/files/tix-8.4.3-tcl8.5.patch?id=56bd759df1d0c750a065b8c845e93d5dfa6b549d"; + sha256 = "0wzqmcxxq0rqpnjgxz10spw92yhfygnlwv0h8pcx2ycnqiljz6vj"; + }) + ] ++ stdenv.lib.optional (tcl.release == "8.6") + (fetchpatch { + name = "tix-8.4.3-tcl8.6.patch"; + url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/dev-tcltk/tix/files/tix-8.4.3-tcl8.6.patch?id=56bd759df1d0c750a065b8c845e93d5dfa6b549d"; + sha256 = "1jaz0l22xj7x1k4rb9ia6i1psnbwk4pblgq4gfvya7gg7fbb7r36"; + }) + ; + buildInputs = [ tcl tk ]; + # the configure script expects to find the location of the sources of + # tcl and tk in {tcl,tk}Config.sh + # In fact, it only needs some private headers. We copy them in + # the private_headers folders and trick the configure script into believing + # the sources are here. + preConfigure = '' + mkdir -p private_headers/generic + < ${tcl}/lib/tclConfig.sh sed "s@TCL_SRC_DIR=.*@TCL_SRC_DIR=private_headers@" > tclConfig.sh + < ${tk}/lib/tkConfig.sh sed "s@TK_SRC_DIR=.*@TK_SRC_DIR=private_headers@" > tkConfig.sh + for i in ${tcl}/include/* ${tk.dev}/include/*; do + ln -s $i private_headers/generic; + done; + ''; + configureFlags = '' + --with-tclinclude=${tcl}/include + --with-tclconfig=. + --with-tkinclude=${tk.dev}/include + --with-tkconfig=. + --libdir=''${prefix}/lib + ''; + + meta = with stdenv.lib; { + description = "A widget library for Tcl/Tk"; + homepage = http://tix.sourceforge.net/; + platforms = platforms.all; + license = with licenses; [ + bsd2 # tix + gpl2 # patches from portage + ]; + }; +} + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d9842aaede35..50d6f5abcbb6 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9477,6 +9477,8 @@ in tivodecode = callPackage ../applications/video/tivodecode { }; + tix = callPackage ../development/libraries/tix { }; + tk = tk-8_6; tk-8_6 = callPackage ../development/libraries/tk/8.6.nix { }; From a6e3d713614da30bc75c0b9579a379e82eb3411c Mon Sep 17 00:00:00 2001 From: Symphorien Gibol Date: Sun, 1 Jan 2017 19:37:02 +0100 Subject: [PATCH 3/3] python: support the tkinter.tix module --- .../development/interpreters/python/cpython/2.7/default.nix | 6 +++++- .../development/interpreters/python/cpython/3.3/default.nix | 6 +++++- .../development/interpreters/python/cpython/3.4/default.nix | 6 +++++- .../development/interpreters/python/cpython/3.5/default.nix | 6 +++++- .../development/interpreters/python/cpython/3.6/default.nix | 6 +++++- pkgs/development/interpreters/python/pypy/2.7/default.nix | 3 ++- 6 files changed, 27 insertions(+), 6 deletions(-) diff --git a/pkgs/development/interpreters/python/cpython/2.7/default.nix b/pkgs/development/interpreters/python/cpython/2.7/default.nix index 5842f6fb309a..15b21b5bed9b 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 6a543a8a0ee0..3ab0de96704c 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 623fa5d74f64..e081a60c6bc4 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 7172e429f236..92f9d66ea52d 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 8892b0f5c711..795bd7467253 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 1fd9eaee4303..1cc2f95791fd 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 ]