Files
nixpkgs/pkgs/by-name/un/unnethack/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

89 lines
1.8 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
util-linux,
ncurses,
flex,
bison,
lua5_4,
}:
stdenv.mkDerivation {
pname = "unnethack";
version = "6.0.14";
src = fetchFromGitHub {
owner = "UnNetHack";
repo = "UnNetHack";
# releases are not tagged
rev = "c8c1a467bb114fc7cb9967d20ebf389e11e1e7fd";
hash = "sha256-45sybOM2zCPCCuHGZ5sEeJzkgcwvi3MhgOC1v1kRwWg=";
};
patches = [
# util-linux does not contains "col" binary on Darwin. Only needed for documentation build.
# https://github.com/util-linux/util-linux/commit/8886d84e25a457702b45194d69a47313f76dc6bc
./disable-col-check.patch
];
buildInputs = [
ncurses
lua5_4
];
nativeBuildInputs = [
util-linux
flex
bison
];
configureFlags = [
"--enable-curses-graphics"
"--disable-tty-graphics"
"--with-owner=no"
"--with-group=no"
"--with-gamesdir=/tmp/unnethack"
];
makeFlags = [ "GAMEPERM=744" ];
enableParallelBuilding = true;
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 = {
description = "Fork of NetHack";
mainProgram = "unnethack";
homepage = "https://unnethack.wordpress.com/";
license = with lib.licenses; [
gpl3Only
cc-by-sa-30
publicDomain
];
platforms = lib.platforms.all;
maintainers = [ ];
};
}