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

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