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

This commit is contained in:
Mitsuhiro Nakamura 2018-01-22 00:01:17 +09:00
parent d1a04efbf7
commit 728a13271e
3 changed files with 25 additions and 10 deletions

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;
};
}

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, CoreFoundation, Cocoa }:
stdenv.mkDerivation rec {
version = "2017-12-09";
@ -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 [ CoreFoundation Cocoa ];
postPatch = ''
patchShebangs .
@ -26,7 +27,11 @@ 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"
];
postInstall = ''
wrapProgram $out/bin/cataclysm-tiles \
@ -65,6 +70,6 @@ stdenv.mkDerivation rec {
'';
homepage = http://en.cataclysmdda.com/;
license = licenses.cc-by-sa-30;
platforms = platforms.linux;
platforms = platforms.unix;
};
}

View File

@ -18139,9 +18139,13 @@ with pkgs;
bzflag = callPackage ../games/bzflag { };
cataclysm-dda = callPackage ../games/cataclysm-dda { };
cataclysm-dda = callPackage ../games/cataclysm-dda {
inherit (darwin.apple_sdk.frameworks) Cocoa;
};
cataclysm-dda-git = callPackage ../games/cataclysm-dda/git.nix { };
cataclysm-dda-git = callPackage ../games/cataclysm-dda/git.nix {
inherit (darwin.apple_sdk.frameworks) CoreFoundation Cocoa;
};
chessdb = callPackage ../games/chessdb { };