From a0667e93d039451e80af646faa5008d27b78f85b Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 18 Jul 2015 01:52:51 +0200 Subject: initial version of macosx bundle script --- CMakeLists.txt | 7 +++++++ macosx/make-app-bundle.sh | 35 ++++++++++++++++++++++++++++++++ macosx/opentrack.app/Contents/Info.plist | 26 ++++++++++++++++++++++++ 3 files changed, 68 insertions(+) create mode 100644 macosx/make-app-bundle.sh create mode 100644 macosx/opentrack.app/Contents/Info.plist diff --git a/CMakeLists.txt b/CMakeLists.txt index f8ce4378..1e9fd3c8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -352,6 +352,13 @@ if(SDK_WINE_PREFIX) endif() endif() +if(APPLE) + install(SCRIPT " +execute_process(COMMAND /bin/sh \"\${CMAKE_SOURCE_DIR}/macosx/make-app-bundle.sh\" + \"\${CMAKE_SOURCE_DIR}/macosx\" \"\${CMAKE_INSTALL_PREFIX}\" \"\${CMAKE_BUILD_DIR}\" \"${OPENTRACK__COMMIT}\") +") +endif() + opentrack_library(opentrack-tracker-udp ftnoir_tracker_udp) opentrack_library(opentrack-tracker-freepie-udp ftnoir_tracker_freepie-udp) diff --git a/macosx/make-app-bundle.sh b/macosx/make-app-bundle.sh new file mode 100644 index 00000000..390f7af1 --- /dev/null +++ b/macosx/make-app-bundle.sh @@ -0,0 +1,35 @@ +#!/bin/sh + +APPNAME=opentrack + +dir="$1" +test -n "$dir" || exit 1 +install="$1" +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 + +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 + +rm -rf "$tmp/$APPNAME.iconset" +mkdir "$tmp/$APPNAME.iconset" + +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 +zip -9 "$output_dir/$APPNAME-$version.zip" "$APPNAME.app" || exit 1 +ls -lh "$output_dir/$APPNAME-$version.zip" \ No newline at end of file diff --git a/macosx/opentrack.app/Contents/Info.plist b/macosx/opentrack.app/Contents/Info.plist new file mode 100644 index 00000000..60791ba9 --- /dev/null +++ b/macosx/opentrack.app/Contents/Info.plist @@ -0,0 +1,26 @@ + +!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> + + + CFBundleGetInfoString + @OPENTRACK-VERSION@ + CFBundleExecutable + opentrack.bin + CFBundleIdentifier + com.github.opentrack + CFBundleName + opentrack + CFBundleIconFile + opentrack.icns + CFBundleShortVersionString + 0.01 + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + APPL + IFMajorVersion + 0 + IFMinorVersion + 1 + + \ No newline at end of file -- cgit v1.2.3