1 { stdenv, lib, fetchFromGitHub, fetchpatch, which, sqlite, lua5_1, perl, python3, zlib, pkg-config, ncurses
2 , dejavu_fonts, libpng, SDL2, SDL2_image, SDL2_mixer, libGLU, libGL, freetype, pngcrush, advancecomp
3 , tileMode ? false, enableSound ? tileMode, buildPackages
5 # MacOS / Darwin builds
9 stdenv.mkDerivation rec {
10 pname = "crawl${lib.optionalString tileMode "-tiles"}";
13 src = fetchFromGitHub {
17 sha256 = "sha256-SM8dSDV+88QGMqoFkITop1PHh9EakdgiV4tkXCw9pjM=";
20 # Patch hard-coded paths and remove force library builds
21 patches = [ ./crawl_purify.patch ];
23 nativeBuildInputs = [ pkg-config which perl pngcrush advancecomp ];
25 # Still unstable with luajit
26 buildInputs = [ lua5_1 zlib sqlite ncurses ]
27 ++ (with python3.pkgs; [ pyyaml ])
28 ++ lib.optionals tileMode [ libpng SDL2 SDL2_image freetype libGLU libGL ]
29 ++ lib.optional enableSound SDL2_mixer
30 ++ (lib.optionals stdenv.isDarwin (
31 assert (lib.assertMsg (darwin != null) "Must have darwin frameworks available for darwin builds");
32 with darwin.apple_sdk.frameworks; [
33 AppKit AudioUnit CoreAudio ForceFeedback Carbon IOKit OpenGL
39 echo "${version}" > util/release_ver
41 patchShebangs util/gen-mi-enum
45 fontsPath = lib.optionalString tileMode dejavu_fonts;
47 makeFlags = [ "prefix=${placeholder "out"}" "FORCE_CC=${stdenv.cc.targetPrefix}cc" "FORCE_CXX=${stdenv.cc.targetPrefix}c++" "HOSTCXX=${buildPackages.stdenv.cc.targetPrefix}c++"
49 "SAVEDIR=~/.crawl" "sqlite=${sqlite.dev}"
50 "DATADIR=${placeholder "out"}"
51 ] ++ lib.optional tileMode "TILES=y"
52 ++ lib.optional enableSound "SOUND=y";
55 ${lib.optionalString tileMode "mv $out/bin/crawl $out/bin/crawl-tiles"}
56 sed -i 's#/usr/games/##' debian/crawl${lib.optionalString tileMode "-tiles"}.desktop
57 install -m 444 -D debian/crawl${lib.optionalString tileMode "-tiles"}.desktop \
58 $out/share/applications/crawl${lib.optionalString tileMode "-tiles"}.desktop
59 install -m 444 -D dat/tiles/stone_soup_icon-512x512.png $out/share/icons/hicolor/512x512/apps/crawl.png
62 enableParallelBuilding = true;
65 description = "Open-source, single-player, role-playing roguelike game";
66 homepage = "http://crawl.develz.org/";
68 Dungeon Crawl: Stone Soup, an open-source, single-player, role-playing
69 roguelike game of exploration and treasure-hunting in dungeons filled
70 with dangerous and unfriendly monsters in a quest to rescue the
71 mystifyingly fabulous Orb of Zot.
73 platforms = platforms.linux ++ platforms.darwin;
74 license = with licenses; [ gpl2Plus bsd2 bsd3 mit licenses.zlib cc0 ];
75 maintainers = [ maintainers.abbradar ];