summary refs log tree commit diff
path: root/pkgs/games
diff options
context:
space:
mode:
authorSandro <sandro.jaeckel@gmail.com>2022-06-15 01:32:21 +0200
committerGitHub <noreply@github.com>2022-06-15 01:32:21 +0200
commitf600a0dfd8eefac533ef5ef4b99e70f29dd02da5 (patch)
treeb1200157b6907ec09c3f333e9e2958415f5540ac /pkgs/games
parentf7251ca210593cbd2299581975128af6ef9a4e40 (diff)
parent312078319cfcea2c07cbc77bbc47751326903b96 (diff)
downloadnixpkgs-f600a0dfd8eefac533ef5ef4b99e70f29dd02da5.tar
nixpkgs-f600a0dfd8eefac533ef5ef4b99e70f29dd02da5.tar.gz
nixpkgs-f600a0dfd8eefac533ef5ef4b99e70f29dd02da5.tar.bz2
nixpkgs-f600a0dfd8eefac533ef5ef4b99e70f29dd02da5.tar.lz
nixpkgs-f600a0dfd8eefac533ef5ef4b99e70f29dd02da5.tar.xz
nixpkgs-f600a0dfd8eefac533ef5ef4b99e70f29dd02da5.tar.zst
nixpkgs-f600a0dfd8eefac533ef5ef4b99e70f29dd02da5.zip
Merge pull request #177331 from kenranunderscore/add-sil-q
Diffstat (limited to 'pkgs/games')
-rw-r--r--pkgs/games/sil-q/default.nix66
1 files changed, 66 insertions, 0 deletions
diff --git a/pkgs/games/sil-q/default.nix b/pkgs/games/sil-q/default.nix
new file mode 100644
index 00000000000..1676f8da55a
--- /dev/null
+++ b/pkgs/games/sil-q/default.nix
@@ -0,0 +1,66 @@
+{ lib, stdenv, fetchFromGitHub, writeScript, makeWrapper, ncurses, libX11 }:
+
+let
+  setup = writeScript "setup" ''
+    mkdir -p "$ANGBAND_PATH"
+    # copy all the data files into place
+    cp -ar $1/* "$ANGBAND_PATH"
+    # the copied files need to be writable
+    chmod +w -R "$ANGBAND_PATH"
+  '';
+in stdenv.mkDerivation rec {
+  pname = "sil-q";
+  version = "1.5.0";
+
+  src = fetchFromGitHub {
+    owner = "sil-quirk";
+    repo = "sil-q";
+    rev = "v${version}";
+    sha256 = "sha256-v/sWhPWF9cCKD8N0RHpwzChMM1t9G2yrMDmi1cZxdOs=";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = [ ncurses libX11 ];
+
+  # Makefile(s) and config are not top-level
+  sourceRoot = "source/src";
+
+  postPatch = ''
+    # allow usage of ANGBAND_PATH
+    substituteInPlace config.h --replace "#define FIXED_PATHS" ""
+
+    # change Makefile.std for ncurses according to its own comment
+    substituteInPlace Makefile.std --replace "-lcurses" "-lncurses"
+  '';
+
+  makefile = "Makefile.std";
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/bin
+    cp sil $out/bin/sil-q
+    wrapProgram $out/bin/sil-q \
+      --run "export ANGBAND_PATH=\$HOME/.sil" \
+      --run "${setup} ${src}/lib"
+
+    runHook postInstall
+  '';
+
+  meta = {
+    description = "A roguelike game set in the First Age of Middle-earth";
+    longDescription = ''
+      A game of adventure set in the First Age of Middle-earth, when the world still
+      rang with Elven song and gleamed with Dwarven mail.
+
+      Walk the dark halls of Angband.  Slay creatures black and fell.  Wrest a shining
+      Silmaril from Morgoth’s iron crown.
+
+      A fork of Sil that's still actively developed.
+    '';
+    homepage = "https://github.com/sil-quirk/sil-q";
+    license = lib.licenses.gpl2;
+    maintainers = [ lib.maintainers.kenran ];
+    platforms = lib.platforms.linux;
+  };
+}