#!/bin/sh APPBUNDLE=ioquake3.app BINARY=ioquake3.ub PKGINFO=APPIOQ3 ICNS=code/unix/MacSupport/ioquake3.icns DESTDIR=build/release-darwin-ub BASEDIR=base Q3_VERSION=`grep "\#define Q3_VERSION" code/qcommon/q_shared.h | \ sed -e 's/.*".* \([^ ]*\)"/\1/'`; BIN_OBJ=" build/release-darwin-ppc/tremulous.ppc build/release-darwin-x86/tremulous.x86 " BASE_OBJ=" build/release-darwin-ppc/$BASEDIR/cgameppc.dylib build/release-darwin-x86/$BASEDIR/cgamex86.dylib build/release-darwin-ppc/$BASEDIR/uippc.dylib build/release-darwin-x86/$BASEDIR/uix86.dylib build/release-darwin-ppc/$BASEDIR/gameppc.dylib build/release-darwin-x86/$BASEDIR/gamex86.dylib " if [ ! -f Makefile ]; then echo "This script must be run from the ioquake3 build directory"; fi if [ ! -d /Developer/SDKs/MacOSX10.2.8.sdk ]; then echo " /Developer/SDKs/MacOSX10.2.8.sdk/ is missing, this doesn't install by default with newer XCode releases, but you should be able to fine the installer at /Applications/Installers/Xcode Tools/Packages/" exit 1; fi if [ ! -d /Developer/SDKs/MacOSX10.4u.sdk ]; then echo " /Developer/SDKs/MacOSX10.4u.sdk/ is missing. You must install XCode 2.2 or newer in order to build Universal Binaries" exit 1; fi (BUILD_MACOSX_UB=ppc make && BUILD_MACOSX_UB=x86 make) || exit 1; echo "Creating .app bundle $DESTDIR/$APPBUNDLE" if [ ! -d $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR ]; then mkdir -p $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR || exit 1; fi if [ ! -d $DESTDIR/$APPBUNDLE/Contents/MacOS/$MPACKDIR ]; then mkdir -p $DESTDIR/$APPBUNDLE/Contents/MacOS/$MPACKDIR || exit 1; fi if [ ! -d $DESTDIR/$APPBUNDLE/Contents/Resources ]; then mkdir -p $DESTDIR/$APPBUNDLE/Contents/Resources fi cp $ICNS $DESTDIR/$APPBUNDLE/Contents/Resources/ioquake3.icns || exit 1; echo $PKGINFO > $DESTDIR/$APPBUNDLE/Contents/PkgInfo echo " CFBundleDevelopmentRegion English CFBundleExecutable $BINARY CFBundleGetInfoString ioquake3 $Q3_VERSION CFBundleIconFile ioquake3.icns CFBundleIdentifier org.icculus.quake3 CFBundleInfoDictionaryVersion 6.0 CFBundleName ioquake3 CFBundlePackageType APPL CFBundleShortVersionString $Q3_VERSION CFBundleSignature $PKGINFO CFBundleVersion $Q3_VERSION NSExtensions NSPrincipalClass NSApplication " > $DESTDIR/$APPBUNDLE/Contents/Info.plist lipo -create -o $DESTDIR/$APPBUNDLE/Contents/MacOS/$BINARY $BIN_OBJ cp $BASE_OBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR/ cp $MPACK_OBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/$MPACKDIR/ cp code/libs/macosx/*.dylib $DESTDIR/$APPBUNDLE/Contents/MacOS/