2021-08-13 17:55:06 +01:00
|
|
|
{ lib, stdenv, fetchurl, cmake, SDL, makeDesktopItem, copyDesktopItems
|
|
|
|
, imagemagick }:
|
2021-08-07 10:43:20 +01:00
|
|
|
|
2021-08-13 17:55:06 +01:00
|
|
|
let
|
|
|
|
|
|
|
|
icon = fetchurl {
|
|
|
|
url = "https://baller.tuxfamily.org/king.png";
|
|
|
|
sha256 = "1xq2h87s648wjpjl72ds3xnnk2jp8ghbkhjzh2g4hpkq2zdz90hy";
|
|
|
|
};
|
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
2021-08-07 10:43:20 +01:00
|
|
|
pname = "ballerburg";
|
|
|
|
version = "1.2.0";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://download.tuxfamily.org/baller/ballerburg-${version}.tar.gz";
|
|
|
|
sha256 = "sha256-BiX0shPBGA8sshee8rxs41x+mdsrJzBqhpDDic6sYwA=";
|
|
|
|
};
|
|
|
|
|
2021-08-13 17:55:06 +01:00
|
|
|
nativeBuildInputs = [ cmake copyDesktopItems imagemagick ];
|
2021-08-07 10:43:20 +01:00
|
|
|
|
|
|
|
buildInputs = [ SDL ];
|
|
|
|
|
2021-08-13 17:55:06 +01:00
|
|
|
desktopItems = [
|
|
|
|
(makeDesktopItem {
|
|
|
|
name = "Ballerburg";
|
|
|
|
desktopName = "Ballerburg SDL";
|
|
|
|
type = "Application";
|
|
|
|
exec = "_NET_WM_ICON=ballerburg ballerburg";
|
|
|
|
comment = meta.description;
|
|
|
|
icon = "ballerburg";
|
|
|
|
categories = "Game;";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
# Generate and install icon files
|
|
|
|
for size in 16 32 48 64 72 96 128 192 512 1024; do
|
|
|
|
mkdir -p $out/share/icons/hicolor/"$size"x"$size"/apps
|
|
|
|
convert ${icon} -sample "$size"x"$size" \
|
|
|
|
-background white -gravity south -extent "$size"x"$size" \
|
|
|
|
$out/share/icons/hicolor/"$size"x"$size"/apps/ballerburg.png
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2021-08-07 10:43:20 +01:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Classic cannon combat game";
|
|
|
|
longDescription = ''
|
|
|
|
Two castles, separated by a mountain, try to defeat each other with their cannonballs,
|
|
|
|
either by killing the opponent's king or by weakening the opponent enough so that the king capitulates.'';
|
|
|
|
homepage = "https://baller.tuxfamily.org/";
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
maintainers = [ maintainers.j0hax ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|