1{ stdenv, fetchFromGitHub, which, sqlite, lua5_1, perl, zlib, pkgconfig, ncurses
2, dejavu_fonts, libpng, SDL2, SDL2_image, mesa, freetype
3, tileMode ? true
4}:
5
6let version = "0.16.2";
7in
8stdenv.mkDerivation rec {
9 name = "crawl-${version}" + (if tileMode then "-tiles" else "");
10 src = fetchFromGitHub {
11 owner = "crawl-ref";
12 repo = "crawl-ref";
13 rev = version;
14 sha256 = "08ns49if8941vsg6abywgw3mnjafgj5sga0cdvvvviq0qqzprhw9";
15 };
16
17 patches = [ ./crawl_purify.patch ];
18
19 nativeBuildInputs = [ pkgconfig which perl ];
20
21 # Still unstable with luajit
22 buildInputs = [ lua5_1 zlib sqlite ncurses ]
23 ++ stdenv.lib.optionals tileMode
24 [ libpng SDL2 SDL2_image freetype mesa ];
25
26 preBuild = ''
27 cd crawl-ref/source
28 echo "${version}" > util/release_ver
29 # Related to issue #1963
30 sed -i 's/-fuse-ld=gold//g' Makefile
31 for i in util/*; do
32 patchShebangs $i
33 done
34 patchShebangs util/gen-mi-enum
35 '';
36
37 makeFlags = [ "prefix=$(out)" "FORCE_CC=gcc" "FORCE_CXX=g++" "HOSTCXX=g++"
38 "SAVEDIR=~/.crawl" "sqlite=${sqlite}" ]
39 ++ stdenv.lib.optionals tileMode [ "TILES=y" "dejavu_fonts=${dejavu_fonts}" ];
40
41 postInstall = if tileMode then "mv $out/bin/crawl $out/bin/crawl-tiles" else "";
42
43 enableParallelBuilding = true;
44
45 meta = with stdenv.lib; {
46 description = "Open-source, single-player, role-playing roguelike game";
47 homepage = http://crawl.develz.org/;
48 longDescription = ''
49 Open-source, single-player, role-playing roguelike game of exploration and
50 treasure-hunting in dungeons filled with dangerous and unfriendly monsters
51 in a quest to rescue the mystifyingly fabulous Orb of Zot.
52 '';
53 platforms = platforms.linux;
54 license = with licenses; [ gpl2Plus bsd2 bsd3 mit licenses.zlib cc0 ];
55 maintainers = [ maintainers.abbradar ];
56 };
57}