cataclysm-dda{,-git}: build on Darwin

This commit is contained in:
Mitsuhiro Nakamura
2018-01-22 00:01:45 +09:00
parent d1a04efbf7
commit 728a13271e
3 changed files with 25 additions and 10 deletions
+10 -4
View File
@@ -1,5 +1,5 @@
{ fetchFromGitHub, stdenv, makeWrapper, pkgconfig, ncurses, lua, SDL2, SDL2_image, SDL2_ttf,
SDL2_mixer, freetype, gettext }:
SDL2_mixer, freetype, gettext, Cocoa }:
stdenv.mkDerivation rec {
version = "0.C";
@@ -14,7 +14,8 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ makeWrapper pkgconfig ];
buildInputs = [ ncurses lua SDL2 SDL2_image SDL2_ttf SDL2_mixer freetype gettext ];
buildInputs = [ ncurses lua SDL2 SDL2_image SDL2_ttf SDL2_mixer freetype gettext ]
++ stdenv.lib.optionals stdenv.isDarwin [ Cocoa ];
postPatch = ''
patchShebangs .
@@ -26,7 +27,12 @@ stdenv.mkDerivation rec {
-i src/{crafting,skill,weather_data,melee,vehicle,overmap,iuse_actor}.cpp
'';
makeFlags = "PREFIX=$(out) LUA=1 TILES=1 SOUND=1 RELEASE=1 USE_HOME_DIR=1";
makeFlags = [
"PREFIX=$(out) LUA=1 TILES=1 SOUND=1 RELEASE=1 USE_HOME_DIR=1"
] ++ stdenv.lib.optionals stdenv.isDarwin [
"NATIVE=osx CLANG=1"
"OSX_MIN=10.6" # SDL for macOS only supports deploying on 10.6 and above
];
postInstall = ''
wrapProgram $out/bin/cataclysm-tiles \
@@ -64,6 +70,6 @@ stdenv.mkDerivation rec {
homepage = http://en.cataclysmdda.com/;
license = licenses.cc-by-sa-30;
maintainers = [ maintainers.skeidel ];
platforms = platforms.linux;
platforms = platforms.unix;
};
}