Free and Open Source real time strategy game with a new take on micro-management

Difference between revisions of "MAC OS X Development"

From Globulation2

Jump to: navigation, search
(Dependency Tree)
 
(13 intermediate revisions by 4 users not shown)
Line 1: Line 1:
First get XCode Developer tools and X11 installed from you Mac OSX install CD's or the Apple Website.
This page is under development by [[User:AppleBoy | AppleBoy]]<br />
please check the talk page for more information


The following guide uses a quick, low overhead solution called 'Homebrew' to install Globulation 2 dependencies.
== Required dependencies to be installed ==
This area is going to get big and complicated as you have to go thorugh and manually download and isntall just about all of the libraries required by glob2. Hopefully a better process will be found throughout this.


== Installing Homebrew ==
Please install these in the following order. It will make your life easier
# libogg and libvorbis
#: both can be obtained from [http://xiph.org/downloads/ here]
#: libogg must be installed before libvorbis
#: standard ./configure && make && sudo make install
#:
# speex
#: working on this one. It requires multiple dependencies first
#:
# [http://www.libsdl.org SDL Libraries]
#: to get SDL to work properly with glob2 you must download the source code and install it from there.
#: you must also download and install SDL_net, SDL_ttf, and SDL_image.
#: SDL_net and SDL_ttf can be installed by source very easily, no extra dependencies.
#: just run the command:
#: export SDL_CONFIG=/usr/local/bin/sdl-config
#: after you have installed SDL and you're good to go.
#:
#: SDL_image on the other hand is a pain in the butt and I am still working on getting that to install.


{{Message|Assumes fresh environment|The following guide assumes you are not using MacPorts or FinkCommander already. If you are, use them to install dependencies, or adjust the paths of the below commands.}}
(still to add)
* freetype


{{Warning|Globulation 2 compiling|Globulation 2 scons script assumes the dependencies are in /opt/local on the mac. MacPorts uses this directory, but Fink does not. If you need to, symlink the directory. If you can't, edit SConstruct in the glob2 source}}
=== Dependency Tree ===
These are pretty much all standard source install sections. For example:
<pre>
# tar -zxvf libvorbis-1.1.2.tar.gz
# cd libvorbis-1.1.2
# ./configure
# make
# sudo make install
</pre>


* Download and install the latest Git version:
*Glob2
:*[http://xiph.org/downloads/ libvorbis]
::*[http://xiph.org/downloads/ libogg]
:*[http://www.libsdl.org/release/SDL-1.2.11.tar.gz SDL-1.2]
:*[http://www.libsdl.org/projects/SDL_ttf/release/SDL_ttf-2.0.8.tar.gz SDL_ttf]
:*[http://www.libsdl.org/projects/SDL_net/release/SDL_net-1.2.6.tar.gz SDL_net]
:*[http://www.libsdl.org/projects/SDL_image/release/SDL_image-1.2.5.tar.gz SDL_image]
::*many dependencies, will list.
:*speex
:*zlib (included in OS X)
:*boost


http://code.google.com/p/git-osx-installer/downloads/list?can=3
== on to glob2 itself and CVS ==
To checkout CVS please [[CVS | see this page]]


* Run the following in a console:


$ mkdir /opt
$ cd /opt
$ git clone git://github.com/mxcl/homebrew.git local
$ chown -R [your_name]:[your_group] local '''(replace the bracket values)'''


== Adding PATH's ==

Open up ~/.profile (or sometimes called .bash_profile) in your favourite editor, and add at the top of the file:

export PATH=/opt/local/bin/:$PATH
export MANPATH=/opt/local/share/man:$MANPATH
export CPPFLAGS="-I/opt/local/include $CPPFLAGS"
export LDFLAGS="-L/opt/local/lib $LDFLAGS"

Save ~/.profile, Quit the Terminal.app program, and then restart it. Type

$ which brew

and hit enter. If the result is '/opt/local/bin/brew' then feel free to continue, else find out what's wrong.

== Handling Dependencies ==

With Homebrew installed, the PATH's in place, and the Terminal open, run:

$ brew install libpng
$ brew link libpng
$ brew install scons sdl sdl_ttf sdl_image sdl_net speex libvorbis libogg boost fribidi portaudio

== Compiling Globulation 2 ==

Mac support is very limited, so for now, you'll just need to play the game in the directory you compiled it. Assuming you have download Globulation 2 and extracted the source code (if not, see [[Download and Install]]), change into the directory with the console and run:

$ scons

If all goes well, it should build the glob2 binary at the end of the process. You can safely ignore all the warnings it gives.

== Before Running ==

Once compiled, you'll need to run the following at the Globulation 2 source root to get the game working. Not sure why this is necessary yet (sources indicate Globulation 2 source needs altering).

$ ln -s /opt/local/lib/libboost_thread-mt.dylib


[[Category:en]]
[[Category:Developer Resources]]
[[Category:Developer Resources]]

Latest revision as of 05:53, 23 October 2009

First get XCode Developer tools and X11 installed from you Mac OSX install CD's or the Apple Website.

The following guide uses a quick, low overhead solution called 'Homebrew' to install Globulation 2 dependencies.

Installing Homebrew

Assumes fresh environment: The following guide assumes you are not using MacPorts or FinkCommander already. If you are, use them to install dependencies, or adjust the paths of the below commands.
Globulation 2 compiling: Globulation 2 scons script assumes the dependencies are in /opt/local on the mac. MacPorts uses this directory, but Fink does not. If you need to, symlink the directory. If you can't, edit SConstruct in the glob2 source
  • Download and install the latest Git version:
 http://code.google.com/p/git-osx-installer/downloads/list?can=3
  • Run the following in a console:
 $ mkdir /opt
 $ cd /opt
 $ git clone git://github.com/mxcl/homebrew.git local
 $ chown -R [your_name]:[your_group] local    (replace the bracket values)

Adding PATH's

Open up ~/.profile (or sometimes called .bash_profile) in your favourite editor, and add at the top of the file:

 export PATH=/opt/local/bin/:$PATH
 export MANPATH=/opt/local/share/man:$MANPATH
 export CPPFLAGS="-I/opt/local/include $CPPFLAGS"
 export LDFLAGS="-L/opt/local/lib $LDFLAGS"

Save ~/.profile, Quit the Terminal.app program, and then restart it. Type

 $ which brew

and hit enter. If the result is '/opt/local/bin/brew' then feel free to continue, else find out what's wrong.

Handling Dependencies

With Homebrew installed, the PATH's in place, and the Terminal open, run:

 $ brew install libpng
 $ brew link libpng
 $ brew install scons sdl sdl_ttf sdl_image sdl_net speex libvorbis libogg boost fribidi portaudio 

Compiling Globulation 2

Mac support is very limited, so for now, you'll just need to play the game in the directory you compiled it. Assuming you have download Globulation 2 and extracted the source code (if not, see Download and Install), change into the directory with the console and run:

 $ scons

If all goes well, it should build the glob2 binary at the end of the process. You can safely ignore all the warnings it gives.

Before Running

Once compiled, you'll need to run the following at the Globulation 2 source root to get the game working. Not sure why this is necessary yet (sources indicate Globulation 2 source needs altering).

 $ ln -s /opt/local/lib/libboost_thread-mt.dylib
Misc