mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-25 05:48:07 -05:00
gnu: python-matplotlib: Add 'TkAgg' backend and update to version '1.4.3'.
* gnu/packages/python.scm (python-matplotlib, python2-matplotlib): Do it. * gnu/packages/patches/matplotlib-setupext-tk.patch: New file. * gnu-system.am (dist_patch_DATA): Add the new patch.
This commit is contained in:
parent
214ed6a39b
commit
1bbc659fd2
3 changed files with 50 additions and 9 deletions
|
@ -611,6 +611,7 @@ dist_patch_DATA = \
|
|||
gnu/packages/patches/make-impure-dirs.patch \
|
||||
gnu/packages/patches/mars-install.patch \
|
||||
gnu/packages/patches/mars-sfml-2.3.patch \
|
||||
gnu/packages/patches/matplotlib-setupext-tk.patch \
|
||||
gnu/packages/patches/maxima-defsystem-mkdir.patch \
|
||||
gnu/packages/patches/mc-fix-ncurses-build.patch \
|
||||
gnu/packages/patches/mcron-install.patch \
|
||||
|
|
34
gnu/packages/patches/matplotlib-setupext-tk.patch
Normal file
34
gnu/packages/patches/matplotlib-setupext-tk.patch
Normal file
|
@ -0,0 +1,34 @@
|
|||
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-02 10:39:47.282363530 +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,19 @@
|
||||
# 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()
|
||||
+ pkg_config_libs = getoutput('pkg-config --libs-only-L tk').split()
|
||||
+ # drop '-L' part of strings
|
||||
+ pkg_config_libs = [s[2:] for s in pkg_config_libs]
|
||||
+ pkg_config_ver = getoutput('pkg-config --modversion tk')
|
||||
+ tk_ver = re.match(r"(\d+.\d+)[\d.]*", pkg_config_ver).group(1)
|
||||
+ tcl_lib_dir = next(s for s in pkg_config_libs
|
||||
+ if re.match(r".*-tcl-.*", s)) + '/tcl' + tk_ver
|
||||
+ tk_lib_dir = next(s for s in pkg_config_libs
|
||||
+ if re.match(r".*-tk-.*", s)) + '/tk' + tk_ver
|
||||
except:
|
||||
tk_ver = ''
|
||||
result = self.hardcoded_tcl_config()
|
|
@ -3182,7 +3182,7 @@ (define-public python2-numexpr
|
|||
(define-public python-matplotlib
|
||||
(package
|
||||
(name "python-matplotlib")
|
||||
(version "1.4.2")
|
||||
(version "1.4.3")
|
||||
(source
|
||||
(origin
|
||||
(method url-fetch)
|
||||
|
@ -3190,13 +3190,15 @@ (define-public python-matplotlib
|
|||
"/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-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
|
||||
|
@ -3231,7 +3233,8 @@ (define-public python-matplotlib
|
|||
;; 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)
|
||||
|
@ -3250,8 +3253,12 @@ (define-public python-matplotlib
|
|||
(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)
|
||||
|
@ -3295,10 +3302,9 @@ (define-public python2-matplotlib
|
|||
(propagated-inputs
|
||||
`(("python2-pycairo" ,python2-pycairo)
|
||||
("python2-pygobject-2" ,python2-pygobject-2)
|
||||
,@(alist-delete "python-pycairo"
|
||||
(alist-delete "python-pygobject"
|
||||
(package-propagated-inputs
|
||||
matplotlib))))))))
|
||||
("python2-tkinter" ,python-2 "tk")
|
||||
,@(fold alist-delete (package-propagated-inputs matplotlib)
|
||||
'("python-pycairo" "python-pygobject" "python-tkinter")))))))
|
||||
|
||||
(define-public python2-pysnptools
|
||||
(package
|
||||
|
|
Loading…
Reference in a new issue