diff options
author | Tim Jenßen <tim.jenssen@qt.io> | 2024-12-05 20:10:30 +0100 |
---|---|---|
committer | Tim Jenssen <tim.jenssen@qt.io> | 2024-12-09 10:17:33 +0000 |
commit | ef4cddc9bbb46a87476e399a41f06e0a2de0b8e6 (patch) | |
tree | 2936fb4bfbe8a33b26f5699fa87ae3e67daf48f8 /scripts/deploy.py | |
parent | f4380de722b40a47b397a4b01c7b5f6645091ad2 (diff) |
Build/deploy: solve missing QtWebEngineProcess dependency
Task-number: QDS-14292
Change-Id: Ib464df3e0f11d48625c78b35c7d39b3e7b693076
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'scripts/deploy.py')
-rwxr-xr-x | scripts/deploy.py | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/scripts/deploy.py b/scripts/deploy.py index 8df90f1ac14..a16f762cbb5 100755 --- a/scripts/deploy.py +++ b/scripts/deploy.py @@ -452,6 +452,49 @@ def get_qt_install_info(qmake_binary): qml=qt_install_info['QT_INSTALL_QML'], translations=qt_install_info['QT_INSTALL_TRANSLATIONS'])) + +def check_webengine(dest_dir): + if common.is_linux_platform(): + core_path = os.path.join(dest_dir, 'lib', 'libQt6WebEngineCore.so.6') + elif common.is_windows_platform(): + core_path = os.path.join(dest_dir, 'Qt6WebEngineCore.dll') + + if not os.path.exists(core_path): + return False + return True + + +def deploy_webengine_process(qt_install_dir, dest_dir): + if common.is_linux_platform(): + process_path = os.path.join(qt_install_dir, 'libexec', 'QtWebEngineProcess') + elif common.is_windows_platform(): + process_path = os.path.join(qt_install_dir, 'bin', 'QtWebEngineProcess.exe') + + if not os.path.exists(process_path): + print(f"Error: QtWebEngineProcess not found at {process_path}.") + sys.exit(1) + + if common.is_linux_platform(): + dest_process_dir = os.path.join(dest_dir, 'libexec') + if common.is_windows_platform(): + dest_process_dir = dest_dir + os.makedirs(dest_process_dir, exist_ok=True) + print(f"Copying: {process_path} -> {dest_process_dir}") + shutil.copy(process_path, dest_process_dir) + + resources = ['icudtl.dat', 'qtwebengine_resources.pak', 'qtwebengine_resources_100p.pak', + 'qtwebengine_resources_200p.pak', 'qtwebengine_devtools_resources.pak', 'v8_context_snapshot.bin'] + resources_dir = os.path.join(qt_install_dir, 'resources') + dest_resources_dir = os.path.join(dest_dir, 'resources') + os.makedirs(dest_resources_dir, exist_ok=True) + + for resource in resources: + resource_path = os.path.join(resources_dir, resource) + if os.path.exists(resource_path): + print(f"Copying: {resource_path} -> {dest_resources_dir}") + shutil.copy(resource_path, dest_resources_dir) + + def main(): args = get_args() chrpath_bin = None @@ -500,6 +543,9 @@ def main(): print("fixing rpaths...") common.fix_rpaths(install_dir, os.path.join(qt_deploy_prefix, 'lib'), qt_install_info, chrpath_bin) + # Unlike macOS, where it is part of lib/QtWebEngineCore.framework, it is missing + if check_webengine(qt_deploy_prefix): + deploy_webengine_process(qt_install_info['QT_INSTALL_PREFIX'], qt_deploy_prefix) if __name__ == "__main__": main() |