···11+{ fetchFromGitHub, stdenv, makeWrapper, pkgconfig, ncurses, lua, SDL2, SDL2_image, SDL2_ttf,
22+SDL2_mixer, freetype, gettext }:
33+44+stdenv.mkDerivation rec {
55+ version = "2017-07-12";
66+ name = "cataclysm-dda-git-${version}";
77+88+ src = fetchFromGitHub {
99+ owner = "CleverRaven";
1010+ repo = "Cataclysm-DDA";
1111+ rev = "2d7aa8c";
1212+ sha256 = "0xx7si4k5ivyb5gv98fzlcghrg3w0dfblri547x7x4is7fj5ffjd";
1313+ };
1414+1515+ nativeBuildInputs = [ makeWrapper pkgconfig ];
1616+1717+ buildInputs = [ ncurses lua SDL2 SDL2_image SDL2_ttf SDL2_mixer freetype gettext ];
1818+1919+ postPatch = ''
2020+ patchShebangs .
2121+ sed -i Makefile \
2222+ -e 's,-Werror,,g' \
2323+ -e 's,\(DATA_PREFIX=$(PREFIX)/share/\)cataclysm-dda/,\1,g'
2424+2525+ sed '1i#include <cmath>' \
2626+ -i src/{crafting,skill,weather_data,melee,vehicle,overmap,iuse_actor}.cpp
2727+ '';
2828+2929+ makeFlags = "PREFIX=$(out) LUA=1 TILES=1 SOUND=1 RELEASE=1 USE_HOME_DIR=1";
3030+3131+ postInstall = ''
3232+ wrapProgram $out/bin/cataclysm-tiles \
3333+ --add-flags "--datadir $out/share/cataclysm-dda/"
3434+ '';
3535+3636+ enableParallelBuilding = true;
3737+3838+ meta = with stdenv.lib; {
3939+ description = "A free, post apocalyptic, zombie infested rogue-like";
4040+ longDescription = ''
4141+ Cataclysm: Dark Days Ahead is a roguelike set in a post-apocalyptic world.
4242+ Surviving is difficult: you have been thrown, ill-equipped, into a
4343+ landscape now riddled with monstrosities of which flesh eating zombies are
4444+ neither the strangest nor the deadliest.
4545+4646+ Yet with care and a little luck, many things are possible. You may try to
4747+ eke out an existence in the forests silently executing threats and
4848+ providing sustenance with your longbow. You can ride into town in a
4949+ jerry-rigged vehicle, all guns blazing, to settle matters in a fug of
5050+ smoke from your molotovs. You could take a more measured approach and
5151+ construct an impregnable fortress, surrounded by traps to protect you from
5252+ the horrors without. The longer you survive, the more skilled and adapted
5353+ you will get and the better equipped and armed to deal with the threats
5454+ you are presented with.
5555+5656+ In the course of your ordeal there will be opportunities and temptations
5757+ to improve or change your very nature. There are tales of survivors fitted
5858+ with extraordinary cybernetics giving great power and stories too of
5959+ gravely mutated survivors who, warped by their ingestion of exotic
6060+ substances or radiation, now more closely resemble insects, birds or fish
6161+ than their original form.
6262+ '';
6363+ homepage = http://en.cataclysmdda.com/;
6464+ license = licenses.cc-by-sa-30;
6565+ platforms = platforms.linux;
6666+ };
6767+}