1 { lib, stdenv, fetchurl, fetchpatch, SDL, ncurses, libtcod, makeDesktopItem }:
3 stdenv.mkDerivation rec {
8 url = "https://sites.google.com/site/broguegame/brogue-${version}-linux-amd64.tbz2";
9 sha256 = "0i042zb3axjf0cpgpdh8hvfn66dbfizidyvw0iymjk2n760z2kx7";
12 # Pull upstream fix for -fno-common toolchains:
13 # https://github.com/tmewett/BrogueCE/pull/63
15 name = "fno-common.patch";
16 url = "https://github.com/tmewett/BrogueCE/commit/2c7ed0c48d9efd06bf0a2589ba967c0a22a8fa87.patch";
17 sha256 = "19lr2fa25dh79klm4f4kqyyqq7w5xmw9z0fvylkcckqvcv7dwhp3";
22 sed -i Makefile -e 's,LIBTCODDIR=.*,LIBTCODDIR=${libtcod},g' \
23 -e 's,sdl-config,${lib.getDev SDL}/bin/sdl-config,g'
24 sed -i src/platform/tcod-platform.c -e "s,fonts/font,$out/share/brogue/fonts/font,g"
29 buildInputs = [ SDL ncurses libtcod ];
31 desktopItem = makeDesktopItem {
33 desktopName = "Brogue";
34 genericName = "Roguelike";
35 comment = "Brave the Dungeons of Doom!";
38 categories = [ "Game" "AdventureGame" ];
42 install -m 555 -D bin/brogue $out/bin/brogue
43 install -m 444 -D ${desktopItem}/share/applications/brogue.desktop $out/share/applications/brogue.desktop
44 install -m 444 -D bin/brogue-icon.png $out/share/icons/hicolor/256x256/apps/brogue.png
45 mkdir -p $out/share/brogue
46 cp -r bin/fonts $out/share/brogue/
49 # fix crash; shouldn’t be a security risk because it’s an offline game
50 hardeningDisable = [ "stackprotector" "fortify" ];
53 description = "A roguelike game";
54 homepage = "https://sites.google.com/site/broguegame/";
55 license = licenses.agpl3;
56 maintainers = [ maintainers.skeidel ];
57 platforms = [ "x86_64-linux" ];