1 { lib, stdenv, fetchFromGitHub, fetchpatch, util-linux, ncurses, flex, bison }:
3 stdenv.mkDerivation rec {
7 src = fetchFromGitHub {
12 sha256 = "1rg0mqyplgn3dfh3wz09a600qxk7aidqw4d84kyiincljvhyb7ps";
15 buildInputs = [ ncurses ];
17 nativeBuildInputs = [ util-linux flex bison ];
19 configureFlags = [ "--enable-curses-graphics"
20 "--disable-tty-graphics"
23 "--with-gamesdir=/tmp/unnethack"
26 makeFlags = [ "GAMEPERM=744" ];
28 # fix regression with bison, merged in master
30 name = "fix-bison.patch";
31 url = "https://github.com/UnNetHack/UnNetHack/commit/04f0a3a850a94eb8837ddcef31303968240d1c31.patch";
32 sha256 = "1zblbwqqz9nx16k6n31wi2hdvz775lvzmkjblmrx18nbm4ylj0n9";
36 enableParallelBuilding = true;
39 cp -r /tmp/unnethack $out/share/unnethack/profile
40 mv $out/bin/unnethack $out/bin/.wrapped_unnethack
41 cat <<EOF >$out/bin/unnethack
43 if [ ! -d ~/.unnethack ]; then
45 cp -r $out/share/unnethack/profile/* ~/.unnethack
46 chmod -R +w ~/.unnethack
49 ln -s ~/.unnethack /tmp/unnethack
56 $out/bin/.wrapped_unnethack
58 chmod +x $out/bin/unnethack
62 description = "Fork of NetHack";
63 homepage = "https://unnethack.wordpress.com/";
65 platforms = platforms.all;
66 maintainers = with maintainers; [ abbradar ];