unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
blob cd0332e3794b3dad4770d48518a217807467a0fc 1315 bytes (raw)
name: gnu/packages/patches/matplotlib-setupext-tk.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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()

debug log:

solving cd0332e ...
found cd0332e in https://yhetil.org/guix-bugs/CAKrPhPM0UqgC0x+pOqR7Ta7afGchG6KGaBqfwp+OB2RoaAMQpg__17772.0975051217$1449001240$gmane$org@mail.gmail.com/

applying [1/1] https://yhetil.org/guix-bugs/CAKrPhPM0UqgC0x+pOqR7Ta7afGchG6KGaBqfwp+OB2RoaAMQpg__17772.0975051217$1449001240$gmane$org@mail.gmail.com/
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

1:22: trailing whitespace.
 
Checking patch gnu/packages/patches/matplotlib-setupext-tk.patch...
Applied patch gnu/packages/patches/matplotlib-setupext-tk.patch cleanly.
warning: 1 line adds whitespace errors.

index at:
100644 cd0332e3794b3dad4770d48518a217807467a0fc	gnu/packages/patches/matplotlib-setupext-tk.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).