3
0
Fork 0
forked from mirrors/nixpkgs

pikchr: enable tcl support

This commit is contained in:
Francesco Gazzetta 2023-01-19 10:46:36 +01:00
parent 48125f1ee9
commit 7f0ebaecd1

View file

@ -1,6 +1,9 @@
{ lib
, stdenv
, fetchfossil
, tcl
, enableTcl ? true
}:
stdenv.mkDerivation {
@ -19,14 +22,27 @@ stdenv.mkDerivation {
substituteInPlace Makefile --replace open "test -f"
'';
nativeBuildInputs = lib.optional enableTcl tcl.tclPackageHook;
buildInputs = lib.optional enableTcl tcl;
makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ];
buildFlags = [ "pikchr" ] ++ lib.optional enableTcl "piktcl";
installPhase = ''
runHook preInstall
install -Dm755 pikchr $out/bin/pikchr
install -Dm755 pikchr.out $out/lib/pikchr.o
install -Dm644 pikchr.h $out/include/pikchr.h
'' + lib.optionalString enableTcl ''
cp -r piktcl $out/lib/piktcl
'' + ''
runHook postInstall
'';
dontWrapTclBinaries = true;
doCheck = true;
checkTarget = "test";