churchyard / rpms / python2

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