about summary refs log tree commit diff
path: root/pkgs/misc/emulators
diff options
context:
space:
mode:
authorRyan Mulligan <ryan@ryantm.com>2016-06-04 13:43:43 -0700
committerRyan Mulligan <ryan@ryantm.com>2016-06-09 06:22:13 -0700
commitb54fa1e351074531628178cd4da7dccc7c334824 (patch)
treeec1f9e0524021ea108160ca02c613e4714d62ffd /pkgs/misc/emulators
parent01da474aa1307c9e4c068d7eb96023beaf3431c3 (diff)
downloadnixlib-b54fa1e351074531628178cd4da7dccc7c334824.tar
nixlib-b54fa1e351074531628178cd4da7dccc7c334824.tar.gz
nixlib-b54fa1e351074531628178cd4da7dccc7c334824.tar.bz2
nixlib-b54fa1e351074531628178cd4da7dccc7c334824.tar.lz
nixlib-b54fa1e351074531628178cd4da7dccc7c334824.tar.xz
nixlib-b54fa1e351074531628178cd4da7dccc7c334824.tar.zst
nixlib-b54fa1e351074531628178cd4da7dccc7c334824.zip
zsnes: add desktop item
add desktop item so zsnes can be used without the terminal
add icons
Diffstat (limited to 'pkgs/misc/emulators')
-rw-r--r--pkgs/misc/emulators/zsnes/default.nix30
1 files changed, 28 insertions, 2 deletions
diff --git a/pkgs/misc/emulators/zsnes/default.nix b/pkgs/misc/emulators/zsnes/default.nix
index 23930ac624ce..be7666487b95 100644
--- a/pkgs/misc/emulators/zsnes/default.nix
+++ b/pkgs/misc/emulators/zsnes/default.nix
@@ -1,6 +1,18 @@
-{stdenv, fetchurl, fetchpatch, nasm, SDL, zlib, libpng, ncurses, mesa}:
+{stdenv, fetchurl, fetchpatch, nasm, SDL, zlib, libpng, ncurses, mesa
+, makeDesktopItem }:
 
-stdenv.mkDerivation {
+let
+  desktopItem = makeDesktopItem {
+    name = "zsnes";
+    exec = "zsnes";
+    icon = "zsnes";
+    comment = "A SNES emulator";
+    desktopName = "zsnes";
+    genericName = "zsnes";
+    categories = "Game;";
+  };
+
+in stdenv.mkDerivation {
   name = "zsnes-1.51";
 
   src = fetchurl {
@@ -39,6 +51,20 @@ stdenv.mkDerivation {
 
   configureFlags = [ "--enable-release" ];
 
+  postInstall = ''
+    function installIcon () {
+        mkdir -p $out/share/icons/hicolor/$1/apps/
+        cp icons/$1x32.png $out/share/icons/hicolor/$1/apps/zsnes.png
+    }
+    installIcon "16x16"
+    installIcon "32x32"
+    installIcon "48x48"
+    installIcon "64x64"
+
+    mkdir -p $out/share/applications
+    ln -s ${desktopItem}/share/applications/* $out/share/applications/
+  '';
+
   meta = {
     description = "A Super Nintendo Entertainment System Emulator";
     license = stdenv.lib.licenses.gpl2Plus;