2018-01-22 13:58:51 +00:00
|
|
|
{ fetchFromGitHub, stdenv, pkgconfig, ncurses, lua, SDL2, SDL2_image, SDL2_ttf,
|
2018-02-06 15:01:15 +00:00
|
|
|
SDL2_mixer, freetype, gettext, CoreFoundation, Cocoa,
|
|
|
|
tiles ? true }:
|
2016-07-03 20:42:37 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2017-12-09 13:09:09 +00:00
|
|
|
version = "2017-12-09";
|
2016-07-03 20:42:37 +00:00
|
|
|
name = "cataclysm-dda-git-${version}";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "CleverRaven";
|
|
|
|
repo = "Cataclysm-DDA";
|
2017-12-09 13:09:09 +00:00
|
|
|
rev = "24e92956db5587809750283873c242cc0796d7e6";
|
|
|
|
sha256 = "1a7kdmx76na4g65zra01qaq98lxp9j2dl9ddv09r0p5yxaizw68z";
|
2016-07-03 20:42:37 +00:00
|
|
|
};
|
|
|
|
|
2018-01-22 13:58:51 +00:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
2016-07-03 20:42:37 +00:00
|
|
|
|
2018-02-06 15:01:15 +00:00
|
|
|
buildInputs = with stdenv.lib; [ ncurses lua gettext ]
|
|
|
|
++ optionals stdenv.isDarwin [ CoreFoundation ]
|
|
|
|
++ optionals tiles [ SDL2 SDL2_image SDL2_ttf SDL2_mixer freetype ]
|
|
|
|
++ optionals (tiles && stdenv.isDarwin) [ Cocoa ];
|
2016-07-03 20:42:37 +00:00
|
|
|
|
2018-01-22 10:45:12 +00:00
|
|
|
patches = [ ./patches/fix_locale_dir_git.patch ];
|
|
|
|
|
2016-07-03 20:42:37 +00:00
|
|
|
postPatch = ''
|
|
|
|
patchShebangs .
|
2018-01-26 12:47:51 +00:00
|
|
|
sed -i data/xdg/com.cataclysmdda.cataclysm-dda.desktop \
|
|
|
|
-e "s,\(Exec=\)\(cataclysm-tiles\),\1$out/bin/\2,"
|
2016-07-03 20:42:37 +00:00
|
|
|
'';
|
|
|
|
|
2018-02-06 15:01:15 +00:00
|
|
|
makeFlags = with stdenv.lib; [
|
|
|
|
"PREFIX=$(out)"
|
|
|
|
"LUA=1"
|
|
|
|
"RELEASE=1"
|
|
|
|
"USE_HOME_DIR=1"
|
2018-01-22 15:13:10 +00:00
|
|
|
"LANGUAGES=all"
|
2018-02-06 15:01:15 +00:00
|
|
|
"VERSION=git-${version}-${substring 0 8 src.rev}"
|
|
|
|
] ++ optionals tiles [
|
|
|
|
"TILES=1"
|
|
|
|
"SOUND=1"
|
|
|
|
] ++ optionals stdenv.isDarwin [
|
|
|
|
"NATIVE=osx"
|
|
|
|
"CLANG=1"
|
2018-01-21 15:01:17 +00:00
|
|
|
];
|
2016-07-03 20:42:37 +00:00
|
|
|
|
2018-02-06 15:01:15 +00:00
|
|
|
postInstall = with stdenv.lib; optionalString (tiles && !stdenv.isDarwin) ''
|
2018-01-26 12:47:51 +00:00
|
|
|
install -D -m 444 data/xdg/com.cataclysmdda.cataclysm-dda.desktop -T $out/share/applications/cataclysm-dda.desktop
|
|
|
|
install -D -m 444 data/xdg/cataclysm-dda.svg -t $out/share/icons/hicolor/scalable/apps
|
2018-02-06 15:01:15 +00:00
|
|
|
'' + optionalString (tiles && stdenv.isDarwin) ''
|
2018-01-22 03:19:27 +00:00
|
|
|
app=$out/Applications/Cataclysm.app
|
|
|
|
install -D -m 444 data/osx/Info.plist -t $app/Contents
|
|
|
|
install -D -m 444 data/osx/AppIcon.icns -t $app/Contents/Resources
|
|
|
|
mkdir $app/Contents/MacOS
|
|
|
|
launcher=$app/Contents/MacOS/Cataclysm.sh
|
|
|
|
cat << SCRIPT > $launcher
|
|
|
|
#!/bin/sh
|
|
|
|
$out/bin/cataclysm-tiles
|
|
|
|
SCRIPT
|
|
|
|
chmod 555 $launcher
|
2016-07-03 20:42:37 +00:00
|
|
|
'';
|
|
|
|
|
2017-12-04 22:42:47 +00:00
|
|
|
# https://hydra.nixos.org/build/65193254
|
|
|
|
# src/weather_data.cpp:203:1: fatal error: opening dependency file obj/tiles/weather_data.d: No such file or directory
|
|
|
|
# make: *** [Makefile:687: obj/tiles/weather_data.o] Error 1
|
|
|
|
enableParallelBuilding = false;
|
2016-07-03 20:42:37 +00:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A free, post apocalyptic, zombie infested rogue-like";
|
|
|
|
longDescription = ''
|
|
|
|
Cataclysm: Dark Days Ahead is a roguelike set in a post-apocalyptic world.
|
|
|
|
Surviving is difficult: you have been thrown, ill-equipped, into a
|
|
|
|
landscape now riddled with monstrosities of which flesh eating zombies are
|
|
|
|
neither the strangest nor the deadliest.
|
|
|
|
|
|
|
|
Yet with care and a little luck, many things are possible. You may try to
|
|
|
|
eke out an existence in the forests silently executing threats and
|
|
|
|
providing sustenance with your longbow. You can ride into town in a
|
|
|
|
jerry-rigged vehicle, all guns blazing, to settle matters in a fug of
|
|
|
|
smoke from your molotovs. You could take a more measured approach and
|
|
|
|
construct an impregnable fortress, surrounded by traps to protect you from
|
|
|
|
the horrors without. The longer you survive, the more skilled and adapted
|
|
|
|
you will get and the better equipped and armed to deal with the threats
|
|
|
|
you are presented with.
|
|
|
|
|
|
|
|
In the course of your ordeal there will be opportunities and temptations
|
|
|
|
to improve or change your very nature. There are tales of survivors fitted
|
|
|
|
with extraordinary cybernetics giving great power and stories too of
|
|
|
|
gravely mutated survivors who, warped by their ingestion of exotic
|
|
|
|
substances or radiation, now more closely resemble insects, birds or fish
|
|
|
|
than their original form.
|
|
|
|
'';
|
2018-03-25 05:04:25 +00:00
|
|
|
homepage = https://cataclysmdda.org/;
|
2016-07-03 20:42:37 +00:00
|
|
|
license = licenses.cc-by-sa-30;
|
2018-01-21 15:01:17 +00:00
|
|
|
platforms = platforms.unix;
|
2016-07-03 20:42:37 +00:00
|
|
|
};
|
|
|
|
}
|