summaryrefslogtreecommitdiffstats
path: root/INSTALL-MacOSX.md
blob: 862fda476125be014628c030b26f9902441015e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Compile and install instructions on MacOSX

To compile Colobot on MacOS X, you need to first get all tools, all
building dependencies (including the recompilation of some of them), and
finally compile colobot.

* Install git from [git-osx-installer on Google Code](https://code.google.com/p/git-osx-installer/)
* Install Xcode through the Mac AppStore
* Accept the Xcode license

        xcodebuild -license

* Download and install Apple's Command Line Developer Tools from within Xcode (Preferences, Download, Components)
* Download and install [Mac Ports](http://www.macports.org/install.php#requirements)
* Install GCC 4.8 through MacPorts

        sudo port install gcc48

* Install all colobot build depends

        sudo port install cmake libsdl libsdl_image libsdl_ttf boost libsndfile glew libicns librsvg

  > [po4a](http://po4a.alioth.debian.org/) should also be installed for the translation of levels, but the [MacPorts' Portfiles have not been accepted yet](http://trac.macports.org/ticket/41227).

* Rebuild libtiff locally

  This is needed because of the following error:

  > libtiff.5.dylib (for architecture x86_64) because larger updated load
  > commands do not fit (the program must be relinked, and you may need to
  > use -headerpad or -headerpad_max_install_names)

  MacPorts changed the default linker flag, a simple local rebuild suffices:

        sudo port -ns upgrade --force tiff

* Rebuild boost with the same gcc that we want to use

  This is needed because boost is compiled against Mac's system libstdc++
  which is older than the one used by gcc-4.8

        sudo port -ns upgrade --force boost configure.compiler=macports-gcc-4.8

* Build colobot with gcc-4.8

        mkdir -p build
        cd build
        CC=/opt/local/bin/gcc-mp-4.8 CXX=/opt/local/bin/g++-mp-4.8 cmake ..
        make

* Build a Colobot drag-n-drop package

        make package

* Open the package

        open colobot-*.dmg

* Once opened, drag the Colobot application and drop it in the
  Application directory. Then just launch it as any other application.