Skip to content

Instantly share code, notes, and snippets.

@benob
Created May 24, 2020 19:33
Show Gist options
  • Save benob/ae766fbbb069f174a43223d957c5f1e7 to your computer and use it in GitHub Desktop.
Save benob/ae766fbbb069f174a43223d957c5f1e7 to your computer and use it in GitHub Desktop.
nix package for brogue community edition
#{ stdenv, fetchurl, SDL2, SDL2_image makeDesktopItem }:
with import <nixpkgs> {};
stdenv.mkDerivation rec {
pname = "brogue-ce";
version = "1.8.3";
src = fetchFromGitHub {
owner = "tmewett";
repo = "BrogueCE";
rev = "v${version}";
sha256 = "1f6026ahr0sps7a7sbazvd131a0kbir8lj08fnx4nmjkslh13nkq";
};
prePatch = ''
sed -i Makefile -e 's,-Wno-format,,g'
sed -i config.mk -e 's,DATADIR := .,DATADIR := '$out'/share/brogue,g'
sed -i linux/brogue-multiuser.sh -e 's,broguedir="/opt/brogue",broguedir="'$out'/bin",'
sed -i linux/brogue-multiuser.sh -e 's,exec "$broguedir"/brogue,exec "$broguedir"/brogue.real,'
make clean
'';
buildInputs = [ SDL2 SDL2_image ];
desktopItem = makeDesktopItem {
name = "brogue";
desktopName = "Brogue";
genericName = "Roguelike";
comment = "Brave the Dungeons of Doom! (Community Edition)";
icon = "brogue";
exec = "brogue";
categories = "Game;AdventureGame;";
terminal = "false";
};
installPhase = ''
install -m 555 -D bin/brogue $out/bin/brogue.real
install -m 555 -D linux/brogue-multiuser.sh $out/bin/brogue
install -m 444 -D ${desktopItem}/share/applications/brogue.desktop $out/share/applications/brogue.desktop
install -m 444 -D bin/assets/icon.png $out/share/icons/hicolor/256x256/apps/brogue.png
mkdir -p $out/share/brogue
cp -r bin/assets $out/share/brogue/
'';
meta = with stdenv.lib; {
description = "A roguelike game (brogue community edition)";
homepage = "https://github.com/tmewett/BrogueCE";
license = licenses.agpl3;
maintainers = [ maintainers.benob ];
platforms = [ "x86_64-linux" ];
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment