scid: 4.3 -> 5.0.2

This commit is contained in:
Weijia Wang 2023-06-05 16:59:37 +03:00
parent 09720cc41f
commit c346b9ce22
2 changed files with 35 additions and 42 deletions

View file

@ -1,59 +1,55 @@
{ lib, fetchurl, tcl, tk, libX11, zlib, makeWrapper }:
{ lib
, stdenv
, fetchFromGitHub
, makeWrapper
, tcl
, tk
, libX11
, zlib
}:
tcl.mkTclDerivation {
tcl.mkTclDerivation rec {
pname = "scid";
version = "4.3";
version = "5.0.2";
src = fetchurl {
url = "mirror://sourceforge/scid/scid-4.3.tar.bz2";
sha256 = "0zb5qp04x8w4gn2kvfdfq2p44kmzfcqn7v167dixz6nlyxg41hrw";
src = fetchFromGitHub {
owner = "benini";
repo = "scid";
rev = "v${version}";
hash = "sha256-5WGZm7EwhZAMKJKxj/OOIFOJIgPBcc6/Bh4xVAlia4Y=";
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ tk libX11 zlib ];
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
postPatch = ''
substituteInPlace configure \
--replace "set var(INSTALL) {install_mac}" ""
'';
nativeBuildInputs = [
makeWrapper
];
buildInputs = [
tk
libX11
zlib
];
configureFlags = [
"BINDIR=$(out)/bin"
"SHAREDIR=$(out)/share"
];
hardeningDisable = [ "format" ];
makeFlags = [
"CC=${stdenv.cc.targetPrefix}cc"
];
dontPatchShebangs = true;
# TODO: can this use tclWrapperArgs?
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#!${tcl}/bin/tcslsh' "$out/bin/spf2spi"
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
wrapProgram "$cmd" \
--set TK_LIBRARY "${tk}/lib/${tk.libPrefix}"
done
'';
enableParallelBuilding = true;
meta = {
description = "Chess database with play and training functionality";
maintainers = with lib.maintainers; [ agbrooks ];
homepage = "https://scid.sourceforge.net/";
license = lib.licenses.gpl2;
platforms = lib.platforms.all;
};
}

View file

@ -37101,10 +37101,7 @@ with pkgs;
sauerbraten = callPackage ../games/sauerbraten { };
scid = callPackage ../games/scid {
tcl = tcl-8_5;
tk = tk-8_5;
};
scid = callPackage ../games/scid { };
scid-vs-pc = callPackage ../games/scid-vs-pc {
tcl = tcl-8_6;