Downloading and Compiling under Mac OS X
This page documents how to compile Arx Libertatis from https://github.com/arx/ArxLibertatis under Mac OS X.
Specific instructions are given for a cleanly installed Lion 10.7.3 system, but the procedure should be similar for other versions.
Setting Up the Build Environment
To download and compile Arx Libertatis you will need the following tools:
XcodeTested with 4.3, install the latest from the App Store (https://developer.apple.com/xcode/)
- Install command line tools from Xcode, in Preferences -> Download
- Set the path to the Xcode folder:
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
github for MacAlso install the command line tools (http://mac.github.com/)
- Note: if you are using an older mac (Core Duo, i.e. 32-bit processor), install git from here: http://code.google.com/p/git-osx-installer/
cmakeshould be build from source (http://www.cmake.org/)
Boostheaders and program_options library (http://www.boost.org/)
OpenGLNothing to do... Framework is bundled with Xcode
OpenALNothing to do... Framework is bundled with Xcode
I installed those using MacPorts... but you can probably obtain "native" versions too.
sudo port install zlib
sudo port install freetype
sudo port install boost
sudo port install qt4-mac
sudo port install libsdl
sudo port install glew
Or as a single line:
sudo port install zlib freetype boost qt4-mac libsdl glew
- NOTE: these packages take a long time to build. Do not be discouraged if it seems like nothing is happening.
Getting the source code
There are several methods to get the Arx Libertatis source code - choose the one that suits you best:
Downloading a released version
The easiest way to get the AL source code is to download a versioned release. This will get you a reasonably up to date copy of the source code that has been tested to work.
- Arx Libertatis Source Code (tar.xz) (mirror)arx-libertatis-1.0.3.tar.xz890 KiB
- Arx Libertatis Source Code (zip) (mirror)arx-libertatis-1.0.3.zip1.6 MiB
Cloning the repository
If you want the absolute latest version of the Arx Libertatis development code and stay up to date, you can clone the AL source code repository. Beware that this will give you the current master development branch that we are actively working on. While the code in that branch should always work, it hasn't undergone any significant testing. If you just want to play the game, consider using a released version instead.
To clone the repository, type:
git clone git://github.com/arx/ArxLibertatis.git
This creates a directory called ArxLibertatis and downloads the current source code from github.
Later if you want to update your local copy of the source code, run
Downloading a snapshot
Alternatively you can download the current snapshot of the source code repository as a .zip or .tar.gz file and extract that:
- Arx Libertatis Development Snapshot (tar.gz)latest snapshot of branch 'master'
- Arx Libertatis Development Snapshot (zip)latest snapshot of branch 'master'
This will give you the same code as cloning the repository, but won't let you update it without downloading everything again.
Using GitHub for Mac
Finally, you can use the GitHub for Mac application to clone the repository. Refer to http://mac.github.com/help.html :)
Building CMake from source
The latest release of CMake (2.8.7) still has issues with Xcode 4.3, but it's been fixed in the development branch. You can build cmake from source to fix this:
git clone http://cmake.org/cmake.git cd cmake ./configure make sudo make install
You're now ready to generate makefiles or an Xcode project. cd to the root of the arx repository
mkdir build cd build cmake .. make
NOTE: If this results in an error that says something about an invalid command "--as-needed", try again with a clean build environment (ie: remove CMakeCache.txt). If the error persists, please report it as a bug at bugs.arx-libertatis.org with detailed build logs.
mkdir build_xcode cd build_xcode cmake .. -G Xcode open ArxLibertatis.xcodeproj/
Then compile and run the project from Xcode. (?)
Running the executable
By default, the user directory for Arx on Mac is
You will need to obtain a copy of the data files from a commercial copy of Arx Fatalis, or use the demo data files, put these in the directory mentioned above and you are ready to go! Run the file "arx" which is in the ArxLibertatis repository. The game will automatically change all used files to lower-case on the first start. If you want to run the game with read-only data you need to do this manually.
For running arx in a debugger, see Debugging