root/make-macosx-ub.sh

Revision 0:abd33ab9075a, 2.9 kB (checked in by mdoison, 3 years ago)

Make trunk with tremulous svn992

  • Property exe set to *
Line 
1#!/bin/sh
2APPBUNDLE=Tremulous.app
3BINARY=Tremulous.ub
4PKGINFO=APPLTREM
5ICNS=misc/Tremulous.icns
6DESTDIR=build/release-darwin-ub
7BASEDIR=base
8Q3_VERSION=`grep "\#define Q3_VERSION" src/qcommon/q_shared.h | \
9        sed -e 's/.*".* \([^ ]*\)"/\1/'`;
10
11BIN_OBJ="
12        build/release-darwin-ppc/tremulous.ppc
13        build/release-darwin-x86/tremulous.x86
14"
15BASE_OBJ="
16        build/release-darwin-ppc/$BASEDIR/cgameppc.dylib
17        build/release-darwin-x86/$BASEDIR/cgamex86.dylib
18        build/release-darwin-ppc/$BASEDIR/uippc.dylib
19        build/release-darwin-x86/$BASEDIR/uix86.dylib
20        build/release-darwin-ppc/$BASEDIR/gameppc.dylib
21        build/release-darwin-x86/$BASEDIR/gamex86.dylib
22"
23if [ ! -f Makefile ]; then
24        echo "This script must be run from the Tremulous build directory";
25fi
26
27if [ ! -d /Developer/SDKs/MacOSX10.2.8.sdk ]; then
28        echo "
29/Developer/SDKs/MacOSX10.2.8.sdk/ is missing, this doesn't install by default
30with newer XCode releases, but the installers is included"
31        exit 1;
32fi
33
34if [ ! -d /Developer/SDKs/MacOSX10.4u.sdk ]; then
35        echo "
36/Developer/SDKs/MacOSX10.4u.sdk/ is missing.  You must install XCode 2.2 or
37newer in order to build Universal Binaries"
38        exit 1;
39fi
40
41(BUILD_MACOSX_UB=ppc make && BUILD_MACOSX_UB=x86 make) || exit 1;
42
43echo "Creating .app bundle $DESTDIR/$APPBUNDLE"
44if [ ! -d $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR ]; then
45        mkdir -p $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR || exit 1;
46fi
47if [ ! -d $DESTDIR/$APPBUNDLE/Contents/MacOS/$MPACKDIR ]; then
48        mkdir -p $DESTDIR/$APPBUNDLE/Contents/MacOS/$MPACKDIR || exit 1;
49fi
50if [ ! -d $DESTDIR/$APPBUNDLE/Contents/Resources ]; then
51        mkdir -p $DESTDIR/$APPBUNDLE/Contents/Resources
52fi
53cp $ICNS $DESTDIR/$APPBUNDLE/Contents/Resources/Tremulous.icns || exit 1;
54echo $PKGINFO > $DESTDIR/$APPBUNDLE/Contents/PkgInfo
55echo "
56        <?xml version=\"1.0\" encoding="UTF-8"?>
57        <!DOCTYPE plist
58                PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\"
59                \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
60        <plist version=\"1.0\">
61        <dict>
62                <key>CFBundleDevelopmentRegion</key>
63                <string>English</string>
64                <key>CFBundleExecutable</key>
65                <string>$BINARY</string>
66                <key>CFBundleGetInfoString</key>
67                <string>$Q3_VERSION</string>
68                <key>CFBundleIconFile</key>
69                <string>Tremulous.icns</string>
70                <key>CFBundleIdentifier</key>
71                <string>net.tremulous</string>
72                <key>CFBundleInfoDictionaryVersion</key>
73                <string>6.0</string>
74                <key>CFBundleName</key>
75                <string>Tremulous</string>
76                <key>CFBundlePackageType</key>
77                <string>APPL</string>
78                <key>CFBundleShortVersionString</key>
79                <string>$Q3_VERSION</string>
80                <key>CFBundleSignature</key>
81                <string>$PKGINFO</string>
82                <key>CFBundleVersion</key>
83                <string>$Q3_VERSION</string>
84                <key>NSExtensions</key>
85                <dict/>
86                <key>NSPrincipalClass</key>
87                <string>NSApplication</string>
88        </dict>
89        </plist>
90        " > $DESTDIR/$APPBUNDLE/Contents/Info.plist
91
92lipo -create -o $DESTDIR/$APPBUNDLE/Contents/MacOS/$BINARY $BIN_OBJ
93cp $BASE_OBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR/
94cp src/libs/macosx/*.dylib $DESTDIR/$APPBUNDLE/Contents/MacOS/
Note: See TracBrowser for help on using the browser.