Blob Blame History Raw
Index: meson_python-0.8.1/mesonpy/__init__.py
===================================================================
--- meson_python-0.8.1.orig/mesonpy/__init__.py
+++ meson_python-0.8.1/mesonpy/__init__.py
@@ -327,7 +327,9 @@ class _WheelBuilder():
         counter.update(location)
 
         # fix file
-        if platform.system() == 'Linux':
+        # disable rpath addition for rpmbuilds -- https://github.com/FFY00/meson-python/issues/125
+        if (platform.system() == 'Linux' and (os.environ.get("RPM_BUILD_ROOT", None) is None or
+                                              os.environ.get("MESONPY_FORCE_LOCAL_LIB", None))):
             # add .mesonpy.libs to the RPATH of ELF files
             if self._is_elf(os.fspath(origin)):
                 # copy ELF to our working directory to avoid Meson having to regenerate the file