tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
ballerburg: include desktop file and icon
Johannes Arnold
4 years ago
b40971db
e60ece88
+33
-3
1 changed file
expand all
collapse all
unified
split
pkgs
games
ballerburg
default.nix
+33
-3
pkgs/games/ballerburg/default.nix
···
1
1
-
{ lib, stdenv, fetchurl, cmake, SDL }:
1
1
+
{ lib, stdenv, fetchurl, cmake, SDL, makeDesktopItem, copyDesktopItems
2
2
+
, imagemagick }:
3
3
+
4
4
+
let
2
5
3
3
-
stdenv.mkDerivation rec {
6
6
+
icon = fetchurl {
7
7
+
url = "https://baller.tuxfamily.org/king.png";
8
8
+
sha256 = "1xq2h87s648wjpjl72ds3xnnk2jp8ghbkhjzh2g4hpkq2zdz90hy";
9
9
+
};
10
10
+
11
11
+
in stdenv.mkDerivation rec {
4
12
pname = "ballerburg";
5
13
version = "1.2.0";
6
14
···
9
17
sha256 = "sha256-BiX0shPBGA8sshee8rxs41x+mdsrJzBqhpDDic6sYwA=";
10
18
};
11
19
12
12
-
nativeBuildInputs = [ cmake ];
20
20
+
nativeBuildInputs = [ cmake copyDesktopItems imagemagick ];
13
21
14
22
buildInputs = [ SDL ];
23
23
+
24
24
+
desktopItems = [
25
25
+
(makeDesktopItem {
26
26
+
name = "Ballerburg";
27
27
+
desktopName = "Ballerburg SDL";
28
28
+
type = "Application";
29
29
+
exec = "_NET_WM_ICON=ballerburg ballerburg";
30
30
+
comment = meta.description;
31
31
+
icon = "ballerburg";
32
32
+
categories = "Game;";
33
33
+
})
34
34
+
];
35
35
+
36
36
+
postInstall = ''
37
37
+
# Generate and install icon files
38
38
+
for size in 16 32 48 64 72 96 128 192 512 1024; do
39
39
+
mkdir -p $out/share/icons/hicolor/"$size"x"$size"/apps
40
40
+
convert ${icon} -sample "$size"x"$size" \
41
41
+
-background white -gravity south -extent "$size"x"$size" \
42
42
+
$out/share/icons/hicolor/"$size"x"$size"/apps/ballerburg.png
43
43
+
done
44
44
+
'';
15
45
16
46
meta = with lib; {
17
47
description = "Classic cannon combat game";