Fix RPATH of Qbs binaries when built with Qt 6

The build system for Qt Creator ensures that we have the right
relative RPATH to Qt for the packages.
We still check if we need to fix the RPATHs when deploying Qt, and
the Qbs build relies on that.

That part was broken for Qt 6 since it looked for libQt5* to decide
if the relative RPATH to Qt must be added. Remove the Qt version
number from the check.

Change-Id: Ib9d0408943d61364bfe9c8813a55bf60145b7972
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
This commit is contained in:
Eike Ziller
2021-10-29 08:56:57 +02:00
parent 39d04fa886
commit 03bcdc9186

View File

@@ -164,13 +164,13 @@ def fix_rpaths(path, qt_deploy_path, qt_install_info, chrpath=None):
if len(rpath) <= 0: if len(rpath) <= 0:
return return
# remove previous Qt RPATH # remove previous Qt RPATH
new_rpath = list(filter(lambda path: not path.startswith(qt_install_prefix) and not path.startswith(qt_install_libs), new_rpath = [path for path in rpath if not path.startswith(qt_install_prefix)
rpath)) and not path.startswith(qt_install_libs)]
# check for Qt linking # check for Qt linking
lddOutput = subprocess.check_output(['ldd', filepath]) lddOutput = subprocess.check_output(['ldd', filepath])
lddDecodedOutput = lddOutput.decode(encoding) if encoding else lddOutput lddDecodedOutput = lddOutput.decode(encoding) if encoding else lddOutput
if lddDecodedOutput.find('libQt5') >= 0 or lddDecodedOutput.find('libicu') >= 0: if lddDecodedOutput.find('libQt') >= 0 or lddDecodedOutput.find('libicu') >= 0:
# add Qt RPATH if necessary # add Qt RPATH if necessary
relative_path = os.path.relpath(qt_deploy_path, os.path.dirname(filepath)) relative_path = os.path.relpath(qt_deploy_path, os.path.dirname(filepath))
if relative_path == '.': if relative_path == '.':