about summary refs log tree commit diff
path: root/pkgs/by-name/ga/galaxis/package.nix
blob: 788a7453e20ffb80bd37aff10ba96c68c0a8d9cf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
{ lib
, asciidoctor
, fetchFromGitLab
, ncurses
, stdenv
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "galaxis";
  version = "1.11";

  src = fetchFromGitLab {
    owner = "esr";
    repo = "galaxis";
    rev = finalAttrs.version;
    hash = "sha256-fSzifGoSdWyFGt99slzAsqCMDoeLbBqQGXujX8QAfGc=";
  };

  outputs = [ "out" "man" ];

  nativeBuildInputs = [
    asciidoctor
  ];

  buildInputs = [
    ncurses
  ];

  strictDeps = true;

  makeFlags = [
    "CC=${stdenv.cc.targetPrefix}cc"
    "galaxis"
    "galaxis.6"
  ];

  postPatch = ''
    sed -i -E '/[[:space:]]*xmlto/ s|xmlto|xmlto --skip-validation|' Makefile
  '';

  # This is better than sed-patch the Makefile
  installPhase = ''
    runHook preInstall
    mkdir -p $out/bin $man/share/man/man6
    install -Dm755 galaxis -t $out/bin/
    install -Dm644 galaxis.6 -t $man/share/man/man6
    runHook postInstall
  '';

  meta = {
    description = "Rescue lifeboats lost in interstellar space";
    longDescription = ''
      Lifeboats from a crippled interstellar liner are adrift in a starfield. To
      find them, you can place probes that look in all eight compass directions
      and tell you how many lifeboats they see. If you drop a probe directly on
      a lifeboat it will be revealed immediately. Your objective: find the
      lifeboats as quickly as possible, before the stranded passengers run out
      of oxygen!

      This is a UNIX-hosted, curses-based clone of the nifty little Macintosh
      freeware game Galaxis. It doesn't have the super-simple, point-and-click
      interface of the original, but compensates by automating away some of the
      game's simpler deductions.
    '';
    homepage = "http://catb.org/~esr/galaxis/";
    license = with lib.licenses; [ gpl2Plus ];
    mainProgram = "galaxis";
    maintainers = with lib.maintainers; [ AndersonTorres ];
    platforms = lib.platforms.linux;
  };
})