diff options
| author | R. van Twisk <ries.van.twisk@ing.com> | 2019-12-19 21:07:19 +0100 | 
|---|---|---|
| committer | R. van Twisk <ries.van.twisk@ing.com> | 2019-12-19 21:07:19 +0100 | 
| commit | 96316119fd57b1d5acdfc0ff51e1766a9311f11f (patch) | |
| tree | d4f82397cbfc4427b39901023cc350ac9673965f /macosx | |
| parent | 8d29288ecd592bae5b0bc2951cd44c7400e36654 (diff) | |
Fix bundle creation OSX
Diffstat (limited to 'macosx')
| -rw-r--r-- | macosx/CMakeLists.txt | 6 | ||||
| -rw-r--r-- | macosx/Info.plist (renamed from macosx/opentrack.app/Contents/Info.plist) | 4 | ||||
| -rw-r--r-- | macosx/PkgInfo | 1 | ||||
| -rwxr-xr-x | macosx/install-fail-tool | 10 | ||||
| -rwxr-xr-x | macosx/make-app-bundle.sh | 41 | ||||
| -rw-r--r-- | macosx/opentrack.app/Contents/PkgInfo | 1 | ||||
| -rwxr-xr-x | macosx/opentrack.sh | 2 | 
7 files changed, 34 insertions, 31 deletions
diff --git a/macosx/CMakeLists.txt b/macosx/CMakeLists.txt index 89901251..8520e9e9 100644 --- a/macosx/CMakeLists.txt +++ b/macosx/CMakeLists.txt @@ -1,13 +1,11 @@  if(APPLE)      otr_escape_string(srcdir "${CMAKE_SOURCE_DIR}") -    otr_escape_string(bindir "${CMAKE_BINARY_DIR}")      otr_escape_string(instdir "${CMAKE_INSTALL_PREFIX}")      otr_escape_string(commit "${OPENTRACK_COMMIT}")      install(CODE " -        execute_process(COMMAND /bin/sh \"${srcdir}/macosx/make-app-bundle.sh\" +       execute_process(COMMAND /bin/sh \"${srcdir}/macosx/make-app-bundle.sh\"                                          \"${srcdir}/macosx\"                                          \"${instdir}\" -                                        \"${bindir}\" -                                        \"${commit}\") +                                       \"${commit}\")      ")  endif() diff --git a/macosx/opentrack.app/Contents/Info.plist b/macosx/Info.plist index 41ca402a..38b8e0e7 100644 --- a/macosx/opentrack.app/Contents/Info.plist +++ b/macosx/Info.plist @@ -22,5 +22,9 @@    <string>opentrack</string>    <key>CFBundleSignature</key>    <string>????</string> +  <key>NSPrincipalClass</key> +  <string>NSApplication</string> +  <key>NSHighResolutionCapable</key> +  <string>True</string>  </dict>  </plist> diff --git a/macosx/PkgInfo b/macosx/PkgInfo new file mode 100644 index 00000000..6f749b0f --- /dev/null +++ b/macosx/PkgInfo @@ -0,0 +1 @@ +APPL???? diff --git a/macosx/install-fail-tool b/macosx/install-fail-tool index a5464c18..16284562 100755 --- a/macosx/install-fail-tool +++ b/macosx/install-fail-tool @@ -4,22 +4,22 @@ test -n "$1" || exit 1  dir="$1" -for i in "$dir"/* "$dir"/*/* "$dir"/*/*/*; do -        { test -x "$i" && test -f "$i"; } || continue +for i in "$dir"/*; do +	echo $i +        { test -f "$i"; } || continue          case "$i" in              *.dll|*.exe) continue ;;              *) : ;;          esac -        case "$i" in -            *.dylib|*.bin) strip -x "$i" ;; esac          echo ---- $i ----          install_name_tool -id "@executable_path/$(echo "$i" | sed -e "s,^$dir/,,")" "$i"          otool -L "$i" | awk '{ print $1 }' |          while read l; do                  j="$(basename -- "$l")" +                echo === $j ===                  if test -e "$dir/$j"; then -                        install_name_tool -change "$l" "@executable_path/$j" "$i" +                        install_name_tool -change "$l" "@rpath/$j" "$i"                  fi          done  done 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" diff --git a/macosx/opentrack.app/Contents/PkgInfo b/macosx/opentrack.app/Contents/PkgInfo deleted file mode 100644 index b18f8c6c..00000000 --- a/macosx/opentrack.app/Contents/PkgInfo +++ /dev/null @@ -1 +0,0 @@ -APPLopentrack diff --git a/macosx/opentrack.sh b/macosx/opentrack.sh index 74a911e2..788afe96 100755 --- a/macosx/opentrack.sh +++ b/macosx/opentrack.sh @@ -1,6 +1,6 @@  #!/bin/sh  cd -- "$(dirname -- "$0")" && -exec ./opentrack.bin -platformpluginpath "$(pwd)" "$@" +exec ./opentrack -platformpluginpath "$(pwd)" "$@"  exit 1  | 
