summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/matplotlib-setupext-tk.patch
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-12-12 11:42:12 +0100
committerLudovic Courtès <ludo@gnu.org>2015-12-12 11:48:46 +0100
commite82e55e58c67b0215e768c4612ca542bc670f633 (patch)
tree856c4512fa1fbde59c1d9845c5a763ef8c4a14b4 /gnu/packages/patches/matplotlib-setupext-tk.patch
parent98bd851ee891ca4a84e061fe1e78ba78c292b096 (diff)
parente35dff973375266db253747140ddf25084ecddc2 (diff)
downloadguix-patches-e82e55e58c67b0215e768c4612ca542bc670f633.tar
guix-patches-e82e55e58c67b0215e768c4612ca542bc670f633.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'gnu/packages/patches/matplotlib-setupext-tk.patch')
-rw-r--r--gnu/packages/patches/matplotlib-setupext-tk.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/gnu/packages/patches/matplotlib-setupext-tk.patch b/gnu/packages/patches/matplotlib-setupext-tk.patch
new file mode 100644
index 0000000000..37c3d686e0
--- /dev/null
+++ b/gnu/packages/patches/matplotlib-setupext-tk.patch
@@ -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()