nixpkgs/pkgs/misc/emulators/dosbox/default.nix
Chris Rendle-Short 86b5fb78dd 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.
2019-04-21 22:04:10 +10:00

47 lines
1.3 KiB
Nix

{ stdenv, lib, fetchurl, makeDesktopItem, SDL, SDL_net, SDL_sound, libGLU_combined, libpng, graphicsmagick }:
stdenv.mkDerivation rec {
name = "dosbox-0.74-2";
src = fetchurl {
url = "mirror://sourceforge/dosbox/${name}.tar.gz";
sha256 = "1ksp1b5szi0vy4x55rm3j1y9wq5mlslpy8llpg87rpdyjlsk0xvh";
};
hardeningDisable = [ "format" ];
buildInputs = [ SDL SDL_net SDL_sound libGLU_combined libpng ];
nativeBuildInputs = [ graphicsmagick ];
configureFlags = lib.optional stdenv.isDarwin "--disable-sdltest";
desktopItem = makeDesktopItem {
name = "dosbox";
exec = "dosbox";
icon = "dosbox";
comment = "x86 emulator with internal DOS";
desktopName = "DOSBox";
genericName = "DOS emulator";
categories = "Application;Emulator;";
};
postInstall = ''
mkdir -p $out/share/applications
cp ${desktopItem}/share/applications/* $out/share/applications
mkdir -p $out/share/icons/hicolor/256x256/apps
gm convert src/dosbox.ico $out/share/icons/hicolor/256x256/apps/dosbox.png
'';
enableParallelBuilding = true;
meta = with lib; {
homepage = http://www.dosbox.com/;
description = "A DOS emulator";
platforms = platforms.unix;
maintainers = with maintainers; [ matthewbauer ];
license = licenses.gpl2;
};
}