Script to package a game build into a zip

This commit is contained in:
Paul Chote
2010-07-02 21:20:18 +12:00
committed by Chris Forbes
parent cfa4820379
commit 4671e6b261
3 changed files with 39 additions and 3 deletions

View File

@@ -1,12 +1,13 @@
#!/bin/bash
# Where is the game we are trying to load?
GAME_PATH="/Users/paul/src/OpenRA/"
# Find where we are and what we want to run
APP_PATH=`echo $0 | awk '{split($0,patharr,"/"); idx=1; while(patharr[idx+3] != "") { if (patharr[idx] != "/") {printf("%s/", patharr[idx]); idx++ }} }'`
EXE_PATH="$APP_PATH/Contents/MacOS/"
# Where is the game we are trying to load?
GAME_PATH="$EXE_PATH../Resources/"
# Override paths within mono to avoid string-hacking the executable
export LD_LIBRARY_PATH="$EXE_PATH/lib"
export MONO_PATH="$EXE_PATH/lib"

35
packaging/osx/package-game.sh Executable file
View File

@@ -0,0 +1,35 @@
#!/bin/sh
# OpenRA Packaging script for osx
# Packages game files into the launcher app
# previously created by the package-launcher script
PWD=`pwd`
PACKAGING_PATH="$PWD/osxbuild"
LAUNCHER_PATH="$PACKAGING_PATH/launcher/OpenRA.app"
SOURCE_PATH="$PWD/."
FILES="OpenRA.Game.exe OpenRA.Gl.dll OpenRA.FileFormats.dll FreeSans.ttf FreeSansBold.ttf titles.ttf shaders maps mods/ra mods/cnc"
EXCLUDE="*.mdb ./mods/cnc/packages/*.mix ./mods/ra/packages/*.mix ./mods/cnc/packages/*.MIX ./mods/ra/packages/*.MIX"
# Copy source files into packaging dir
PAYLOAD="$PACKAGING_PATH/payload"
mkdir -p $PAYLOAD
mkdir -p "$PAYLOAD/mods"
for i in $FILES; do
cp -RX "$i" "$PAYLOAD/$i"
done
# Delete unwanted files
cd $PAYLOAD
for i in $EXCLUDE; do
find . -path "$i" -delete
done
cd $PACKAGING_PATH
# Move everything into the app bundle
cp -r "$LAUNCHER_PATH" .
cp -r "$PAYLOAD/" "OpenRA.app/Contents/Resources/"
rm -rf $PAYLOAD
zip OpenRA -r -9 OpenRA.app
echo "Done!"

View File

@@ -11,7 +11,7 @@
# A list of the binaries that we want to be able to run
DEPS_LOCAL="OpenRA.Game.exe OpenRA.Gl.dll OpenRA.FileFormats.dll"
PACKAGING_DIR="osxbuild"
PACKAGING_DIR="osxbuild/launcher"
SYSTEM_MONO="/Library/Frameworks/Mono.framework/Versions/2.6.3"
# dylibs referred to by dlls in the gac; won't show up to otool