summaryrefslogtreecommitdiffhomepage
path: root/macosx
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-07-19 16:50:41 +0200
committerStanislaw Halik <sthalik@misaki.pl>2015-07-19 16:50:41 +0200
commit4da0c0619cbf052eb87a618aba4c8de79f0d4325 (patch)
treee075b2a2601d6d2f26a8a70fb83cb682cdfb23df /macosx
parentf9b5b72cbcf9f121e0184f9a907bbffd7e1e16a9 (diff)
parenta8165591d993a23ae71ea4e5bb7df7596688ef7b (diff)
Merge branch 'unstable' into trackhat-ui
Diffstat (limited to 'macosx')
-rw-r--r--macosx/install-fail-tool25
-rw-r--r--macosx/make-app-bundle.sh40
-rw-r--r--macosx/opentrack.app/Contents/Info.plist26
-rw-r--r--macosx/opentrack.app/Contents/PkgInfo1
-rwxr-xr-xmacosx/opentrack.sh4
5 files changed, 96 insertions, 0 deletions
diff --git a/macosx/install-fail-tool b/macosx/install-fail-tool
new file mode 100644
index 00000000..a5464c18
--- /dev/null
+++ b/macosx/install-fail-tool
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+test -n "$1" || exit 1
+
+dir="$1"
+
+for i in "$dir"/* "$dir"/*/* "$dir"/*/*/*; do
+ { test -x "$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")"
+ if test -e "$dir/$j"; then
+ install_name_tool -change "$l" "@executable_path/$j" "$i"
+ fi
+ done
+done
diff --git a/macosx/make-app-bundle.sh b/macosx/make-app-bundle.sh
new file mode 100644
index 00000000..f851fe77
--- /dev/null
+++ b/macosx/make-app-bundle.sh
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+APPNAME=trackhat-opentrack
+
+dir="$1"
+test -n "$dir" || exit 1
+install="$2"
+test -n "$install" || exit 1
+output_dir="$3"
+test -n "$output_dir" || exit 1
+version="$4"
+test -n "$version" || exit 1
+
+tmp="$(mktemp -d "/tmp/$APPNAME-tmp.XXXXXXX")"
+test $? -eq 0 || exit 1
+
+sh "$dir/install-fail-tool" "$install"
+
+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
+
+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
+
+sips -z 16 16 "$dir/../facetracknoir/images/facetracknoir.png" --out "$tmp/$APPNAME.iconset/icon_16x16.png" || exit 1
+sips -z 32 32 "$dir/../facetracknoir/images/facetracknoir.png" --out "$tmp/$APPNAME.iconset/icon_16x16@2x.png" || exit 1
+sips -z 32 32 "$dir/../facetracknoir/images/facetracknoir.png" --out "$tmp/$APPNAME.iconset/icon_32x32.png" || exit 1
+sips -z 64 64 "$dir/../facetracknoir/images/facetracknoir.png" --out "$tmp/$APPNAME.iconset/icon_32x32@2x.png" || exit 1
+sips -z 128 128 "$dir/../facetracknoir/images/facetracknoir.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/$APPNAME-$version.zip"
+zip -9r "$output_dir/$APPNAME-$version.zip" "$APPNAME.app" || exit 1
+rm -rf "$tmp"
+ls -lh "$output_dir/$APPNAME-$version.zip"
diff --git a/macosx/opentrack.app/Contents/Info.plist b/macosx/opentrack.app/Contents/Info.plist
new file mode 100644
index 00000000..17e17735
--- /dev/null
+++ b/macosx/opentrack.app/Contents/Info.plist
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleExecutable</key>
+ <string>opentrack.sh</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.github.opentrack.trackhat</string>
+ <key>CFBundleName</key>
+ <string>trackhat-opentrack</string>
+ <key>CFBundleIconFile</key>
+ <string>opentrack.icns</string>
+ <key>CFBundleVersion</key>
+ <string>@OPENTRACK-VERSION@</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleDisplayName</key>
+ <string>trackhat-opentrack</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+</dict>
+</plist>
diff --git a/macosx/opentrack.app/Contents/PkgInfo b/macosx/opentrack.app/Contents/PkgInfo
new file mode 100644
index 00000000..b18f8c6c
--- /dev/null
+++ b/macosx/opentrack.app/Contents/PkgInfo
@@ -0,0 +1 @@
+APPLopentrack
diff --git a/macosx/opentrack.sh b/macosx/opentrack.sh
new file mode 100755
index 00000000..62ad01a5
--- /dev/null
+++ b/macosx/opentrack.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+dir="$(dirname -- "$0")"
+exec "$dir"/opentrack.bin -platformpluginpath "$dir" "$@"