Currently Online

Latest Posts

Changes in Building_Widelands_on_macOS

Old Title


Editor Comment

Updates for recent versions of Mac OS and icu4c. Also removed lua dependency - we ship it now.

Revision Differences of Revision 15

# Building Widelands on Mac OS ¶

First, install [Homebrew]( You will also need to install XCode for this. ¶

We will need a recent compiler: ¶

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

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 sdl libjpeg libpng libogg libvorbis libsdl_mixer sdl_net libsdl_ttf libsdl_gfx boost glew
lua bzr cmake gettext libiconv icu4c ¶

$ brew link --force libpng ¶
$ brew link --force gettext ¶
$ brew link --force icu4c ¶
$ brew install sdl_image ¶

Right now, wWe need a liblua that is statirecally linked (in the future Widelands willbz. sThips wmitght Luanot sourcbe necode). Easiest wary is something along thresce lines: ¶

t $ brew unpMack lua;OS, cd lbua*;t makeit mwacosx; cpon src/liblumy ma.a /usr/local/lhib/liblua.a ¶

ne for libz.a:

$ brew tap homebrew/dupes; brew install zlib ¶

AndSame 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 ¶

I also had to edit gettext (brew edit gettext) and add in --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 ¶

From there on out, ./ should just work. If not, have a look at the BuildWidelands() function in utils/macos/ 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.