aboutsummaryrefslogtreecommitdiffstats
path: root/build_scripts
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2018-07-25 16:15:28 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2018-07-25 16:15:28 +0200
commitf645e5c8fe02bc6eb177061cfec4fa5bddab05d3 (patch)
tree6b7d403fd6e28ff53748587de7ccc026221e6eec /build_scripts
parentbe202bd1baf600c7b422c96cc6b47a327e7a9d23 (diff)
parent0479cbd6abc8fffb9ba8b5f94de067e1670ffffa (diff)
Merge branch '5.11' into dev
Diffstat (limited to 'build_scripts')
-rw-r--r--build_scripts/main.py12
-rw-r--r--build_scripts/platforms/linux.py2
-rw-r--r--build_scripts/utils.py16
3 files changed, 15 insertions, 15 deletions
diff --git a/build_scripts/main.py b/build_scripts/main.py
index 8d3a58eb0..d825357fd 100644
--- a/build_scripts/main.py
+++ b/build_scripts/main.py
@@ -885,6 +885,13 @@ class PysideBuild(_build):
def build_patchelf(self):
if not sys.platform.startswith('linux'):
return
+ self._patchelf_path = find_executable('patchelf')
+ if self._patchelf_path:
+ if not os.path.isabs(self._patchelf_path):
+ self._patchelf_path = os.path.join(os.getcwd(),
+ self._patchelf_path)
+ log.info("Using {} ...".format(self._patchelf_path))
+ return
log.info("Building patchelf...")
module_src_dir = os.path.join(self.sources_dir, "patchelf")
build_cmd = [
@@ -895,6 +902,7 @@ class PysideBuild(_build):
]
if run_process(build_cmd) != 0:
raise DistutilsSetupError("Error building patchelf")
+ self._patchelf_path = os.path.join(self.script_dir, "patchelf")
def build_extension(self, extension):
# calculate the subrepos folder name
@@ -1235,8 +1243,6 @@ class PysideBuild(_build):
pyside_libs = [lib for lib in os.listdir(
package_path) if filter_match(lib, ["*.so", "*.so.*"])]
- patchelf_path = os.path.join(self.script_dir, "patchelf")
-
def rpath_cmd(srcpath):
final_rpath = ''
# Command line rpath option takes precedence over
@@ -1251,7 +1257,7 @@ class PysideBuild(_build):
if OPTION_STANDALONE:
qt_lib_dir = "$ORIGIN/Qt/lib"
final_rpath = local_rpath + ':' + qt_lib_dir
- cmd = [patchelf_path, '--set-rpath', final_rpath, srcpath]
+ cmd = [self._patchelf_path, '--set-rpath', final_rpath, srcpath]
if run_process(cmd) != 0:
raise RuntimeError("Error patching rpath in " + srcpath)
diff --git a/build_scripts/platforms/linux.py b/build_scripts/platforms/linux.py
index bdeb2b66e..4c38fef6c 100644
--- a/build_scripts/platforms/linux.py
+++ b/build_scripts/platforms/linux.py
@@ -66,7 +66,7 @@ def prepare_standalone_package_linux(self, executables, vars):
# dir if necessary. We choose the QtCore lib to inspect, by
# checking which QtCore library the shiboken2 executable uses.
if not maybe_icu_libs:
- copy_icu_libs(resolved_destination_lib_dir)
+ copy_icu_libs(self._patchelf_path, resolved_destination_lib_dir)
if self.is_webengine_built(built_modules):
copydir("{qt_lib_execs_dir}",
diff --git a/build_scripts/utils.py b/build_scripts/utils.py
index 1a5fa8c7b..7160630d1 100644
--- a/build_scripts/utils.py
+++ b/build_scripts/utils.py
@@ -944,7 +944,7 @@ def find_qt_core_library_glob(lib_dir):
# ldd for the specified platforms.
# This has less priority because ICU libs are not used in the default
# Qt configuration build.
-def copy_icu_libs(destination_lib_dir):
+def copy_icu_libs(patchelf, destination_lib_dir):
"""
Copy ICU libraries that QtCore depends on,
to given `destination_lib_dir`.
@@ -983,7 +983,7 @@ def copy_icu_libs(destination_lib_dir):
copyfile(path, destination, force_copy_symlink=True)
# Patch the ICU libraries to contain the $ORIGIN rpath
# value, so that only the local package libraries are used.
- linux_set_rpaths(destination, '$ORIGIN')
+ linux_set_rpaths(patchelf, destination, '$ORIGIN')
# Patch the QtCore library to find the copied over ICU libraries
# (if necessary).
@@ -994,18 +994,12 @@ def copy_icu_libs(destination_lib_dir):
log.info('Patching QtCore library to contain $ORIGIN rpath.')
rpaths.insert(0, '$ORIGIN')
new_rpaths_string = ":".join(rpaths)
- linux_set_rpaths(qt_core_library_path, new_rpaths_string)
+ linux_set_rpaths(patchelf, qt_core_library_path, new_rpaths_string)
-def linux_set_rpaths(executable_path, rpath_string):
+def linux_set_rpaths(patchelf, executable_path, rpath_string):
""" Patches the `executable_path` with a new rpath string. """
- if not hasattr(linux_set_rpaths, "patchelf_path"):
- script_dir = os.getcwd()
- patchelf_path = os.path.join(script_dir, "patchelf")
- setattr(linux_set_rpaths, "patchelf_path", patchelf_path)
-
- cmd = [linux_set_rpaths.patchelf_path, '--set-rpath',
- rpath_string, executable_path]
+ cmd = [patchelf, '--set-rpath', rpath_string, executable_path]
if run_process(cmd) != 0:
raise RuntimeError("Error patching rpath in {}".format(