2021-01-15 22:18:51 +00:00
|
|
|
|
{ lib, stdenv, fetchzip, ncurses, libX11, libXaw, libXt, libXext, libXmu, makeWrapper, writeScript, ... }:
|
|
|
|
|
let
|
2020-04-24 23:36:52 +00:00
|
|
|
|
setup = writeScript "setup" ''
|
|
|
|
|
mkdir -p "$ANGBAND_PATH"
|
|
|
|
|
# Copy all the data files into place
|
|
|
|
|
cp -ar $1/* "$ANGBAND_PATH"
|
|
|
|
|
# The copied files are not writable, make them so
|
|
|
|
|
chmod +w -R "$ANGBAND_PATH"
|
|
|
|
|
'';
|
|
|
|
|
in
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
pname = "Sil";
|
|
|
|
|
version = "1.3.0";
|
|
|
|
|
|
|
|
|
|
src = fetchzip {
|
|
|
|
|
url = "http://www.amirrorclear.net/flowers/game/sil/Sil-130-src.zip";
|
|
|
|
|
sha256 = "1amp2mr3fxascra0k76sdsvikjh8g76nqh46kka9379zd35lfq8w";
|
|
|
|
|
stripRoot=false;
|
|
|
|
|
};
|
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
buildInputs = [ ncurses libX11 libXaw libXt libXext libXmu ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
sourceRoot = "source/Sil/src";
|
|
|
|
|
|
|
|
|
|
makefile = "Makefile.std";
|
|
|
|
|
|
|
|
|
|
prePatch = ''
|
|
|
|
|
# Allow usage of ANGBAND_PATH
|
2021-01-15 22:18:51 +00:00
|
|
|
|
substituteInPlace config.h --replace "#define FIXED_PATHS" ""
|
2020-04-24 23:36:52 +00:00
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
|
buildFlagsArray+=("LIBS=-lXaw -lXext -lSM -lICE -lXmu -lXt -lX11 -lncurses")
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
|
# the makefile doesn't have a sensible install target, so we hav to do it ourselves
|
|
|
|
|
mkdir -p $out/bin
|
|
|
|
|
cp sil $out/bin/sil
|
|
|
|
|
# Wrap the program to set a user-local ANGBAND_PATH, and run the setup script to copy files into place
|
2021-01-15 22:18:51 +00:00
|
|
|
|
# We could just use the options for a user-local save and scores dir, but it tried to write to the
|
2020-04-24 23:36:52 +00:00
|
|
|
|
# lib directory anyway, so we might as well give everyone a copy
|
|
|
|
|
wrapProgram $out/bin/sil \
|
|
|
|
|
--run "set -u" \
|
|
|
|
|
--run "export ANGBAND_PATH=\$HOME/.sil" \
|
|
|
|
|
--run "${setup} ${src}/Sil/lib"
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
|
description = "A rouge-like game set in the first age of Middle-earth";
|
|
|
|
|
longDescription = ''
|
2021-01-15 22:18:51 +00:00
|
|
|
|
A game of adventure set in the first age of Middle-earth, when the world still
|
2020-04-24 23:36:52 +00:00
|
|
|
|
rang with elven song and gleamed with dwarven mail.
|
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
|
Walk the dark halls of Angband. Slay creatures black and fell. Wrest a shining
|
2020-04-24 23:36:52 +00:00
|
|
|
|
Silmaril from Morgoth’s iron crown.
|
|
|
|
|
'';
|
|
|
|
|
homepage = "http://www.amirrorclear.net/flowers/game/sil/index.html";
|
2021-01-15 22:18:51 +00:00
|
|
|
|
license = lib.licenses.gpl2;
|
|
|
|
|
maintainers = [ lib.maintainers.michaelpj ];
|
|
|
|
|
platforms = lib.platforms.linux;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
};
|
|
|
|
|
}
|