summaryrefslogtreecommitdiff
path: root/os/macosx
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2019-04-07 12:00:36 +0200
committerglx22 <glx22@users.noreply.github.com>2020-06-05 19:36:05 +0200
commitb7643b1d36cb41eb6712042761c13b9819fcbe74 (patch)
tree3bb422ed83832cf197692aef82f142a187a28af6 /os/macosx
parent56d54cf60eb5814f77dfcce91cf12879f01e1d1b (diff)
downloadopenttd-b7643b1d36cb41eb6712042761c13b9819fcbe74.tar.xz
Add: create bundles via CPack
CPack works closely together with CMake to do the right thing in terms of bundling (called 'package'). This generates all the packaging we need, and some more.
Diffstat (limited to 'os/macosx')
-rw-r--r--os/macosx/Info.plist.in33
-rw-r--r--os/macosx/launch.sh8
-rwxr-xr-xos/macosx/plistgen.sh46
3 files changed, 41 insertions, 46 deletions
diff --git a/os/macosx/Info.plist.in b/os/macosx/Info.plist.in
new file mode 100644
index 000000000..b3285589d
--- /dev/null
+++ b/os/macosx/Info.plist.in
@@ -0,0 +1,33 @@
+<?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>English</string>
+ <key>CFBundleDisplayName</key>
+ <string>${CPACK_BUNDLE_NAME}</string>
+ <key>CFBundleExecutable</key>
+ <string>${CPACK_BUNDLE_NAME}</string>
+ <key>CFBundleGetInfoString</key>
+ <string>#CPACK_PACKAGE_VERSION#, Copyright 2004-${CURRENT_YEAR} The OpenTTD team</string>
+ <key>CFBundleIconFile</key>
+ <string>${CPACK_BUNDLE_NAME}.icns</string>
+ <key>CFBundleIdentifier</key>
+ <string>org.openttd.openttd</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${CPACK_BUNDLE_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>#CPACK_PACKAGE_VERSION#</string>
+ <key>CFBundleVersion</key>
+ <string>#CPACK_PACKAGE_VERSION#</string>
+ <key>NSHumanReadableCopyright</key>
+ <string>Copyright 2004-${CURRENT_YEAR} The OpenTTD team</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
diff --git a/os/macosx/launch.sh b/os/macosx/launch.sh
new file mode 100644
index 000000000..7b0389d8a
--- /dev/null
+++ b/os/macosx/launch.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+ROOT_DIR=$(dirname "$0")/..
+
+export DYLD_LIBRARY_PATH=${ROOT_DIR}/Frameworks
+
+cd ${ROOT_DIR}/Resources
+exec ./openttd "$@"
diff --git a/os/macosx/plistgen.sh b/os/macosx/plistgen.sh
deleted file mode 100755
index f492bcdcf..000000000
--- a/os/macosx/plistgen.sh
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/bin/sh
-
-# sets VERSION to the value if RELEASE if there are any,
-# otherwise it sets VERSION to revision number
-if [ "$3" ]; then
-VERSION="$3"
-else
-VERSION="$2"
-fi
-date=`date +%Y`
-
-# Generates Info.plist while applying $VERSION
-
-echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
-<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\"
-\"http://www.apple.com/DTDs/Prop$
-<plist version=\"1.0\">
-<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>English</string>
- <key>CFBundleDisplayName</key>
- <string>OpenTTD</string>
- <key>CFBundleExecutable</key>
- <string>openttd</string>
- <key>CFBundleGetInfoString</key>
- <string>$VERSION, Copyright 2004-$date The OpenTTD team</string>
- <key>CFBundleIconFile</key>
- <string>openttd.icns</string>
- <key>CFBundleIdentifier</key>
- <string>org.openttd.openttd</string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundleName</key>
- <string>OpenTTD</string>
- <key>CFBundlePackageType</key>
- <string>APPL</string>
- <key>CFBundleShortVersionString</key>
- <string>$VERSION</string>
- <key>CFBundleVersion</key>
- <string>$VERSION</string>
- <key>NSHumanReadableCopyright</key>
- <string>Copyright 2004-$date The OpenTTD team</string>
- <key>NSPrincipalClass</key>
- <string>NSApplication</string>
-</dict>
-</plist>" > "$1"/Contents/Info.plist