···11+{ stdenv, fetchzip, ncurses, libX11, libXaw, libXt, libXext, libXmu, makeWrapper, writeScript, ... }:
22+let
33+ setup = writeScript "setup" ''
44+ mkdir -p "$ANGBAND_PATH"
55+ # Copy all the data files into place
66+ cp -ar $1/* "$ANGBAND_PATH"
77+ # The copied files are not writable, make them so
88+ chmod +w -R "$ANGBAND_PATH"
99+ '';
1010+in
1111+stdenv.mkDerivation rec {
1212+ name = "Sil-${version}";
1313+ version = "1.3.0";
1414+1515+ src = fetchzip {
1616+ url = "http://www.amirrorclear.net/flowers/game/sil/Sil-130-src.zip";
1717+ sha256 = "1amp2mr3fxascra0k76sdsvikjh8g76nqh46kka9379zd35lfq8w";
1818+ stripRoot=false;
1919+ };
2020+2121+ buildInputs = [ makeWrapper ncurses libX11 libXaw libXt libXext libXmu ];
2222+2323+ sourceRoot = "source/Sil/src";
2424+2525+ makefile = "Makefile.std";
2626+2727+ prePatch = ''
2828+ # Allow usage of ANGBAND_PATH
2929+ substituteInPlace config.h --replace "#define FIXED_PATHS" ""
3030+ '';
3131+3232+ preConfigure = ''
3333+ buildFlagsArray+=("LIBS=-lXaw -lXext -lSM -lICE -lXmu -lXt -lX11 -lncurses")
3434+ '';
3535+3636+ installPhase = ''
3737+ # the makefile doesn't have a sensible install target, so we hav to do it ourselves
3838+ mkdir -p $out/bin
3939+ cp sil $out/bin/sil
4040+ # Wrap the program to set a user-local ANGBAND_PATH, and run the setup script to copy files into place
4141+ # We could just use the options for a user-local save and scores dir, but it tried to write to the
4242+ # lib directory anyway, so we might as well give everyone a copy
4343+ wrapProgram $out/bin/sil \
4444+ --run "set -u" \
4545+ --run "export ANGBAND_PATH=\$HOME/.sil" \
4646+ --run "${setup} ${src}/Sil/lib"
4747+ '';
4848+4949+ meta = {
5050+ description = "A rouge-like game set in the first age of Middle-earth";
5151+ longDescription = ''
5252+ A game of adventure set in the first age of Middle-earth, when the world still
5353+ rang with elven song and gleamed with dwarven mail.
5454+5555+ Walk the dark halls of Angband. Slay creatures black and fell. Wrest a shining
5656+ Silmaril from Morgoth’s iron crown.
5757+ '';
5858+ homepage = http://www.amirrorclear.net/flowers/game/sil/index.html;
5959+ license = stdenv.lib.licenses.gpl2;
6060+ maintainers = [ stdenv.lib.maintainers.michaelpj ];
6161+ platforms = stdenv.lib.platforms.linux;
6262+ };
6363+}
+2
pkgs/top-level/all-packages.nix
···18621186211862218622 sienna = callPackage ../games/sienna { love = love_0_10; };
18623186231862418624+ sil = callPackage ../games/sil { };
1862518625+1862418626 simutrans = callPackage ../games/simutrans { };
1862518627 # get binaries without data built by Hydra
1862618628 simutrans_binaries = lowPrio simutrans.binaries;