COMPILING_osx.md has all the basic instructions, there has to be just a few additional steps if you use homebrew package manager (witch is the one every Mac dev/power user should use).
Here is updated instructions:
[tt]
Building Cataclysm-DDA on Mac OS X
To build Cataclysm on Mac you’ll have to get XCode with command line tools (or just download them separately from https://developer.apple.com/downloads/) and Homebrew package manager.
SDL
SDL, SDL_image, and SDL_ttf are needed for the tiles build.
Option (1):
SDL framework
http://www.libsdl.org/release/SDL-1.2.15.dmg
SDL_image framework
http://www.libsdl.org/projects/SDL_image/release/SDL_image-1.2.12.dmg
SDL_ttf framework
http://www.libsdl.org/projects/SDL_ttf/release/SDL_ttf-2.0.11.dmg
Copy SDL.framework
, SDL_image.framework
, and SDL_ttf.framework
to /Library/Frameworks
or /Users/name/Library/Frameworks
.
Option (2):
Alternately, shared libraries (libsdl, libsdl_image, libsdl_ttf) can be used
instead of frameworks. Install with a package manager (Fink, MacPorts,
Homebrew, pkgsrc) or build and install from source.
For Homebrew:
brew install sdl sdl_image sdl_ttf
ncurses, gettext
ncurses and gettext are needed for localization.
Install with a package manager, or build from source and install.
- ncurses needs wide character support enabled.
For Homebrew:
brew tap homebrew/dupes
brew install gettext ncurses
brew link --force gettext ncurses
- After you build Cataclysm remember to unlink gettext and ncurses with
brew unlink gettext ncurses
if you build other software, it might conflict with OSX versions.
Example builds:
Build a release version with SDL graphical tiles:
$ make FRAMEWORK=1 NATIVE=osx OSX_MIN=10.6 RELEASE=1 TILES=1 LOCALIZE=0
Build SDL version with shared libraries:
$ make NATIVE=osx OSX_MIN=10.6 RELEASE=1 TILES=1 LOCALIZE=0
Build a release console version without localization:
$ make NATIVE=osx OSX_MIN=10.6 RELEASE=1 LOCALIZE=0
Build a debug version with SDL ASCII:
$ make FRAMEWORK=1 NATIVE=osx OSX_MIN=10.6 SDL=1 LOCALIZE=0
Run
$ ./cataclysm
or
$ ./cataclysm-tiles
Make Options
FRAMEWORK=1
use frameworks; omit to use libsdl, libsdl_image, libsdl_ttf.
LOCALIZED=0
disable localization; enabled by default (requires gettext and ncurses with wide character support).
NATIVE=osx
build for OS X.
OSX_MIN=version
set -mmacosx-version-min=
(for OS X > 10.5 set it to 10.6 or higher); omit for 10.5.
RELEASE=1
build an optimized ‘release’ version.
SDL=1
build the SDL version with ASCII characters.
TILES=1
build the SDL version with graphical tiles.
Application bundle packaging:
Create new folder and name it Cataclysm.app
.
Put compiled binaries (./cataclysm-tiles
and/or ./cataclysm
) with ./gfx/
and ./data/
folders inside /Cataclysm.app/Contents/Resources/
.
To bundle SDL libs copy SDL.framework
, SDL_image.framework
, and SDL_ttf.framework
to /Cataclysm.app/Contents/Resources/libs/
or shared libs homebrew installed from /usr/local/Cellar/sdl*/version/lib/
.
Create folder /Cataclysm.app/Contents/MacOS
and file ./Cataclysm within it with this content:
#!/bin/sh
PWD=dirname "${0}"
OSREV=uname -r | cut -d. -f1
if [ “$OSREV” -ge 11 ] ; then
export DYLD_LIBRARY_PATH=${PWD}/…/Resources/libs
export DYLD_FRAMEWORK_PATH=${PWD}/…/Resources/libs
else
export DYLD_FALLBACK_LIBRARY_PATH=${PWD}/…/Resources/libs
export DYLD_FALLBACK_FRAMEWORK_PATH=${PWD}/…/Resources/libs
fi
cd “${PWD}/…/Resources/”; ./cataclysm-tiles
// TODO: Write Applescript with version selector and Terminal/iTerm launcher for curses version.[/tt]
Don’t put code tags in spoilers, yo. -The MGMT, GlyphGryph