2006-08-02 04:01:36 +00:00
|
|
|
#!/bin/sh
|
2006-09-26 03:12:54 +00:00
|
|
|
APPBUNDLE=ioquake3.app
|
|
|
|
BINARY=ioquake3.ub
|
2007-12-14 16:54:13 +00:00
|
|
|
DEDBIN=ioq3ded.ub
|
2007-04-13 17:31:29 +00:00
|
|
|
PKGINFO=APPLIOQ3
|
2007-09-05 18:17:46 +00:00
|
|
|
ICNS=misc/quake3.icns
|
2006-08-02 04:01:36 +00:00
|
|
|
DESTDIR=build/release-darwin-ub
|
|
|
|
BASEDIR=baseq3
|
2007-12-14 16:54:13 +00:00
|
|
|
SDKDIR=""
|
2006-08-02 04:01:36 +00:00
|
|
|
MPACKDIR=missionpack
|
2006-09-26 03:12:54 +00:00
|
|
|
Q3_VERSION=`grep "\#define Q3_VERSION" code/qcommon/q_shared.h | \
|
|
|
|
sed -e 's/.*".* \([^ ]*\)"/\1/'`;
|
2006-08-02 04:01:36 +00:00
|
|
|
|
|
|
|
BIN_OBJ="
|
|
|
|
build/release-darwin-ppc/ioquake3.ppc
|
2006-08-02 05:12:20 +00:00
|
|
|
build/release-darwin-i386/ioquake3.i386
|
2006-08-02 04:01:36 +00:00
|
|
|
"
|
2007-12-14 16:54:13 +00:00
|
|
|
BIN_DEDOBJ="
|
|
|
|
build/release-darwin-ppc/ioq3ded.ppc
|
|
|
|
build/release-darwin-i386/ioq3ded.i386
|
|
|
|
"
|
2006-08-02 04:01:36 +00:00
|
|
|
BASE_OBJ="
|
|
|
|
build/release-darwin-ppc/$BASEDIR/cgameppc.dylib
|
2006-08-02 05:12:20 +00:00
|
|
|
build/release-darwin-i386/$BASEDIR/cgamei386.dylib
|
2006-08-02 04:01:36 +00:00
|
|
|
build/release-darwin-ppc/$BASEDIR/uippc.dylib
|
2006-08-02 05:12:20 +00:00
|
|
|
build/release-darwin-i386/$BASEDIR/uii386.dylib
|
2006-08-02 04:01:36 +00:00
|
|
|
build/release-darwin-ppc/$BASEDIR/qagameppc.dylib
|
2006-08-02 05:12:20 +00:00
|
|
|
build/release-darwin-i386/$BASEDIR/qagamei386.dylib
|
2006-08-02 04:01:36 +00:00
|
|
|
"
|
|
|
|
MPACK_OBJ="
|
|
|
|
build/release-darwin-ppc/$MPACKDIR/cgameppc.dylib
|
2006-08-02 05:12:20 +00:00
|
|
|
build/release-darwin-i386/$MPACKDIR/cgamei386.dylib
|
2006-08-02 04:01:36 +00:00
|
|
|
build/release-darwin-ppc/$MPACKDIR/uippc.dylib
|
2006-08-02 05:12:20 +00:00
|
|
|
build/release-darwin-i386/$MPACKDIR/uii386.dylib
|
2006-08-02 04:01:36 +00:00
|
|
|
build/release-darwin-ppc/$MPACKDIR/qagameppc.dylib
|
2006-08-02 05:12:20 +00:00
|
|
|
build/release-darwin-i386/$MPACKDIR/qagamei386.dylib
|
2006-08-02 04:01:36 +00:00
|
|
|
"
|
|
|
|
if [ ! -f Makefile ]; then
|
|
|
|
echo "This script must be run from the ioquake3 build directory";
|
|
|
|
fi
|
|
|
|
|
2007-12-14 16:54:13 +00:00
|
|
|
# this is kind of a hack to find out the latest SDK to use. I assume that newer SDKs appear later in this for loop,
|
|
|
|
# thus the last valid one is the one we want.
|
|
|
|
|
|
|
|
for availsdks in /Developer/SDKs/*
|
|
|
|
do
|
|
|
|
if [ -d $availsdks ]
|
|
|
|
then
|
|
|
|
SDKDIR="$availsdks"
|
|
|
|
fi
|
|
|
|
done
|
2006-08-02 04:01:36 +00:00
|
|
|
|
2007-12-14 16:54:13 +00:00
|
|
|
if [ -z $SDKDIR ]
|
|
|
|
then
|
|
|
|
echo "MacOSX SDK is missing. Please install a recent version of the MacOSX SDK."
|
2006-08-02 04:01:36 +00:00
|
|
|
exit 1;
|
2007-12-14 16:54:13 +00:00
|
|
|
else
|
|
|
|
echo "Using $SDKDIR for compilation"
|
2006-08-02 04:01:36 +00:00
|
|
|
fi
|
|
|
|
|
2006-08-02 05:12:20 +00:00
|
|
|
(BUILD_MACOSX_UB=ppc make && BUILD_MACOSX_UB=i386 make) || exit 1;
|
2006-08-02 04:01:36 +00:00
|
|
|
|
2006-09-26 03:12:54 +00:00
|
|
|
echo "Creating .app bundle $DESTDIR/$APPBUNDLE"
|
|
|
|
if [ ! -d $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR ]; then
|
|
|
|
mkdir -p $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR || exit 1;
|
2006-08-02 04:01:36 +00:00
|
|
|
fi
|
2006-09-26 03:12:54 +00:00
|
|
|
if [ ! -d $DESTDIR/$APPBUNDLE/Contents/MacOS/$MPACKDIR ]; then
|
|
|
|
mkdir -p $DESTDIR/$APPBUNDLE/Contents/MacOS/$MPACKDIR || exit 1;
|
2006-08-02 04:01:36 +00:00
|
|
|
fi
|
2006-09-26 03:12:54 +00:00
|
|
|
if [ ! -d $DESTDIR/$APPBUNDLE/Contents/Resources ]; then
|
|
|
|
mkdir -p $DESTDIR/$APPBUNDLE/Contents/Resources
|
2006-08-02 04:01:36 +00:00
|
|
|
fi
|
2006-09-26 03:12:54 +00:00
|
|
|
cp $ICNS $DESTDIR/$APPBUNDLE/Contents/Resources/ioquake3.icns || exit 1;
|
|
|
|
echo $PKGINFO > $DESTDIR/$APPBUNDLE/Contents/PkgInfo
|
|
|
|
echo "
|
|
|
|
<?xml version=\"1.0\" encoding="UTF-8"?>
|
|
|
|
<!DOCTYPE plist
|
|
|
|
PUBLIC \"-//Apple Computer//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>CFBundleExecutable</key>
|
|
|
|
<string>$BINARY</string>
|
|
|
|
<key>CFBundleGetInfoString</key>
|
|
|
|
<string>ioquake3 $Q3_VERSION</string>
|
|
|
|
<key>CFBundleIconFile</key>
|
|
|
|
<string>ioquake3.icns</string>
|
|
|
|
<key>CFBundleIdentifier</key>
|
|
|
|
<string>org.icculus.quake3</string>
|
|
|
|
<key>CFBundleInfoDictionaryVersion</key>
|
|
|
|
<string>6.0</string>
|
|
|
|
<key>CFBundleName</key>
|
|
|
|
<string>ioquake3</string>
|
|
|
|
<key>CFBundlePackageType</key>
|
|
|
|
<string>APPL</string>
|
|
|
|
<key>CFBundleShortVersionString</key>
|
|
|
|
<string>$Q3_VERSION</string>
|
|
|
|
<key>CFBundleSignature</key>
|
|
|
|
<string>$PKGINFO</string>
|
|
|
|
<key>CFBundleVersion</key>
|
|
|
|
<string>$Q3_VERSION</string>
|
|
|
|
<key>NSExtensions</key>
|
|
|
|
<dict/>
|
|
|
|
<key>NSPrincipalClass</key>
|
|
|
|
<string>NSApplication</string>
|
|
|
|
</dict>
|
|
|
|
</plist>
|
|
|
|
" > $DESTDIR/$APPBUNDLE/Contents/Info.plist
|
2006-08-02 04:01:36 +00:00
|
|
|
|
2006-09-26 03:12:54 +00:00
|
|
|
lipo -create -o $DESTDIR/$APPBUNDLE/Contents/MacOS/$BINARY $BIN_OBJ
|
2007-12-14 16:54:13 +00:00
|
|
|
lipo -create -o $DESTDIR/$APPBUNDLE/Contents/MacOS/$DEDBIN $BIN_DEDOBJ
|
2006-09-26 03:12:54 +00:00
|
|
|
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/
|
2006-08-02 04:01:36 +00:00
|
|
|
|