BuildingOnMac.wiki
author RedGrinner@gmail.com
Sun, 25 Sep 2011 13:46:43 +0000
changeset 142 4926fef16e6c
parent 117 5c10784de5cb
child 267 92b0dfdda298
permissions -rw-r--r--
Edited wiki page LuaAPI through web user interface.

#summary Instructions for building Hedgewars on Mac OS X
#labels Phase-Implementation,Phase-Deploy,Phase-Support

= Prerequisites =

  * XCode must be installed
  * some knowledge of Terminal is preferred

=== Notes ===

   # it has been reported that Xcode 3.2.6 creates problem when linking frameworks! If you can't use another version, try this: https://discussions.apple.com/thread/2781968?threadID=2781968&tstart=105
   # Qt 4.7.0 is the only Qt4.7 version that works! All the others suffer from this bug http://bugreports.qt.nokia.com/browse/QTBUG-17333
   # Lion has an incompatible ABI with older version of Freepascal! Please use the 2.5.1 snapshot or newer. See http://bugs.freepascal.org/view.php?id=19269

== Necessary Libraries ==

Download the following libraries and place them under `/Library/Frameworks/`

  * SDL - http://www.libsdl.org/release/SDL-1.2.14.dmg
  * SDL_image - http://www.libsdl.org/projects/SDL_image/release/SDL_image-1.2.10.dmg
  * SDL_mixer - http://www.libsdl.org/projects/SDL_mixer/release/SDL_mixer-1.2.11.dmg
  * SDL_net - http://dl.dropbox.com/u/24468/SDL_net.framework.zip
  * SDL_ttf - http://www.libsdl.org/projects/SDL_ttf/release/SDL_ttf-2.0.10.dmg
  * Ogg sources - http://downloads.xiph.org/releases/ogg/libogg-1.2.1.tar.bz2
  * Vorbis sources - http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.2.tar.bz2

=== Compiling Ogg Vorbis ===

Since there is no framework distribution for ogg vorbis libraries, we will need to compile our own. Extract the sources and open the relative .xcodeproj file.

It is likely that you will need to adjust some parameters, such as the Base SDK you have installed and for which architecture (ppc, i386, x86_64) you want to build. Go into "Project"->"Edit Project Settings", under "Build" set Architectures to Standard and Base SDK to 10.5 (otherwise newer).

After that build as usual and copy the generated framework to the usual `/Library/Frameworks/` directory.

=== (Optional) Server ===

If you want to compile server for hosting lan games, you need to download a Haskell compiler: we are going to use the Glasgow Haskell Compiler.

  * download the Haskell Platform and install both the GHC and Haskell Platform - http://lambda.galois.com/hp-tmp/2011.2.0.1/Haskell%20Platform%202011.2.0.1-i386.pkg
  * run `cabal update` to get an updated list of available libraries and install the necessary dependencies with
{{{
sudo cabal install gameServer/hedgewars-server.cabal
}}}
  * _(even more optional)_ if you feel experimental, you can also try to use the 64bit variant of Haskell, just make sure that your `~/.cabal/` directory doesn't conflict with previous installations - http://lambda.galois.com/hp-tmp/2011.2.0.1/Haskell%20Platform%202011.2.0.1-x86_64.pkg

== Necessary Tools ==

Download and install the following toolchains

  * Freepascal compiler - http://sourceforge.net/projects/freepascal/files/Mac%20OS%20X/2.4.4/fpc-2.4.4.intel-macosx.dmg/download
  * CMake - http://www.cmake.org/files/v2.8/cmake-2.8.3-Darwin-universal.dmg
  * QT - http://download.qt.nokia.com/qtsdk/qt-sdk-mac-opensource-2010.05.dmg
  * note that for compiling the 64 bit version you need download the cocoa version of QT (from here http://qt.nokia.com/downloads/qt-for-open-source-cpp-development-on-mac-os-x/)

= Building process =

  * download the source tarball or clone the hg repo
  * configure the sources with the following line
{{{
cmake . -DQT_QMAKE_EXECUTABLE=/usr/bin/qmake -DCMAKE_BUILD_TYPE=Release
}}}
  * run `make` and `make install`

Enjoy!