diff options
Diffstat (limited to 'macosx/make-app-bundle.sh')
-rwxr-xr-x | macosx/make-app-bundle.sh | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/macosx/make-app-bundle.sh b/macosx/make-app-bundle.sh index 05259702..5181b141 100755 --- a/macosx/make-app-bundle.sh +++ b/macosx/make-app-bundle.sh @@ -1,41 +1,42 @@ #!/bin/sh APPNAME=opentrack +# Alternative we could look at https://github.com/arl/macdeployqtfix ?? -dir="$1" +#macosx directory +dir="$1" test -n "$dir" || exit 1 +# install directory install="$2" test -n "$install" || exit 1 -output_dir="$3" -test -n "$output_dir" || exit 1 -version="$4" +version="$3" test -n "$version" || exit 1 tmp="$(mktemp -d "/tmp/$APPNAME-tmp.XXXXXXX")" test $? -eq 0 || exit 1 -rm -f -- "$install/.DS_Store" -sh "$dir/install-fail-tool" "$install" +# Add framework and other libraries +macdeployqt "$install/$APPNAME.app" -libpath="$install/$APPNAME.app/Contents/MacOS" -cp -R "$dir/opentrack.app" "$tmp/" || exit 1 -cp -R "$install" "$tmp/$APPNAME.app/Contents/MacOS" || exit 1 -sed -i '' -e "s#@OPENTRACK-VERSION@#$version#g" "$tmp/$APPNAME.app/Contents/Info.plist" || exit 1 +# Fixup dylib linker issues +sh "$dir/install-fail-tool" "$install/$APPNAME.app/Contents/Frameworks" -mkdir "$tmp/$APPNAME.iconset" || exit 1 -mkdir "$tmp/$APPNAME.app/Contents/Resources" || exit 1 -cp "$dir"/opentrack.sh "$tmp/$APPNAME.app/Contents/MacOS" || exit 1 +# Copy our own plist and set correct version +cp "$dir/Info.plist" "$install/$APPNAME.app/Contents/" +cp "$dir/PkgInfo" "$install/$APPNAME.app/Contents/" +cp "$dir/opentrack.sh" "$install/$APPNAME.app/Contents/MacOS/" +sed -i '' -e "s#@OPENTRACK-VERSION@#$version#g" "$install/$APPNAME.app/Contents/Info.plist" || exit 1 +# Build iconset +mkdir "$tmp/$APPNAME.iconset" || exit 1 sips -z 16 16 "$dir/../gui/images/opentrack.png" --out "$tmp/$APPNAME.iconset/icon_16x16.png" || exit 1 sips -z 32 32 "$dir/../gui/images/opentrack.png" --out "$tmp/$APPNAME.iconset/icon_16x16@2x.png" || exit 1 sips -z 32 32 "$dir/../gui/images/opentrack.png" --out "$tmp/$APPNAME.iconset/icon_32x32.png" || exit 1 sips -z 64 64 "$dir/../gui/images/opentrack.png" --out "$tmp/$APPNAME.iconset/icon_32x32@2x.png" || exit 1 sips -z 128 128 "$dir/../gui/images/opentrack.png" --out "$tmp/$APPNAME.iconset/icon_128x128.png" || exit 1 - -iconutil -c icns -o "$tmp/$APPNAME.app/Contents/Resources/$APPNAME.icns" "$tmp/$APPNAME.iconset" -rm -r "$tmp/$APPNAME.iconset" - -cd "$tmp" || exit 1 -rm -f "$output_dir/$version-macosx.zip" -zip -9r "$output_dir/$version-macosx.zip" "$APPNAME.app" || exit 1 +iconutil -c icns -o "$install/$APPNAME.app/Contents/Resources/$APPNAME.icns" "$tmp/$APPNAME.iconset" rm -rf "$tmp" -ls -lh "$output_dir/$version-macosx.zip" + +# Zip it up +#zip -9r "$install/$version-macosx.zip" "$APPNAME.app" || exit 1 +#ls -lh "$install/$version-macosx.zip" |