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

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