git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #59915 from lightbulbjim/crawl-icon

crawl: add .desktop file and use high-res app icon

commitbd89f7c0f948fe48c94f03b305a403227ff7e106 authorworldofpeace <worldofpeace@users.noreply.github.com> dateFri 26 Apr 2019, 09:34 (8 years ago) parent201497582d31fd
1 file changed+15−4
pkgs/games/crawl/default.nix+15−4
pkgs/games/crawl/default.nix+15−4
@@ -1,4 +1,4 @@
1−{ stdenv, lib, fetchFromGitHub, which, sqlite, lua5_1, perl, python3, zlib, pkgconfig, ncurses
1+{ stdenv, lib, fetchFromGitHub, fetchpatch, which, sqlite, lua5_1, perl, python3, zlib, pkgconfig, ncurses
22, dejavu_fonts, libpng, SDL2, SDL2_image, SDL2_mixer, libGLU_combined, freetype, pngcrush, advancecomp
33, tileMode ? false, enableSound ? tileMode
44}:
@@ -14,8 +14,13 @@ stdenv.mkDerivation rec {
1414 sha256 = "1d6mip4rvp81839yf2xm63hf34aza5wg4g5z5hi5275j94szaacs";
1515 };
1616
17− # Patch hard-coded paths in the makefile
18− patches = [ ./crawl_purify.patch ];
17+ patches = [
18+ ./crawl_purify.patch # Patch hard-coded paths
19+ (fetchpatch { # Use a nice high-res app icon
20+ url = "https://github.com/crawl/crawl/commit/2aa1166087e44e6585b26cedf1fe81b3f3ba547f.patch";
21+ sha256 = "1jqrdv4wy18shg1fdabdb421232hg5micphkixcyzxd1lrmvadg0";
22+ })
23+ ];
1924
2025 nativeBuildInputs = [ pkgconfig which perl pngcrush advancecomp ];
2126
@@ -40,7 +45,13 @@ stdenv.mkDerivation rec {
4045 ] ++ lib.optional tileMode "TILES=y"
4146 ++ lib.optional enableSound "SOUND=y";
4247
43− postInstall = lib.optionalString tileMode "mv $out/bin/crawl $out/bin/crawl-tiles";
48+ postInstall = ''
49+ ${lib.optionalString tileMode "mv $out/bin/crawl $out/bin/crawl-tiles"}
50+ sed -i 's#/usr/games/##' debian/crawl${lib.optionalString tileMode "-tiles"}.desktop
51+ install -m 444 -D debian/crawl${lib.optionalString tileMode "-tiles"}.desktop \
52+ $out/share/applications/crawl${lib.optionalString tileMode "-tiles"}.desktop
53+ install -m 444 -D dat/tiles/stone_soup_icon-512x512.png $out/share/icons/hicolor/512x512/apps/crawl.png
54+ '';
4455
4556 enableParallelBuilding = true;
4657