Blame SOURCES/00187-add-RPATH-to-pyexpat.patch

72be67
diff -r e8b8279ca118 setup.py
72be67
--- a/setup.py	Sun Jul 21 21:57:52 2013 -0400
72be67
+++ b/setup.py	Tue Aug 20 09:45:31 2013 +0200
72be67
@@ -1480,12 +1480,21 @@
72be67
                              'expat/xmltok_impl.h'
72be67
                              ]
72be67
 
72be67
+        # Add an explicit RPATH to pyexpat.so pointing at the directory
72be67
+        # containing the system expat (which has the extra XML_SetHashSalt
72be67
+        # symbol), to avoid an ImportError with a link error if there's an
72be67
+        # LD_LIBRARY_PATH containing a "vanilla" build of expat (without the
72be67
+        # symbol) (rhbz#833271):
72be67
+        EXPAT_RPATH = '/usr/lib64' if sys.maxint == 0x7fffffffffffffff else '/usr/lib'
72be67
+
72be67
+
72be67
         exts.append(Extension('pyexpat',
72be67
                               define_macros = define_macros,
72be67
                               include_dirs = expat_inc,
72be67
                               libraries = expat_lib,
72be67
                               sources = ['pyexpat.c'] + expat_sources,
72be67
                               depends = expat_depends,
72be67
+                              extra_link_args = ['-Wl,-rpath,%s' % EXPAT_RPATH]
72be67
                               ))
72be67
 
72be67
         # Fredrik Lundh's cElementTree module.  Note that this also