forked from qt-creator/qt-creator
deployqtHelper: Assign names to command line arguments
Change-Id: I3870ce09c399743f30fa81ae3df51f65d47697b4 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -28,111 +28,117 @@
|
|||||||
[ $# -lt 5 ] && echo "Usage: $(basename $0) <app folder> <qt translations folder> <qt plugin folder> <qt quick imports folder> <qt quick 2 imports folder>" && exit 2
|
[ $# -lt 5 ] && echo "Usage: $(basename $0) <app folder> <qt translations folder> <qt plugin folder> <qt quick imports folder> <qt quick 2 imports folder>" && exit 2
|
||||||
[ $(uname -s) != "Darwin" ] && echo "Run this script on Mac OS X" && 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"
|
||||||
|
|
||||||
echo "Deploying Qt"
|
echo "Deploying Qt"
|
||||||
|
|
||||||
# collect designer plugins
|
# collect designer plugins
|
||||||
designerDestDir="$1/Contents/PlugIns/designer"
|
designerDestDir="$app_path/Contents/PlugIns/designer"
|
||||||
if [ ! -d "$designerDestDir" ]; then
|
if [ ! -d "$designerDestDir" ]; then
|
||||||
echo "- Copying designer plugins"
|
echo "- Copying designer plugins"
|
||||||
mkdir -p "$designerDestDir"
|
mkdir -p "$designerDestDir"
|
||||||
for plugin in "$3"/designer/*.dylib; do
|
for plugin in "$plugin_src"/designer/*.dylib; do
|
||||||
cp "$plugin" "$designerDestDir"/ || exit 1
|
cp "$plugin" "$designerDestDir"/ || exit 1
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# copy Qt Quick 1 imports
|
# copy Qt Quick 1 imports
|
||||||
importsDir="$1/Contents/Imports/qtquick1"
|
importsDir="$app_path/Contents/Imports/qtquick1"
|
||||||
if [ -d "$4" ]; then
|
if [ -d "$quick1_src" ]; then
|
||||||
if [ ! -d "$importsDir" ]; then
|
if [ ! -d "$importsDir" ]; then
|
||||||
echo "- Copying Qt Quick 1 imports"
|
echo "- Copying Qt Quick 1 imports"
|
||||||
mkdir -p "$importsDir"
|
mkdir -p "$importsDir"
|
||||||
cp -R "$4"/ "$importsDir"/
|
cp -R "$quick1_src"/ "$importsDir"/
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# copy Qt Quick 2 imports
|
# copy Qt Quick 2 imports
|
||||||
imports2Dir="$1/Contents/Imports/qtquick2"
|
imports2Dir="$app_path/Contents/Imports/qtquick2"
|
||||||
if [ -d "$5" ]; then
|
if [ -d "$quick2_src" ]; then
|
||||||
if [ ! -d "$imports2Dir" ]; then
|
if [ ! -d "$imports2Dir" ]; then
|
||||||
echo "- Copying Qt Quick 2 imports"
|
echo "- Copying Qt Quick 2 imports"
|
||||||
mkdir -p "$imports2Dir"
|
mkdir -p "$imports2Dir"
|
||||||
cp -R "$5"/ "$imports2Dir"/
|
cp -R "$quick2_src"/ "$imports2Dir"/
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# copy qt creator qt.conf
|
# copy qt creator qt.conf
|
||||||
if [ ! -f "$1/Contents/Resources/qt.conf" ]; then
|
if [ ! -f "$app_path/Contents/Resources/qt.conf" ]; then
|
||||||
echo "- Copying qt.conf"
|
echo "- Copying qt.conf"
|
||||||
cp -f "$(dirname "${BASH_SOURCE[0]}")/../dist/installer/mac/qt.conf" "$1/Contents/Resources/qt.conf" || exit 1
|
cp -f "$(dirname "${BASH_SOURCE[0]}")/../dist/installer/mac/qt.conf" "$app_path/Contents/Resources/qt.conf" || exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# copy ios tools' qt.conf
|
# copy ios tools' qt.conf
|
||||||
if [ ! -f "$1/Contents/Resources/ios/qt.conf" ]; then
|
if [ ! -f "$app_path/Contents/Resources/ios/qt.conf" ]; then
|
||||||
echo "- Copying ios/qt.conf"
|
echo "- Copying ios/qt.conf"
|
||||||
cp -f "$(dirname "${BASH_SOURCE[0]}")/../dist/installer/mac/ios_qt.conf" "$1/Contents/Resources/ios/qt.conf" || exit 1
|
cp -f "$(dirname "${BASH_SOURCE[0]}")/../dist/installer/mac/ios_qt.conf" "$app_path/Contents/Resources/ios/qt.conf" || exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# copy qml2puppet's qt.conf
|
# copy qml2puppet's qt.conf
|
||||||
if [ ! -f "$1/Contents/Resources/qmldesigner/qt.conf" ]; then
|
if [ ! -f "$app_path/Contents/Resources/qmldesigner/qt.conf" ]; then
|
||||||
echo "- Copying qmldesigner/qt.conf"
|
echo "- Copying qmldesigner/qt.conf"
|
||||||
cp -f "$(dirname "${BASH_SOURCE[0]}")/../dist/installer/mac/qmldesigner_qt.conf" "$1/Contents/Resources/qmldesigner/qt.conf" || exit 1
|
cp -f "$(dirname "${BASH_SOURCE[0]}")/../dist/installer/mac/qmldesigner_qt.conf" "$app_path/Contents/Resources/qmldesigner/qt.conf" || exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# copy Qt translations
|
# copy Qt translations
|
||||||
# check for known existing translation to avoid copying multiple times
|
# check for known existing translation to avoid copying multiple times
|
||||||
if [ ! -f "$1/Contents/Resources/translations/qt_de.qm" ]; then
|
if [ ! -f "$app_path/Contents/Resources/translations/qt_de.qm" ]; then
|
||||||
echo "- Copying Qt translations"
|
echo "- Copying Qt translations"
|
||||||
cp "$2"/*.qm "$1/Contents/Resources/translations/" || exit 1
|
cp "$translation_src"/*.qm "$app_path/Contents/Resources/translations/" || exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# copy libclang if needed
|
# copy libclang if needed
|
||||||
if [ $LLVM_INSTALL_DIR ]; then
|
if [ $LLVM_INSTALL_DIR ]; then
|
||||||
if [ "$LLVM_INSTALL_DIR"/lib/libclang.dylib -nt "$1/Contents/PlugIns"/libclang.dylib ]; then
|
if [ "$LLVM_INSTALL_DIR"/lib/libclang.dylib -nt "$app_path/Contents/PlugIns"/libclang.dylib ]; then
|
||||||
echo "- Copying libclang"
|
echo "- Copying libclang"
|
||||||
mkdir -p "$1/Contents/Frameworks" || exit 1
|
mkdir -p "$app_path/Contents/Frameworks" || exit 1
|
||||||
# use recursive copy to make it copy symlinks as symlinks
|
# use recursive copy to make it copy symlinks as symlinks
|
||||||
mkdir -p "$1/Contents/Resources/clang/bin"
|
mkdir -p "$app_path/Contents/Resources/clang/bin"
|
||||||
mkdir -p "$1/Contents/Resources/clang/lib"
|
mkdir -p "$app_path/Contents/Resources/clang/lib"
|
||||||
cp -Rf "$LLVM_INSTALL_DIR"/lib/libclang.*dylib "$1/Contents/Frameworks/" || exit 1
|
cp -Rf "$LLVM_INSTALL_DIR"/lib/libclang.*dylib "$app_path/Contents/Frameworks/" || exit 1
|
||||||
cp -Rf "$LLVM_INSTALL_DIR"/lib/clang "$1/Contents/Resources/clang/lib/" || exit 1
|
cp -Rf "$LLVM_INSTALL_DIR"/lib/clang "$app_path/Contents/Resources/clang/lib/" || exit 1
|
||||||
clangsource="$LLVM_INSTALL_DIR"/bin/clang
|
clangsource="$LLVM_INSTALL_DIR"/bin/clang
|
||||||
clanglinktarget="$(readlink "$clangsource")"
|
clanglinktarget="$(readlink "$clangsource")"
|
||||||
cp -Rf "$clangsource" "$1/Contents/Resources/clang/bin/" || exit 1
|
cp -Rf "$clangsource" "$app_path/Contents/Resources/clang/bin/" || exit 1
|
||||||
if [ $clanglinktarget ]; then
|
if [ $clanglinktarget ]; then
|
||||||
cp -Rf "$(dirname "$clangsource")/$clanglinktarget" "$1/Contents/Resources/clang/bin/$clanglinktarget" || exit 1
|
cp -Rf "$(dirname "$clangsource")/$clanglinktarget" "$app_path/Contents/Resources/clang/bin/$clanglinktarget" || exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
_CLANG_CODEMODEL_LIB="$1/Contents/PlugIns/libClangCodeModel_debug.dylib"
|
_CLANG_CODEMODEL_LIB="$app_path/Contents/PlugIns/libClangCodeModel_debug.dylib"
|
||||||
if [ ! -f "$_CLANG_CODEMODEL_LIB" ]; then
|
if [ ! -f "$_CLANG_CODEMODEL_LIB" ]; then
|
||||||
_CLANG_CODEMODEL_LIB="$1/Contents/PlugIns/libClangCodeModel.dylib"
|
_CLANG_CODEMODEL_LIB="$app_path/Contents/PlugIns/libClangCodeModel.dylib"
|
||||||
fi
|
fi
|
||||||
# this will just fail when run a second time on libClangCodeModel
|
# this will just fail when run a second time on libClangCodeModel
|
||||||
xcrun install_name_tool -delete_rpath "$LLVM_INSTALL_DIR/lib" "$_CLANG_CODEMODEL_LIB" || true
|
xcrun install_name_tool -delete_rpath "$LLVM_INSTALL_DIR/lib" "$_CLANG_CODEMODEL_LIB" || true
|
||||||
xcrun install_name_tool -add_rpath "@loader_path/../Frameworks" "$_CLANG_CODEMODEL_LIB" || true
|
xcrun install_name_tool -add_rpath "@loader_path/../Frameworks" "$_CLANG_CODEMODEL_LIB" || true
|
||||||
clangbackendArgument="-executable=$1/Contents/Resources/clangbackend"
|
clangbackendArgument="-executable=$app_path/Contents/Resources/clangbackend"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#### macdeployqt
|
#### macdeployqt
|
||||||
|
|
||||||
if [ ! -d "$1/Contents/Frameworks/QtCore.framework" ]; then
|
if [ ! -d "$app_path/Contents/Frameworks/QtCore.framework" ]; then
|
||||||
|
|
||||||
qml2puppetapp="$1/Contents/Resources/qmldesigner/qml2puppet"
|
qml2puppetapp="$app_path/Contents/Resources/qmldesigner/qml2puppet"
|
||||||
if [ -f "$qml2puppetapp" ]; then
|
if [ -f "$qml2puppetapp" ]; then
|
||||||
qml2puppetArgument="-executable=$qml2puppetapp"
|
qml2puppetArgument="-executable=$qml2puppetapp"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
qbsapp="$1/Contents/MacOS/qbs"
|
qbsapp="$app_path/Contents/MacOS/qbs"
|
||||||
|
|
||||||
echo "- Running macdeployqt ($(which macdeployqt))"
|
echo "- Running macdeployqt ($(which macdeployqt))"
|
||||||
|
|
||||||
macdeployqt "$1" \
|
macdeployqt "$app_path" \
|
||||||
"-executable=$1/Contents/Resources/qtpromaker" \
|
"-executable=$app_path/Contents/Resources/qtpromaker" \
|
||||||
"-executable=$1/Contents/Resources/sdktool" \
|
"-executable=$app_path/Contents/Resources/sdktool" \
|
||||||
"-executable=$1/Contents/Resources/ios/iostool" \
|
"-executable=$app_path/Contents/Resources/ios/iostool" \
|
||||||
"-executable=$1/Contents/Resources/ios/iossim" \
|
"-executable=$app_path/Contents/Resources/ios/iossim" \
|
||||||
"-executable=$1/Contents/Resources/ios/iossim_1_8_2" \
|
"-executable=$app_path/Contents/Resources/ios/iossim_1_8_2" \
|
||||||
"-executable=$1/Contents/Resources/buildoutputparser" \
|
"-executable=$app_path/Contents/Resources/buildoutputparser" \
|
||||||
"-executable=$1/Contents/Resources/cpaster" \
|
"-executable=$app_path/Contents/Resources/cpaster" \
|
||||||
"-executable=$qbsapp" \
|
"-executable=$qbsapp" \
|
||||||
"-executable=$qbsapp-config" \
|
"-executable=$qbsapp-config" \
|
||||||
"-executable=$qbsapp-config-ui" \
|
"-executable=$qbsapp-config-ui" \
|
||||||
|
Reference in New Issue
Block a user