Skip to content

Instantly share code, notes, and snippets.

@kelvie
Forked from benob/brogue-ce.nix
Last active June 21, 2021 02:45
Show Gist options
  • Save kelvie/be009fa37d92a5228674e59eb7606544 to your computer and use it in GitHub Desktop.
Save kelvie/be009fa37d92a5228674e59eb7606544 to your computer and use it in GitHub Desktop.
nix package for brogue community edition, with terminal support
#{ fetchurl, SDL2, SDL2_image makeDesktopItem }:
with import <nixpkgs> {};
stdenv.mkDerivation rec {
pname = "brogue-ce";
version = "1.9.3";
src = fetchFromGitHub {
owner = "tmewett";
repo = "BrogueCE";
rev = "v${version}";
sha256 = "1n6i6np8ddbi1w9p33qwq4rq4prwk0ykr8zs1079j7hlj0nhpam4";
};
prePatch = ''
sed -i Makefile -e 's,-Wno-format,-Wno-format-security,g'
sed -i config.mk -e 's,DATADIR := .,DATADIR := '$out'/share/brogue,g'
sed -i config.mk -e 's,TERMINAL := NO,TERMINAL := YES,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 ncurses ];
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 lib; {
description = "A roguelike game (brogue community edition)";
homepage = "https://github.com/tmewett/BrogueCE";
license = licenses.agpl3;
maintainers = [ "kelvie@kelvie.ca" ];
platforms = [ "x86_64-linux" ];
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment