How horrible is it to use dpkg-architecture?  It adds a dependency on
dpkg-dev, but that doesn't seem so bad to *me*. :)

Attached is a patch that uses dpkg-architecture and fixes the problem for me.
=== modified file 'debian/changelog'
--- debian/changelog	2012-11-30 15:06:23 +0000
+++ debian/changelog	2012-12-12 19:11:43 +0000
@@ -1,3 +1,10 @@
+python-virtualenv (1.8.4-2) experimental; urgency=low
+
+  * debian/patches/multiarch.patch: Use system multiarch path if available.
+    Closes: #695707
+
+ -- Barry Warsaw <ba...@python.org>  Wed, 12 Dec 2012 14:10:49 -0500
+
 python-virtualenv (1.8.4-1) experimental; urgency=low
 
   * Team upload.

=== modified file 'debian/control'
--- debian/control	2012-04-22 17:34:40 +0000
+++ debian/control	2012-12-12 19:13:44 +0000
@@ -19,6 +19,7 @@
 Depends:
  python-pkg-resources,
  python-setuptools,
+ dpkg-dev,
  ${misc:Depends},
  ${python:Depends}
 Recommends: python-pip (>= 0.7.2)

=== added file 'debian/patches/multiarch.patch'
--- debian/patches/multiarch.patch	1970-01-01 00:00:00 +0000
+++ debian/patches/multiarch.patch	2012-12-12 19:29:25 +0000
@@ -0,0 +1,33 @@
+Description: Use system multiarch path if available.
+Author: Barry Warsaw <ba...@python.org>
+Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=695707
+Forwarded: no
+
+--- a/virtualenv_embedded/site.py
++++ b/virtualenv_embedded/site.py
+@@ -83,6 +83,16 @@
+ USER_SITE = None
+ USER_BASE = None
+ 
++# Debian multiarch support.
++# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=695707
++# We can't use subprocess here. :/
++try:
++    with os.popen('dpkg-architecture -qDEB_HOST_MULTIARCH') as fp:
++        host_arch = fp.read().splitlines()[0]
++except IndexError:
++    host_arch = ''
++plat_arch = 'plat-%s' % (sys.platform if not host_arch else host_arch)
++
+ _is_pypy = hasattr(sys, 'pypy_version_info')
+ _is_jython = sys.platform[:4] == 'java'
+ if _is_jython:
+@@ -570,7 +580,7 @@
+         #
+         # This is hardcoded in the Python executable, but relative to sys.prefix:
+         for path in paths[:]:
+-            plat_path = os.path.join(path, 'plat-%s' % sys.platform)
++            plat_path = os.path.join(path, plat_arch)
+             if os.path.exists(plat_path):
+                 paths.append(plat_path)
+     elif sys.platform == 'win32':

=== modified file 'debian/patches/series'
--- debian/patches/series	2012-11-30 15:06:23 +0000
+++ debian/patches/series	2012-12-12 19:10:23 +0000
@@ -2,3 +2,4 @@
 use_distribute.patch
 system-python.patch
 entry-points.patch
+multiarch.patch

Reply via email to