···
1
-
{ fetchFromGitHub, stdenv, pkgconfig, ncurses, lua, SDL2, SDL2_image, SDL2_ttf,
2
-
SDL2_mixer, freetype, gettext, Cocoa, libicns,
1
+
{ stdenv, callPackage, ncurses
2
+
, tiles ? true, Cocoa, libicns
5
-
stdenv.mkDerivation rec {
7
+
inherit (stdenv.lib) optionals optionalString;
8
+
inherit (callPackage ./common.nix { inherit tiles Cocoa debug; }) common utils;
9
+
inherit (utils) fetchFromCleverRaven installMacOSAppLauncher;
12
+
stdenv.mkDerivation (common // rec {
name = "cataclysm-dda-${version}";
9
-
src = fetchFromGitHub {
10
-
owner = "CleverRaven";
11
-
repo = "Cataclysm-DDA";
16
+
src = fetchFromCleverRaven {
sha256 = "03sdzsk4qdq99qckq0axbsvg1apn6xizscd8pwp5w6kq2fyj5xkv";
16
-
nativeBuildInputs = [ pkgconfig ]
17
-
++ stdenv.lib.optionals (tiles && stdenv.isDarwin) [ libicns ];
19
-
buildInputs = with stdenv.lib; [ ncurses lua gettext ]
20
-
++ optionals tiles [ SDL2 SDL2_image SDL2_ttf SDL2_mixer freetype ]
21
-
++ optionals (tiles && stdenv.isDarwin) [ Cocoa ];
21
+
nativeBuildInputs = common.nativeBuildInputs
22
+
++ optionals (tiles && stdenv.isDarwin) [ libicns ];
patches = [ ./patches/fix_locale_dir.patch ];
29
-
makeFlags = with stdenv.lib; [
34
-
# "LANGUAGES=all" # vanilla C:DDA installs all translations even without this flag!
35
-
] ++ optionals tiles [
38
-
] ++ optionals stdenv.isDarwin [
26
+
makeFlags = common.makeFlags
27
+
++ optionals stdenv.isDarwin [
"OSX_MIN=10.6" # SDL for macOS only supports deploying on 10.6 and above
] ++ optionals stdenv.cc.isGNU [
"WARNINGS+=-Wno-deprecated-declarations"
···
"WARNINGS+=-Wno-inconsistent-missing-override"
49
-
NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-user-defined-warnings";
36
+
NIX_CFLAGS_COMPILE = optionalString stdenv.cc.isClang "-Wno-user-defined-warnings";
51
-
postBuild = stdenv.lib.optionalString (tiles && stdenv.isDarwin) ''
38
+
postBuild = optionalString (tiles && stdenv.isDarwin) ''
# iconutil on macOS is not available in nixpkgs
png2icns data/osx/AppIcon.icns data/osx/AppIcon.iconset/*
56
-
postInstall = stdenv.lib.optionalString (tiles && stdenv.isDarwin) ''
57
-
app=$out/Applications/Cataclysm.app
58
-
install -D -m 444 data/osx/Info.plist -t $app/Contents
59
-
install -D -m 444 data/osx/AppIcon.icns -t $app/Contents/Resources
60
-
mkdir $app/Contents/MacOS
61
-
launcher=$app/Contents/MacOS/Cataclysm.sh
62
-
cat << SCRIPT > $launcher
64
-
$out/bin/cataclysm-tiles
43
+
postInstall = optionalString (tiles && stdenv.isDarwin)
44
+
installMacOSAppLauncher;
# Disable, possible problems with hydra
#enableParallelBuilding = true;
72
-
meta = with stdenv.lib; {
73
-
description = "A free, post apocalyptic, zombie infested rogue-like";
74
-
longDescription = ''
75
-
Cataclysm: Dark Days Ahead is a roguelike set in a post-apocalyptic world.
76
-
Surviving is difficult: you have been thrown, ill-equipped, into a
77
-
landscape now riddled with monstrosities of which flesh eating zombies are
78
-
neither the strangest nor the deadliest.
80
-
Yet with care and a little luck, many things are possible. You may try to
81
-
eke out an existence in the forests silently executing threats and
82
-
providing sustenance with your longbow. You can ride into town in a
83
-
jerry-rigged vehicle, all guns blazing, to settle matters in a fug of
84
-
smoke from your molotovs. You could take a more measured approach and
85
-
construct an impregnable fortress, surrounded by traps to protect you from
86
-
the horrors without. The longer you survive, the more skilled and adapted
87
-
you will get and the better equipped and armed to deal with the threats
88
-
you are presented with.
90
-
In the course of your ordeal there will be opportunities and temptations
91
-
to improve or change your very nature. There are tales of survivors fitted
92
-
with extraordinary cybernetics giving great power and stories too of
93
-
gravely mutated survivors who, warped by their ingestion of exotic
94
-
substances or radiation, now more closely resemble insects, birds or fish
95
-
than their original form.
97
-
homepage = https://cataclysmdda.org/;
98
-
license = licenses.cc-by-sa-30;
99
-
maintainers = [ maintainers.skeidel ];
100
-
platforms = platforms.unix;
49
+
meta = with stdenv.lib.maintainers; common.meta // {
50
+
maintainers = common.meta.maintainers ++ [ skeidel ];