diff --git a/dist/installer/mac/qt.conf b/dist/installer/mac/qt.conf index 8083c02061be7873e368601aba778a950ddd1f55..4b04103c9a6083635da2be135ad944d389954a56 100644 --- a/dist/installer/mac/qt.conf +++ b/dist/installer/mac/qt.conf @@ -1,4 +1,5 @@ [Paths] +Binaries = MacOS Imports = Imports/qtquick1 Qml2Imports = Imports/qtquick2 Plugins = PlugIns diff --git a/qtcreator.pro b/qtcreator.pro index 1292836db248c4e599989c3a4a5cd3bbdb8bee24..b71317061b38970269b2e4c7a5ea9866db99056f 100644 --- a/qtcreator.pro +++ b/qtcreator.pro @@ -97,7 +97,7 @@ macx { APPBUNDLE = "$$OUT_PWD/bin/Qt Creator.app" BINDIST_SOURCE = "$$OUT_PWD/bin/Qt Creator.app" BINDIST_INSTALLER_SOURCE = $$BINDIST_SOURCE - deployqt.commands = $$PWD/scripts/deployqtHelper_mac.sh \"$${APPBUNDLE}\" \"$$[QT_INSTALL_TRANSLATIONS]\" \"$$[QT_INSTALL_PLUGINS]\" \"$$[QT_INSTALL_IMPORTS]\" \"$$[QT_INSTALL_QML]\" + deployqt.commands = $$PWD/scripts/deployqtHelper_mac.sh \"$${APPBUNDLE}\" \"$$[QT_INSTALL_BINS]\" \"$$[QT_INSTALL_TRANSLATIONS]\" \"$$[QT_INSTALL_PLUGINS]\" \"$$[QT_INSTALL_IMPORTS]\" \"$$[QT_INSTALL_QML]\" codesign.commands = codesign --deep -s \"$(SIGNING_IDENTITY)\" $(SIGNING_FLAGS) \"$${APPBUNDLE}\" dmg.commands = $$PWD/scripts/makedmg.sh $$OUT_PWD/bin $${BASENAME}.dmg #dmg.depends = deployqt diff --git a/scripts/deployqt.py b/scripts/deployqt.py index 11ff8c013b9be7122d5640e52e8e0be1e77c73a0..d2c2e7abac3eb61f85f83b9500939bdcebace7e0 100755 --- a/scripts/deployqt.py +++ b/scripts/deployqt.py @@ -107,7 +107,7 @@ def ignored_qt_lib_files(path, filenames): return [] return [fn for fn in filenames if is_ignored_windows_file(debug_build, path, fn)] -def copy_qt_libs(target_qt_prefix_path, qt_libs_dir, qt_plugin_dir, qt_import_dir, qt_qml_dir, plugins, imports): +def copy_qt_libs(target_qt_prefix_path, qt_bin_dir, qt_libs_dir, qt_plugin_dir, qt_import_dir, qt_qml_dir, plugins, imports): print "copying Qt libraries..." if common.is_windows_platform(): @@ -165,6 +165,14 @@ def copy_qt_libs(target_qt_prefix_path, qt_libs_dir, qt_plugin_dir, qt_import_di print('{0} -> {1}'.format(qt_qml_dir, target)) common.copytree(qt_qml_dir, target, ignore=ignored_qt_lib_files, symlinks=True) + 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) + + def add_qt_conf(target_path, qt_prefix_path): qtconf_filepath = os.path.join(target_path, 'qt.conf') prefix_path = os.path.relpath(qt_prefix_path, target_path).replace('\\', '/') @@ -172,6 +180,7 @@ def add_qt_conf(target_path, qt_prefix_path): f = open(qtconf_filepath, 'w') f.write('[Paths]\n') f.write('Prefix={0}\n'.format(prefix_path)) + f.write('Binaries={0}\n'.format('bin' if common.is_linux_platform() else '.')) f.write('Libraries={0}\n'.format('lib' if common.is_linux_platform() else '.')) f.write('Plugins=plugins\n') f.write('Imports=imports\n') @@ -306,9 +315,9 @@ def main(): debug_build = is_debug_build(install_dir) if common.is_windows_platform(): - copy_qt_libs(qt_deploy_prefix, QT_INSTALL_BINS, QT_INSTALL_PLUGINS, QT_INSTALL_IMPORTS, QT_INSTALL_QML, plugins, imports) + copy_qt_libs(qt_deploy_prefix, QT_INSTALL_BINS, QT_INSTALL_BINS, QT_INSTALL_PLUGINS, QT_INSTALL_IMPORTS, QT_INSTALL_QML, plugins, imports) else: - copy_qt_libs(qt_deploy_prefix, QT_INSTALL_LIBS, QT_INSTALL_PLUGINS, QT_INSTALL_IMPORTS, QT_INSTALL_QML, plugins, imports) + copy_qt_libs(qt_deploy_prefix, QT_INSTALL_BINS, QT_INSTALL_LIBS, QT_INSTALL_PLUGINS, QT_INSTALL_IMPORTS, QT_INSTALL_QML, plugins, imports) copy_translations(install_dir, QT_INSTALL_TRANSLATIONS) if "LLVM_INSTALL_DIR" in os.environ: deploy_libclang(install_dir, os.environ["LLVM_INSTALL_DIR"], chrpath_bin) @@ -317,6 +326,7 @@ def main(): print "fixing rpaths..." common.fix_rpaths(install_dir, os.path.join(qt_deploy_prefix, 'lib'), qt_install_info, chrpath_bin) add_qt_conf(os.path.join(install_dir, 'libexec', 'qtcreator'), qt_deploy_prefix) # e.g. for qml2puppet + add_qt_conf(os.path.join(qt_deploy_prefix, 'bin'), qt_deploy_prefix) # e.g. qtdiag add_qt_conf(os.path.join(install_dir, 'bin'), qt_deploy_prefix) if __name__ == "__main__": diff --git a/scripts/deployqtHelper_mac.sh b/scripts/deployqtHelper_mac.sh index d78758145c1b99fbc16aab3d93d6a2eeb4535a5c..ca91e8dac27ce4ed02f99e3e6c901414bce17bd2 100755 --- a/scripts/deployqtHelper_mac.sh +++ b/scripts/deployqtHelper_mac.sh @@ -25,17 +25,26 @@ # ############################################################################ -[ $# -lt 5 ] && echo "Usage: $(basename $0) " && exit 2 +[ $# -lt 5 ] && echo "Usage: $(basename $0) " && exit 2 [ $(uname -s) != "Darwin" ] && echo "Run this script on Mac OS X" && exit 2; app_path="$1" -translation_src="$2" -plugin_src="$3" -quick1_src="$4" -quick2_src="$5" +bin_src="$2" +translation_src="$3" +plugin_src="$4" +quick1_src="$5" +quick2_src="$6" echo "Deploying Qt" +# copy qtdiag +echo "- Copying qtdiag" +cp "$bin_src/qtdiag" "$app_path/Contents/MacOS/" || exit 1 +# fix rpath if qtdiag was from binary Qt package +( xcrun install_name_tool -delete_rpath "@loader_path/../lib" "$app_path/Contents/MacOS/qtdiag" && + xcrun install_name_tool -add_rpath "@loader_path/../Frameworks" "$app_path/Contents/MacOS/qtdiag" ) || true + + # collect designer plugins designerDestDir="$app_path/Contents/PlugIns/designer" if [ ! -d "$designerDestDir" ]; then @@ -139,6 +148,7 @@ if [ ! -d "$app_path/Contents/Frameworks/QtCore.framework" ]; then "-executable=$app_path/Contents/Resources/ios/iossim_1_8_2" \ "-executable=$app_path/Contents/Resources/buildoutputparser" \ "-executable=$app_path/Contents/Resources/cpaster" \ + "-executable=$app_path/Contents/MacOS/qtdiag" \ "-executable=$qbsapp" \ "-executable=$qbsapp-config" \ "-executable=$qbsapp-config-ui" \