Building Spring on MacOSX
Build from source on MacOSX
Guide is for x86/Intel based OSX installs
I am hoping that with our efforts on the forum that we can have an .app bundle released everytime spring is updated and that will save most people needing to go through the headache of compiling from source code. But if you must try, then here's the steps to help!
I cannot stress enough that this will most likely only work on Intel based systems at this stage. With my understanding of how unitsync works, it seems like online play will not be possible between PPC and x86 architecture.
Obtaining the Source
Current (0.80.2)
(For playing Spring online)
This code is the same as that used to build the last public release. If you want to play online on the main server, use this or desyncs will occur.
Development Sources from Git
I will update this later, as the main intention of this guide, is for Mac OSX users to be able to play online with their Linux / PC counterparts!
Get Dependencies
You will need to install some development packages Spring depends on. Most of these are vailable using Macports (similar to portage / apt-get etc available on various linux distro's)
You will also need to install the Xcode developers package (this requires a free membership to apple's ADC website)
Full list
- Programs necessary to build
- Xcode
- cmake (or scons)
- zip
- The usual build toolchain
- gcc (comes with Xcode tools)
- make (comes with Xcode tools)
- Libraries
- SDL
- boost (version 1.35 or later recommended)
- threads
- regex
- signals
- system
- DeviL (IL, ILU)
- OpenAL Please check the OpenAL section for MacOSX specific info
- OpenGL headers (mesa, glew, etc.) (comes with Xcode tools)
- zlib
- freetype
- ogg,vorbis and vorbisfile
- Optional, for bindings and Ais
- Python (2.5)
- Java-SDK (pre-installed on OSX)
Using Macports
Once you have downloaded and configured Macports use these commands to download / compile and install the required dependencies :
sudo port install cmake
sudo port install libsdl
sudo port install libsdl-framework
sudo port install boost
sudo port install boost-jam
sudo port install libdevil
sudo port install libogg
sudo port install libvorbis
sudo port install python25
If all was successful, you are very close to being able to compile Spring natively!
OpenAL
After having mountains of problems myself with the OpenAL pre-installed with the Xcode tools, I discoverd that it is version 1.0 of OpenAL (not the correct version we want).
Head to your /System/Library/Framework/ folder and delete any trace of OpenAL framework / folders that are there.
Now download this copy of OpenAL
Using the terminal, go into the folder where you downloaded openal-soft and pass these commands
bzip2 -d openal-soft-xxxx.tar.bz2 | tar xvf -
cd openal-soft-xxxx
cmake .
make
make install
All done, now you will have no problems compiling the Sound.cpp file in spring!