Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / games / snipes / default.nix
blob01b24ee434c3deadf380abf30dd55a5e5a600503
1 { lib, stdenv, fetchFromGitHub, fetchurl, SDL2, SDL2_ttf }:
3 let
4   font = fetchurl {
5     url    = "http://kingbird.myphotos.cc/ee22d44076adb8a34d8e20df4be3730a/SnipesConsole.ttf";
6     sha256 = "06n8gq18js0bv4svx84ljzhs9zmi81wy0zqcqj3b4g0rsrkr20a7";
7   };
9 in stdenv.mkDerivation {
10   pname = "snipes";
11   version = "20180930";
13   src = fetchFromGitHub {
14     owner  = "Davidebyzero";
15     repo   = "Snipes";
16     rev    = "594af45108e07aa4159c3babc9b5e53609c3fd6e";
17     sha256 = "0gmh38swm74jmljy0bq27ipqzb4h8y9rzwc1j6harbd9qqz5knac";
18   };
20   postPatch = ''
21     substitute config-sample.h config.h \
22       --replace SnipesConsole.ttf $out/share/snipes/SnipesConsole.ttf
23     substituteInPlace GNUmakefile \
24       --replace 'CFLAGS=-Werror -Wall' 'CFLAGS=-Wall'
25   '';
27   enableParallelBuilding = true;
29   buildInputs = [ SDL2 SDL2_ttf ];
31   installPhase = ''
32     runHook preInstall
34     install -Dm755 -t $out/bin snipes
35     install -Dm644 -t $out/share/doc/snipes *.md
36     install -Dm644 ${font} $out/share/snipes/SnipesConsole.ttf
38     runHook postInstall
39   '';
41   meta = with lib; {
42     description = "Modern port of the classic 1982 text-mode game Snipes";
43     homepage    = "https://www.vogons.org/viewtopic.php?f=7&t=49073";
44     license     = licenses.free; # This reverse-engineered source code is released with the original authors' permission.
45     maintainers = with maintainers; [ peterhoeg ];
46   };