Spring on MacOSX
Last page update: 2010/12/19 by daftalx (changed MacPorts repo; added Java Developer Package requirement)
Current milestones available:
- Spring: 0.81.2.1
- SpringLobby: 0.95
- QtLobby: 1.0 alpha rev. 597
Preamble
This tutorial is intended for Mac OS X Snow Leopard (10.6.*) users running in 32bit kernel mode. Although Spring compiles and runs in 64 bits, it does not work in 64bit kernel mode (thanks to frequencyandsulphur for digging this one out).
This tutorial has not been tested on older releases of Mac OS X (10.5-). Yet, there are big chances that you can get through and still be able to run Spring. Keep in mind though that due to architecture incompatibilities, Intel-powered macs will be able to discuss online together, as well as with PCs, but not with PPC-powered Macs.
Finally, please bear in mind that this tutorial is mostly for testing purposes and proof of concept. Although no manual compilation is required, using the Terminal application is necessary (for now). Due to the little amount of time people are dedicating to the Mac version of Spring, things will move only slowly and often behind the other platforms. Once things get stabilized, an all-in-one installer will (hopefully one day) replace this tutorial.
Good luck, and have fun !
Basics
Install the XCode tools
These are available on your Mac OS X install DVD, the installer is called "XCode Tools" in the "Optional installs" folder.
Install the Java developer packages
As of Apple's "Java for Mac OS X 10.6 Update 3", headers for JNI (among other stuff) are no longer provided by default. In order to build spring AIs but also various dependencies, you should download and install the Java Developer package available on Apple's support site here (NOTE: you must have an Apple ID to access this page. Feel free to post any public hard link in the forum to be added here instead).
Install MacPorts
- If you never had MacPorts installed, the latest version is available as a ".dmg" installer on this page
- If you already have MacPorts, make sure you run the latest version with
sudo port selfupdate
and upgrade your ports with
sudo port upgrade outdated
Configure MacPorts
Spring and it's lobbies are published in a different repository than MacPorts's official one. So you must edit (as root) the MacPorts sources file (located by default in /opt/local/etc/macports/sources.conf), and add the following line before the last one:
rsync://daftserver.dyndns.org/macports/
Sync MacPorts regularly
To sync your MacPorts install with the latest repositories hit
sudo port sync
Note that you should hit this command again everytime a Portfile is added and/or updated. To give you a hint on whether you should sync or not, here is a quick changelog of the repository:
- 2010/10/21 14:31 PM: libtorrent-rasterbar: Port update (ver. 0.15.4)
- 2010/08/16 12:07 PM: springlobby: Port release (ver. 0.95)
- 2010/08/06 01:37 PM: qtlobby: Port release (ver. 1.0alpha)
- 2010/08/03 02:35 PM: wxWidgets: Fixed shared library linking
- 2010/07/30 11:26 PM: springlobby-devel: Port release (fetches latest git)
- 2010/07/25 01:22 AM: wxWidgets: Port release (ver. 2.9.1)
- 2010/07/09 01:02 AM: spring: Removed unnecessary Python 2.5 dependency
- 2010/07/07 01:05 AM: spring: Port release (ver. 0.8.2.1)
From now on I assume your Portfiles will always be up-to-date, therefore I will get straight to the point during the remainder of this tutorial.
Spring
Install spring
Crazy as it may seem, installing spring now comes down to this command:
sudo port install springrts
WARNING: this will take a *long* while, especially on a fresh system (ballpark figure: over an hour with an Intel C2D 2.2GHz cpu).
Setup game data
create a ".spring" folder in your home directory, and create the usual "mods", "maps" and "demos" folder. There you can store your favorite game data (most of the content is cross-platform compatible).
Check if Spring works
spring
should launch the standalone GUI in window mode, which allows offline gaming, e.g. if you have demo scripts or single player mods (my favorite these days is Chicken BA).
Lobbies
SpringLobby
Although the Mac OS port of SpringLobby should be considered "barely alpha"-stage, quite a lot of features are already functional, so you should be able to play online with patience and little effort.
Install SpringLobby
SpringLobby currently relies on the boost library in debug mode. To install or upgrade boost with debug option on hit
sudo port install boost +debug
then proceed to SpringLobby with
sudo port install springlobby
In the end you should get two "double-clickable" .app bundles (springlobby and springsettings) in MacPorts's binary folder (/opt/local/bin by default).
Setup SpringLobby
Upon first run, you'll have to tell SpringLobby where to find the spring executable and unitsync library manually. The spring executable is in "/opt/local/bin/spring" and the unitsync library in "/opt/local/lib/libunitsync.dylib".
As mentioned earlier the lobby is in a very early port stage. One major feature that does *NOT* work yet is to join (or autojoin) an IRC channel (but you may chat inside a battleroom). So before connecting to the main server, open the "Autojoin channels" options window and remove all default channels.
That's it, connect and enjoy NOTE: SpringLobby will mostly crash upon startup (much less afterwards). Don't worry, just keep trying until you get through... or try QtLobby (see below)...
Known bugs
- Join a chat channel (the /join command stalls the app)
- Add bot in a game (hitting the "Add bot" button stalls the app)
- Loading replays (they appear in the list but wouldn't run)
QtLobby
Although QtLobby is now an unmaintained project, it had acquired the reputation of being a both fast and stable alternative to TASclient and SpringLobby. Here is how it compares to the Mac port of SpringLobby:
- Interface is faster and more responsive
- Great IRC chat management
- Bots & Replays not supported (at all)
Again, installing is as simple as
sudo port install qtlobby
and launching is as simple as hitting
qtlobby
As for SpringLobby, upon first run you will have to point to spring executable, unitsync library and data folder manually.
Troubleshooting
In case you encounter compile or install errors on the way, MacPorts will let you know that a log file has been stored somewhere like /opt/local/var/macports/logs/??/main.log, where the "??" describes the port you are installing. Paste the contents of this file into a paste bin (http://www.pastebin.ca) and post the shortlink to the pastebin in this topic, together will your full system info (OS, CPU, ARCH, MacPorts version).
That's it ! Enjoy !