2021-04-17 00:35:05 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2023-02-02 18:25:31 +00:00
|
|
|
, fetchfossil
|
2023-02-16 17:41:37 +00:00
|
|
|
, tcl
|
|
|
|
|
|
|
|
, enableTcl ? true
|
2021-04-17 00:35:05 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "pikchr";
|
2021-08-18 13:19:15 +00:00
|
|
|
# To update, use the last check-in in https://pikchr.org/home/timeline?r=trunk
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "0-unstable-2024-02-12";
|
2021-04-17 00:35:05 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
src = fetchfossil {
|
|
|
|
url = "https://pikchr.org/home";
|
2024-04-21 15:54:59 +00:00
|
|
|
rev = "ae3317b0ec2e635c";
|
|
|
|
hash = "sha256-kCbd6XAaUCwFVYOPPLIux7wW62KRfVnfaxT8Z1RGFfc=";
|
2021-04-17 00:35:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# can't open generated html files
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace Makefile --replace open "test -f"
|
|
|
|
'';
|
|
|
|
|
2023-02-16 17:41:37 +00:00
|
|
|
nativeBuildInputs = lib.optional enableTcl tcl.tclPackageHook;
|
|
|
|
|
|
|
|
buildInputs = lib.optional enableTcl tcl;
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ];
|
|
|
|
|
2023-02-16 17:41:37 +00:00
|
|
|
buildFlags = [ "pikchr" ] ++ lib.optional enableTcl "piktcl";
|
|
|
|
|
2021-04-17 00:35:05 +00:00
|
|
|
installPhase = ''
|
2023-02-16 17:41:37 +00:00
|
|
|
runHook preInstall
|
2021-04-17 00:35:05 +00:00
|
|
|
install -Dm755 pikchr $out/bin/pikchr
|
|
|
|
install -Dm755 pikchr.out $out/lib/pikchr.o
|
|
|
|
install -Dm644 pikchr.h $out/include/pikchr.h
|
2023-02-16 17:41:37 +00:00
|
|
|
'' + lib.optionalString enableTcl ''
|
|
|
|
cp -r piktcl $out/lib/piktcl
|
|
|
|
'' + ''
|
|
|
|
runHook postInstall
|
2021-04-17 00:35:05 +00:00
|
|
|
'';
|
|
|
|
|
2023-02-16 17:41:37 +00:00
|
|
|
dontWrapTclBinaries = true;
|
|
|
|
|
2021-04-17 00:35:05 +00:00
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A PIC-like markup language for diagrams in technical documentation";
|
|
|
|
homepage = "https://pikchr.org";
|
|
|
|
license = licenses.bsd0;
|
|
|
|
maintainers = with maintainers; [ fgaz ];
|
|
|
|
platforms = platforms.all;
|
2023-10-09 19:29:22 +00:00
|
|
|
mainProgram = "pikchr";
|
2021-04-17 00:35:05 +00:00
|
|
|
};
|
|
|
|
}
|