Commit 3c2ec64d authored by Eike Ziller's avatar Eike Ziller
Browse files

OS X: deployqtHelper: never deploy anyting twice



There are targets that have a "depends" on "deployqt",
and since the Makefile doesn't know any specifics, the deployqtHelper
script is run twice when calling e.g.
make deployqt
make codesign
make dmg

That results in the "make dmg" calling the helper script again, which
overwrites for example the previously signed designer plugins with
the unsigned original again, leading to code signature verification
failure. This became only apparent since OS X 10.9 changed to always
do deep verification of signatures.

Change-Id: I36ec6de1a7d184800c59a3db47e01afedc0e6879
Reviewed-by: default avatarEike Ziller <eike.ziller@theqtcompany.com>
parent 2c669e2a
......@@ -2,53 +2,56 @@
[ $# -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;
echo "Deploying Qt"
# collect designer plugins
designerDestDir="$1/Contents/PlugIns/designer"
test -d "$designerDestDir" || mkdir -p "$designerDestDir"
for plugin in "$3"/designer/*.dylib; do
cp "$plugin" "$designerDestDir"/ || exit 1
done
if [ ! -d "$designerDestDir" ]; then
echo "- Copying designer plugins"
mkdir -p "$designerDestDir"
for plugin in "$3"/designer/*.dylib; do
cp "$plugin" "$designerDestDir"/ || exit 1
done
fi
# copy Qt Quick 1 imports
importsDir="$1/Contents/Imports/qtquick1"
if [ -d "$4" ]; then
test -d "$importsDir" || mkdir -p "$importsDir"
cp -R "$4"/ "$importsDir"/
if [ ! -d "$importsDir" ]; then
echo "- Copying Qt Quick 1 imports"
mkdir -p "$importsDir"
cp -R "$4"/ "$importsDir"/
fi
fi
# copy Qt Quick 2 imports
imports2Dir="$1/Contents/Imports/qtquick2"
if [ -d "$5" ]; then
test -d "$imports2Dir" || mkdir -p "$imports2Dir"
cp -R "$5"/ "$imports2Dir"/
fi
qmlpuppetapp="$1/Contents/MacOS/qmlpuppet"
if [ -f "$qmlpuppetapp" ]; then
qmlpuppetArgument="-executable=$qmlpuppetapp"
fi
qml2puppetapp="$1/Contents/MacOS/qml2puppet"
if [ -f "$qml2puppetapp" ]; then
qml2puppetArgument="-executable=$qml2puppetapp"
if [ ! -d "$imports2Dir" ]; then
echo "- Copying Qt Quick 2 imports"
mkdir -p "$imports2Dir"
cp -R "$5"/ "$imports2Dir"/
fi
fi
macdeployqt "$1" \
"-executable=$1/Contents/Resources/qtpromaker" \
"-executable=$1/Contents/Resources/sdktool" \
"-executable=$1/Contents/Resources/ios/iostool" \
"-executable=$1/Contents/Resources/ios/iossim" \
"-executable=$1/Contents/Resources/ios/iossim_1_8_2" \
"$qmlpuppetArgument" "$qml2puppetArgument" || exit 1
# copy qt creator qt.conf
cp -f "$(dirname "${BASH_SOURCE[0]}")/../dist/installer/mac/qt.conf" "$1/Contents/Resources/qt.conf" || exit 1
if [ ! -f "$1/Contents/Resources/qt.conf" ]; then
echo "- Copying qt.conf"
cp -f "$(dirname "${BASH_SOURCE[0]}")/../dist/installer/mac/qt.conf" "$1/Contents/Resources/qt.conf" || exit 1
fi
# copy ios tools' qt.conf
cp -f "$(dirname "${BASH_SOURCE[0]}")/../dist/installer/mac/ios_qt.conf" "$1/Contents/Resources/ios/qt.conf" || exit 1
if [ ! -f "$1/Contents/Resources/ios/qt.conf" ]; then
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
fi
# copy Qt translations
cp "$2"/*.qm "$1/Contents/Resources/translations/" || exit 1
# check for known existing translation to avoid copying multiple times
if [ ! -f "$1/Contents/Resources/translations/qt_de.qm" ]; then
echo "- Copying Qt translations"
cp "$2"/*.qm "$1/Contents/Resources/translations/" || exit 1
fi
# copy libclang if needed
if [ $LLVM_INSTALL_DIR ]; then
......@@ -60,6 +63,28 @@ if [ $LLVM_INSTALL_DIR ]; then
if [ ! -f "$_CLANG_CODEMODEL_LIB" ]; then
_CLANG_CODEMODEL_LIB="$1/Contents/PlugIns/libClangCodeModel.dylib"
fi
# this will just fail when run a second time on libClangCodeModel
xcrun install_name_tool -rpath "$LLVM_INSTALL_DIR/lib" "@loader_path/" "$_CLANG_CODEMODEL_LIB" || true
fi
#### macdeployqt
qmlpuppetapp="$1/Contents/MacOS/qmlpuppet"
if [ -f "$qmlpuppetapp" ]; then
qmlpuppetArgument="-executable=$qmlpuppetapp"
fi
qml2puppetapp="$1/Contents/MacOS/qml2puppet"
if [ -f "$qml2puppetapp" ]; then
qml2puppetArgument="-executable=$qml2puppetapp"
fi
echo "- Running macdeployqt"
macdeployqt "$1" \
"-executable=$1/Contents/Resources/qtpromaker" \
"-executable=$1/Contents/Resources/sdktool" \
"-executable=$1/Contents/Resources/ios/iostool" \
"-executable=$1/Contents/Resources/ios/iossim" \
"-executable=$1/Contents/Resources/ios/iossim_1_8_2" \
"$qmlpuppetArgument" "$qml2puppetArgument" || exit 1
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment