summary refs log tree commit diff
path: root/pkgs/games/unnethack
diff options
context:
space:
mode:
authorNikolay Amiantov <ab@fmap.me>2015-06-29 14:19:23 +0300
committerNikolay Amiantov <ab@fmap.me>2015-07-28 12:33:29 +0300
commit97a289b111477db5a02fff40806e776fcc28edb1 (patch)
tree94acb9639f62a22098dad718f7904d6ec4502a9e /pkgs/games/unnethack
parent6e049800ed40d073785b01cc8ea2ffc8606afb3d (diff)
downloadnixlib-97a289b111477db5a02fff40806e776fcc28edb1.tar
nixlib-97a289b111477db5a02fff40806e776fcc28edb1.tar.gz
nixlib-97a289b111477db5a02fff40806e776fcc28edb1.tar.bz2
nixlib-97a289b111477db5a02fff40806e776fcc28edb1.tar.lz
nixlib-97a289b111477db5a02fff40806e776fcc28edb1.tar.xz
nixlib-97a289b111477db5a02fff40806e776fcc28edb1.tar.zst
nixlib-97a289b111477db5a02fff40806e776fcc28edb1.zip
unnethack: add new package
Diffstat (limited to 'pkgs/games/unnethack')
-rw-r--r--pkgs/games/unnethack/default.nix53
1 files changed, 53 insertions, 0 deletions
diff --git a/pkgs/games/unnethack/default.nix b/pkgs/games/unnethack/default.nix
new file mode 100644
index 000000000000..0ba542fe63c2
--- /dev/null
+++ b/pkgs/games/unnethack/default.nix
@@ -0,0 +1,53 @@
+{ stdenv, fetchgit, utillinux, ncurses, flex, bison }:
+
+stdenv.mkDerivation rec {
+  name = "unnethack-5.3.1";
+
+  src = fetchgit {
+    url = "https://github.com/UnNetHack/UnNetHack";
+    rev = "63677eb256b5a75430f190cfb0f76bdd9bd0b9dd";
+    sha256 = "48a80ef83308b91d4aa86598e30e5b5ce9a5b2da2a763fe921698990c3243969";
+  };
+
+  buildInputs = [ ncurses ];
+
+  nativeBuildInputs = [ utillinux flex bison ];
+
+  configureFlags = [ "--enable-curses-graphics"
+                     "--disable-tty-graphics"
+                     "--with-owner=no"
+                     "--with-group=no"
+                     "--with-gamesdir=/tmp/unnethack"
+                   ];
+
+  postInstall = ''
+    cp -r /tmp/unnethack $out/share/unnethack/profile
+    mv $out/bin/unnethack $out/bin/.wrapped_unnethack
+    cat <<EOF >$out/bin/unnethack
+      #! ${stdenv.shell} -e
+      if [ ! -d ~/.unnethack ]; then
+        mkdir -p ~/.unnethack
+        cp -r $out/share/unnethack/profile/* ~/.unnethack
+        chmod -R +w ~/.unnethack
+      fi
+
+      ln -s ~/.unnethack /tmp/unnethack
+
+      cleanup() {
+        rm -rf /tmp/unnethack
+      }
+      trap cleanup EXIT
+
+      $out/bin/.wrapped_unnethack
+    EOF
+    chmod +x $out/bin/unnethack
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Fork of NetHack";
+    homepage = "http://unnethack.wordpress.com/";
+    license = "nethack";
+    platforms = platforms.all;
+    maintainers = with maintainers; [ abbradar ];
+  }; 
+}