* Re: Tkinter moved to separate output
@ 2015-12-01 20:19 Federico Beffa
2015-12-01 22:00 ` bug#20889: " Ludovic Courtès
2015-12-01 22:00 ` Ludovic Courtès
0 siblings, 2 replies; 12+ messages in thread
From: Federico Beffa @ 2015-12-01 20:19 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: 宋文武, Guix-devel, 20889
[-- Attachment #1: Type: text/plain, Size: 422 bytes --]
Federico Beffa <beffa@ieee.org> writes:
> On Sun, Nov 29, 2015 at 11:09 PM, Ludovic Courtès <ludo@gnu.org> wrote:
>> Federico Beffa <beffa@ieee.org> skribis:
> Looking into the failed build directory, it seems that PKG_CONFIG_PATH
> is set correctly. Still, it doesn't get the correct flags.
The attached patch fixes the problem and I can now plot with TkAgg :-)
Thanks for making Tkinter available!
Fede
[-- Attachment #2: 0001-gnu-python-matplotlib-Add-TkAgg-backend-and-update-t.patch --]
[-- Type: text/x-diff, Size: 4427 bytes --]
From b40cf5522bcc15166ca07dfbae50167203d29e2d Mon Sep 17 00:00:00 2001
From: Federico Beffa <beffa@fbengineering.ch>
Date: Tue, 1 Dec 2015 17:20:59 +0100
Subject: [PATCH 1/2] gnu: python-matplotlib: Add 'TkAgg' backend and update to
version '1.4.3'.
* gnu/packages/python.scm (python-matplotlib): Do it.
* gnu/packages/patches/matplotlib-setupext-tk.patch: New file.
---
gnu/packages/patches/matplotlib-setupext-tk.patch | 30 +++++++++++++++++++++++
gnu/packages/python.scm | 17 +++++++++----
2 files changed, 42 insertions(+), 5 deletions(-)
create mode 100644 gnu/packages/patches/matplotlib-setupext-tk.patch
diff --git a/gnu/packages/patches/matplotlib-setupext-tk.patch b/gnu/packages/patches/matplotlib-setupext-tk.patch
new file mode 100644
index 0000000..cd0332e
--- /dev/null
+++ b/gnu/packages/patches/matplotlib-setupext-tk.patch
@@ -0,0 +1,30 @@
+Use 'pkg-config' instead of heuristics to find 'tk' flags.
+
+--- matplotlib-1.4.3/setupext.py.orig 2015-12-01 14:21:19.554417453 +0100
++++ matplotlib-1.4.3/setupext.py 2015-12-01 14:35:51.999928797 +0100
+@@ -1457,7 +1457,7 @@
+ p = subprocess.Popen(
+ '. %s ; eval echo ${%s}' % (file, varname),
+ shell=True,
+- executable="/bin/sh",
++ executable="sh",
+ stdout=subprocess.PIPE)
+ result = p.communicate()[0]
+ return result.decode('ascii')
+@@ -1601,8 +1601,15 @@
+ # of distros.
+
+ # Query Tcl/Tk system for library paths and version string
++ def getoutput(s):
++ ret = os.popen(s).read().strip()
++ return ret
+ try:
+- tcl_lib_dir, tk_lib_dir, tk_ver = self.query_tcltk()
++ #tcl_lib_dir, tk_lib_dir, tk_ver = self.query_tcltk()
++ pkg_config_res = getoutput('pkg-config --libs tk').split()
++ tk_ver = pkg_config_res[-1][-3:]
++ tcl_lib_dir = pkg_config_res[0][2:] + '/tcl' + tk_ver
++ tk_lib_dir = pkg_config_res[1][2:] + '/tk' + tk_ver
+ except:
+ tk_ver = ''
+ result = self.hardcoded_tcl_config()
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 39d0751..5e23bab 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -3175,7 +3175,7 @@ transcendental functions).")
(define-public python-matplotlib
(package
(name "python-matplotlib")
- (version "1.4.2")
+ (version "1.4.3")
(source
(origin
(method url-fetch)
@@ -3183,13 +3183,15 @@ transcendental functions).")
"/matplotlib-" version ".tar.gz"))
(sha256
(base32
- "0m6v9nwdldlwk22gcd339zg6mny5m301fxgks7z8sb8m9wawg8qp"))))
+ "1dn05cvd0g984lzhh72wa0z93psgwshbbg93fkab6slx5m3l95av"))
+ (patches (list (search-patch "matplotlib-setupext-tk.patch")))))
(build-system python-build-system)
(outputs '("out" "doc"))
(propagated-inputs ; the following packages are all needed at run time
`(("python-pyparsing" ,python-pyparsing)
("python-pygobject" ,python-pygobject)
("gobject-introspection" ,gobject-introspection)
+ ("python" ,python "tk")
;; The 'gtk+' package (and 'gdk-pixbuf', 'atk' and 'pango' propagated
;; from 'gtk+') provides the required 'typelib' files used by
;; 'gobject-introspection'. The location of these files is set with the
@@ -3224,7 +3226,8 @@ transcendental functions).")
;; FIXME: Add backends when available.
;("python-wxpython" ,python-wxpython)
;("python-pyqt" ,python-pyqt)
- ))
+ ("tcl" ,tcl)
+ ("tk" ,tk)))
(native-inputs
`(("pkg-config" ,pkg-config)
("texlive" ,texlive)
@@ -3243,8 +3246,12 @@ transcendental functions).")
(setenv "HOME" (getcwd))
(call-with-output-file "setup.cfg"
(lambda (port)
- (format port "[rc_options]~%
-backend = GTK3Agg~%")))))
+ (format port "[directories]~%
+basedirlist = ~a,~a~%
+[rc_options]~%
+backend = TkAgg~%"
+ (assoc-ref inputs "tcl")
+ (assoc-ref inputs "tk"))))))
(alist-cons-after
'install 'install-doc
(lambda* (#:key outputs #:allow-other-keys)
--
2.4.3
^ permalink raw reply related [flat|nested] 12+ messages in thread
* bug#20889: Tkinter moved to separate output
2015-12-01 20:19 Tkinter moved to separate output Federico Beffa
@ 2015-12-01 22:00 ` Ludovic Courtès
2015-12-01 22:00 ` Ludovic Courtès
1 sibling, 0 replies; 12+ messages in thread
From: Ludovic Courtès @ 2015-12-01 22:00 UTC (permalink / raw)
To: Federico Beffa; +Cc: 宋文武, Guix-devel, iyzsong, 20889
Federico Beffa <beffa@ieee.org> skribis:
> The attached patch fixes the problem and I can now plot with TkAgg :-)
>
> Thanks for making Tkinter available!
> Fede
>
> From b40cf5522bcc15166ca07dfbae50167203d29e2d Mon Sep 17 00:00:00 2001
> From: Federico Beffa <beffa@fbengineering.ch>
> Date: Tue, 1 Dec 2015 17:20:59 +0100
> Subject: [PATCH 1/2] gnu: python-matplotlib: Add 'TkAgg' backend and update to
> version '1.4.3'.
>
> * gnu/packages/python.scm (python-matplotlib): Do it.
> * gnu/packages/patches/matplotlib-setupext-tk.patch: New file.
Nice!
Please make sure to add the patch to gnu-system.am, but otherwise looks
great!
Thanks for fixing it!
I gather this addresses http://bugs.gnu.org/20888, right?
Ludo’.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Tkinter moved to separate output
2015-12-01 20:19 Tkinter moved to separate output Federico Beffa
2015-12-01 22:00 ` bug#20889: " Ludovic Courtès
@ 2015-12-01 22:00 ` Ludovic Courtès
2015-12-02 17:28 ` Federico Beffa
2015-12-02 17:28 ` bug#20889: " Federico Beffa
1 sibling, 2 replies; 12+ messages in thread
From: Ludovic Courtès @ 2015-12-01 22:00 UTC (permalink / raw)
To: Federico Beffa; +Cc: 宋文武, Guix-devel, 20889
Federico Beffa <beffa@ieee.org> skribis:
> The attached patch fixes the problem and I can now plot with TkAgg :-)
>
> Thanks for making Tkinter available!
> Fede
>
> From b40cf5522bcc15166ca07dfbae50167203d29e2d Mon Sep 17 00:00:00 2001
> From: Federico Beffa <beffa@fbengineering.ch>
> Date: Tue, 1 Dec 2015 17:20:59 +0100
> Subject: [PATCH 1/2] gnu: python-matplotlib: Add 'TkAgg' backend and update to
> version '1.4.3'.
>
> * gnu/packages/python.scm (python-matplotlib): Do it.
> * gnu/packages/patches/matplotlib-setupext-tk.patch: New file.
Nice!
Please make sure to add the patch to gnu-system.am, but otherwise looks
great!
Thanks for fixing it!
I gather this addresses http://bugs.gnu.org/20888, right?
Ludo’.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Tkinter moved to separate output
2015-12-01 22:00 ` Ludovic Courtès
@ 2015-12-02 17:28 ` Federico Beffa
2015-12-02 17:28 ` bug#20889: " Federico Beffa
1 sibling, 0 replies; 12+ messages in thread
From: Federico Beffa @ 2015-12-02 17:28 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: 宋文武, Guix-devel, 20889
On Tue, Dec 1, 2015 at 11:00 PM, Ludovic Courtès <ludo@gnu.org> wrote:
> I gather this addresses http://bugs.gnu.org/20888, right?
Well, it partially solves it:
Now there is a working backend suitable for interactive plotting which
is enabled by default. However, the 'GTK3Agg' backend is still there
and still not working. At some point it would be nice to have it
working as well.
Regards,
Fede
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#20889: Tkinter moved to separate output
2015-12-01 22:00 ` Ludovic Courtès
2015-12-02 17:28 ` Federico Beffa
@ 2015-12-02 17:28 ` Federico Beffa
1 sibling, 0 replies; 12+ messages in thread
From: Federico Beffa @ 2015-12-02 17:28 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: 宋文武, Guix-devel, iyzsong, 20889
On Tue, Dec 1, 2015 at 11:00 PM, Ludovic Courtès <ludo@gnu.org> wrote:
> I gather this addresses http://bugs.gnu.org/20888, right?
Well, it partially solves it:
Now there is a working backend suitable for interactive plotting which
is enabled by default. However, the 'GTK3Agg' backend is still there
and still not working. At some point it would be nice to have it
working as well.
Regards,
Fede
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH] tk: Hardcode path to TK_LIBRARY.
@ 2015-11-12 5:50 宋文武
2015-11-12 12:58 ` Ludovic Courtès
0 siblings, 1 reply; 12+ messages in thread
From: 宋文武 @ 2015-11-12 5:50 UTC (permalink / raw)
To: guix-devel
[-- Attachment #1: Type: text/plain, Size: 28 bytes --]
I did it for nixpkgs too :-)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-tk-Hardcode-path-to-TK_LIBRARY.patch --]
[-- Type: text/x-diff; name=0001-tk-Hardcode-path-to-TK_LIBRARY.patch, Size: 3238 bytes --]
From 6c9ea521e88d36bd1ce990a561477ec0e2950017 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= <iyzsong@gmail.com>
Date: Thu, 12 Nov 2015 13:31:19 +0800
Subject: [PATCH] tk: Hardcode path to TK_LIBRARY.
Fixes <http://bugs.gnu.org/20889>.
* gnu/packages/patches/tk-find-library.patch: New patch.
* gnu-system.am (dist_patch_DATA): Add it.
* gnu/packages/tcl.scm (tk)[source]: Add patch.
---
gnu-system.am | 1 +
gnu/packages/patches/tk-find-library.patch | 30 ++++++++++++++++++++++++++++++
gnu/packages/tcl.scm | 3 ++-
3 files changed, 33 insertions(+), 1 deletion(-)
create mode 100644 gnu/packages/patches/tk-find-library.patch
diff --git a/gnu-system.am b/gnu-system.am
index 0b716c7..e7c1b7f 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -662,6 +662,7 @@ dist_patch_DATA = \
gnu/packages/patches/texi2html-document-encoding.patch \
gnu/packages/patches/texi2html-i18n.patch \
gnu/packages/patches/tidy-CVE-2015-5522+5523.patch \
+ gnu/packages/patches/tk-find-library.patch \
gnu/packages/patches/torsocks-dns-test.patch \
gnu/packages/patches/tvtime-gcc41.patch \
gnu/packages/patches/tvtime-pngoutput.patch \
diff --git a/gnu/packages/patches/tk-find-library.patch b/gnu/packages/patches/tk-find-library.patch
new file mode 100644
index 0000000..89c4781
--- /dev/null
+++ b/gnu/packages/patches/tk-find-library.patch
@@ -0,0 +1,30 @@
+This patch hardcode where Tk found its script library during package
+initialization.
+
+See <http://core.tcl.tk/tk/tktview/765642ffffffffffffff>.
+
+diff --git a/generic/tkWindow.c b/generic/tkWindow.c
+index b5cbbab..96b5501 100644
+--- a/generic/tkWindow.c
++++ b/generic/tkWindow.c
+@@ -988,6 +988,7 @@ TkCreateMainWindow(
+
+ Tcl_SetVar2(interp, "tk_patchLevel", NULL, TK_PATCH_LEVEL, TCL_GLOBAL_ONLY);
+ Tcl_SetVar2(interp, "tk_version", NULL, TK_VERSION, TCL_GLOBAL_ONLY);
++ Tcl_SetVar2(interp, "tk_library", NULL, TK_LIBRARY, TCL_GLOBAL_ONLY);
+
+ tsdPtr->numMainWindows++;
+ return tkwin;
+diff --git a/unix/Makefile.in b/unix/Makefile.in
+index f21fdbb..c61b0df 100644
+--- a/unix/Makefile.in
++++ b/unix/Makefile.in
+@@ -1029,7 +1029,7 @@ tkVisual.o: $(GENERIC_DIR)/tkVisual.c
+ $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkVisual.c
+
+ tkWindow.o: $(GENERIC_DIR)/tkWindow.c
+- $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkWindow.c
++ $(CC) -c $(CC_SWITCHES) -DTK_LIBRARY=\"${TK_LIBRARY}\" $(GENERIC_DIR)/tkWindow.c
+
+ tkButton.o: $(GENERIC_DIR)/tkButton.c
+ $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkButton.c
diff --git a/gnu/packages/tcl.scm b/gnu/packages/tcl.scm
index 5b55ccc..c18b8b5 100644
--- a/gnu/packages/tcl.scm
+++ b/gnu/packages/tcl.scm
@@ -140,7 +140,8 @@ X11 GUIs.")
version "/tk" version "-src.tar.gz"))
(sha256
(base32
- "1h96vp15zl5xz0d4qp6wjyrchqmrmdm3q5k22wkw9jaxbvw9vy88"))))
+ "1h96vp15zl5xz0d4qp6wjyrchqmrmdm3q5k22wkw9jaxbvw9vy88"))
+ (patches (list (search-patch "tk-find-library.patch")))))
(build-system gnu-build-system)
(arguments
'(#:phases (modify-phases %standard-phases
--
2.6.2
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH] tk: Hardcode path to TK_LIBRARY.
2015-11-12 5:50 [PATCH] tk: Hardcode path to TK_LIBRARY 宋文武
@ 2015-11-12 12:58 ` Ludovic Courtès
2015-11-16 8:42 ` bug#20889: Tkinter moved to separate output Ludovic Courtès
0 siblings, 1 reply; 12+ messages in thread
From: Ludovic Courtès @ 2015-11-12 12:58 UTC (permalink / raw)
To: 宋文武; +Cc: guix-devel, 20889
宋文武 <iyzsong@openmailbox.org> skribis:
> From 6c9ea521e88d36bd1ce990a561477ec0e2950017 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= <iyzsong@gmail.com>
> Date: Thu, 12 Nov 2015 13:31:19 +0800
> Subject: [PATCH] tk: Hardcode path to TK_LIBRARY.
>
> Fixes <http://bugs.gnu.org/20889>.
>
> * gnu/packages/patches/tk-find-library.patch: New patch.
> * gnu-system.am (dist_patch_DATA): Add it.
> * gnu/packages/tcl.scm (tk)[source]: Add patch.
[...]
> +++ b/gnu/packages/patches/tk-find-library.patch
> @@ -0,0 +1,30 @@
> +This patch hardcode where Tk found its script library during package
^^ ^^^^
“This patch hard-codes the Tk library directory during package
initialization.”
OK with this change. Thanks for providing a quick fix! :-)
Could you commit it in a new ‘tk-update’ branch?
At the same time, I think we should move tkinter*.so to a separate
output of the Python packages; I think it’s a matter of moving the .so
to a separate output, literally. Would you like to give it a try?
Thanks!
Ludo’.
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#20889: Tkinter moved to separate output
2015-11-12 12:58 ` Ludovic Courtès
@ 2015-11-16 8:42 ` Ludovic Courtès
2015-11-16 11:44 ` Federico Beffa
0 siblings, 1 reply; 12+ messages in thread
From: Ludovic Courtès @ 2015-11-16 8:42 UTC (permalink / raw)
To: 宋文武; +Cc: guix-devel, iyzsong, 20889, Federico Beffa
In ‘tk-update’ the ‘python’ packages now have a separate ‘tk’ output for
Tkinter (adding ~50 MiB to the closure of Python.) I’ve tested it along
these lines, for 2.x and 3.x:
guix environment --ad-hoc python python:tk --pure -- python
> import Tkinter
> root = Tkinter.Tk()
One thing I haven’t checked is whether some packages need to have an
additional python:tk input. Matplotlib maybe? Federico?
I plan to have Hydra build that branch once we’ve checked that.
Thanks,
Ludo’.
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#20889: Tkinter moved to separate output
2015-11-16 8:42 ` bug#20889: Tkinter moved to separate output Ludovic Courtès
@ 2015-11-16 11:44 ` Federico Beffa
2015-11-16 12:57 ` Ludovic Courtès
0 siblings, 1 reply; 12+ messages in thread
From: Federico Beffa @ 2015-11-16 11:44 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: 宋文武, Guix-devel, iyzsong, 20889
On Mon, Nov 16, 2015 at 9:42 AM, Ludovic Courtès <ludo@gnu.org> wrote:
> In ‘tk-update’ the ‘python’ packages now have a separate ‘tk’ output for
> Tkinter (adding ~50 MiB to the closure of Python.) I’ve tested it along
> these lines, for 2.x and 3.x:
>
> guix environment --ad-hoc python python:tk --pure -- python
> > import Tkinter
> > root = Tkinter.Tk()
>
> One thing I haven’t checked is whether some packages need to have an
> additional python:tk input. Matplotlib maybe? Federico?
Yes, given that the back-end currently used by matploblib doesn't
work, I would change that by using 'Tkinter'.
Since you are at it, I would also change the default back-end by
changing 'GTK3Agg' to 'TkAgg' in the following snippet:
(lambda (port)
(format port "[rc_options]~%
backend = GTK3Agg~%")))))
I'm not convinced that having 2 versions of packages (a "normal" and a
"minimal" one) is a good idea. The reason is that you often end up
downloading both instead of just one. As one example, I just
downloaded 'vlc' and I noticed that it downloaded both 'cups' and
'cups-minimal'. Similarly, for python, anyone needing 'Tkinter' will
end up with 2 versions in the store.
Regards,
Fede
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#20889: Tkinter moved to separate output
2015-11-16 11:44 ` Federico Beffa
@ 2015-11-16 12:57 ` Ludovic Courtès
2015-11-16 13:16 ` Federico Beffa
2015-11-16 13:16 ` Federico Beffa
0 siblings, 2 replies; 12+ messages in thread
From: Ludovic Courtès @ 2015-11-16 12:57 UTC (permalink / raw)
To: Federico Beffa; +Cc: 宋文武, Guix-devel, iyzsong, 20889
Federico Beffa <beffa@ieee.org> skribis:
> On Mon, Nov 16, 2015 at 9:42 AM, Ludovic Courtès <ludo@gnu.org> wrote:
>> In ‘tk-update’ the ‘python’ packages now have a separate ‘tk’ output for
>> Tkinter (adding ~50 MiB to the closure of Python.) I’ve tested it along
>> these lines, for 2.x and 3.x:
>>
>> guix environment --ad-hoc python python:tk --pure -- python
>> > import Tkinter
>> > root = Tkinter.Tk()
>>
>> One thing I haven’t checked is whether some packages need to have an
>> additional python:tk input. Matplotlib maybe? Federico?
>
> Yes, given that the back-end currently used by matploblib doesn't
> work, I would change that by using 'Tkinter'.
>
> Since you are at it, I would also change the default back-end by
> changing 'GTK3Agg' to 'TkAgg' in the following snippet:
>
> (lambda (port)
> (format port "[rc_options]~%
> backend = GTK3Agg~%")))))
OTOH I see that Matploblib already depends on GTK+ 3.x and
python-pygobject, so maybe it’s best to stick to GTK+ by default?
> I'm not convinced that having 2 versions of packages (a "normal" and a
> "minimal" one) is a good idea. The reason is that you often end up
> downloading both instead of just one. As one example, I just
> downloaded 'vlc' and I noticed that it downloaded both 'cups' and
> 'cups-minimal'. Similarly, for python, anyone needing 'Tkinter' will
> end up with 2 versions in the store.
The ‘minimal’ variants are there to break cyclic dependencies most of
the time. This is the case for cups/cups-filters and Python/Tk.
At run time, cups indeed depends on cups-filters, which depends on
cups-minimal. In that case, as you say, we end up downloading those two
variants. But there’s not much of a choice, as was discussed during the
initial review:
https://lists.gnu.org/archive/html/guix-devel/2015-01/msg00057.html
Conversely, python does not depend on python-minimal. So python-minimal
is here just to break the cycle with Tk/libxcb, as noted in python.scm
and discussed in:
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20889
As for Tkinter, it is in a separate “tk” output, which users can choose
to install or not. The “tk” output contains a single file, but it pulls
in Tcl/Tk.
I hope this clarifies things.
Thanks for your feedback,
Ludo’.
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#20889: Tkinter moved to separate output
2015-11-16 12:57 ` Ludovic Courtès
@ 2015-11-16 13:16 ` Federico Beffa
2015-11-16 13:16 ` Federico Beffa
1 sibling, 0 replies; 12+ messages in thread
From: Federico Beffa @ 2015-11-16 13:16 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: 宋文武, Guix-devel, iyzsong, 20889
On Mon, Nov 16, 2015 at 1:57 PM, Ludovic Courtès <ludo@gnu.org> wrote:
> Federico Beffa <beffa@ieee.org> skribis:
>> Yes, given that the back-end currently used by matploblib doesn't
>> work, I would change that by using 'Tkinter'.
>>
>> Since you are at it, I would also change the default back-end by
>> changing 'GTK3Agg' to 'TkAgg' in the following snippet:
>>
>> (lambda (port)
>> (format port "[rc_options]~%
>> backend = GTK3Agg~%")))))
>
> OTOH I see that Matploblib already depends on GTK+ 3.x and
> python-pygobject, so maybe it’s best to stick to GTK+ by default?
Unfortunately, the back-ends based on GTK+ are broken and I didn't
manage to find how to fix the problem.
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20888
That's why I'm looking forward to get Tkinter :-)
>> I'm not convinced that having 2 versions of packages (a "normal" and a
>> "minimal" one) is a good idea. The reason is that you often end up
>> downloading both instead of just one. As one example, I just
>> downloaded 'vlc' and I noticed that it downloaded both 'cups' and
>> 'cups-minimal'. Similarly, for python, anyone needing 'Tkinter' will
>> end up with 2 versions in the store.
>
> The ‘minimal’ variants are there to break cyclic dependencies most of
> the time. This is the case for cups/cups-filters and Python/Tk.
>
> At run time, cups indeed depends on cups-filters, which depends on
> cups-minimal. In that case, as you say, we end up downloading those two
> variants. But there’s not much of a choice, as was discussed during the
> initial review:
>
> https://lists.gnu.org/archive/html/guix-devel/2015-01/msg00057.html
>
> Conversely, python does not depend on python-minimal. So python-minimal
> is here just to break the cycle with Tk/libxcb, as noted in python.scm
> and discussed in:
>
> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20889
>
> As for Tkinter, it is in a separate “tk” output, which users can choose
> to install or not. The “tk” output contains a single file, but it pulls
> in Tcl/Tk.
OK. Thanks for the explanation!
Regards,
Fede
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Tkinter moved to separate output
2015-11-16 12:57 ` Ludovic Courtès
2015-11-16 13:16 ` Federico Beffa
@ 2015-11-16 13:16 ` Federico Beffa
2015-11-29 22:09 ` bug#20889: " Ludovic Courtès
2015-11-29 22:09 ` Ludovic Courtès
1 sibling, 2 replies; 12+ messages in thread
From: Federico Beffa @ 2015-11-16 13:16 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: 宋文武, Guix-devel, 20889
On Mon, Nov 16, 2015 at 1:57 PM, Ludovic Courtès <ludo@gnu.org> wrote:
> Federico Beffa <beffa@ieee.org> skribis:
>> Yes, given that the back-end currently used by matploblib doesn't
>> work, I would change that by using 'Tkinter'.
>>
>> Since you are at it, I would also change the default back-end by
>> changing 'GTK3Agg' to 'TkAgg' in the following snippet:
>>
>> (lambda (port)
>> (format port "[rc_options]~%
>> backend = GTK3Agg~%")))))
>
> OTOH I see that Matploblib already depends on GTK+ 3.x and
> python-pygobject, so maybe it’s best to stick to GTK+ by default?
Unfortunately, the back-ends based on GTK+ are broken and I didn't
manage to find how to fix the problem.
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20888
That's why I'm looking forward to get Tkinter :-)
>> I'm not convinced that having 2 versions of packages (a "normal" and a
>> "minimal" one) is a good idea. The reason is that you often end up
>> downloading both instead of just one. As one example, I just
>> downloaded 'vlc' and I noticed that it downloaded both 'cups' and
>> 'cups-minimal'. Similarly, for python, anyone needing 'Tkinter' will
>> end up with 2 versions in the store.
>
> The ‘minimal’ variants are there to break cyclic dependencies most of
> the time. This is the case for cups/cups-filters and Python/Tk.
>
> At run time, cups indeed depends on cups-filters, which depends on
> cups-minimal. In that case, as you say, we end up downloading those two
> variants. But there’s not much of a choice, as was discussed during the
> initial review:
>
> https://lists.gnu.org/archive/html/guix-devel/2015-01/msg00057.html
>
> Conversely, python does not depend on python-minimal. So python-minimal
> is here just to break the cycle with Tk/libxcb, as noted in python.scm
> and discussed in:
>
> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20889
>
> As for Tkinter, it is in a separate “tk” output, which users can choose
> to install or not. The “tk” output contains a single file, but it pulls
> in Tcl/Tk.
OK. Thanks for the explanation!
Regards,
Fede
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#20889: Tkinter moved to separate output
2015-11-16 13:16 ` Federico Beffa
@ 2015-11-29 22:09 ` Ludovic Courtès
2015-11-29 22:09 ` Ludovic Courtès
1 sibling, 0 replies; 12+ messages in thread
From: Ludovic Courtès @ 2015-11-29 22:09 UTC (permalink / raw)
To: Federico Beffa; +Cc: 宋文武, Guix-devel, iyzsong, 20889
[-- Attachment #1: Type: text/plain, Size: 978 bytes --]
Federico Beffa <beffa@ieee.org> skribis:
> On Mon, Nov 16, 2015 at 1:57 PM, Ludovic Courtès <ludo@gnu.org> wrote:
>> Federico Beffa <beffa@ieee.org> skribis:
>>> Yes, given that the back-end currently used by matploblib doesn't
>>> work, I would change that by using 'Tkinter'.
>>>
>>> Since you are at it, I would also change the default back-end by
>>> changing 'GTK3Agg' to 'TkAgg' in the following snippet:
>>>
>>> (lambda (port)
>>> (format port "[rc_options]~%
>>> backend = GTK3Agg~%")))))
>>
>> OTOH I see that Matploblib already depends on GTK+ 3.x and
>> python-pygobject, so maybe it’s best to stick to GTK+ by default?
>
> Unfortunately, the back-ends based on GTK+ are broken and I didn't
> manage to find how to fix the problem.
> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20888
>
> That's why I'm looking forward to get Tkinter :-)
Could you or someone else test this patch on current master?
Thanks in advance!
Ludo’.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 963 bytes --]
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 39d0751..76bda96 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -3190,6 +3190,7 @@ transcendental functions).")
`(("python-pyparsing" ,python-pyparsing)
("python-pygobject" ,python-pygobject)
("gobject-introspection" ,gobject-introspection)
+ ("python-tkinter" ,python "tk")
;; The 'gtk+' package (and 'gdk-pixbuf', 'atk' and 'pango' propagated
;; from 'gtk+') provides the required 'typelib' files used by
;; 'gobject-introspection'. The location of these files is set with the
@@ -3244,7 +3245,7 @@ transcendental functions).")
(call-with-output-file "setup.cfg"
(lambda (port)
(format port "[rc_options]~%
-backend = GTK3Agg~%")))))
+backend = TkAgg~%")))))
(alist-cons-after
'install 'install-doc
(lambda* (#:key outputs #:allow-other-keys)
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: Tkinter moved to separate output
2015-11-16 13:16 ` Federico Beffa
2015-11-29 22:09 ` bug#20889: " Ludovic Courtès
@ 2015-11-29 22:09 ` Ludovic Courtès
2015-11-30 16:45 ` bug#20889: " Federico Beffa
1 sibling, 1 reply; 12+ messages in thread
From: Ludovic Courtès @ 2015-11-29 22:09 UTC (permalink / raw)
To: Federico Beffa; +Cc: 宋文武, Guix-devel, 20889
[-- Attachment #1: Type: text/plain, Size: 978 bytes --]
Federico Beffa <beffa@ieee.org> skribis:
> On Mon, Nov 16, 2015 at 1:57 PM, Ludovic Courtès <ludo@gnu.org> wrote:
>> Federico Beffa <beffa@ieee.org> skribis:
>>> Yes, given that the back-end currently used by matploblib doesn't
>>> work, I would change that by using 'Tkinter'.
>>>
>>> Since you are at it, I would also change the default back-end by
>>> changing 'GTK3Agg' to 'TkAgg' in the following snippet:
>>>
>>> (lambda (port)
>>> (format port "[rc_options]~%
>>> backend = GTK3Agg~%")))))
>>
>> OTOH I see that Matploblib already depends on GTK+ 3.x and
>> python-pygobject, so maybe it’s best to stick to GTK+ by default?
>
> Unfortunately, the back-ends based on GTK+ are broken and I didn't
> manage to find how to fix the problem.
> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20888
>
> That's why I'm looking forward to get Tkinter :-)
Could you or someone else test this patch on current master?
Thanks in advance!
Ludo’.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 963 bytes --]
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 39d0751..76bda96 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -3190,6 +3190,7 @@ transcendental functions).")
`(("python-pyparsing" ,python-pyparsing)
("python-pygobject" ,python-pygobject)
("gobject-introspection" ,gobject-introspection)
+ ("python-tkinter" ,python "tk")
;; The 'gtk+' package (and 'gdk-pixbuf', 'atk' and 'pango' propagated
;; from 'gtk+') provides the required 'typelib' files used by
;; 'gobject-introspection'. The location of these files is set with the
@@ -3244,7 +3245,7 @@ transcendental functions).")
(call-with-output-file "setup.cfg"
(lambda (port)
(format port "[rc_options]~%
-backend = GTK3Agg~%")))))
+backend = TkAgg~%")))))
(alist-cons-after
'install 'install-doc
(lambda* (#:key outputs #:allow-other-keys)
^ permalink raw reply related [flat|nested] 12+ messages in thread
* bug#20889: Tkinter moved to separate output
2015-11-29 22:09 ` Ludovic Courtès
@ 2015-11-30 16:45 ` Federico Beffa
0 siblings, 0 replies; 12+ messages in thread
From: Federico Beffa @ 2015-11-30 16:45 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: 宋文武, Guix-devel, iyzsong, 20889
[-- Attachment #1: Type: text/plain, Size: 2994 bytes --]
On Sun, Nov 29, 2015 at 11:09 PM, Ludovic Courtès <ludo@gnu.org> wrote:
> Federico Beffa <beffa@ieee.org> skribis:
>
>> On Mon, Nov 16, 2015 at 1:57 PM, Ludovic Courtès <ludo@gnu.org> wrote:
>>> Federico Beffa <beffa@ieee.org> skribis:
>>>> Yes, given that the back-end currently used by matploblib doesn't
>>>> work, I would change that by using 'Tkinter'.
>>>>
>>>> Since you are at it, I would also change the default back-end by
>>>> changing 'GTK3Agg' to 'TkAgg' in the following snippet:
>>>>
>>>> (lambda (port)
>>>> (format port "[rc_options]~%
>>>> backend = GTK3Agg~%")))))
>>>
>>> OTOH I see that Matploblib already depends on GTK+ 3.x and
>>> python-pygobject, so maybe it’s best to stick to GTK+ by default?
>>
>> Unfortunately, the back-ends based on GTK+ are broken and I didn't
>> manage to find how to fix the problem.
>> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20888
>>
>> That's why I'm looking forward to get Tkinter :-)
>
> Could you or someone else test this patch on current master?
It does not work. It can't find the tcl/tk header files:
...
tkagg: no [The C/C++ header for Tk (tk.h) could not be
found. You may need to install the development
package.]
...
With the attached patch it does find the headers, but then it fails at
link time.
...
g++ -pthread -shared
-Wl,-rpath=/gnu/store/cxrqlhbr6xqgi08x3amd0lvl6m7sxx57-python-3.4.3/lib
build/temp.linux-x86_64-3.4/src/agg_py_transforms.o
build/temp.linux-x86_64-3.4/src/_tkagg.o
build/temp.linux-x86_64-3.4/extern/agg24/src/agg_bezier_arc.o
build/temp.linux-x86_64-3.4/extern/agg24/src/agg_curves.o
build/temp.linux-x86_64-3.4/extern/agg24/src/agg_image_filters.o
build/temp.linux-x86_64-3.4/extern/agg24/src/agg_trans_affine.o
build/temp.linux-x86_64-3.4/extern/agg24/src/agg_vcgen_contour.o
build/temp.linux-x86_64-3.4/extern/agg24/src/agg_vcgen_dash.o
build/temp.linux-x86_64-3.4/extern/agg24/src/agg_vcgen_stroke.o
build/temp.linux-x86_64-3.4/extern/agg24/src/agg_vpgen_segmentator.o
build/temp.linux-x86_64-3.4/extern/CXX/IndirectPythonInterface.o
build/temp.linux-x86_64-3.4/extern/CXX/cxxsupport.o
build/temp.linux-x86_64-3.4/extern/CXX/cxx_extensions.o
build/temp.linux-x86_64-3.4/extern/CXX/cxxextensions.o
-L/gnu/store/ipsq9hlk6k0w1qfiw0y0a03bxkp2clhl-tcl-8.6.4/lib
-L/gnu/store/my9wgryzpfvksng6k7h87xz9rphdwddw-tk-8.6.4/lib
-L/usr/local/lib -L/usr/local/lib
-L/gnu/store/cxrqlhbr6xqgi08x3amd0lvl6m7sxx57-python-3.4.3/lib -ltcl
-ltk -lstdc++ -lm -lpython3.4m -o
build/lib.linux-x86_64-3.4/matplotlib/backends/_tkagg.cpython-34m.so
ld: cannot find -ltcl
ld: cannot find -ltk
collect2: error: ld returned 1 exit status
error: command 'g++' failed with exit status 1
phase `build' failed after 94.8 seconds
...
Looking into the failed build directory, it seems that PKG_CONFIG_PATH
is set correctly. Still, it doesn't get the correct flags.
Regards,
Fede
[-- Attachment #2: mpl.patch --]
[-- Type: text/x-diff, Size: 1510 bytes --]
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 39d0751..4dfe557 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -3190,6 +3190,7 @@ transcendental functions).")
`(("python-pyparsing" ,python-pyparsing)
("python-pygobject" ,python-pygobject)
("gobject-introspection" ,gobject-introspection)
+ ("python-tkinter" ,python "tk")
;; The 'gtk+' package (and 'gdk-pixbuf', 'atk' and 'pango' propagated
;; from 'gtk+') provides the required 'typelib' files used by
;; 'gobject-introspection'. The location of these files is set with the
@@ -3224,7 +3225,8 @@ transcendental functions).")
;; FIXME: Add backends when available.
;("python-wxpython" ,python-wxpython)
;("python-pyqt" ,python-pyqt)
- ))
+ ("tcl" ,tcl)
+ ("tk" ,tk)))
(native-inputs
`(("pkg-config" ,pkg-config)
("texlive" ,texlive)
@@ -3243,8 +3245,13 @@ transcendental functions).")
(setenv "HOME" (getcwd))
(call-with-output-file "setup.cfg"
(lambda (port)
- (format port "[rc_options]~%
-backend = GTK3Agg~%")))))
+ (format port "[directories]~%
+basedirlist = ~a,~a~%
+~%
+[rc_options]~%
+backend = TkAgg~%"
+ (assoc-ref inputs "tcl")
+ (assoc-ref inputs "tk"))))))
(alist-cons-after
'install 'install-doc
(lambda* (#:key outputs #:allow-other-keys)
^ permalink raw reply related [flat|nested] 12+ messages in thread
* bug#20889: python Tkinter
@ 2015-06-24 7:14 Federico Beffa
2015-12-01 20:19 ` bug#20889: Tkinter moved to separate output Federico Beffa
0 siblings, 1 reply; 12+ messages in thread
From: Federico Beffa @ 2015-06-24 7:14 UTC (permalink / raw)
To: 20889
The python package does not provide Tkinter which is part of the
Python Standard Library
https://docs.python.org/3/library/tkinter.html?highlight=tkinter#module-tkinter
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#20889: Tkinter moved to separate output
2015-06-24 7:14 bug#20889: python Tkinter Federico Beffa
@ 2015-12-01 20:19 ` Federico Beffa
0 siblings, 0 replies; 12+ messages in thread
From: Federico Beffa @ 2015-12-01 20:19 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: 宋文武, Guix-devel, iyzsong, 20889
[-- Attachment #1: Type: text/plain, Size: 422 bytes --]
Federico Beffa <beffa@ieee.org> writes:
> On Sun, Nov 29, 2015 at 11:09 PM, Ludovic Courtès <ludo@gnu.org> wrote:
>> Federico Beffa <beffa@ieee.org> skribis:
> Looking into the failed build directory, it seems that PKG_CONFIG_PATH
> is set correctly. Still, it doesn't get the correct flags.
The attached patch fixes the problem and I can now plot with TkAgg :-)
Thanks for making Tkinter available!
Fede
[-- Attachment #2: 0001-gnu-python-matplotlib-Add-TkAgg-backend-and-update-t.patch --]
[-- Type: text/x-diff, Size: 4427 bytes --]
From b40cf5522bcc15166ca07dfbae50167203d29e2d Mon Sep 17 00:00:00 2001
From: Federico Beffa <beffa@fbengineering.ch>
Date: Tue, 1 Dec 2015 17:20:59 +0100
Subject: [PATCH 1/2] gnu: python-matplotlib: Add 'TkAgg' backend and update to
version '1.4.3'.
* gnu/packages/python.scm (python-matplotlib): Do it.
* gnu/packages/patches/matplotlib-setupext-tk.patch: New file.
---
gnu/packages/patches/matplotlib-setupext-tk.patch | 30 +++++++++++++++++++++++
gnu/packages/python.scm | 17 +++++++++----
2 files changed, 42 insertions(+), 5 deletions(-)
create mode 100644 gnu/packages/patches/matplotlib-setupext-tk.patch
diff --git a/gnu/packages/patches/matplotlib-setupext-tk.patch b/gnu/packages/patches/matplotlib-setupext-tk.patch
new file mode 100644
index 0000000..cd0332e
--- /dev/null
+++ b/gnu/packages/patches/matplotlib-setupext-tk.patch
@@ -0,0 +1,30 @@
+Use 'pkg-config' instead of heuristics to find 'tk' flags.
+
+--- matplotlib-1.4.3/setupext.py.orig 2015-12-01 14:21:19.554417453 +0100
++++ matplotlib-1.4.3/setupext.py 2015-12-01 14:35:51.999928797 +0100
+@@ -1457,7 +1457,7 @@
+ p = subprocess.Popen(
+ '. %s ; eval echo ${%s}' % (file, varname),
+ shell=True,
+- executable="/bin/sh",
++ executable="sh",
+ stdout=subprocess.PIPE)
+ result = p.communicate()[0]
+ return result.decode('ascii')
+@@ -1601,8 +1601,15 @@
+ # of distros.
+
+ # Query Tcl/Tk system for library paths and version string
++ def getoutput(s):
++ ret = os.popen(s).read().strip()
++ return ret
+ try:
+- tcl_lib_dir, tk_lib_dir, tk_ver = self.query_tcltk()
++ #tcl_lib_dir, tk_lib_dir, tk_ver = self.query_tcltk()
++ pkg_config_res = getoutput('pkg-config --libs tk').split()
++ tk_ver = pkg_config_res[-1][-3:]
++ tcl_lib_dir = pkg_config_res[0][2:] + '/tcl' + tk_ver
++ tk_lib_dir = pkg_config_res[1][2:] + '/tk' + tk_ver
+ except:
+ tk_ver = ''
+ result = self.hardcoded_tcl_config()
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 39d0751..5e23bab 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -3175,7 +3175,7 @@ transcendental functions).")
(define-public python-matplotlib
(package
(name "python-matplotlib")
- (version "1.4.2")
+ (version "1.4.3")
(source
(origin
(method url-fetch)
@@ -3183,13 +3183,15 @@ transcendental functions).")
"/matplotlib-" version ".tar.gz"))
(sha256
(base32
- "0m6v9nwdldlwk22gcd339zg6mny5m301fxgks7z8sb8m9wawg8qp"))))
+ "1dn05cvd0g984lzhh72wa0z93psgwshbbg93fkab6slx5m3l95av"))
+ (patches (list (search-patch "matplotlib-setupext-tk.patch")))))
(build-system python-build-system)
(outputs '("out" "doc"))
(propagated-inputs ; the following packages are all needed at run time
`(("python-pyparsing" ,python-pyparsing)
("python-pygobject" ,python-pygobject)
("gobject-introspection" ,gobject-introspection)
+ ("python" ,python "tk")
;; The 'gtk+' package (and 'gdk-pixbuf', 'atk' and 'pango' propagated
;; from 'gtk+') provides the required 'typelib' files used by
;; 'gobject-introspection'. The location of these files is set with the
@@ -3224,7 +3226,8 @@ transcendental functions).")
;; FIXME: Add backends when available.
;("python-wxpython" ,python-wxpython)
;("python-pyqt" ,python-pyqt)
- ))
+ ("tcl" ,tcl)
+ ("tk" ,tk)))
(native-inputs
`(("pkg-config" ,pkg-config)
("texlive" ,texlive)
@@ -3243,8 +3246,12 @@ transcendental functions).")
(setenv "HOME" (getcwd))
(call-with-output-file "setup.cfg"
(lambda (port)
- (format port "[rc_options]~%
-backend = GTK3Agg~%")))))
+ (format port "[directories]~%
+basedirlist = ~a,~a~%
+[rc_options]~%
+backend = TkAgg~%"
+ (assoc-ref inputs "tcl")
+ (assoc-ref inputs "tk"))))))
(alist-cons-after
'install 'install-doc
(lambda* (#:key outputs #:allow-other-keys)
--
2.4.3
^ permalink raw reply related [flat|nested] 12+ messages in thread
end of thread, other threads:[~2015-12-02 17:29 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-01 20:19 Tkinter moved to separate output Federico Beffa
2015-12-01 22:00 ` bug#20889: " Ludovic Courtès
2015-12-01 22:00 ` Ludovic Courtès
2015-12-02 17:28 ` Federico Beffa
2015-12-02 17:28 ` bug#20889: " Federico Beffa
-- strict thread matches above, loose matches on Subject: below --
2015-11-12 5:50 [PATCH] tk: Hardcode path to TK_LIBRARY 宋文武
2015-11-12 12:58 ` Ludovic Courtès
2015-11-16 8:42 ` bug#20889: Tkinter moved to separate output Ludovic Courtès
2015-11-16 11:44 ` Federico Beffa
2015-11-16 12:57 ` Ludovic Courtès
2015-11-16 13:16 ` Federico Beffa
2015-11-16 13:16 ` Federico Beffa
2015-11-29 22:09 ` bug#20889: " Ludovic Courtès
2015-11-29 22:09 ` Ludovic Courtès
2015-11-30 16:45 ` bug#20889: " Federico Beffa
2015-06-24 7:14 bug#20889: python Tkinter Federico Beffa
2015-12-01 20:19 ` bug#20889: Tkinter moved to separate output Federico Beffa
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.