diff options
author | Sandro <sandro.jaeckel@gmail.com> | 2021-08-16 15:16:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-16 15:16:22 +0200 |
commit | 6327a87b56a22ce2b28d1bcc6767b02af558fd72 (patch) | |
tree | 003eb8f305d646a21c08947501fae1227510aff8 /pkgs/games | |
parent | 15e63e727cf4ac394a6b390f6be0d499cac132ff (diff) | |
parent | b40971db7fc3431661cb8f8238051289ebebc33d (diff) | |
download | nixlib-6327a87b56a22ce2b28d1bcc6767b02af558fd72.tar nixlib-6327a87b56a22ce2b28d1bcc6767b02af558fd72.tar.gz nixlib-6327a87b56a22ce2b28d1bcc6767b02af558fd72.tar.bz2 nixlib-6327a87b56a22ce2b28d1bcc6767b02af558fd72.tar.lz nixlib-6327a87b56a22ce2b28d1bcc6767b02af558fd72.tar.xz nixlib-6327a87b56a22ce2b28d1bcc6767b02af558fd72.tar.zst nixlib-6327a87b56a22ce2b28d1bcc6767b02af558fd72.zip |
Merge pull request #133792 from j0hax/ballerburg
ballerburg: include desktop file and icon
Diffstat (limited to 'pkgs/games')
-rw-r--r-- | pkgs/games/ballerburg/default.nix | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/pkgs/games/ballerburg/default.nix b/pkgs/games/ballerburg/default.nix index ceb95059eded..43b274a12825 100644 --- a/pkgs/games/ballerburg/default.nix +++ b/pkgs/games/ballerburg/default.nix @@ -1,6 +1,14 @@ -{ lib, stdenv, fetchurl, cmake, SDL }: +{ lib, stdenv, fetchurl, cmake, SDL, makeDesktopItem, copyDesktopItems +, imagemagick }: -stdenv.mkDerivation rec { +let + + icon = fetchurl { + url = "https://baller.tuxfamily.org/king.png"; + sha256 = "1xq2h87s648wjpjl72ds3xnnk2jp8ghbkhjzh2g4hpkq2zdz90hy"; + }; + +in stdenv.mkDerivation rec { pname = "ballerburg"; version = "1.2.0"; @@ -9,10 +17,32 @@ stdenv.mkDerivation rec { sha256 = "sha256-BiX0shPBGA8sshee8rxs41x+mdsrJzBqhpDDic6sYwA="; }; - nativeBuildInputs = [ cmake ]; + nativeBuildInputs = [ cmake copyDesktopItems imagemagick ]; buildInputs = [ SDL ]; + 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 + ''; + meta = with lib; { description = "Classic cannon combat game"; longDescription = '' |