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

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