Merge pull request #7933 from pchote/new-osx-launcher

New OSX launcher
This commit is contained in:
Matthias Mailänder
2015-04-25 12:41:28 +02:00
11 changed files with 21 additions and 116 deletions

7
configure vendored
View File

@@ -22,6 +22,9 @@ if [ "$os" == 'Linux' ]; then
echo "Eluant.dll.config has been created successfully."
fi
elif [ "$os" == 'Darwin' ]; then
cp thirdparty/osx/* .
echo "Copied Lua 5.1 and SDL2 libraries successfully."
echo "Downloading pre-compiled lua and SDL2 libraries"
curl -O https://raw.githubusercontent.com/OpenRA/OpenRALauncherOSX/master/dependencies/Eluant.dll.config
curl -O https://github.com/OpenRA/OpenRALauncherOSX/raw/master/dependencies/liblua.5.1.dylib
curl -O https://github.com/OpenRA/OpenRALauncherOSX/raw/master/dependencies/libSDL2.dylib
echo "Downloaded Lua 5.1 and SDL2 libraries successfully."
fi

View File

@@ -1,8 +1,10 @@
#!/bin/bash
# OpenRA packaging script for Mac OSX
if [ $# -ne "4" ]; then
echo "Usage: `basename $0` tag files-dir platform-files-dir outputdir"
LAUNCHER_TAG="osx-launcher-20150412"
if [ $# -ne "3" ]; then
echo "Usage: `basename $0` tag files-dir outputdir"
exit 1
fi
@@ -12,9 +14,12 @@ if [ -e "OpenRA.app" ]; then
exit 2
fi
wget https://github.com/OpenRA/OpenRALauncherOSX/releases/download/${LAUNCHER_TAG}/launcher.zip || exit 3
unzip launcher.zip
rm launcher.zip
# Copy the template to build the game package
cp -rv template.app OpenRA.app
cp -rv $2/* $3/* "OpenRA.app/Contents/Resources/" || exit 3
cp -rv $2/* "OpenRA.app/Contents/Resources/" || exit 3
# Remove unused icon
rm OpenRA.app/Contents/Resources/OpenRA.ico
@@ -23,14 +28,14 @@ rm OpenRA.app/Contents/Resources/OpenRA.ico
rm OpenRA.app/Contents/Resources/OpenRA.exe
rm OpenRA.app/Contents/Resources/OpenRA.Editor.exe
# Set version string
sed "s/{DEV_VERSION}/${1}/" OpenRA.app/Contents/Info.plist.template > OpenRA.app/Contents/Info.plist
rm OpenRA.app/Contents/Info.plist.template
# Remove linux cruft
rm Eluant.dll.config.in
# Add a symlink to libgdiplus.dylib to work around an issue in mono 3.8
ln -s /Library/Frameworks/Mono.framework/Versions/Current/lib/libgdiplus.dylib OpenRA.app/Contents/Resources/libgdiplus.dylib
# Set version string
sed "s/{DEV_VERSION}/${1}/" OpenRA.app/Contents/Info.plist > OpenRA.app/Contents/Info.plist.tmp
mv OpenRA.app/Contents/Info.plist.tmp OpenRA.app/Contents/Info.plist
# Package app bundle into a zip and clean up
zip OpenRA-$1 -r -9 OpenRA.app --quiet --symlinks
mv OpenRA-$1.zip $4
mv OpenRA-$1.zip $3
rm -rf OpenRA.app

View File

@@ -1,34 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//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>OpenRA</string>
<key>CFBundleExecutable</key>
<string>OpenRA</string>
<key>CFBundleIconFile</key>
<string>OpenRA.icns</string>
<key>CFBundleIdentifier</key>
<string>net.openra.launcher</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>OpenRA</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>{DEV_VERSION}</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>{DEV_VERSION}</string>
<key>LSMinimumSystemVersion</key>
<string>10.5</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>

View File

@@ -1,61 +0,0 @@
#!/bin/bash
# OpenRA OSX launcher script
# Checks for a sufficiently recent mono version, then launches the game from the resources directory.
# Based on code from the monodevelop project
REQUIRED_MAJOR=3
REQUIRED_MINOR=2
# Require a framework build of mono.
# The game files assume that mono-installed libraries are present in /Library/Frameworks/Mono.framework/Libraries
MONO_BIN="/Library/Frameworks/Mono.framework/Commands/mono"
TITLE="Cannot launch OpenRA"
MESSAGE="OpenRA requires Mono $REQUIRED_MAJOR.$REQUIRED_MINOR or later. Please install the Mono MRE package and try again."
MONO_URL="http://www.mono-project.com/download/"
CRASH_TITLE="Fatal Error"
CRASH_MESSAGE="OpenRA has encountered a fatal error.\nRefer to the crash logs and FAQ for more information."
FAQ_URL="http://wiki.openra.net/FAQ"
DIR=$(cd "$(dirname "$0")"; pwd)
RESOURCES="$DIR/../Resources"
MONO_VERSION="$($MONO_BIN --version | grep 'Mono JIT compiler version ' | cut -f5 -d\ )"
MONO_VERSION_MAJOR="$(echo $MONO_VERSION | cut -f1 -d.)"
MONO_VERSION_MINOR="$(echo $MONO_VERSION | cut -f2 -d.)"
if [ -z "$MONO_VERSION" ] \
|| [ $MONO_VERSION_MAJOR -lt $REQUIRED_MAJOR ] \
|| [ $MONO_VERSION_MAJOR -eq $REQUIRED_MAJOR -a $MONO_VERSION_MINOR -lt $REQUIRED_MINOR ]
then
osascript \
-e "tell application \"Finder\"" \
-e " set question to display dialog \"$MESSAGE\" with title \"$TITLE\" with icon alias (POSIX file \"$RESOURCES/OpenRA.icns\") buttons {\"Quit\", \"Download Mono\"} default button 2" \
-e " if button returned of question is equal to \"Download Mono\" then open location \"$MONO_URL\"" \
-e " activate" \
-e "end tell"
exit 1
fi
# Override fontconfig with our own dummy config that prevents long cache delays
cd "$RESOURCES" && FONTCONFIG_PATH="." $MONO_BIN --debug OpenRA.Game.exe Graphics.Renderer=Sdl2
# Display an error dialog on game crash
if [ $? != 0 -a $? != 1 ]
then
osascript \
-e "set logsPath to ((path to application support folder from user domain) as text) & \"OpenRA:Logs:\"" \
-e "log logsPath" \
-e "tell application \"Finder\"" \
-e " repeat" \
-e " set question to display dialog \"$CRASH_MESSAGE\" with title \"$CRASH_TITLE\" with icon alias (POSIX file \"$RESOURCES/OpenRA.icns\") buttons {\"View Logs\", \"View FAQ\", \"Quit\"} default button 3" \
-e " if button returned of question is equal to \"View Logs\" then open logsPath" \
-e " if button returned of question is equal to \"View FAQ\" then open location \"$FAQ_URL\"" \
-e " if button returned of question is equal to \"Quit\" then exit repeat" \
-e " if button returned of question is equal to \"Download Mono\" then open location \"$MONO_URL\"" \
-e " activate" \
-e " end repeat" \
-e "end tell"
exit 1
fi

View File

@@ -1 +0,0 @@
APPL????

View File

@@ -1,4 +0,0 @@
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- dummy fonts.conf file that removed unwanted system overhead -->
<fontconfig/>

View File

@@ -95,7 +95,7 @@ fi
pushd osx
echo "Zipping OS X package"
bash buildpackage.sh "$TAG" "$BUILTDIR" "${SRCDIR}/thirdparty/osx" "$OUTPUTDIR"
bash buildpackage.sh "$TAG" "$BUILTDIR" "$OUTPUTDIR"
if [ $? -ne 0 ]; then
echo "OS X package build failed."
fi

View File

@@ -1,3 +0,0 @@
<configuration>
<dllmap os="osx" dll="lua51.dll" target="liblua.5.1.dylib" />
</configuration>

Binary file not shown.

Binary file not shown.