Latest Posts

Changes in Building_Widelands_on_macOS

Old Title


Editor Comment

Updated to be a bit more streamlined with recent changes in trunk.

Revision Differences of Revision 18

# Building Widelands on Mac OS ¶

First, install [Homebrew]( (
[MacPorts]( should work, too) ¶
You will also need to install XCode for both of them. ¶

We will need a recent compiler
. This installed gcc-6 on my system: ¶

$ brew tap homebrew/versions ¶
$ brew install --enable-cxx gcc

I also strongly suggest installing [ccache]( so that incremental builds do not take ages. ¶

$ brew install ccache ¶

Install python and bzr ¶

$ brew install python && brew install bzr ¶

Then install all the dependencies of Widelands: ¶

$ brew install
-v python sdl2 libjpeg libpng libogg libvorbis libsdl2_mixer sdl2_net libsdl2_ttfimage libsdl2_gttfx boost glew bzr cmake gettext libiconv icu4c ¶

$ brew l
ink --force libpng ¶
$ brew link --force gettext ¶
$ brew link --force
ja icu4c ¶
$ brew install
sdl_image ¶

If you want to build a bundle of Widelands, you might need to run something along these lines for icu: ¶

$ install_name_tool
--change '@loader_path/libicudata.52.dylib' /usr/local/opt/icu4c/lib/libicudata.52.dylib /usr/local/opt/icu4c/lib/libicuuc.52.1.dylib ¶

We need a recent libz. This mi
=ght not be necessary on a recent Mac OS,-6 but it was on my machine: ¶

$ brew tap h
omebrew/dupes; brew install zlib ¶

Same for bzip2: ¶

wget; tar xzvf bzip2-1.0.6.tar.gz; cd bzip2-1.0.6; make; cp libbz2.a /usr/local/lib/libbz2.a ¶

w also had to edit gettext (brew edit gettext) and add ink --with-libiconv-prefix=/usr/local/opt/libiconv/ to link it correctly with homebrew's gettext.

At one point you must also check out the source code of Widelands of course.

This takes forever if you want to have the full version history (which you might
want if you want to do serious development), but if you are only wanting to
build widelands without changing much you can try: ¶

$ bzr checkout --lightweight lp:widelands wl_bzr ¶

FrWe did not 'link' all omf ther dependencies inton our Homebrew path, so ¶
./' smight nouldt jwork oust wof the box fork you. IfYou might need to provide ¶
t,ional parameters to cmake so that it finds all your libraries. Have a look
atwe do ithe Bin ¶
[b]( fu-dev/widelancds/tiorun k/vin ew/head:/utils/macos/ ¶
in the BuildWidelands() function
. This script is used to make the daily builds
for Widelands, so it contains all steps that are needed on my system to build
Widelands from scratch, make a bundle and package it into a .dmg.