en fr

es pl

sv de
direct download download direct download

howto/en/compile on mac

From Wormux

This page will explain how to compile Wormux on mac OS X.

It assumes you have developer tools installed.

Contents

Macports

If all you want is install Wormux on your computer to play it, apart from using the binaries macports is the easiest way (however the process takes a rather long time, and sometimes errors occur that stop the process). However, Macports will not build distributable app bundles.

Download maports from http://www.macports.org/. You can then build Wormux by opening /Applications/Utilities/Terminal and issuing the command sudo /opt/local/bin/port install wormux If the process finishes without error, you can play wormux by typing /opt/local/bin/wormux

Building app bundles with CMake

Before starting you may want to remove any SDL, libpng or libjpeg frameworks/old libs you may have (you can add them again once it's over if you need them). This is probably not necessary but anyway it's not hard and makes sure we avoid conflicts.

  • In the source repository, script /mac/cmake_build.sh will do something very similar to the following steps.

All the following commands are issued in /Applications/Utilities/Terminal. (tip: to do cd operations, just type "cd " in the terminal without quotes, drag and drop the folder onto the terminal window and press enter)

Dependencies

expand gettext archive

% cd /path/to/gettext-0.16
% ./configure
% make
% sudo make install
  • Get other dependencies from this pre-built package : http://download.gna.org/wormux/mac/mac_dependencies.zip
  • Copy all .frameworks to [your hard disk]/Library/Frameworks
  • Copy libSDLmain_UB.a to the main womux source directory
  • Retrieve libintl.a from your gettext installation (most likely in /usr/local/lib, or /opt/local/lib if you used macports) and put it in the main womux source directory

Building Wormux

mkdir cmake-build
cd cmake-build
cmake .. -DPREFIX=/opt/wormux
make
sudo make install

or for a debug build, use this cmake command instead :

cmake .. -DBUILD=Debug -DPREFIX:PATH=/opt/wormux

Building the App bundle

  • You can use a simple script like this, provided you have Info.plist and an icon file :
INSTALL_PREFIX="/opt/wormux"

mkdir -p ./Wormux.app/Contents/Resources
mkdir -p ./Wormux.app/Contents/MacOS
mkdir -p ./Wormux.app/Contents/Frameworks
cp Info.plist ./Wormux.app/Contents/Info.plist
cp wormux.icns ./Wormux.app/Contents/Resources/wormux.icns
cp $INSTALL_PREFIX/bin/wormux ./Wormux.app/Contents/MacOS/wormux
cp -r $INSTALL_PREFIX/share/wormux ./Wormux.app/Contents/Resources/data
cp -r $INSTALL_PREFIX/share/locale ./Wormux.app/Contents/Resources/locale
  • Once this script has been executed, all you need to do to make the app packageable is to copy all *.framework bundles into Wormux.app/Contents/Frameworks and you're done.

Universal binaries

For universal binaries, for now you need to do the entire build process on both a ppc and an intel computer. Then you can lipo libraries as well executables together.

% lipo -create ppc_file intel_file -output universal_binary_file