Finish the osx packaging script

This commit is contained in:
pchote
2010-02-19 21:59:04 +13:00
parent 2d71d71b92
commit bdec6a0596
5 changed files with 27 additions and 13 deletions

View File

@@ -88,4 +88,7 @@ server: $(server_TARGET)
seqed: $(seqed_TARGET)
all: $(fileformats_TARGET) $(gl_TARGET) $(game_TARGET) $(ra_TARGET) $(cnc_TARGET) $(aftermath_TARGET) $(server_TARGET) $(seqed_TARGET)
dist-osx:
packaging/osx/package.sh
.DEFAULT: all

View File

@@ -1,4 +1,8 @@
#!/bin/sh
# Application-launcher for OpenRA.
# Executes the game binary inside the ../Resources directory with the correct working directory
# Based on the file generated by the mono mkbundle utility
APP_PATH=`echo $0 | awk '{split($0,patharr,"/"); idx=1; while(patharr[idx+3] != "") { if (patharr[idx] != "/") {printf("%s/", patharr[idx]); idx++ }} }'`
cd "$APP_PATH/Contents/Resources"
./OpenRA

View File

@@ -1,21 +1,28 @@
#!/bin/sh
# OpenRA Packaging script for osx
# Creates a .app bundle for OpenRA game, and a command line app for OpenRa server
# Statically links all custom dlls into the executable, but requires the Mono and
# Cg frameworks installed on the target machine for these binaries to run
# Set the required environment variables
# List of game files to copy into the app bundle
# TODO: This will be significantly shorter once we move the ra files into its mod dir
GAME_FILES="OpenRA allies.mix conquer.mix expand2.mix general.mix hires.mix interior.mix redalert.mix russian.mix snow.mix sounds.mix temperat.mix line.fx chrome-shp.fx chrome-rgba.fx bogus.SNO bogus.TEM world-shp.fx tileSet.til templates.ini mods maps packaging/osx/settings.ini"
# List of system files to copy into the app bundle
# TODO: Sort out whats going on with libglfw so we don't need to do this
SYSTEM_FILES=libglfw.dylib
# Force 32-bit build and set the pkg-config path for mono.pc
export AS="as -arch i386"
export CC="gcc -arch i386"
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/Library/Frameworks/Mono.framework/Versions/Current/lib/pkgconfig/
# Package a command-line binary for the server
mkbundle --deps -o OpenRA_Server OpenRA.Server.exe OpenRa.FileFormats.dll
# Package the server binary
mkbundle --deps --static -o openra_server OpenRA.Server.exe OpenRa.FileFormats.dll
# Create the app bundle for the game
macpack -mode:winforms -n OpenRA -r OpenRa.FileFormats.dll,OpenRa.Gl.dll,libglfw.dylib,thirdparty/Tao/Tao.Glfw.dll,thirdparty/Tao/Tao.Cg.dll,thirdparty/Tao/Tao.OpenGl.dll,thirdparty/Tao/Tao.OpenAl.dll,allies.mix,conquer.mix,expand2.mix,general.mix,hires.mix,interior.mix,redalert.mix,russian.mix,snow.mix,sounds.mix,temperat.mix,packaging/osx/settings.ini,line.fx,chrome-shp.fx,chrome-rgba.fx,bogus.sno,bogus.tem,world-shp.fx,tileSet.til,templates.ini,packaging/osx/OpenRa.icns,mods,maps OpenRa.Game.exe
# Package the game binary
mkbundle --deps --static -o OpenRA OpenRa.Game.exe OpenRa.FileFormats.dll thirdparty/Tao/Tao.Glfw.dll thirdparty/Tao/Tao.Cg.dll thirdparty/Tao/Tao.OpenGl.dll thirdparty/Tao/Tao.OpenAl.dll OpenRa.Gl.dll
# Package a new binary with included deps
mkbundle --deps -o OpenRA OpenRa.Game.exe OpenRa.Fileformats.dll
# Modify the app bundle with our custom files
cp packaging/osx/Info.plist OpenRA.app/Contents/
rm OpenRA.app/Contents/Resources/OpenRA.exe
cp OpenRA OpenRA.app/Contents/Resources/
cp packaging/osx/OpenRA OpenRA.app/Contents/MacOS/
# Copy everything into our game bundle template
cp -R packaging/osx/OpenRA.app .
cp -R $GAME_FILES $SYSTEM_FILES OpenRA.app/Contents/Resources/