2024-05-16 23:13:39 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
scdoc,
|
|
|
|
hare,
|
2024-05-16 23:14:30 +00:00
|
|
|
hareHook,
|
2024-03-06 14:10:27 +00:00
|
|
|
}:
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "haredoc";
|
2024-05-16 23:13:39 +00:00
|
|
|
outputs = [
|
|
|
|
"out"
|
|
|
|
"man"
|
|
|
|
];
|
2024-03-06 14:10:27 +00:00
|
|
|
inherit (hare) version src;
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
scdoc
|
2024-05-16 23:14:30 +00:00
|
|
|
hareHook
|
2024-03-06 14:10:27 +00:00
|
|
|
];
|
|
|
|
|
2024-05-16 23:13:39 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2024-03-06 14:10:27 +00:00
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
|
|
|
|
2024-05-16 23:14:30 +00:00
|
|
|
hare build -o haredoc ./cmd/haredoc
|
2024-03-06 14:10:27 +00:00
|
|
|
scdoc <docs/haredoc.1.scd >haredoc.1
|
|
|
|
scdoc <docs/haredoc.5.scd >haredoc.5
|
|
|
|
|
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
install -Dm0755 ./haredoc $out/bin/haredoc
|
|
|
|
install -Dm0644 ./haredoc.1 $out/share/man/man1/haredoc.1
|
|
|
|
install -Dm0644 ./haredoc.5 $out/share/man/man5/haredoc.5
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "https://harelang.org/";
|
|
|
|
description = "Hare's documentation tool";
|
|
|
|
license = lib.licenses.gpl3Only;
|
|
|
|
maintainers = with lib.maintainers; [ onemoresuza ];
|
|
|
|
mainProgram = "haredoc";
|
2024-05-16 23:14:30 +00:00
|
|
|
inherit (hareHook.meta) platforms badPlatforms;
|
2024-03-06 14:10:27 +00:00
|
|
|
};
|
|
|
|
}
|