Merge lp:~jtaylor/ubuntu/precise/python-numpy/multiarch-fix-818867 into lp:ubuntu/precise/python-numpy

Proposed by Julian Taylor
Status: Merged
Merge reported by: Julian Taylor
Merged at revision: not available
Proposed branch: lp:~jtaylor/ubuntu/precise/python-numpy/multiarch-fix-818867
Merge into: lp:ubuntu/precise/python-numpy
Diff against target: 49 lines (+29/-0)
3 files modified
debian/changelog (+7/-0)
debian/patches/search-multiarch-paths.patch (+21/-0)
debian/patches/series (+1/-0)
To merge this branch: bzr merge lp:~jtaylor/ubuntu/precise/python-numpy/multiarch-fix-818867
Reviewer Review Type Date Requested Status
Serge Hallyn Approve
Ubuntu branches Pending
Review via email: mp+87165@code.launchpad.net

Description of the change

make numpy's distutils multiarch aware.
See bug 818867 and its duplicate.

the method is very ugly due to the lack of a proper way to get the triplet in python.
Ideally numpy's distutil should not need to know the paths at all and leave that to the compiler but that is a major change better left to upstream once multiarch has settled a bit.

one can test the patch with natty's python-enable package (oneiric's has been patched to work around the issue).
without numpy's patch you get this result:
ldd -r ./usr/lib/python2.7/dist-packages/enthought/kiva/agg/_plat_support.so 2>&1 | grep -v Py
 linux-vdso.so.1 => (0x00007fff82a16000)
 libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fb970780000)
 libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fb97056a000)
 libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fb97034c000)
 libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fb96ffad000)
 libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fb96fd29000)
 /lib64/ld-linux-x86-64.so.2 (0x00007fb970cc7000)
undefined symbol: XCreateImage (./usr/lib/python2.7/dist-packages/enthought/kiva/agg/_plat_support.so)
undefined symbol: XOpenDisplay (./usr/lib/python2.7/dist-packages/enthought/kiva/agg/_plat_support.so)
undefined symbol: XCloseDisplay (./usr/lib/python2.7/dist-packages/enthought/kiva/agg/_plat_support.so)
undefined symbol: XFreeGC (./usr/lib/python2.7/dist-packages/enthought/kiva/agg/_plat_support.so)
undefined symbol: XCreateGC (./usr/lib/python2.7/dist-packages/enthought/kiva/agg/_plat_support.so)
undefined symbol: XPutImage (./usr/lib/python2.7/dist-packages/enthought/kiva/agg/_plat_support.so)

with the patch it correcly links with X11

To post a comment you must log in.
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Thanks very much for taking the time to submit this fix.

The debdiff looks good. I've tested the fix, and it worked for me.

review: Approve
Revision history for this message
Julian Taylor (jtaylor) wrote :

we will want to have numpy -4 in precise due to the better dh_numpy
maybe want to mash this commit into a merge to save some uploads.

Revision history for this message
Julian Taylor (jtaylor) wrote :

I created a numpy 1.6 merge which includes this changeset:
https://code.launchpad.net/~jtaylor/ubuntu/precise/python-numpy/merge-1.6/+merge/92671

Revision history for this message
Julian Taylor (jtaylor) wrote :

the 1.6 branch was merged, which effectively has merged this one too

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2011-12-17 17:22:00 +0000
3+++ debian/changelog 2011-12-30 19:46:25 +0000
4@@ -1,3 +1,10 @@
5+python-numpy (1:1.5.1-2ubuntu4) precise; urgency=low
6+
7+ * debian/patches/search-multiarch-paths.patch: (LP: #818867)
8+ - add multiarch libdirs to numpy.distutils.system_info
9+
10+ -- Julian Taylor <jtaylor@ubuntu.com> Fri, 30 Dec 2011 20:18:49 +0100
11+
12 python-numpy (1:1.5.1-2ubuntu3) precise; urgency=low
13
14 * Build using dh_python2
15
16=== added file 'debian/patches/search-multiarch-paths.patch'
17--- debian/patches/search-multiarch-paths.patch 1970-01-01 00:00:00 +0000
18+++ debian/patches/search-multiarch-paths.patch 2011-12-30 19:46:25 +0000
19@@ -0,0 +1,21 @@
20+Description: search multiarch paths for libraries
21+ hack to get numpys distutils multiarch aware
22+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/python-numpy/+bug/818867
23+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=640940
24+Author: Julian Taylor <jtaylor@ubuntu.com>
25+
26+--- a/numpy/distutils/system_info.py
27++++ b/numpy/distutils/system_info.py
28+@@ -200,6 +200,12 @@
29+ '/usr/lib'], platform_bits)
30+ default_x11_include_dirs = ['/usr/X11R6/include','/usr/X11/include',
31+ '/usr/include']
32++ import subprocess as sp
33++ p = sp.Popen(["dpkg-architecture", "-qDEB_HOST_MULTIARCH"], stdout=sp.PIPE)
34++ triplet = p.communicate()[0].strip()
35++ if p.returncode == 0:
36++ default_x11_lib_dirs += [os.path.join("/usr/lib/", triplet)]
37++ default_lib_dirs += [os.path.join("/usr/lib/", triplet)]
38+
39+ if os.path.join(sys.prefix, 'lib') not in default_lib_dirs:
40+ default_lib_dirs.insert(0,os.path.join(sys.prefix, 'lib'))
41
42=== modified file 'debian/patches/series'
43--- debian/patches/series 2011-08-25 23:56:45 +0000
44+++ debian/patches/series 2011-12-30 19:46:25 +0000
45@@ -5,3 +5,4 @@
46 10_use_local_python.org_object.inv_sphinx.diff
47 20_disable-plot-extension.patch
48 debian-changes-1:1.5.1-2ubuntu2
49+search-multiarch-paths.patch

Subscribers

People subscribed via source and target branches

to all changes: