git.iko.soy/typeable/nixpkgs
on master help sign in
dosbox: add XDG icon

Add an XDG icon for dosbox. The official icon is in .ico format, which is not compatible with the freedesktop.org spec, so graphicsmagick is included as a build time dependency and used to convert it to a PNG.

commit86b5fb78dd44d8db1a658b6f5ed070deff8021ea authorChris Rendle-Short <chris@killred.net> dateSun 21 Apr 2019, 22:04 (8 years ago) parent97d35b2
1 file changed+7−1
pkgs/misc/emulators/dosbox/default.nix+7−1
pkgs/misc/emulators/dosbox/default.nix+7−1
@@ -1,4 +1,4 @@
1−{ stdenv, lib, fetchurl, makeDesktopItem, SDL, SDL_net, SDL_sound, libGLU_combined, libpng }:
1+{ stdenv, lib, fetchurl, makeDesktopItem, SDL, SDL_net, SDL_sound, libGLU_combined, libpng, graphicsmagick }:
22
33stdenv.mkDerivation rec {
44 name = "dosbox-0.74-2";
@@ -12,11 +12,14 @@ stdenv.mkDerivation rec {
1212
1313 buildInputs = [ SDL SDL_net SDL_sound libGLU_combined libpng ];
1414
15+ nativeBuildInputs = [ graphicsmagick ];
16+
1517 configureFlags = lib.optional stdenv.isDarwin "--disable-sdltest";
1618
1719 desktopItem = makeDesktopItem {
1820 name = "dosbox";
1921 exec = "dosbox";
22+ icon = "dosbox";
2023 comment = "x86 emulator with internal DOS";
2124 desktopName = "DOSBox";
2225 genericName = "DOS emulator";
@@ -26,6 +29,9 @@ stdenv.mkDerivation rec {
2629 postInstall = ''
2730 mkdir -p $out/share/applications
2831 cp ${desktopItem}/share/applications/* $out/share/applications
32+
33+ mkdir -p $out/share/icons/hicolor/256x256/apps
34+ gm convert src/dosbox.ico $out/share/icons/hicolor/256x256/apps/dosbox.png
2935 '';
3036
3137 enableParallelBuilding = true;