about summary refs log tree commit diff
path: root/pkgs/games/teeworlds
diff options
context:
space:
mode:
authorGeorg Haas <hax404foogit@hax404.de>2020-03-24 13:37:12 +0100
committerGeorg Haas <hax404foogit@hax404.de>2020-03-24 13:37:12 +0100
commit1d42440eb2d1baf3cf7663828a3f7cba291f1ddd (patch)
tree4fb62c7ff19ec383bc63c89ccf0ec7ecebaf3525 /pkgs/games/teeworlds
parentb6d07eb8ad392dbcae8e22117320430ab45683d7 (diff)
teeworlds: add desktop icon and menu item
Diffstat (limited to 'pkgs/games/teeworlds')
-rw-r--r--pkgs/games/teeworlds/default.nix13
1 files changed, 11 insertions, 2 deletions
diff --git a/pkgs/games/teeworlds/default.nix b/pkgs/games/teeworlds/default.nix
index 99357f20a99d0..13918d2f7a520 100644
--- a/pkgs/games/teeworlds/default.nix
+++ b/pkgs/games/teeworlds/default.nix
@@ -1,5 +1,5 @@
 { fetchFromGitHub, stdenv, cmake, pkgconfig, python3, alsaLib
-, libX11, libGLU, SDL2, lua5_3, zlib, freetype, wavpack
+, libX11, libGLU, SDL2, lua5_3, zlib, freetype, wavpack, icoutils
 }:
 
 stdenv.mkDerivation rec {
@@ -21,12 +21,21 @@ stdenv.mkDerivation rec {
                 '#define DATA_DIR "${placeholder "out"}/share/teeworlds/data"'
   '';
 
-  nativeBuildInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkgconfig icoutils ];
 
   buildInputs = [
     python3 alsaLib libX11 libGLU SDL2 lua5_3 zlib freetype wavpack
   ];
 
+  postInstall = ''
+    # Convert and install desktop icon
+    mkdir -p $out/share/pixmaps
+    icotool --extract --index 1 --output $out/share/pixmaps/teeworlds.png $src/other/icons/teeworlds.ico
+
+    # Install menu item
+    install -D $src/other/teeworlds.desktop $out/share/applications/teeworlds.desktop
+  '';
+
   meta = {
     description = "Retro multiplayer shooter game";