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 # Fails the build occasionally due to missing buid depends:
37 # ./../sys/unix/unixmain.c:9:10: fatal error: date.h: No such file or directory
38 # TODO: remove once upstream issue is fixed:
39 # https://github.com/UnNetHack/UnNetHack/issues/56
40 enableParallelBuilding = false;
43 cp -r /tmp/unnethack $out/share/unnethack/profile
44 mv $out/bin/unnethack $out/bin/.wrapped_unnethack
45 cat <<EOF >$out/bin/unnethack
47 if [ ! -d ~/.unnethack ]; then
49 cp -r $out/share/unnethack/profile/* ~/.unnethack
50 chmod -R +w ~/.unnethack
53 ln -s ~/.unnethack /tmp/unnethack
60 $out/bin/.wrapped_unnethack
62 chmod +x $out/bin/unnethack
66 description = "Fork of NetHack";
67 homepage = "https://unnethack.wordpress.com/";
69 platforms = platforms.all;
70 maintainers = with maintainers; [ abbradar ];