aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCristián Maureira-Fredes <cristian.maureira-fredes@qt.io>2020-01-07 11:00:16 +0100
committerCristian Maureira-Fredes <cristian.maureira-fredes@qt.io>2020-01-27 22:39:56 +0000
commit491eb18eaecfae83aae117bbe85de0f352ee2c0d (patch)
tree9d09e3c5770037a44cf9f72b804c708bf533bec1
parentdeeadb8e5d04975916e3949416d0308b080b389b (diff)
designer: patch rpath for unix
Designer is not statically compiled, so we need to add a RUNPATH to use the Qt libraries we ship with the wheel. Change-Id: I715fcd852b63da99104198be2a4587b042a1eab7 Fixes: PYSIDE-1165 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-rw-r--r--build_scripts/platforms/linux.py13
-rw-r--r--build_scripts/platforms/macos.py9
2 files changed, 20 insertions, 2 deletions
diff --git a/build_scripts/platforms/linux.py b/build_scripts/platforms/linux.py
index e1c2dd5a1..712739e05 100644
--- a/build_scripts/platforms/linux.py
+++ b/build_scripts/platforms/linux.py
@@ -37,7 +37,9 @@
##
#############################################################################
-from ..utils import copydir, copyfile, copy_icu_libs, find_files_using_glob
+from ..utils import (copydir, copyfile, copy_icu_libs, find_files_using_glob,
+ linux_set_rpaths, linux_run_read_elf, linux_get_rpaths,
+ rpaths_has_origin)
from ..config import config
@@ -87,6 +89,15 @@ def prepare_standalone_package_linux(self, vars):
if not maybe_icu_libs:
copy_icu_libs(self._patchelf_path, resolved_destination_lib_dir)
+ # Patching designer to use the Qt libraries provided in the wheel
+ if config.is_internal_pyside_build():
+ designer_path = "{st_build_dir}/{st_package_name}/designer".format(**vars)
+ rpaths = linux_get_rpaths(designer_path)
+ if not rpaths or not rpaths_has_origin(rpaths):
+ rpaths.insert(0, '$ORIGIN/../lib')
+ new_rpaths_string = ":".join(rpaths)
+ linux_set_rpaths(self._patchelf_path, designer_path, new_rpaths_string)
+
if self.is_webengine_built(built_modules):
copydir("{qt_lib_execs_dir}",
"{st_build_dir}/{st_package_name}/Qt/libexec",
diff --git a/build_scripts/platforms/macos.py b/build_scripts/platforms/macos.py
index 159364d9a..7932db337 100644
--- a/build_scripts/platforms/macos.py
+++ b/build_scripts/platforms/macos.py
@@ -39,7 +39,7 @@
import fnmatch
import os
-from ..utils import copydir, copyfile, macos_fix_rpaths_for_library
+from ..utils import copydir, copyfile, macos_fix_rpaths_for_library, macos_add_rpath
from ..config import config
@@ -77,6 +77,13 @@ def prepare_standalone_package_macos(self, vars):
return False
return True
+ # Patching designer to use the Qt libraries provided in the wheel
+ if config.is_internal_pyside_build():
+ designer_bundle = "{st_build_dir}/{st_package_name}/Designer.app".format(**vars)
+ designer_binary = "{}/Contents/MacOS/Designer".format(designer_bundle)
+ rpath = "@loader_path/../../../Qt/lib"
+ macos_add_rpath(rpath, designer_binary)
+
# <qt>/lib/* -> <setup>/{st_package_name}/Qt/lib
if self.qt_is_framework_build():
def framework_dir_filter(dir_name, parent_full_path, dir_full_path):