tags 614627 + patch
thanks

The attached patch is a gross hack and should be applied only as last measure if #614711 is not fixed on time.

--
Jakub Wilk
--- a/setup.py
+++ b/setup.py
@@ -22,6 +22,7 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 #
 import sys, os, subprocess
+import ctypes, tempfile
 from warnings import warn
 from setuptools import setup, Extension
 
@@ -54,6 +55,15 @@
 pc_libs = subprocess.Popen("pkg-config --libs liblzma", shell=True, stdout=subprocess.PIPE, close_fds=True).stdout.readline().strip()
 if(pc_libs):
 	link_args.extend(pc_libs.split(' '))
+try:
+	ctypes.CDLL(None).PyOS_mystricmp
+except AttributeError:
+	# http://bugs.debian.org/614711
+	ar = subprocess.Popen(['ar', '-p', '/usr/lib/python%d.%d/config/libpython%d.%d-pic.a' % (sys.version_info[:2] * 2), 'pystrcmp.o'], stdout=subprocess.PIPE)
+	pystrcmp = tempfile.NamedTemporaryFile(suffix='.o')
+	pystrcmp.write(ar.stdout.read())
+	pystrcmp.flush()
+	link_args.append(pystrcmp.name)
 
 extens=[Extension('lzma', c_files, extra_compile_args=compile_args, extra_link_args=link_args, define_macros=version_define)]
 

Reply via email to