2021-05-01 00:50:04 +01:00
|
|
|
{ lib, fetchurl, tcl, tk, libX11, zlib, makeWrapper, makeDesktopItem }:
|
2018-01-12 16:41:20 +00:00
|
|
|
|
2021-05-01 00:50:04 +01:00
|
|
|
tcl.mkTclDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "scid-vs-pc";
|
2021-08-28 01:15:09 +01:00
|
|
|
version = "4.22";
|
2018-01-12 16:41:20 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-01-11 10:48:41 +00:00
|
|
|
url = "mirror://sourceforge/scidvspc/scid_vs_pc-${version}.tgz";
|
2021-08-28 01:15:09 +01:00
|
|
|
sha256 = "sha256-PSHDPrfhJI/DyEVQLo8Ckargqf/iUG5PgvUbO/4WNJM=";
|
2018-01-12 16:41:20 +00:00
|
|
|
};
|
|
|
|
|
2019-01-11 10:48:41 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2021-05-01 00:50:04 +01:00
|
|
|
buildInputs = [ tk libX11 zlib ];
|
2018-01-12 16:41:20 +00: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;
|
|
|
|
|
2021-06-17 19:43:01 +01:00
|
|
|
# TODO: can this use tclWrapperArgs?
|
2018-01-12 16:41:20 +00:00
|
|
|
postFixup = ''
|
2019-01-11 10:48:41 +00:00
|
|
|
sed -i -e '1c#!'"$out"'/bin/tcscid' "$out/bin/scidpgn"
|
2018-01-12 16:41:20 +00: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 10:48:41 +00:00
|
|
|
for cmd in $out/bin/* ; do
|
2018-01-12 16:41:20 +00:00
|
|
|
wrapProgram "$cmd" \
|
|
|
|
--set TK_LIBRARY "${tk}/lib/${tk.libPrefix}"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2019-01-11 10:48:41 +00: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";
|
2022-02-22 14:56:15 +00:00
|
|
|
categories = [ "Game" "BoardGame" ];
|
2019-01-11 10:48:41 +00:00
|
|
|
};
|
2018-01-12 16:41:20 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2018-01-12 16:41:20 +00:00
|
|
|
description = "Chess database with play and training functionality";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://scidvspc.sourceforge.net/";
|
2021-01-15 04:31:39 +00:00
|
|
|
license = lib.licenses.gpl2;
|
2018-01-12 16:41:20 +00:00
|
|
|
maintainers = [ maintainers.paraseba ];
|
2021-01-15 04:31:39 +00:00
|
|
|
platforms = lib.platforms.linux;
|
2018-01-12 16:41:20 +00:00
|
|
|
};
|
|
|
|
}
|