From 47ccd80b14ab1b51aa223ed9dc68199026db3c6a Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sat, 17 Apr 2010 02:00:26 +1200 Subject: [PATCH] Move the osx-packaging script inside the launcher xcode project --- Makefile | 3 - .../OpenRA.app/Contents/Info.plist | 2 +- .../OpenRA.app/Contents/MacOS/OpenRA | 0 .../Contents/Resources/OpenRA.icns} | Bin .../launcher/OpenRA.xcodeproj/project.pbxproj | 12 +-- packaging/osx/{ => launcher}/package.sh | 71 ++++++++++++------ packaging/osx/{ => launcher}/package_dmg.sh | 0 7 files changed, 54 insertions(+), 34 deletions(-) rename packaging/osx/{ => launcher}/OpenRA.app/Contents/Info.plist (69%) rename packaging/osx/{ => launcher}/OpenRA.app/Contents/MacOS/OpenRA (100%) rename packaging/osx/{OpenRA.app/Contents/Resources/OpenRa.icns => launcher/OpenRA.app/Contents/Resources/OpenRA.icns} (100%) rename packaging/osx/{ => launcher}/package.sh (60%) rename packaging/osx/{ => launcher}/package_dmg.sh (100%) diff --git a/Makefile b/Makefile index 5a1dd680ec..178c8366a4 100644 --- a/Makefile +++ b/Makefile @@ -92,7 +92,4 @@ seqed: $(seqed_TARGET) mapcvtr: $(mapcvtr_TARGET) all: $(fileformats_TARGET) $(gl_TARGET) $(game_TARGET) $(ra_TARGET) $(cnc_TARGET) $(aftermath_TARGET) $(ra_ng_TARGET) $(seqed_TARGET) $(mapcvtr_TARGET) -dist-osx: - packaging/osx/package.sh - .DEFAULT: all diff --git a/packaging/osx/OpenRA.app/Contents/Info.plist b/packaging/osx/launcher/OpenRA.app/Contents/Info.plist similarity index 69% rename from packaging/osx/OpenRA.app/Contents/Info.plist rename to packaging/osx/launcher/OpenRA.app/Contents/Info.plist index fdf6224a09..8d132ae714 100644 --- a/packaging/osx/OpenRA.app/Contents/Info.plist +++ b/packaging/osx/launcher/OpenRA.app/Contents/Info.plist @@ -1,5 +1,5 @@ - + CFBundleIdentifier diff --git a/packaging/osx/OpenRA.app/Contents/MacOS/OpenRA b/packaging/osx/launcher/OpenRA.app/Contents/MacOS/OpenRA similarity index 100% rename from packaging/osx/OpenRA.app/Contents/MacOS/OpenRA rename to packaging/osx/launcher/OpenRA.app/Contents/MacOS/OpenRA diff --git a/packaging/osx/OpenRA.app/Contents/Resources/OpenRa.icns b/packaging/osx/launcher/OpenRA.app/Contents/Resources/OpenRA.icns similarity index 100% rename from packaging/osx/OpenRA.app/Contents/Resources/OpenRa.icns rename to packaging/osx/launcher/OpenRA.app/Contents/Resources/OpenRA.icns diff --git a/packaging/osx/launcher/OpenRA.xcodeproj/project.pbxproj b/packaging/osx/launcher/OpenRA.xcodeproj/project.pbxproj index 0b05aeea1b..b7732d154e 100644 --- a/packaging/osx/launcher/OpenRA.xcodeproj/project.pbxproj +++ b/packaging/osx/launcher/OpenRA.xcodeproj/project.pbxproj @@ -12,7 +12,7 @@ 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; 8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; - DA1241101151F194002EFE2B /* OpenRa.icns in Resources */ = {isa = PBXBuildFile; fileRef = DA12410F1151F194002EFE2B /* OpenRa.icns */; }; + DA1241101151F194002EFE2B /* OpenRA.icns in Resources */ = {isa = PBXBuildFile; fileRef = DA12410F1151F194002EFE2B /* OpenRA.icns */; }; DA28A92A117878EC00342835 /* mods.plist in Resources */ = {isa = PBXBuildFile; fileRef = DA28A929117878EC00342835 /* mods.plist */; }; DAAB5C7911536D6500DCCB80 /* Settings.m in Sources */ = {isa = PBXBuildFile; fileRef = DAAB5C7811536D6500DCCB80 /* Settings.m */; }; DAFD657B11520799001F4C97 /* launcher.ini in Resources */ = {isa = PBXBuildFile; fileRef = DAFD657A11520799001F4C97 /* launcher.ini */; }; @@ -31,7 +31,7 @@ 8990E7AE1151C0F20089C198 /* Controller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Controller.m; sourceTree = ""; }; 8D1107310486CEB800E47090 /* OpenRA-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "OpenRA-Info.plist"; sourceTree = ""; }; 8D1107320486CEB800E47090 /* OpenRA.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = OpenRA.app; sourceTree = BUILT_PRODUCTS_DIR; }; - DA12410F1151F194002EFE2B /* OpenRa.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = OpenRa.icns; sourceTree = ""; }; + DA12410F1151F194002EFE2B /* OpenRA.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = OpenRA.icns; sourceTree = ""; }; DA28A929117878EC00342835 /* mods.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = mods.plist; sourceTree = ""; }; DAAB5C7711536D6500DCCB80 /* Settings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Settings.h; sourceTree = ""; }; DAAB5C7811536D6500DCCB80 /* Settings.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Settings.m; sourceTree = ""; }; @@ -113,7 +113,7 @@ children = ( DAFD657A11520799001F4C97 /* launcher.ini */, 8D1107310486CEB800E47090 /* OpenRA-Info.plist */, - DA12410F1151F194002EFE2B /* OpenRa.icns */, + DA12410F1151F194002EFE2B /* OpenRA.icns */, 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, 1DDD58140DA1D0A300B32029 /* MainMenu.xib */, DA28A929117878EC00342835 /* mods.plist */, @@ -176,7 +176,7 @@ files = ( 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */, 1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */, - DA1241101151F194002EFE2B /* OpenRa.icns in Resources */, + DA1241101151F194002EFE2B /* OpenRA.icns in Resources */, DAFD657B11520799001F4C97 /* launcher.ini in Resources */, DA28A92A117878EC00342835 /* mods.plist in Resources */, ); @@ -196,8 +196,8 @@ outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "cd ../../../\n#make clean\n#make all\n#make dist-osx\ncp -r OpenRA.app ${TARGET_BUILD_DIR}/OpenRA.app/Contents/Resources/"; + shellPath = /bin/bash; + shellScript = "./package.sh\ncp -r build/game/OpenRA.app ${TARGET_BUILD_DIR}/OpenRA.app/Contents/Resources/"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ diff --git a/packaging/osx/package.sh b/packaging/osx/launcher/package.sh similarity index 60% rename from packaging/osx/package.sh rename to packaging/osx/launcher/package.sh index 05a05fd78a..7b5182a71b 100755 --- a/packaging/osx/package.sh +++ b/packaging/osx/launcher/package.sh @@ -3,20 +3,10 @@ # Creates a .app bundle for OpenRA game, and a command line app for OpenRa server # All dependencies are packaged inside the game bundle -# List of game files to copy into the app bundle -GAME_FILES="OpenRA shaders maps FreeSans.ttf FreeSansBold.ttf titles.ttf" - -# List of mods to include -MODS="ra cnc" - -# Files/directories to include -MODS_INCLUDE_FILES="find mods/$m ! -name \"*.mdb\" ! -name \"packages\"" - -# dylibs referred to by dlls in the gac; won't show up to otool -GAC_DYLIBS="/Library/Frameworks/Mono.framework/Versions/2.6.3/lib/libMonoPosixHelper.dylib /Library/Frameworks/Mono.framework/Versions/2.6.3/lib/libgdiplus.dylib " - -# Remove old app bundle -rm -r OpenRA.app +# ASSUMPTIONS: +# - Mono version is 2.6.3 +# - pkg-config is installed via Fink +# - Fink is installed in /sw # Recursively modify and copy the mono files depended on by OpenRA into the app bundle function patch_mono { @@ -39,31 +29,64 @@ function patch_mono { } function copy_mods { - for m in $MODS; do - mkdir -p "OpenRA.app/Contents/Resources/mods/$m" + for m in $MODS; do + mkdir -p ${BUILD_DIR}"OpenRA.app/Contents/Resources/mods/$m" - #for f in $( find mods/$m \! -name "*.mdb" \! -name "packages"); do - #for f in `$MODS_INCLUDE_FILES`; do - cp -R "mods/$m/" "OpenRA.app/Contents/Resources/mods/$m/" - #done + #for f in $( find mods/$m \! -name "*.mdb" \! -name "packages"); do + #for f in `$MODS_INCLUDE_FILES`; do + cp -R "mods/$m/" ${BUILD_DIR}"OpenRA.app/Contents/Resources/mods/$m/" + #done done } +# Setup environment for mkbundle # Force 32-bit build and set the pkg-config path for mono.pc export AS="as -arch i386" export CC="gcc -arch i386 -mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.5.sdk" export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/Library/Frameworks/Mono.framework/Versions/Current/lib/pkgconfig/ +export PATH=/sw/bin:/sw/sbin:$PATH + +# List of game files to copy into the app bundle +GAME_FILES="shaders maps FreeSans.ttf FreeSansBold.ttf titles.ttf" + +# List of mods to include +MODS="ra cnc aftermath ra-ng" + +# Files/directories to include +MODS_INCLUDE_FILES="find mods/$m ! -name \"*.mdb\" ! -name \"packages\"" + +# dylibs referred to by dlls in the gac; won't show up to otool +GAC_DYLIBS="/Library/Frameworks/Mono.framework/Versions/2.6.3/lib/libMonoPosixHelper.dylib /Library/Frameworks/Mono.framework/Versions/2.6.3/lib/libgdiplus.dylib " + +# Binaries to compile into our executable +DEPS="OpenRA.Game.exe OpenRA.Gl.dll OpenRA.FileFormats.dll thirdparty/Tao/Tao.Cg.dll thirdparty/Tao/Tao.Cg.dll.config thirdparty/Tao/Tao.OpenGl.dll thirdparty/Tao/Tao.OpenGl.dll.config thirdparty/Tao/Tao.OpenAl.dll thirdparty/Tao/Tao.OpenAl.dll.config thirdparty/Tao/Tao.FreeType.dll thirdparty/Tao/Tao.FreeType.dll.config thirdparty/Tao/Tao.Sdl.dll thirdparty/Tao/Tao.Sdl.dll.config " +DEPS_LOCAL="OpenRA.Game.exe OpenRA.Gl.dll OpenRA.FileFormats.dll Tao.Cg.dll Tao.OpenGl.dll Tao.OpenAl.dll Tao.FreeType.dll Tao.Sdl.dll" + +# Create clean build dir +BUILD_DIR=`pwd`/build/game/ + +rm -rf $BUILD_DIR +mkdir $BUILD_DIR + +# Copy deps into build dir +cp -r OpenRA.app $BUILD_DIR +cd ../../../ +cp $DEPS $BUILD_DIR +cd $BUILD_DIR # Package the game binary -mkbundle --deps --static -z -o OpenRA OpenRA.Game.exe OpenRA.Gl.dll OpenRA.FileFormats.dll thirdparty/Tao/Tao.Cg.dll thirdparty/Tao/Tao.OpenGl.dll thirdparty/Tao/Tao.OpenAl.dll thirdparty/Tao/Tao.FreeType.dll thirdparty/Tao/Tao.Sdl.dll +mkbundle --deps --static -z -o OpenRA $DEPS_LOCAL +rm $DEPS_LOCAL +rm *.config +mv OpenRA OpenRA.app/Contents/Resources/ # Copy game files into our game bundle template -cp -R packaging/osx/OpenRA.app . -cp -R $GAME_FILES OpenRA.app/Contents/Resources/ +cd ../../../../../ +cp -R $GAME_FILES ${BUILD_DIR}OpenRA.app/Contents/Resources/ copy_mods +cd $BUILD_DIR # Copy frameworks into our game bundle template -mkdir OpenRA.app/Contents/Frameworks/ patch_mono OpenRA.app/Contents/Resources/OpenRA # The dylibs referenced by dll.configs in the gac don't show up to otool: patch them manually diff --git a/packaging/osx/package_dmg.sh b/packaging/osx/launcher/package_dmg.sh similarity index 100% rename from packaging/osx/package_dmg.sh rename to packaging/osx/launcher/package_dmg.sh