nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 makeDesktopItem,
6 copyDesktopItems,
7 SDL2,
8 SDL2_image,
9}:
10
11stdenv.mkDerivation (finalAttrs: {
12 pname = "brogue-ce";
13 version = "1.14.1";
14
15 src = fetchFromGitHub {
16 owner = "tmewett";
17 repo = "BrogueCE";
18 rev = "v${finalAttrs.version}";
19 hash = "sha256-habmfq1jZa70eggLOgsPT6j1OGmmQ6qmWcCwRN2G4Fo=";
20 };
21
22 postPatch = ''
23 substituteInPlace linux/brogue-multiuser.sh \
24 --replace broguedir= "broguedir=$out/opt/brogue-ce #"
25 '';
26
27 nativeBuildInputs = [
28 copyDesktopItems
29 ];
30
31 buildInputs = [
32 SDL2
33 SDL2_image
34 ];
35
36 makeFlags = [ "DATADIR=$(out)/opt/brogue-ce" ];
37
38 desktopItems = [
39 (makeDesktopItem {
40 name = "brogue-ce";
41 desktopName = "Brogue CE";
42 genericName = "Roguelike";
43 comment = "Brave the Dungeons of Doom!";
44 icon = "brogue-ce";
45 exec = "brogue-ce";
46 categories = [
47 "Game"
48 "AdventureGame"
49 ];
50 })
51 ];
52
53 installPhase = ''
54 runHook preInstall
55 mkdir -p $out/opt
56 cp -r bin $out/opt/brogue-ce
57 install -Dm755 linux/brogue-multiuser.sh $out/bin/brogue-ce
58 install -Dm 644 bin/assets/icon.png $out/share/icons/hicolor/256x256/apps/brogue-ce.png
59 runHook postInstall
60 '';
61
62 meta = with lib; {
63 description = "Community-lead fork of the minimalist roguelike game Brogue";
64 mainProgram = "brogue-ce";
65 homepage = "https://github.com/tmewett/BrogueCE";
66 license = licenses.agpl3Plus;
67 maintainers = with maintainers; [
68 fgaz
69 ];
70 platforms = platforms.all;
71 };
72})