~ubuntu-branches/ubuntu/saucy/python-imaging/saucy

« back to all changes in this revision

Viewing changes to debian/patches/01_multiarch_support.patch

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2011-07-09 11:56:15 UTC
  • mfrom: (2.1.9 sid)
  • Revision ID: james.westby@ubuntu.com-20110709115615-s91azw5pk8mf1keg
Tags: 1.1.7-4
* Add multiarch search directories as given by dpkg-architecture.
  This re-enables support for: tkinter, jpeg, zlib, freetype2, and
  littlecms (Marc Tardif, Barry Warsaw). LP: #806661.
  Closes: #632962, #632180.
* Build using libjpeg8.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Description: Add multiarch search directory as given by dpkg-architecture so
2
 
 that the zlib library can be found.  Without this, zip_decoder and
3
 
 zip_encoder are not included in the _imaging module.  Problem found and patch
4
 
 inspired by Marc Tardif (cr3).
5
 
Author: Barry Warsaw <barry@python.org>
6
 
Bug-Ubuntu: http://pad.lv/806661
7
 
 
8
 
--- a/setup.py
9
 
+++ b/setup.py
10
 
@@ -6,6 +6,8 @@
11
 
 #
12
 
 
13
 
 import glob, os, re, struct, string, sys
14
 
+import subprocess
15
 
+from distutils.spawn import find_executable
16
 
 
17
 
 # make it possible to run the setup script from another directory
18
 
 try:
19
 
@@ -147,6 +149,16 @@
20
 
             add_directory(library_dirs, "/opt/local/lib")
21
 
             add_directory(include_dirs, "/opt/local/include")
22
 
 
23
 
+        elif find_executable('dpkg-architecture'):
24
 
+            # Debian/Ubuntu multiarch support.
25
 
+            proc = subprocess.Popen(
26
 
+                'dpkg-architecture -qDEB_HOST_MULTIARCH'.split(),
27
 
+                stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
28
 
+            stdout, stderr = proc.communicate()
29
 
+            multiarch_path = stdout.strip()
30
 
+            add_directory(include_dirs, '/usr/include/' + multiarch_path)
31
 
+            add_directory(library_dirs, '/usr/lib/' + multiarch_path)
32
 
+
33
 
         add_directory(library_dirs, "/usr/local/lib")
34
 
         # FIXME: check /opt/stuff directories here?
35