2021-01-11 10:54:33 +03:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fetchpatch, util-linux, ncurses, flex, bison }:
|
2015-06-29 14:19:23 +03:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 15:41:18 +03:00
|
|
|
pname = "unnethack";
|
2020-09-15 06:48:49 +03:00
|
|
|
version = "5.3.2";
|
2015-06-29 14:19:23 +03:00
|
|
|
|
2020-09-15 06:48:49 +03:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
name = "UnNetHack";
|
|
|
|
owner = "UnNetHack";
|
|
|
|
repo = "UnNetHack";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "1rg0mqyplgn3dfh3wz09a600qxk7aidqw4d84kyiincljvhyb7ps";
|
2015-06-29 14:19:23 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ ncurses ];
|
|
|
|
|
2020-11-24 18:29:28 +03:00
|
|
|
nativeBuildInputs = [ util-linux flex bison ];
|
2015-06-29 14:19:23 +03:00
|
|
|
|
|
|
|
configureFlags = [ "--enable-curses-graphics"
|
|
|
|
"--disable-tty-graphics"
|
|
|
|
"--with-owner=no"
|
|
|
|
"--with-group=no"
|
|
|
|
"--with-gamesdir=/tmp/unnethack"
|
|
|
|
];
|
|
|
|
|
2017-06-16 15:24:39 +03:00
|
|
|
makeFlags = [ "GAMEPERM=744" ];
|
2020-09-15 06:48:49 +03:00
|
|
|
patches = [
|
|
|
|
# fix regression with bison, merged in master
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fix-bison.patch";
|
|
|
|
url = "https://github.com/UnNetHack/UnNetHack/commit/04f0a3a850a94eb8837ddcef31303968240d1c31.patch";
|
|
|
|
sha256 = "1zblbwqqz9nx16k6n31wi2hdvz775lvzmkjblmrx18nbm4ylj0n9";
|
|
|
|
})
|
|
|
|
];
|
2017-06-16 15:24:39 +03:00
|
|
|
|
2019-06-03 18:42:59 +03:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2015-06-29 14:19:23 +03: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
|
|
|
|
'';
|
|
|
|
|
2021-01-11 10:54:33 +03:00
|
|
|
meta = with lib; {
|
2015-06-29 14:19:23 +03:00
|
|
|
description = "Fork of NetHack";
|
2020-04-01 04:11:51 +03:00
|
|
|
homepage = "https://unnethack.wordpress.com/";
|
2015-06-29 14:19:23 +03:00
|
|
|
license = "nethack";
|
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = with maintainers; [ abbradar ];
|
2020-09-15 06:48:49 +03:00
|
|
|
};
|
2015-06-29 14:19:23 +03:00
|
|
|
}
|