@@ -1,5 +1,5 @@
11{ fetchFromGitHub, stdenv, makeWrapper, pkgconfig, ncurses, lua, SDL2, SDL2_image, SDL2_ttf,
2−SDL2_mixer, freetype, gettext }:
2+SDL2_mixer, freetype, gettext, Cocoa }:
33
44stdenv.mkDerivation rec {
55 version = "0.C";
@@ -14,7 +14,8 @@ stdenv.mkDerivation rec {
1414
1515 nativeBuildInputs = [ makeWrapper pkgconfig ];
1616
17− buildInputs = [ ncurses lua SDL2 SDL2_image SDL2_ttf SDL2_mixer freetype gettext ];
17+ buildInputs = [ ncurses lua SDL2 SDL2_image SDL2_ttf SDL2_mixer freetype gettext ]
18+ ++ stdenv.lib.optionals stdenv.isDarwin [ Cocoa ];
1819
1920 postPatch = ''
2021 patchShebangs .
@@ -26,7 +27,12 @@ stdenv.mkDerivation rec {
2627 -i src/{crafting,skill,weather_data,melee,vehicle,overmap,iuse_actor}.cpp
2728 '';
2829
29− makeFlags = "PREFIX=$(out) LUA=1 TILES=1 SOUND=1 RELEASE=1 USE_HOME_DIR=1";
30+ makeFlags = [
31+ "PREFIX=$(out) LUA=1 TILES=1 SOUND=1 RELEASE=1 USE_HOME_DIR=1"
32+ ] ++ stdenv.lib.optionals stdenv.isDarwin [
33+ "NATIVE=osx CLANG=1"
34+ "OSX_MIN=10.6" # SDL for macOS only supports deploying on 10.6 and above
35+ ];
3036
3137 postInstall = ''
3238 wrapProgram $out/bin/cataclysm-tiles \
@@ -64,6 +70,6 @@ stdenv.mkDerivation rec {
6470 homepage = http://en.cataclysmdda.com/;
6571 license = licenses.cc-by-sa-30;
6672 maintainers = [ maintainers.skeidel ];
67− platforms = platforms.linux;
73+ platforms = platforms.unix;
6874 };
6975}