From 5fbf8635e3e53720f5883227bbd6d4e1c4f43240 Mon Sep 17 00:00:00 2001 From: Bignaux Ronan Date: Sat, 14 Mar 2020 17:43:39 +0100 Subject: [PATCH] caprice32: enable freedesktop entries --- pkgs/misc/emulators/caprice32/default.nix | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/pkgs/misc/emulators/caprice32/default.nix b/pkgs/misc/emulators/caprice32/default.nix index 8d336b0ba3da..8694d4d2d5ae 100644 --- a/pkgs/misc/emulators/caprice32/default.nix +++ b/pkgs/misc/emulators/caprice32/default.nix @@ -1,4 +1,5 @@ -{ stdenv, fetchFromGitHub, libpng, pkgconfig, SDL, freetype, zlib }: +{ stdenv, fetchFromGitHub, desktop-file-utils, libpng +, pkgconfig, SDL, freetype, zlib }: stdenv.mkDerivation rec { @@ -12,7 +13,7 @@ stdenv.mkDerivation rec { sha256 = "0hng5krwgc1h9bz1xlkp2hwnvas965nd7sb3z9mb2m6x9ghxlacz"; }; - nativeBuildInputs = [ pkgconfig ]; + nativeBuildInputs = [ desktop-file-utils pkgconfig ]; buildInputs = [ libpng SDL freetype zlib ]; makeFlags = [ @@ -22,6 +23,20 @@ stdenv.mkDerivation rec { "prefix=/" ]; + postInstall = '' + mkdir -p $out/share/icons/ + mv $out/share/caprice32/resources/freedesktop/caprice32.png $out/share/icons/ + mv $out/share/caprice32/resources/freedesktop/emulators.png $out/share/icons/ + + desktop-file-install --dir $out/share/applications \ + $out/share/caprice32/resources/freedesktop/caprice32.desktop + + desktop-file-install --dir $out/share/desktop-directories \ + $out/share/caprice32/resources/freedesktop/Emulators.directory + + install -Dm644 $out/share/caprice32/resources/freedesktop/caprice32.menu -t $out/etc/xdg/menus/applications-merged/ + ''; + meta = with stdenv.lib; { description = "A complete emulation of CPC464, CPC664 and CPC6128"; homepage = "https://github.com/ColinPitrat/caprice32";