Blame python-2.6.6-add-RPATH-to-pyexpat.patch

c217786
diff -up Python-2.6.6/setup.py.add-RPATH-to-pyexpat Python-2.6.6/setup.py
c217786
--- Python-2.6.6/setup.py.add-RPATH-to-pyexpat	2012-08-15 11:36:26.042932293 -0400
c217786
+++ Python-2.6.6/setup.py	2012-08-15 12:09:43.344564591 -0400
c217786
@@ -1318,11 +1318,19 @@ class PyBuildExt(build_ext):
c217786
                              'expat/xmlrole.c',
c217786
                              'expat/xmltok.c']
c217786
 
c217786
+        # Add an explicit RPATH to pyexpat.so pointing at the directory
c217786
+        # containing the system expat (which has the extra XML_SetHashSalt
c217786
+        # symbol), to avoid an ImportError with a link error if there's an
c217786
+        # LD_LIBRARY_PATH containing a "vanilla" build of expat (without the
c217786
+        # symbol) (rhbz#833271):
c217786
+        EXPAT_RPATH = '/lib64' if sys.maxint == 0x7fffffffffffffff else '/lib'
c217786
+
c217786
         exts.append(Extension('pyexpat',
c217786
                               define_macros = define_macros,
c217786
                               include_dirs = expat_inc,
c217786
                               libraries = expat_lib,
c217786
-                              sources = ['pyexpat.c'] + expat_sources
c217786
+                              sources = ['pyexpat.c'] + expat_sources,
c217786
+                              extra_link_args = ['-Wl,-rpath,%s' % EXPAT_RPATH]
c217786
                               ))
c217786
 
c217786
         # Fredrik Lundh's cElementTree module.  Note that this also