1 { pkgs, lib, stdenv, fetchFromGitHub, writeScript, makeWrapper, ncurses, libX11 }:
4 setup = writeScript "setup" ''
5 mkdir -p "$ANGBAND_PATH"
6 # copy all the data files into place
7 cp -ar $1/* "$ANGBAND_PATH"
8 # the copied files need to be writable
9 chmod +w -R "$ANGBAND_PATH"
11 in stdenv.mkDerivation rec {
15 src = fetchFromGitHub {
19 sha256 = "sha256-v/sWhPWF9cCKD8N0RHpwzChMM1t9G2yrMDmi1cZxdOs=";
22 nativeBuildInputs = [ makeWrapper ];
23 buildInputs = [ ncurses libX11 ];
25 # Makefile(s) and config are not top-level
26 sourceRoot = "source/src";
29 # allow usage of ANGBAND_PATH
30 substituteInPlace config.h --replace "#define FIXED_PATHS" ""
32 # change Makefile.std for ncurses according to its own comment
33 substituteInPlace Makefile.std --replace "-lcurses" "-lncurses"
36 makefile = "Makefile.std";
43 wrapProgram $out/bin/sil-q \
44 --run "export ANGBAND_PATH=\$HOME/.sil-q" \
45 --run "${setup} ${src}/lib"
51 saveDirCreation = pkgs.runCommand "save-dir-creation" {} ''
52 HOME=$(pwd) ${lib.getExe pkgs.sil-q} --help
53 test -d .sil-q && touch $out
58 description = "A roguelike game set in the First Age of Middle-earth";
60 A game of adventure set in the First Age of Middle-earth, when the world still
61 rang with Elven song and gleamed with Dwarven mail.
63 Walk the dark halls of Angband. Slay creatures black and fell. Wrest a shining
64 Silmaril from Morgoth’s iron crown.
66 A fork of Sil that's still actively developed.
68 homepage = "https://github.com/sil-quirk/sil-q";
69 license = lib.licenses.gpl2;
70 maintainers = [ lib.maintainers.kenran ];
71 platforms = lib.platforms.linux;