11 | | == Step 2: Install Homebrew == |
12 | | |
13 | | Homebrew, a package management tool for Mac, is far superior to it's predecessors (like MacPorts and FinkCommander). It's lightweight, and very fast, and the preferred package management tool. If you use MacPorts or FinkCommander, you're on your own, since the content below will focus on using Homebrew to compile the game. |
14 | | |
15 | | To install, follow the instructions at https://github.com/mxcl/homebrew/wiki/installation , but skip the step about installing XCode, as you did that above. |
16 | | |
17 | | The rest of this guide assumes you installed Homebrew to /usr/local, not to /opt or any other non-standard prefix, and that you didn't use sudo. If you installed otherwise, you're on your own. |
18 | | |
19 | | == Step 3: Install 0 A.D. Dependencies == |
20 | | |
21 | | Run the following in a console to install the dependencies needed for 0 A.D. Installing all dependencies takes anywhere between '''40 minutes up to as much as 2 hours''', during which time, the computer is pretty slow, so be patient with it. Best to do it when you won't be using the computer while it's installing. |
| 10 | == Step 2: Obtaining the 0 A.D. source == |
| 11 | If you want to grab the release files, you can do that. But in this guide, we'll compile SVN, which has the newest features. |
33 | | '''COMING SOON''' |
| 29 | 1. Build the game as a loose binary |
| 30 | * Run [source:/ps/trunk/libraries/osx/build-osx-libs.sh build-osx-libs.sh], the OS X libraries build script, this will download and build the game's dependencies. |
| 31 | {{{ |
| 32 | #!sh |
| 33 | cd libraries/osx |
| 34 | ./build-osx-libs.sh -j3 |
| 35 | }}} |
| 36 | * '''-j3''' gives the number of parallel builds to run, and should typically be one plus the number of CPU cores available. |
| 37 | * To build on the command line with LLVM/gcc, follow the [#Build build] instructions for Linux beginning with `./update-workspaces.sh`. |
| 38 | * Or if you have Xcode 4 installed, you can open `build/workspaces/xcode4/pyrogenesis.xcworkspace` (see discussion on this [http://www.wildfiregames.com/forum/index.php?showtopic=15511&st=160#entry261743 here]). |
| 39 | * Or if you're on Snow Leopard and have Xcode 3 installed, you can open `build/workspaces/xcode3/pyrogenesis.xcodeproj` |
| 40 | * Newer versions of Xcode no longer include the command line tools by default, you need to install them as described above. Additionally, the command line tools package no longer includes GCC but it does include LLVM-GCC which is compatible. If you get errors during the build like "C compiler cannot create executables" then you probably have the newer command line tools with LLVM. The following command should fix it: |
| 41 | {{{ |
| 42 | #!sh |
| 43 | export CC=gcc CXX=g++ |
| 44 | }}} |
| 45 | 1. Build the game as a distributable bundle |
| 46 | * You will need Xcode installed (for its SDKs) |
| 47 | * Open [source:/ps/trunk/build/workspaces/build-osx-bundle.sh build/workspaces/build-osx-bundle.sh] and read the comments. You might need to change a few settings depending on your version of OS X, Xcode, etc. |
| 48 | * Run `build-osx-bundle.sh`: |
| 49 | {{{ |
| 50 | #!sh |
| 51 | cd build/workspaces |
| 52 | ./build-osx-bundle.sh -j3 |
| 53 | }}} |
| 54 | * '''-j3''' gives the number of parallel builds to run, and should typically be one plus the number of CPU cores available. |
| 55 | * When it's finished, there should be a complete '''0ad app''' bundle in `build/workspaces`. |