summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorTim Jenssen <tim.jenssen@qt.io>2023-01-10 18:46:19 +0100
committerTim Jenssen <tim.jenssen@qt.io>2023-01-10 17:48:42 +0000
commit9eb2a7bc5b7da67ef153e8070b08a68b65b57a29 (patch)
tree6393ffd2bab8b3b34ebb48b0d587f68ba457d977 /scripts
parentdf3ace009ac0371610337e8efee0299469b0ef6a (diff)
parentc2788b0f053015f08aa979c93ab920303a28ebd6 (diff)
downloadqt-creator-9eb2a7bc5b7da67ef153e8070b08a68b65b57a29.tar.gz
Merge remote-tracking branch 'origin/9.0' into qds/dev
Change-Id: Ic60cb293d07e7e25716adfbaa2f35e9d25ca148b
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/build_plugin.py22
-rwxr-xr-xscripts/deployqt.py7
-rwxr-xr-xscripts/deployqtHelper_mac.sh3
3 files changed, 30 insertions, 2 deletions
diff --git a/scripts/build_plugin.py b/scripts/build_plugin.py
index 4e142bcd1e..df06908c9d 100755
--- a/scripts/build_plugin.py
+++ b/scripts/build_plugin.py
@@ -39,6 +39,13 @@ def get_arguments():
action='store_true', default=False)
parser.add_argument('--build-type', help='Build type to pass to CMake (defaults to RelWithDebInfo)',
default='RelWithDebInfo')
+ # zipping
+ parser.add_argument('--zip-threads', help='Sets number of threads to use for 7z. Use "+" for turning threads on '
+ 'without a specific number of threads. This is directly passed to the "-mmt" option of 7z.',
+ default='2')
+ # signing
+ parser.add_argument('--keychain-unlock-script',
+ help='Path to script for unlocking the keychain used for signing (macOS)')
args = parser.parse_args()
args.with_debug_info = args.build_type == 'RelWithDebInfo'
return args
@@ -144,6 +151,21 @@ def package(args, paths):
common.check_print_call(['7z', 'a', '-mmt2',
os.path.join(paths.result, args.name + '-debug.7z'), '*'],
paths.debug_install)
+ if common.is_mac_platform() and common.codesign_call():
+ if args.keychain_unlock_script:
+ common.check_print_call([args.keychain_unlock_script], paths.install)
+ if os.environ.get('SIGNING_IDENTITY'):
+ signed_install_path = paths.install + '-signed'
+ common.copytree(paths.install, signed_install_path, symlinks=True)
+ apps = [d for d in os.listdir(signed_install_path) if d.endswith('.app')]
+ if apps:
+ app = apps[0]
+ common.conditional_sign_recursive(os.path.join(signed_install_path, app),
+ lambda ff: ff.endswith('.dylib'))
+ common.check_print_call(['7z', 'a', '-mmt' + args.zip_threads,
+ os.path.join(paths.result, args.name + '-signed.7z'),
+ app],
+ signed_install_path)
def get_paths(args):
Paths = collections.namedtuple('Paths',
diff --git a/scripts/deployqt.py b/scripts/deployqt.py
index 50eb3eb125..05113e43e7 100755
--- a/scripts/deployqt.py
+++ b/scripts/deployqt.py
@@ -110,9 +110,12 @@ def is_ignored_windows_file(use_debug, basepath, filename):
return False
def ignored_qt_lib_files(path, filenames):
+ # Qt ships some unneeded object files in the qml plugins
+ # On Windows we also do not want to ship the wrong debug/release .dlls or .lib files etc
if not common.is_windows_platform():
- return []
- return [fn for fn in filenames if is_ignored_windows_file(debug_build, path, fn)]
+ return [fn for fn in filenames if fn.endswith('.cpp.o')]
+ return [fn for fn in filenames
+ if fn.endswith('.cpp.obj') or is_ignored_windows_file(debug_build, path, fn)]
def copy_qt_libs(target_qt_prefix_path, qt_bin_dir, qt_libs_dir, qt_plugin_dir, qt_qml_dir, plugins):
print("copying Qt libraries...")
diff --git a/scripts/deployqtHelper_mac.sh b/scripts/deployqtHelper_mac.sh
index 4109e6f31d..efcde54bdf 100755
--- a/scripts/deployqtHelper_mac.sh
+++ b/scripts/deployqtHelper_mac.sh
@@ -143,6 +143,9 @@ if [ ! -d "$app_path/Contents/Frameworks/QtCore.framework" ]; then
fi
+# clean up unneeded object files that are part of Qt for some static libraries
+find "$app_path" -ipath "*/objects-*" -delete
+
# clean up after macdeployqt
# it deploys some plugins (and libs for these) that interfere with what we want
echo "Cleaning up after macdeployqt..."