···1+{ stdenv, fetchzip, ncurses, libX11, libXaw, libXt, libXext, libXmu, makeWrapper, writeScript, ... }:
2+let
3+ setup = writeScript "setup" ''
4+ mkdir -p "$ANGBAND_PATH"
5+ # Copy all the data files into place
6+ cp -ar $1/* "$ANGBAND_PATH"
7+ # The copied files are not writable, make them so
8+ chmod +w -R "$ANGBAND_PATH"
9+ '';
10+in
11+stdenv.mkDerivation rec {
12+ name = "Sil-${version}";
13+ version = "1.3.0";
14+15+ src = fetchzip {
16+ url = "http://www.amirrorclear.net/flowers/game/sil/Sil-130-src.zip";
17+ sha256 = "1amp2mr3fxascra0k76sdsvikjh8g76nqh46kka9379zd35lfq8w";
18+ stripRoot=false;
19+ };
20+21+ buildInputs = [ makeWrapper ncurses libX11 libXaw libXt libXext libXmu ];
22+23+ sourceRoot = "source/Sil/src";
24+25+ makefile = "Makefile.std";
26+27+ prePatch = ''
28+ # Allow usage of ANGBAND_PATH
29+ substituteInPlace config.h --replace "#define FIXED_PATHS" ""
30+ '';
31+32+ preConfigure = ''
33+ buildFlagsArray+=("LIBS=-lXaw -lXext -lSM -lICE -lXmu -lXt -lX11 -lncurses")
34+ '';
35+36+ installPhase = ''
37+ # the makefile doesn't have a sensible install target, so we hav to do it ourselves
38+ mkdir -p $out/bin
39+ cp sil $out/bin/sil
40+ # Wrap the program to set a user-local ANGBAND_PATH, and run the setup script to copy files into place
41+ # We could just use the options for a user-local save and scores dir, but it tried to write to the
42+ # lib directory anyway, so we might as well give everyone a copy
43+ wrapProgram $out/bin/sil \
44+ --run "set -u" \
45+ --run "export ANGBAND_PATH=\$HOME/.sil" \
46+ --run "${setup} ${src}/Sil/lib"
47+ '';
48+49+ meta = {
50+ description = "A rouge-like game set in the first age of Middle-earth";
51+ longDescription = ''
52+ A game of adventure set in the first age of Middle-earth, when the world still
53+ rang with elven song and gleamed with dwarven mail.
54+55+ Walk the dark halls of Angband. Slay creatures black and fell. Wrest a shining
56+ Silmaril from Morgoth’s iron crown.
57+ '';
58+ homepage = http://www.amirrorclear.net/flowers/game/sil/index.html;
59+ license = stdenv.lib.licenses.gpl2;
60+ maintainers = [ stdenv.lib.maintainers.michaelpj ];
61+ platforms = stdenv.lib.platforms.linux;
62+ };
63+}
+2
pkgs/top-level/all-packages.nix
···1862118622 sienna = callPackage ../games/sienna { love = love_0_10; };
186230018624 simutrans = callPackage ../games/simutrans { };
18625 # get binaries without data built by Hydra
18626 simutrans_binaries = lowPrio simutrans.binaries;
···1862118622 sienna = callPackage ../games/sienna { love = love_0_10; };
1862318624+ sil = callPackage ../games/sil { };
18625+18626 simutrans = callPackage ../games/simutrans { };
18627 # get binaries without data built by Hydra
18628 simutrans_binaries = lowPrio simutrans.binaries;