Skip to content

Commit 4e5bbec

Browse files
Merge pull request #1 from CleverRaven/master
Hmm lets see if i screwed up
2 parents d3b2ac1 + e585b53 commit 4e5bbec

File tree

321 files changed

+94675
-70865
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

321 files changed

+94675
-70865
lines changed

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ logg.txt
1010
bindist/
1111
cataclysmdda-*
1212
objwin/
13-
version.h
13+
src/version.h
14+
lua/catabindings.cpp
1415
CataclysmWin.cscope_file_list
1516
CataclysmWin.depend
1617
CataclysmWin.layout
@@ -40,3 +41,6 @@ Thumbs.db
4041
core
4142
tags
4243
cscope.*
44+
45+
# Compiled binary translations
46+
lang/mo/

COMPILING_osx.md

Lines changed: 71 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
# Building Cataclysm-DDA on Mac OS X
22

3-
Tested with OS X 10.8.4, Xcode 4.6.2.
4-
I haven't played it extensively but it builds and runs.
3+
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.
54

6-
Not sure if it compiles with older OS/XCode versions.
7-
This worked for me, your mileage may vary.
85

96
### SDL
107

118
SDL, SDL\_image, and SDL\_ttf are needed for the tiles build.
129

10+
Option (1):
1311
[**SDL framework**](http://www.libsdl.org/download-1.2.php)
1412
http://www.libsdl.org/release/SDL-1.2.15.dmg
1513

@@ -22,42 +20,48 @@ http://www.libsdl.org/projects/SDL_ttf/release/SDL_ttf-2.0.11.dmg
2220
Copy `SDL.framework`, `SDL_image.framework`, and `SDL_ttf.framework`
2321
to `/Library/Frameworks` or `/Users/name/Library/Frameworks`.
2422

23+
Option (2):
2524
Alternately, shared libraries (libsdl, libsdl\_image, libsdl\_ttf) can be used
2625
instead of frameworks. Install with a package manager (Fink, MacPorts,
2726
Homebrew, pkgsrc) or build and install from source.
2827

28+
For Homebrew:
29+
`brew install sdl sdl_image sdl_ttf`
30+
2931
### ncurses, gettext
3032

3133
ncurses and gettext are needed for localization.
3234
Install with a package manager, or build from source and install.
3335

3436
* ncurses needs wide character support enabled.
3537

36-
## Build
37-
38-
From the Cataclysm-DDA source folder:
39-
40-
The easiest way to try it out is the console version without localization:
41-
42-
$ make NATIVE=osx LOCALIZED=0 OSX_MIN=10.6
38+
For Homebrew:
39+
`brew tap homebrew/dupes`
40+
`brew install gettext ncurses`
41+
`brew link --force gettext ncurses`
4342

44-
For localization support and/or to use libsdl (not frameworks):
45-
46-
$ export CXXFLAGS="-I/path/to/include" LDFLAGS="-L/path/to/lib"
47-
48-
This adds paths to find shared libraries outside of /usr and /usr/local.
49-
Multiple `-I/...` or `-L/...` paths can be specified.
43+
* 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.
5044

5145
### Example builds:
5246

5347
Build a release version with SDL graphical tiles:
5448

5549
$ make FRAMEWORK=1 NATIVE=osx OSX_MIN=10.6 RELEASE=1 TILES=1 LOCALIZE=0
5650

51+
Build SDL version with shared libraries:
52+
53+
$ make NATIVE=osx OSX_MIN=10.6 RELEASE=1 TILES=1 LOCALIZE=0
54+
55+
Build a release console version without localization:
56+
57+
$ make NATIVE=osx OSX_MIN=10.6 RELEASE=1 LOCALIZE=0
58+
5759
Build a debug version with SDL ASCII:
5860

5961
$ make FRAMEWORK=1 NATIVE=osx OSX_MIN=10.6 SDL=1 LOCALIZE=0
6062

63+
64+
6165
## Run
6266

6367
$ ./cataclysm
@@ -81,3 +85,53 @@ or
8185
`SDL=1` build the SDL version with ASCII characters.
8286

8387
`TILES=1` build the SDL version with graphical tiles.
88+
89+
### Application bundle packaging:
90+
91+
Create new folder and name it `Cataclysm.app`.
92+
93+
Put compiled binaries (`./cataclysm-tiles` and/or `./cataclysm`) with `./gfx/` and `./data/` folders inside `/Cataclysm.app/Contents/Resources/`.
94+
95+
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/`.
96+
97+
Create folder `/Cataclysm.app/Contents/MacOS` and file ./Cataclysm within it with this content:
98+
99+
#!/bin/sh
100+
PWD=`dirname "${0}"`
101+
OSREV=`uname -r | cut -d. -f1`
102+
if [ "$OSREV" -ge 11 ] ; then
103+
export DYLD_LIBRARY_PATH=${PWD}/../Resources/libs
104+
export DYLD_FRAMEWORK_PATH=${PWD}/../Resources/libs
105+
else
106+
export DYLD_FALLBACK_LIBRARY_PATH=${PWD}/../Resources/libs
107+
export DYLD_FALLBACK_FRAMEWORK_PATH=${PWD}/../Resources/libs
108+
fi
109+
cd "${PWD}/../Resources/"; ./cataclysm-tiles
110+
111+
112+
### Creating a DMG
113+
Create an new folder named Cataclysm
114+
115+
Move your Cataclysm.app into it
116+
117+
Start Disk Utility
118+
119+
File / New -> Disk Image From Folder
120+
121+
Select the Cataclysm folder you created above.
122+
123+
Done!
124+
125+
126+
# Troubleshooting
127+
128+
ISSUE: crash on startup due to libint.8.dylib aborting
129+
130+
Basically if you're compiling on Mountain Lion or above, it won't be possible to run successfully on older OS X versions due to libint.8 / pthreads version issue.
131+
132+
See below (quoted form https://wiki.gnome.org/GTK+/OSX/Building)
133+
134+
"There's another issue with building on Lion or Mountain Lion using either "native" or the 10.7 SDK: Apple has updated the pthreads implementation to provide recursive locking. This would be good except that Gettext's libintl uses this and if the pthreads implementation doesn't provide it it fabricates its own. Since the Lion pthreads does provide it, libintl links the provided function and then crashes when you try to run it against an older version of the library. The simplest solution is to specify the 10.6 SDK when building on Lion, but that won't work on Mountain Lion, which doesn't include it. See below for how to install and use XCode 3 on Lion and later for building applications compatible with earlier versions of OSX."
135+
136+
Workaround: install XCode 3 like that article describes, or disable localization support in Cataclysm so gettext/libint are not dependencies. Or else simply don't support OS X versions below 10.7.
137+

0 commit comments

Comments
 (0)