2015-06-29 11:19:23 +00:00
|
|
|
{ stdenv, fetchgit, utillinux, ncurses, flex, bison }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-06-03 15:42:59 +00:00
|
|
|
name = "unnethack-${version}";
|
|
|
|
version = "5.2.0";
|
2015-06-29 11:19:23 +00:00
|
|
|
|
|
|
|
src = fetchgit {
|
|
|
|
url = "https://github.com/UnNetHack/UnNetHack";
|
2019-06-03 15:42:59 +00:00
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
sha256 = "088gd2c7v95f2pm9ky38i28sz73mnsksr2p2hhhflkchxncd21f1";
|
2015-06-29 11:19:23 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ ncurses ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ utillinux flex bison ];
|
|
|
|
|
|
|
|
configureFlags = [ "--enable-curses-graphics"
|
|
|
|
"--disable-tty-graphics"
|
|
|
|
"--with-owner=no"
|
|
|
|
"--with-group=no"
|
|
|
|
"--with-gamesdir=/tmp/unnethack"
|
|
|
|
];
|
|
|
|
|
2017-06-16 12:24:39 +00:00
|
|
|
makeFlags = [ "GAMEPERM=744" ];
|
|
|
|
|
2019-06-03 15:42:59 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2015-06-29 11:19:23 +00:00
|
|
|
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";
|
2018-01-05 19:42:46 +00:00
|
|
|
homepage = https://unnethack.wordpress.com/;
|
2015-06-29 11:19:23 +00:00
|
|
|
license = "nethack";
|
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = with maintainers; [ abbradar ];
|
|
|
|
};
|
|
|
|
}
|