From 57044969535afec809d0a9786424e9aab1254908 Mon Sep 17 00:00:00 2001 From: Johannes Frankenau Date: Fri, 11 Jan 2019 11:48:41 +0100 Subject: [PATCH] scid-vs-pc: 4.18.1 -> 4.19 --- pkgs/games/scid-vs-pc/default.nix | 37 ++++++++++++++++++++----------- 1 file 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";