Skip to content

Commit f600a0d

Browse files
Merge pull request #177331 from kenranunderscore/add-sil-q
2 parents f7251ca + 3120783 commit f600a0d

3 files changed

Lines changed: 75 additions & 0 deletions

File tree

maintainers/maintainer-list.nix

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6684,6 +6684,13 @@
66846684
fingerprint = "932F 3E8E 1C0F 4A98 95D7 B8B8 B0CA A28A 0295 8308";
66856685
}];
66866686
};
6687+
kenran = {
6688+
email = "johannes.maier@mailbox.org";
6689+
github = "kenranunderscore";
6690+
githubId = 5188977;
6691+
matrix = "@kenran_:matrix.org";
6692+
name = "Johannes Maier";
6693+
};
66876694
kentjames = {
66886695
email = "jameschristopherkent@gmail.com";
66896696
github = "kentjames";

pkgs/games/sil-q/default.nix

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{ lib, stdenv, fetchFromGitHub, writeScript, makeWrapper, ncurses, libX11 }:
2+
3+
let
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"
10+
'';
11+
in stdenv.mkDerivation rec {
12+
pname = "sil-q";
13+
version = "1.5.0";
14+
15+
src = fetchFromGitHub {
16+
owner = "sil-quirk";
17+
repo = "sil-q";
18+
rev = "v${version}";
19+
sha256 = "sha256-v/sWhPWF9cCKD8N0RHpwzChMM1t9G2yrMDmi1cZxdOs=";
20+
};
21+
22+
nativeBuildInputs = [ makeWrapper ];
23+
buildInputs = [ ncurses libX11 ];
24+
25+
# Makefile(s) and config are not top-level
26+
sourceRoot = "source/src";
27+
28+
postPatch = ''
29+
# allow usage of ANGBAND_PATH
30+
substituteInPlace config.h --replace "#define FIXED_PATHS" ""
31+
32+
# change Makefile.std for ncurses according to its own comment
33+
substituteInPlace Makefile.std --replace "-lcurses" "-lncurses"
34+
'';
35+
36+
makefile = "Makefile.std";
37+
38+
installPhase = ''
39+
runHook preInstall
40+
41+
mkdir -p $out/bin
42+
cp sil $out/bin/sil-q
43+
wrapProgram $out/bin/sil-q \
44+
--run "export ANGBAND_PATH=\$HOME/.sil" \
45+
--run "${setup} ${src}/lib"
46+
47+
runHook postInstall
48+
'';
49+
50+
meta = {
51+
description = "A roguelike game set in the First Age of Middle-earth";
52+
longDescription = ''
53+
A game of adventure set in the First Age of Middle-earth, when the world still
54+
rang with Elven song and gleamed with Dwarven mail.
55+
56+
Walk the dark halls of Angband. Slay creatures black and fell. Wrest a shining
57+
Silmaril from Morgoth’s iron crown.
58+
59+
A fork of Sil that's still actively developed.
60+
'';
61+
homepage = "https://github.com/sil-quirk/sil-q";
62+
license = lib.licenses.gpl2;
63+
maintainers = [ lib.maintainers.kenran ];
64+
platforms = lib.platforms.linux;
65+
};
66+
}

pkgs/top-level/all-packages.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32315,6 +32315,8 @@ with pkgs;
3231532315

3231632316
sil = callPackage ../games/sil { };
3231732317

32318+
sil-q = callPackage ../games/sil-q { };
32319+
3231832320
simutrans = callPackage ../games/simutrans { };
3231932321
# get binaries without data built by Hydra
3232032322
simutrans_binaries = lowPrio simutrans.binaries;

0 commit comments

Comments
 (0)