about summary refs log tree commit diff
path: root/pkgs/games
diff options
context:
space:
mode:
authorJohannes Frankenau <johannes@frankenau.net>2019-01-11 11:48:41 +0100
committerDmitry Kalinkin <dmitry.kalinkin@gmail.com>2019-02-07 18:13:11 -0500
commit57044969535afec809d0a9786424e9aab1254908 (patch)
tree3bd024cb1f69b7b211e2b0cdd535c29cfdfddad8 /pkgs/games
parente16e9c978d6426c4511e97e5f868346f39c0e88b (diff)
downloadnixlib-57044969535afec809d0a9786424e9aab1254908.tar
nixlib-57044969535afec809d0a9786424e9aab1254908.tar.gz
nixlib-57044969535afec809d0a9786424e9aab1254908.tar.bz2
nixlib-57044969535afec809d0a9786424e9aab1254908.tar.lz
nixlib-57044969535afec809d0a9786424e9aab1254908.tar.xz
nixlib-57044969535afec809d0a9786424e9aab1254908.tar.zst
nixlib-57044969535afec809d0a9786424e9aab1254908.zip
scid-vs-pc: 4.18.1 -> 4.19
Diffstat (limited to 'pkgs/games')
-rw-r--r--pkgs/games/scid-vs-pc/default.nix37
1 files changed, 24 insertions, 13 deletions
diff --git a/pkgs/games/scid-vs-pc/default.nix b/pkgs/games/scid-vs-pc/default.nix
index db32cb70d413..94e102e57520 100644
--- a/pkgs/games/scid-vs-pc/default.nix
+++ b/pkgs/games/scid-vs-pc/default.nix
@@ -1,15 +1,16 @@
-{ stdenv, fetchurl, tcl, tk, libX11, zlib, makeWrapper }:
+{ stdenv, fetchurl, tcl, tk, libX11, zlib, makeWrapper, makeDesktopItem }:
 
 stdenv.mkDerivation rec {
   name = "scid-vs-pc-${version}";
-  version = "4.18.1";
+  version = "4.19";
 
   src = fetchurl {
-    url = "mirror://sourceforge/scidvspc/scid_vs_pc-4.18.1.tgz";
-    sha256 = "01nd88g3wh3avz1yk9fka9zf20ij8dlnpwzz8gnx78i5b06cp459";
+    url = "mirror://sourceforge/scidvspc/scid_vs_pc-${version}.tgz";
+    sha256 = "1k2cgs6bjyrmxy5x6x1chmrxfmm224p3r9r9mpc37kridk4hshqs";
   };
 
-  buildInputs = [ tcl tk libX11 zlib makeWrapper ];
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = [ tcl tk libX11 zlib ];
 
   prePatch = ''
     sed -i -e '/^ *set headerPath *{/a ${tcl}/include ${tk}/include' \
@@ -42,23 +43,33 @@ stdenv.mkDerivation rec {
   dontPatchShebangs = true;
 
   postFixup = ''
-    for cmd in sc_addmove sc_eco sc_epgn scidpgn \
-               sc_import sc_spell sc_tree spliteco
-    do
-      sed -i -e '1c#!'"$out"'/bin/tcscid' "$out/bin/$cmd"
-    done
-
+    sed -i -e '1c#!'"$out"'/bin/tcscid' "$out/bin/scidpgn"
     sed -i -e '1c#!${tk}/bin/wish' "$out/bin/sc_remote"
     sed -i -e '1c#!'"$out"'/bin/tkscid' "$out/bin/scid"
 
-    for cmd in $out/bin/*
-    do
+    for cmd in $out/bin/* ; do
       wrapProgram "$cmd" \
         --set TCLLIBPATH "${tcl}/${tcl.libdir}" \
         --set TK_LIBRARY "${tk}/lib/${tk.libPrefix}"
     done
   '';
 
+  postInstall = ''
+    mkdir -p $out/share/applications
+    cp $desktopItem/share/applications/* $out/share/applications/
+
+    install -D icons/scid.png "$out"/share/icons/hicolor/128x128/apps/scid.png
+  '';
+
+  desktopItem = makeDesktopItem {
+    name = "scid-vs-pc";
+    desktopName = "Scid vs. PC";
+    genericName = "Chess Database";
+    comment = meta.description;
+    icon = "scid";
+    exec = "scid";
+    categories = "Game;BoardGame;";
+  };
 
   meta = with stdenv.lib; {
     description = "Chess database with play and training functionality";