aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2017-11-03 14:27:50 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2017-11-15 15:47:04 +0000
commita7f3f7d3e711520a32f87aace8df265589a649e7 (patch)
tree3e67a31b9c5d939481d9f8bcc2d4f7ff125e340a
parent8815ef1cfddd79b99314a8e8e351b1a2235afc26 (diff)
Fix rpath handling on Linux
In addition to adding $ORIGIN, add an RPATH to the Qt lib directory (the one used when building PySide) so that there is no necessity to set LD_LIBRARY_PATH. Change-Id: I0d54da2ef084abbe503bd427b0773481264334e6 Task-number: PYSIDE-558 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
-rw-r--r--setup.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/setup.py b/setup.py
index ecc9dbb5f..c484c62d3 100644
--- a/setup.py
+++ b/setup.py
@@ -1355,7 +1355,16 @@ class pyside_build(_build):
patchelf_path = os.path.join(self.script_dir, "patchelf")
def rpath_cmd(srcpath):
- cmd = [patchelf_path, '--set-rpath', '$ORIGIN/', srcpath]
+ final_rpath = ''
+ # Command line rpath option takes precedence over automatically added one.
+ if OPTION_RPATH_VALUES:
+ final_rpath = OPTION_RPATH_VALUES
+ else:
+ # Add rpath values pointing to $ORIGIN and the installed qt lib directory.
+ local_rpath = '$ORIGIN/'
+ qt_lib_dir = self.qtinfo.libs_dir
+ final_rpath = local_rpath + ':' + qt_lib_dir
+ cmd = [patchelf_path, '--set-rpath', final_rpath, srcpath]
if run_process(cmd) != 0:
raise RuntimeError("Error patching rpath in " + srcpath)