23 , enableSound ? tileMode
25 # MacOS / Darwin builds
29 stdenv.mkDerivation rec {
30 pname = "crawl${lib.optionalString tileMode "-tiles"}";
33 src = fetchFromGitHub {
37 hash = "sha256-jhjFC8+A2dQomMwKZPSiEViXeQpty2Dk9alDcNsLvq0=";
40 # Patch hard-coded paths and remove force library builds
42 substituteInPlace crawl-ref/source/util/find_font \
43 --replace '/usr/share/fonts /usr/local/share/fonts /usr/*/lib/X11/fonts' '${fontsPath}/share/fonts'
44 substituteInPlace crawl-ref/source/windowmanager-sdl.cc \
45 --replace 'SDL_image.h' 'SDL2/SDL_image.h'
48 nativeBuildInputs = [ pkg-config which perl pngcrush advancecomp ];
50 # Still unstable with luajit
51 buildInputs = [ lua5_1 zlib sqlite ncurses ]
52 ++ (with python3.pkgs; [ pyyaml ])
53 ++ lib.optionals tileMode [ libpng SDL2 SDL2_image freetype libGLU libGL ]
54 ++ lib.optional enableSound SDL2_mixer
55 ++ (lib.optionals stdenv.hostPlatform.isDarwin (
56 with darwin.apple_sdk.frameworks; [
69 echo "${version}" > util/release_ver
71 patchShebangs util/gen-mi-enum
73 mkdir -p $out/xdg-data
75 + lib.optionalString tileMode "mv xdg-data/*_tiles.* $out/xdg-data"
76 + lib.optionalString (!tileMode) "mv xdg-data/*_console.* $out/xdg-data";
78 fontsPath = lib.optionalString tileMode dejavu_fonts;
81 "prefix=${placeholder "out"}"
82 "FORCE_CC=${stdenv.cc.targetPrefix}cc"
83 "FORCE_CXX=${stdenv.cc.targetPrefix}c++"
84 "HOSTCXX=${buildPackages.stdenv.cc.targetPrefix}c++"
87 "sqlite=${sqlite.dev}"
88 "DATADIR=${placeholder "out"}"
90 ++ lib.optional tileMode "TILES=y"
91 ++ lib.optional enableSound "SOUND=y";
94 lib.optionalString tileMode ''
95 mv $out/bin/crawl $out/bin/crawl-tiles
96 echo "Exec=crawl-tiles" >> $out/xdg-data/org.develz.Crawl_tiles.desktop
97 echo "Icon=crawl" >> $out/xdg-data/org.develz.Crawl_tiles.desktop
98 install -Dm444 $out/xdg-data/org.develz.Crawl_tiles.desktop -t $out/share/applications
99 install -Dm444 $out/xdg-data/org.develz.Crawl_tiles.appdata.xml -t $out/share/metainfo
102 lib.optionalString (!tileMode) ''
103 echo "Exec=crawl" >> $out/xdg-data/org.develz.Crawl_console.desktop
104 echo "Icon=crawl" >> $out/xdg-data/org.develz.Crawl_console.desktop
105 install -Dm444 $out/xdg-data/org.develz.Crawl_console.desktop -t $out/share/applications
106 install -Dm444 $out/xdg-data/org.develz.Crawl_console.appdata.xml -t $out/share/metainfo
108 + "install -Dm444 dat/tiles/stone_soup_icon-512x512.png $out/share/icons/hicolor/512x512/apps/crawl.png"
111 enableParallelBuilding = true;
114 description = "Open-source, single-player, role-playing roguelike game";
115 homepage = "http://crawl.develz.org/";
117 Dungeon Crawl: Stone Soup, an open-source, single-player, role-playing
118 roguelike game of exploration and treasure-hunting in dungeons filled
119 with dangerous and unfriendly monsters in a quest to rescue the
120 mystifyingly fabulous Orb of Zot.
122 platforms = platforms.linux ++ platforms.darwin;
123 license = with licenses; [ gpl2Plus bsd2 bsd3 mit licenses.zlib cc0 ];
124 maintainers = [ maintainers.abbradar ];