diff options
author | Chris Rendle-Short <chris@killred.net> | 2019-04-20 12:54:04 +1000 |
---|---|---|
committer | Chris Rendle-Short <chris@killred.net> | 2019-04-26 20:14:41 +1000 |
commit | 82d31fd2639477fa5270b662a4e72a9fac8514ef (patch) | |
tree | 0d2b80f7848f3cda82c5e65012531d167d9f81ee /pkgs/games/crawl | |
parent | ca40b73fa20fd4f5c5f45fe2213f03411ead7213 (diff) |
crawl: add .desktop file and use high-res app icon
The crawl source includes .desktop files but currently they are not
installed. This change installs them (with the executable path tweaked
for NixOS compatibility).
Also included in this change is an upstream patch to use the included
high-res app icon instead of the default 32x32 icon. The default icon
is very low res and looks out of place beside other app icons.
Diffstat (limited to 'pkgs/games/crawl')
-rw-r--r-- | pkgs/games/crawl/default.nix | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/pkgs/games/crawl/default.nix b/pkgs/games/crawl/default.nix index 01d1202658c0..ac58a43aecb0 100644 --- a/pkgs/games/crawl/default.nix +++ b/pkgs/games/crawl/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, fetchFromGitHub, which, sqlite, lua5_1, perl, python3, zlib, pkgconfig, ncurses +{ stdenv, lib, fetchFromGitHub, fetchpatch, which, sqlite, lua5_1, perl, python3, zlib, pkgconfig, ncurses , dejavu_fonts, libpng, SDL2, SDL2_image, SDL2_mixer, libGLU_combined, freetype, pngcrush, advancecomp , tileMode ? false, enableSound ? tileMode }: @@ -14,8 +14,13 @@ stdenv.mkDerivation rec { sha256 = "1d6mip4rvp81839yf2xm63hf34aza5wg4g5z5hi5275j94szaacs"; }; - # Patch hard-coded paths in the makefile - patches = [ ./crawl_purify.patch ]; + patches = [ + ./crawl_purify.patch # Patch hard-coded paths + (fetchpatch { # Use a nice high-res app icon + url = "https://github.com/crawl/crawl/commit/2aa1166087e44e6585b26cedf1fe81b3f3ba547f.patch"; + sha256 = "1jqrdv4wy18shg1fdabdb421232hg5micphkixcyzxd1lrmvadg0"; + }) + ]; nativeBuildInputs = [ pkgconfig which perl pngcrush advancecomp ]; @@ -40,7 +45,13 @@ stdenv.mkDerivation rec { ] ++ lib.optional tileMode "TILES=y" ++ lib.optional enableSound "SOUND=y"; - postInstall = lib.optionalString tileMode "mv $out/bin/crawl $out/bin/crawl-tiles"; + postInstall = '' + ${lib.optionalString tileMode "mv $out/bin/crawl $out/bin/crawl-tiles"} + sed -i 's#/usr/games/##' debian/crawl${lib.optionalString tileMode "-tiles"}.desktop + install -m 444 -D debian/crawl${lib.optionalString tileMode "-tiles"}.desktop \ + $out/share/applications/crawl${lib.optionalString tileMode "-tiles"}.desktop + install -m 444 -D dat/tiles/stone_soup_icon-512x512.png $out/share/icons/hicolor/512x512/apps/crawl.png + ''; enableParallelBuilding = true; |