aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/deploy.py
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2023-07-26 09:07:15 +0200
committerEike Ziller <eike.ziller@qt.io>2023-08-28 10:12:59 +0000
commitfe185253267b2e53b05cdb0f1d463c38c78dd622 (patch)
tree515fd66197c56b982a2008bcef08bef0010dbb1a /scripts/deploy.py
parent22476fc26fb819961d732296061e18062977533b (diff)
Build/deploy: Move copying qtdiag to deploy.py
Moving things away from deployqtHelper_mac.sh Change-Id: Ic71ad9a8ed522dc8c4eaa745ec519d9d705d1073 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'scripts/deploy.py')
-rwxr-xr-xscripts/deploy.py46
1 files changed, 31 insertions, 15 deletions
diff --git a/scripts/deploy.py b/scripts/deploy.py
index 70a8399c8cc..8415bd2389a 100755
--- a/scripts/deploy.py
+++ b/scripts/deploy.py
@@ -49,6 +49,9 @@ def get_args():
return args
+def with_exe_ext(filepath):
+ return filepath + '.exe' if common.is_windows_platform() else filepath
+
def which(program):
def is_exe(fpath):
return os.path.exists(fpath) and os.access(fpath, os.X_OK)
@@ -158,12 +161,21 @@ def copy_qt_libs(target_qt_prefix_path, qt_bin_dir, qt_libs_dir, qt_plugin_dir,
print('{0} -> {1}'.format(qt_qml_dir, target))
common.copytree(qt_qml_dir, target, ignore=ignored_qt_lib_files, symlinks=True)
+
+def deploy_qtdiag(qtc_binary_path, qt_install):
print("Copying qtdiag")
- bin_dest = target_qt_prefix_path if common.is_windows_platform() else os.path.join(target_qt_prefix_path, 'bin')
- qtdiag_src = os.path.join(qt_bin_dir, 'qtdiag.exe' if common.is_windows_platform() else 'qtdiag')
- if not os.path.exists(bin_dest):
- os.makedirs(bin_dest)
- shutil.copy(qtdiag_src, bin_dest)
+ qtdiag_src = os.path.join(qt_install.bin, with_exe_ext('qtdiag'))
+ destdir = (qtc_binary_path if common.is_windows_platform()
+ else os.path.join(qtc_binary_path, 'Contents', 'MacOS') if common.is_mac_platform()
+ else os.path.join(qtc_binary_path, '..', 'lib', 'Qt', 'bin'))
+ if not os.path.exists(destdir):
+ os.makedirs(destdir)
+ shutil.copy(qtdiag_src, destdir)
+ if common.is_mac_platform():
+ # fix RPATHs
+ qtdiag_dest = os.path.join(destdir, 'qtdiag')
+ subprocess.check_call(['xcrun', 'install_name_tool', '-add_rpath', '@loader_path/../Frameworks', qtdiag_dest])
+ subprocess.check_call(['xcrun', 'install_name_tool', '-delete_rpath', '@loader_path/../lib', qtdiag_dest])
def add_qt_conf(target_path, qt_prefix_path):
@@ -336,26 +348,30 @@ def get_qt_install_info(qmake_binary):
def main():
args = get_args()
+ chrpath_bin = None
+ if common.is_linux_platform():
+ chrpath_bin = which('chrpath')
+ if chrpath_bin == None:
+ print("Cannot find required binary 'chrpath'.")
+ sys.exit(2)
+
+ (qt_install_info, qt_install) = get_qt_install_info(args.qmake_binary)
+ # <qtc>/bin for Win/Lin, <path>/<appname>.app for macOS
+ qtcreator_binary_path = (args.qtcreator_binary if common.is_mac_platform()
+ else os.path.dirname(args.qtcreator_binary))
+
+ deploy_qtdiag(qtcreator_binary_path, qt_install)
+
if common.is_mac_platform():
deploy_mac(args)
return
- (qt_install_info, qt_install) = get_qt_install_info(args.qmake_binary)
-
- qtcreator_binary_path = os.path.dirname(args.qtcreator_binary)
install_dir = os.path.abspath(os.path.join(qtcreator_binary_path, '..'))
if common.is_linux_platform():
qt_deploy_prefix = os.path.join(install_dir, 'lib', 'Qt')
else:
qt_deploy_prefix = os.path.join(install_dir, 'bin')
- chrpath_bin = None
- if common.is_linux_platform():
- chrpath_bin = which('chrpath')
- if chrpath_bin == None:
- print("Cannot find required binary 'chrpath'.")
- sys.exit(2)
-
plugins = ['assetimporters', 'accessible', 'codecs', 'designer', 'iconengines', 'imageformats', 'platformthemes',
'platforminputcontexts', 'platforms', 'printsupport', 'qmltooling', 'sqldrivers', 'styles',
'xcbglintegrations',