summary refs log tree commit diff
path: root/pkgs/games/brogue-ce/default.nix
blob: 77e58ed5a1a6a78f7ab29f2999744953ffc9c0ad (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
{ lib
, stdenv
, fetchFromGitHub
, makeDesktopItem
, copyDesktopItems
, SDL2
, SDL2_image
}:

stdenv.mkDerivation rec {
  pname = "brogue-ce";
  version = "1.13";

  src = fetchFromGitHub {
    owner = "tmewett";
    repo = "BrogueCE";
    rev = "v${version}";
    hash = "sha256-FUIdi1Ytn+INeD9550MW41qXtLb6in0QS3Snt8QaXUA=";
  };

  postPatch = ''
    substituteInPlace linux/brogue-multiuser.sh \
      --replace broguedir= "broguedir=$out/opt/brogue-ce #"
  '';

  nativeBuildInputs = [
    copyDesktopItems
  ];

  buildInputs = [
    SDL2
    SDL2_image
  ];

  makeFlags = [ "DATADIR=$(out)/opt/brogue-ce" ];

  desktopItems = [(makeDesktopItem {
    name = "brogue-ce";
    desktopName = "Brogue CE";
    genericName = "Roguelike";
    comment = "Brave the Dungeons of Doom!";
    icon = "brogue-ce";
    exec = "brogue-ce";
    categories = [ "Game" "AdventureGame" ];
  })];

  installPhase = ''
    runHook preInstall
    mkdir -p $out/opt
    cp -r bin $out/opt/brogue-ce
    install -Dm755 linux/brogue-multiuser.sh $out/bin/brogue-ce
    install -Dm 644 bin/assets/icon.png $out/share/icons/hicolor/256x256/apps/brogue-ce.png
    runHook postInstall
  '';

  meta = with lib; {
    description = "A community-lead fork of the minimalist roguelike game Brogue";
    homepage = "https://github.com/tmewett/BrogueCE";
    license = licenses.agpl3;
    maintainers = with maintainers; [ AndersonTorres fgaz ];
    platforms = platforms.all;
  };
}