diff options
author | Weijia Wang <9713184+wegank@users.noreply.github.com> | 2023-06-05 16:59:37 +0300 |
---|---|---|
committer | Weijia Wang <9713184+wegank@users.noreply.github.com> | 2023-06-05 16:59:37 +0300 |
commit | c346b9ce227bda38ee656e3e24e30b38ad9440be (patch) | |
tree | a1919f5b9c0096612af7c444d3982325cfdfe791 /pkgs/games/scid | |
parent | 09720cc41f0dad446f119e3a6259c640d4b33003 (diff) |
scid: 4.3 -> 5.0.2
Diffstat (limited to 'pkgs/games/scid')
-rw-r--r-- | pkgs/games/scid/default.nix | 72 |
1 files changed, 34 insertions, 38 deletions
diff --git a/pkgs/games/scid/default.nix b/pkgs/games/scid/default.nix index 792909f856f31..576e6dc36772f 100644 --- a/pkgs/games/scid/default.nix +++ b/pkgs/games/scid/default.nix @@ -1,59 +1,55 @@ -{ lib, fetchurl, tcl, tk, libX11, zlib, makeWrapper }: - -tcl.mkTclDerivation { +{ lib +, stdenv +, fetchFromGitHub +, makeWrapper +, tcl +, tk +, libX11 +, zlib +}: + +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 ]; + postPatch = '' + substituteInPlace configure \ + --replace "set var(INSTALL) {install_mac}" "" + ''; - 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 + nativeBuildInputs = [ + makeWrapper + ]; - sed -i -e '/^ *set scidShareDir/s|\[file.*|"'"$out/share"'"|' \ - tcl/config.tcl - ''; + buildInputs = [ + tk + libX11 + zlib + ]; configureFlags = [ "BINDIR=$(out)/bin" "SHAREDIR=$(out)/share" ]; - hardeningDisable = [ "format" ]; - - 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" + makeFlags = [ + "CC=${stdenv.cc.targetPrefix}cc" + ]; - 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; }; } |