Downloading and Compiling under macOS: Difference between revisions
No edit summary |
Stevereno30 (talk | contribs) No edit summary |
||
Line 12: | Line 12: | ||
** Set the path to the Xcode folder: <code>sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer</code> | ** Set the path to the Xcode folder: <code>sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer</code> | ||
* <code>github for Mac</code> Also install the command line tools (http://mac.github.com/) | * <code>github for Mac</code> Also 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/ | |||
* <code>cmake</code> should be build from source (http://www.cmake.org/) | * <code>cmake</code> should be build from source (http://www.cmake.org/) | ||
* <code>MacPorts</code> (http://www.macports.org/) | * <code>MacPorts</code> (http://www.macports.org/) | ||
Line 36: | Line 37: | ||
Or as a single line: | Or as a single line: | ||
sudo port install zlib freetype libdevil boost qt4-mac libsdl glew | sudo port install zlib freetype libdevil 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. | |||
== Cloning the code repository == | == Cloning the code repository == | ||
Line 68: | Line 70: | ||
cmake .. | cmake .. | ||
make | make | ||
**Note: If this results in an error that says something about an invalid command "--as-needed", open CMakeLists.txt from the Arx repository, and delete lines 460 and 461, which are: | |||
# Because we are lazy | |||
add_ldflag("-Wl,--as-needed") | |||
=== Xcode project === | === Xcode project === | ||
Line 79: | Line 84: | ||
<code>/Users/username/Library/Application Support/ArxLibertatis/</code> | <code>/Users/username/Library/Application Support/ArxLibertatis/</code> | ||
You will need to [[Getting the game data|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! | You will need to [[Getting the game data|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 Arx 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. | 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]] | For running arx in a debugger, see [[Debugging]] |
Revision as of 12:59, 24 May 2012
ℹ️ This page describes compiling Arx Libertatis from source under Mac OS X and assumes some familiarity with the command-line. If you just want to play the game, it might be easier to grab a binary release or snapshot if available.
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:
Xcode
Tested 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 Mac
Also 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/
cmake
should be build from source (http://www.cmake.org/)MacPorts
(http://www.macports.org/)
Libraries
SDL
1.2 (http://www.libsdl.org/)GLEW
(http://glew.sourceforge.net/)DevIL
(http://openil.sourceforge.net/)zlib
(http://zlib.net/)Boost
headers and program_options library (http://www.boost.org/)Freetype
(http://www.freetype.org/)OpenGL
Nothing to do... Framework is bundled with XcodeOpenAL
Nothing to do... Framework is bundled with Xcode
I installed those using MacPorts... but you can probably obtain "native" versions too.
- zLib:
sudo port install zlib
- freetype:
sudo port install freetype
- devil:
sudo port install libdevil
- boost:
sudo port install boost
- qt:
sudo port install qt4-mac
- sdl:
sudo port install libsdl
- glew:
sudo port install glew
Or as a single line:
sudo port install zlib freetype libdevil 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.
Cloning the code repository
Using GitHub for Mac
Refer to http://mac.github.com/help.html :)
From the command line
First, go to where you want the ArxLibertatis directory to be located.
cd ~/Code
You are now ready 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.
cd ArxLibertatis
Compiling
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
Makefiles
mkdir build cd build cmake .. make
- Note: If this results in an error that says something about an invalid command "--as-needed", open CMakeLists.txt from the Arx repository, and delete lines 460 and 461, which are:
# Because we are lazy add_ldflag("-Wl,--as-needed")
Xcode project
mkdir build_xcode cd build_xcode cmake .. -G Xcode open ArxLibertatis.xcodeproj/
Running the executable
By default, the user directory for Arx on Mac is
/Users/username/Library/Application Support/ArxLibertatis/
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 Arx 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