From 933f53eabb0f8b6f78b5b4ac6ae42e23c56335dd Mon Sep 17 00:00:00 2001 From: Okina Matara Date: Tue, 19 Jun 2018 02:12:41 -0500 Subject: [PATCH] mgba: Add desktop file --- pkgs/misc/emulators/mgba/default.nix | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/pkgs/misc/emulators/mgba/default.nix b/pkgs/misc/emulators/mgba/default.nix index 755e2a2d72ba..7fb804d31e41 100644 --- a/pkgs/misc/emulators/mgba/default.nix +++ b/pkgs/misc/emulators/mgba/default.nix @@ -1,7 +1,19 @@ -{ stdenv, fetchFromGitHub, fetchpatch, pkgconfig, cmake, libzip, epoxy, ffmpeg -, imagemagick, SDL2, qtbase, qtmultimedia, qttools, libedit, minizip }: +{ stdenv, fetchFromGitHub, fetchpatch, makeDesktopItem, makeWrapper, pkgconfig +, cmake, epoxy, libzip, ffmpeg, imagemagick, SDL2, qtbase, qtmultimedia, libedit +, qttools, minizip }: -stdenv.mkDerivation rec { +let + desktopItem = makeDesktopItem { + name = "mgba"; + exec = "mgba-qt"; + icon = "mgba"; + comment = "A Game Boy Advance Emulator"; + desktopName = "mgba"; + genericName = "Game Boy Advance Emulator"; + categories = "Game;Emulator;"; + startupNotify = "false"; + }; +in stdenv.mkDerivation rec { name = "mgba-${version}"; version = "0.6.3"; @@ -13,7 +25,7 @@ stdenv.mkDerivation rec { }; enableParallelBuilding = true; - nativeBuildInputs = [ pkgconfig cmake ]; + nativeBuildInputs = [ makeWrapper pkgconfig cmake ]; buildInputs = [ libzip epoxy ffmpeg imagemagick SDL2 qtbase qtmultimedia libedit minizip @@ -25,6 +37,12 @@ stdenv.mkDerivation rec { sha256 = "0j334v8wf594kg8s1hngmh58wv1pi003z8avy6fjhj5qpjmbbavh"; })]; + postInstall = '' + cp -r ${desktopItem}/share/applications $out/share + wrapProgram $out/bin/mgba-qt --suffix QT_PLUGIN_PATH : \ + ${qtbase.bin}/${qtbase.qtPluginPrefix} + ''; + meta = with stdenv.lib; { homepage = https://mgba.io; description = "A modern GBA emulator with a focus on accuracy";