mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-30 16:53:40 +00:00
scid: New package, version 4.3.
Just saw Michael Raskin's GNU Chess and XBoard updates and did a short check if Scid is already in nixpkgs. It wasn't, so I decided to add it, so thanks to @7c6f434c :-) The package involves a lot of patching, as usual with Tcl/Tk on NixOS. In this case the program is written in C++ and embeds the Tcl/Wish interpreter. Unfortunately this doesn't make it easier to inject TCLLIBPATH, as there doesn't seem to be a direct library call (well in theory you could `lappend TCLLIBPATH`, but that won't help with TK_LIBRARY). Signed-off-by: aszlig <aszlig@redmoonstudios.org>
This commit is contained in:
parent
9337078fde
commit
5054e8ec29
55
pkgs/games/scid/default.nix
Normal file
55
pkgs/games/scid/default.nix
Normal file
@ -0,0 +1,55 @@
|
||||
{ stdenv, fetchurl, tcl, tk, libX11, zlib, makeWrapper }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "scid-${version}";
|
||||
version = "4.3";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://sourceforge/scid/scid-4.3.tar.bz2";
|
||||
sha256 = "0zb5qp04x8w4gn2kvfdfq2p44kmzfcqn7v167dixz6nlyxg41hrw";
|
||||
};
|
||||
|
||||
buildInputs = [ tcl tk libX11 zlib makeWrapper ];
|
||||
|
||||
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"
|
||||
];
|
||||
|
||||
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#!${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 TCLLIBPATH "${tcl}/${tcl.libdir}" \
|
||||
--set TK_LIBRARY "${tk}/lib/${tk.libPrefix}"
|
||||
done
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Chess database with play and training functionality";
|
||||
homepage = "http://scid.sourceforge.net/";
|
||||
license = stdenv.lib.licenses.gpl2;
|
||||
};
|
||||
}
|
@ -8259,6 +8259,8 @@ let
|
||||
|
||||
sauerbraten = callPackage ../games/sauerbraten {};
|
||||
|
||||
scid = callPackage ../games/scid { };
|
||||
|
||||
scummvm = callPackage ../games/scummvm { };
|
||||
|
||||
scorched3d = callPackage ../games/scorched3d { };
|
||||
|
Loading…
Reference in New Issue
Block a user