diff --git a/BUILDING.md b/BUILDING.md index 3f5ca7dba..2b66a66b4 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -44,13 +44,13 @@ Linux / Unix MAC OS X ---------------------------------------------------------------------------------- - You need to have Xcode from the Apple App Store installed in Applications, [Command Line Tools for the same Xcode version](https://developer.apple.com/), + You need to have Xcode from the Apple App Store installed in Applications, [Command Line Tools for the same Xcode version](https://developer.apple.com/) may be included depending on the version, [Homebrew](http://brew.sh/), and `$ brew install openssl` for openssl. Next compulsory requirement is Qt 5 (>= 5.7) with QtWebEngine. - After successful compilation, you need to run macdeploy.sh script to correctly - build the application bundle. You will do it with following command: + After successful compilation, you need to build the application bundle and follow any + instructions that may be presented. You will do it with following command: - $ ./mac/macdeploy.sh + $ ./mac/macdeploy.sh [] You need to specify path to macdeployqt (usually in QTDIR/bin/macdeployqt) only if it is not in PATH. diff --git a/mac/macdeploy.sh b/mac/macdeploy.sh index 6d86eb41d..89596d7fd 100755 --- a/mac/macdeploy.sh +++ b/mac/macdeploy.sh @@ -7,6 +7,8 @@ MACDEPLOYQT="macdeployqt" LIBRARY_NAME="libQupZilla.2.dylib" +PLUGINS="QupZilla.app/Contents/Resources/plugins" +QTPLUGINS="QupZilla.app/Contents/PlugIns" if [ -n "$1" ]; then MACDEPLOYQT=$1 @@ -19,23 +21,52 @@ cd bin # copy libQupZilla into bundle cp $LIBRARY_NAME QupZilla.app/Contents/MacOS/ -# copy all plugins into bundle -test -d QupZilla.app/Contents/Resources/plugins || mkdir QupZilla.app/Contents/Resources/plugins -cp plugins/*.dylib QupZilla.app/Contents/Resources/plugins/ +# copy all QupZilla plugins into bundle +test -d $PLUGINS || mkdir $PLUGINS +cp plugins/*.dylib $PLUGINS/ # fix libQupZilla install_name_tool -change $LIBRARY_NAME @executable_path/$LIBRARY_NAME QupZilla.app/Contents/MacOS/QupZilla # fix plugins -for plugin in QupZilla.app/Contents/Resources/plugins/*.dylib +for plugin in $PLUGINS/*.dylib do install_name_tool -change $LIBRARY_NAME @executable_path/$LIBRARY_NAME $plugin done +# prompt and optionally copy additional Qt native plugin(s) into bundle +echo -n "Do you wish to redistribute known, missing, Qt Library plugins (y/n)? " +old_stty_cfg=$(stty -g) +stty raw -echo +answer=$( while ! head -c 1 | grep -i '[yn]'; do true; done ) +stty $old_stty_cfg +if echo "$answer" | grep -iq "^y"; then + if [ -z ${QTDIR+x} ]; then + printf '\nPlease set the environment variable for the Qt platform folder.\n\texample:\n\t$ export QTDIR="$HOME/Qt/5.7/clang_64"\n' + exit 1 + else + printf '\nCopying known, missing, Qt native library plugins to target bundle...\n' + + mkdir -p $QTPLUGINS + + FILE="$QTDIR/plugins/iconengines/libqsvgicon.dylib" + if [ -f "$FILE" ]; then + cp $FILE $QTPLUGINS/ + else + echo "$FILE: No such file" + exit 1 + fi + + fi +else + printf '\nChecking for prior deploy image Qt native library plugins at target bundle...\n' + + rm -Rf $QTPLUGINS +fi + # run macdeployqt $MACDEPLOYQT QupZilla.app # create final dmg image cd ../mac ./create_dmg.sh -