lol
1{ stdenv, fetchgit, utillinux, ncurses, flex, bison }:
2
3stdenv.mkDerivation rec {
4 name = "unnethack-5.3.1";
5
6 src = fetchgit {
7 url = "https://github.com/UnNetHack/UnNetHack";
8 rev = "63677eb256b5a75430f190cfb0f76bdd9bd0b9dd";
9 sha256 = "48a80ef83308b91d4aa86598e30e5b5ce9a5b2da2a763fe921698990c3243969";
10 };
11
12 buildInputs = [ ncurses ];
13
14 nativeBuildInputs = [ utillinux flex bison ];
15
16 configureFlags = [ "--enable-curses-graphics"
17 "--disable-tty-graphics"
18 "--with-owner=no"
19 "--with-group=no"
20 "--with-gamesdir=/tmp/unnethack"
21 ];
22
23 postInstall = ''
24 cp -r /tmp/unnethack $out/share/unnethack/profile
25 mv $out/bin/unnethack $out/bin/.wrapped_unnethack
26 cat <<EOF >$out/bin/unnethack
27 #! ${stdenv.shell} -e
28 if [ ! -d ~/.unnethack ]; then
29 mkdir -p ~/.unnethack
30 cp -r $out/share/unnethack/profile/* ~/.unnethack
31 chmod -R +w ~/.unnethack
32 fi
33
34 ln -s ~/.unnethack /tmp/unnethack
35
36 cleanup() {
37 rm -rf /tmp/unnethack
38 }
39 trap cleanup EXIT
40
41 $out/bin/.wrapped_unnethack
42 EOF
43 chmod +x $out/bin/unnethack
44 '';
45
46 meta = with stdenv.lib; {
47 description = "Fork of NetHack";
48 homepage = "http://unnethack.wordpress.com/";
49 license = "nethack";
50 platforms = platforms.all;
51 maintainers = with maintainers; [ abbradar ];
52 };
53}