2019-01-11 11:48:41 +01:00
|
|
|
{ stdenv, fetchurl, tcl, tk, libX11, zlib, makeWrapper, makeDesktopItem }:
|
2018-01-12 17:41:20 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "scid-vs-pc";
|
2020-01-30 08:45:32 +01:00
|
|
|
version = "4.21";
|
2018-01-12 17:41:20 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-01-11 11:48:41 +01:00
|
|
|
url = "mirror://sourceforge/scidvspc/scid_vs_pc-${version}.tgz";
|
2020-01-30 08:45:32 +01:00
|
|
|
sha256 = "1lsm5s2hlhqbmwm6f38jlg2kc4j6lwp86lg6z3w6nc3jibzgvsay";
|
2018-01-12 17:41:20 +01:00
|
|
|
};
|
|
|
|
|
2019-01-11 11:48:41 +01:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [ tcl tk libX11 zlib ];
|
2018-01-12 17:41:20 +01:00
|
|
|
|
|
|
|
prePatch = ''
|
|
|
|
sed -i -e '/^ *set headerPath *{/a ${tcl}/include ${tk}/include' \
|
|
|
|
-e '/^ *set libraryPath *{/a ${tcl}/lib ${tk}/lib' \
|
|
|
|
-e '/^ *set x11Path *{/a ${libX11}/lib/' \
|
|
|
|
configure
|
|
|
|
|
|
|
|
sed -i -e '/^ *set scidShareDir/s|\[file.*|"'"$out/share"'"|' \
|
|
|
|
tcl/config.tcl
|
|
|
|
'';
|
|
|
|
|
|
|
|
# configureFlags = [
|
|
|
|
# "BINDIR=$(out)/bin"
|
|
|
|
# "SHAREDIR=$(out)/share"
|
|
|
|
# "FONTDIR=$(out)/fonts"
|
|
|
|
# ];
|
|
|
|
|
|
|
|
preConfigure = ''configureFlags="
|
|
|
|
BINDIR=$out/bin
|
|
|
|
SHAREDIR=$out/share
|
|
|
|
FONTDIR=$out/fonts"
|
|
|
|
'';
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
./0001-put-fonts-in-out.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
hardeningDisable = [ "format" ];
|
|
|
|
|
|
|
|
dontPatchShebangs = true;
|
|
|
|
|
|
|
|
postFixup = ''
|
2019-01-11 11:48:41 +01:00
|
|
|
sed -i -e '1c#!'"$out"'/bin/tcscid' "$out/bin/scidpgn"
|
2018-01-12 17:41:20 +01:00
|
|
|
sed -i -e '1c#!${tk}/bin/wish' "$out/bin/sc_remote"
|
|
|
|
sed -i -e '1c#!'"$out"'/bin/tkscid' "$out/bin/scid"
|
|
|
|
|
2019-01-11 11:48:41 +01:00
|
|
|
for cmd in $out/bin/* ; do
|
2018-01-12 17:41:20 +01:00
|
|
|
wrapProgram "$cmd" \
|
|
|
|
--set TCLLIBPATH "${tcl}/${tcl.libdir}" \
|
|
|
|
--set TK_LIBRARY "${tk}/lib/${tk.libPrefix}"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2019-01-11 11:48:41 +01:00
|
|
|
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;";
|
|
|
|
};
|
2018-01-12 17:41:20 +01:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Chess database with play and training functionality";
|
|
|
|
homepage = http://scidvspc.sourceforge.net/;
|
|
|
|
license = stdenv.lib.licenses.gpl2;
|
|
|
|
maintainers = [ maintainers.paraseba ];
|
2018-01-14 02:42:51 +01:00
|
|
|
platforms = stdenv.lib.platforms.linux;
|
2018-01-12 17:41:20 +01:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|