BuildingOnMac.wiki
author RedGrinner
Mon, 06 Dec 2010 14:35:16 +0000
changeset 48 3c5d26c1562a
parent 34 bb98d418d1e3
child 88 460d92a9be10
permissions -rw-r--r--
Edited wiki page LuaAPI through web user interface.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
25
4f6f055c0848 Created wiki page through web user interface.
vittorio.giovara@gmail.com
parents:
diff changeset
     1
#summary Instructions for building Hedgewars on Mac OS X
4f6f055c0848 Created wiki page through web user interface.
vittorio.giovara@gmail.com
parents:
diff changeset
     2
#labels Phase-Deploy
4f6f055c0848 Created wiki page through web user interface.
vittorio.giovara@gmail.com
parents:
diff changeset
     3
4f6f055c0848 Created wiki page through web user interface.
vittorio.giovara@gmail.com
parents:
diff changeset
     4
= Prerequisites =
4f6f055c0848 Created wiki page through web user interface.
vittorio.giovara@gmail.com
parents:
diff changeset
     5
4f6f055c0848 Created wiki page through web user interface.
vittorio.giovara@gmail.com
parents:
diff changeset
     6
  * XCode must be installed
4f6f055c0848 Created wiki page through web user interface.
vittorio.giovara@gmail.com
parents:
diff changeset
     7
  * some knowledge of Terminal is preferred
4f6f055c0848 Created wiki page through web user interface.
vittorio.giovara@gmail.com
parents:
diff changeset
     8
4f6f055c0848 Created wiki page through web user interface.
vittorio.giovara@gmail.com
parents:
diff changeset
     9
== Necessary Libraries ==
4f6f055c0848 Created wiki page through web user interface.
vittorio.giovara@gmail.com
parents:
diff changeset
    10
4f6f055c0848 Created wiki page through web user interface.
vittorio.giovara@gmail.com
parents:
diff changeset
    11
Download the following libraries and place them under `/Library/Frameworks/`
4f6f055c0848 Created wiki page through web user interface.
vittorio.giovara@gmail.com
parents:
diff changeset
    12
4f6f055c0848 Created wiki page through web user interface.
vittorio.giovara@gmail.com
parents:
diff changeset
    13
  * SDL - http://www.libsdl.org/release/SDL-1.2.14.dmg
4f6f055c0848 Created wiki page through web user interface.
vittorio.giovara@gmail.com
parents:
diff changeset
    14
  * SDL_image - http://www.libsdl.org/projects/SDL_image/release/SDL_image-1.2.10.dmg
27
6fc5b427224f Edited wiki page BuildingOnMac through web user interface.
vittorio.giovara@gmail.com
parents: 26
diff changeset
    15
  * SDL_mixer - http://www.libsdl.org/projects/SDL_mixer/release/SDL_mixer-1.2.11.dmg
25
4f6f055c0848 Created wiki page through web user interface.
vittorio.giovara@gmail.com
parents:
diff changeset
    16
  * SDL_net - http://dl.dropbox.com/u/24468/SDL_net.framework.zip
4f6f055c0848 Created wiki page through web user interface.
vittorio.giovara@gmail.com
parents:
diff changeset
    17
  * SDL_ttf - http://www.libsdl.org/projects/SDL_ttf/release/SDL_ttf-2.0.10.dmg
4f6f055c0848 Created wiki page through web user interface.
vittorio.giovara@gmail.com
parents:
diff changeset
    18
  * Ogg sources - http://downloads.xiph.org/releases/ogg/libogg-1.2.1.tar.bz2
26
1c1ed695c676 Edited wiki page BuildingOnMac through web user interface.
vittorio.giovara@gmail.com
parents: 25
diff changeset
    19
  * Vorbis sources - http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.2.tar.bz2
25
4f6f055c0848 Created wiki page through web user interface.
vittorio.giovara@gmail.com
parents:
diff changeset
    20
4f6f055c0848 Created wiki page through web user interface.
vittorio.giovara@gmail.com
parents:
diff changeset
    21
=== Compiling Ogg Vorbis ===
4f6f055c0848 Created wiki page through web user interface.
vittorio.giovara@gmail.com
parents:
diff changeset
    22
4f6f055c0848 Created wiki page through web user interface.
vittorio.giovara@gmail.com
parents:
diff changeset
    23
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.
4f6f055c0848 Created wiki page through web user interface.
vittorio.giovara@gmail.com
parents:
diff changeset
    24
4f6f055c0848 Created wiki page through web user interface.
vittorio.giovara@gmail.com
parents:
diff changeset
    25
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. After that build as usual and copy the generated framework to the usual `/Library/Frameworks/` directory.
4f6f055c0848 Created wiki page through web user interface.
vittorio.giovara@gmail.com
parents:
diff changeset
    26
33
397cb8bbddde Edited wiki page BuildingOnMac through web user interface.
vittorio.giovara@gmail.com
parents: 27
diff changeset
    27
=== (Optional) Server ===
397cb8bbddde Edited wiki page BuildingOnMac through web user interface.
vittorio.giovara@gmail.com
parents: 27
diff changeset
    28
397cb8bbddde Edited wiki page BuildingOnMac through web user interface.
vittorio.giovara@gmail.com
parents: 27
diff changeset
    29
If you want to compile server for hosting lan games, you need to download an Haskell compiler. We are going to use the Glasgow Haskell Compiler.
397cb8bbddde Edited wiki page BuildingOnMac through web user interface.
vittorio.giovara@gmail.com
parents: 27
diff changeset
    30
34
bb98d418d1e3 Edited wiki page BuildingOnMac through web user interface.
vittorio.giovara@gmail.com
parents: 33
diff changeset
    31
  * download the Haskell Platform and install both the GHC and Haskell Platform - http://lambda.galois.com/hp-tmp/2010.2.0.0/haskell-platform-2010.2.0.0.i386.dmg
33
397cb8bbddde Edited wiki page BuildingOnMac through web user interface.
vittorio.giovara@gmail.com
parents: 27
diff changeset
    32
  * run `cabal update` to get an updated list of available libraries and install the necessary dependencies with
397cb8bbddde Edited wiki page BuildingOnMac through web user interface.
vittorio.giovara@gmail.com
parents: 27
diff changeset
    33
{{{
397cb8bbddde Edited wiki page BuildingOnMac through web user interface.
vittorio.giovara@gmail.com
parents: 27
diff changeset
    34
sudo cabal install dataenc hslogger network-bytestring
397cb8bbddde Edited wiki page BuildingOnMac through web user interface.
vittorio.giovara@gmail.com
parents: 27
diff changeset
    35
}}}
397cb8bbddde Edited wiki page BuildingOnMac through web user interface.
vittorio.giovara@gmail.com
parents: 27
diff changeset
    36
  * then in the following cmake comand, remember to add `-DWITH_SERVER=1` or `-DBUNDLE`
397cb8bbddde Edited wiki page BuildingOnMac through web user interface.
vittorio.giovara@gmail.com
parents: 27
diff changeset
    37
25
4f6f055c0848 Created wiki page through web user interface.
vittorio.giovara@gmail.com
parents:
diff changeset
    38
== Necessary Tools ==
4f6f055c0848 Created wiki page through web user interface.
vittorio.giovara@gmail.com
parents:
diff changeset
    39
4f6f055c0848 Created wiki page through web user interface.
vittorio.giovara@gmail.com
parents:
diff changeset
    40
Download and install the following toolchains
4f6f055c0848 Created wiki page through web user interface.
vittorio.giovara@gmail.com
parents:
diff changeset
    41
4f6f055c0848 Created wiki page through web user interface.
vittorio.giovara@gmail.com
parents:
diff changeset
    42
  * Freepascal compiler - http://sourceforge.net/projects/freepascal/files/Mac%20OS%20X/2.4.0/fpc-2.4.0.intel-macosx.dmg/download
4f6f055c0848 Created wiki page through web user interface.
vittorio.giovara@gmail.com
parents:
diff changeset
    43
  * CMake - http://www.cmake.org/files/v2.8/cmake-2.8.3-Darwin-universal.dmg
4f6f055c0848 Created wiki page through web user interface.
vittorio.giovara@gmail.com
parents:
diff changeset
    44
  * QT - http://download.qt.nokia.com/qtsdk/qt-sdk-mac-opensource-2010.05.dmg
4f6f055c0848 Created wiki page through web user interface.
vittorio.giovara@gmail.com
parents:
diff changeset
    45
  * note that for compiling the 64 bit version you need download the cocoa version of QT
4f6f055c0848 Created wiki page through web user interface.
vittorio.giovara@gmail.com
parents:
diff changeset
    46
4f6f055c0848 Created wiki page through web user interface.
vittorio.giovara@gmail.com
parents:
diff changeset
    47
= Building process =
4f6f055c0848 Created wiki page through web user interface.
vittorio.giovara@gmail.com
parents:
diff changeset
    48
4f6f055c0848 Created wiki page through web user interface.
vittorio.giovara@gmail.com
parents:
diff changeset
    49
  * download the source tarball or clone the hg repo
4f6f055c0848 Created wiki page through web user interface.
vittorio.giovara@gmail.com
parents:
diff changeset
    50
  * configure the sources with the following line
4f6f055c0848 Created wiki page through web user interface.
vittorio.giovara@gmail.com
parents:
diff changeset
    51
{{{
4f6f055c0848 Created wiki page through web user interface.
vittorio.giovara@gmail.com
parents:
diff changeset
    52
cmake . -DQT_QMAKE_EXECUTABLE=/usr/bin/qmake -DCMAKE_BUILD_TYPE=Release
4f6f055c0848 Created wiki page through web user interface.
vittorio.giovara@gmail.com
parents:
diff changeset
    53
}}}
4f6f055c0848 Created wiki page through web user interface.
vittorio.giovara@gmail.com
parents:
diff changeset
    54
  * (optional) if you want to build a relocatable bundle, that is a bundle you can copy on your friend's mac or distribute it, add `-DBUNDLE` to the above command line
33
397cb8bbddde Edited wiki page BuildingOnMac through web user interface.
vittorio.giovara@gmail.com
parents: 27
diff changeset
    55
  * (note) if you specify `-DBUNDLE` you'll need to install GHC as well
25
4f6f055c0848 Created wiki page through web user interface.
vittorio.giovara@gmail.com
parents:
diff changeset
    56
  * run `make` and `make install`
4f6f055c0848 Created wiki page through web user interface.
vittorio.giovara@gmail.com
parents:
diff changeset
    57
4f6f055c0848 Created wiki page through web user interface.
vittorio.giovara@gmail.com
parents:
diff changeset
    58
Enjoy!