depot/third_party/nixpkgs/pkgs/by-name/ha/haredo/package.nix
Default email 23b612e36f Project import generated by Copybara.
GitOrigin-RevId: ae5c332cbb5827f6b1f02572496b141021de335f
2024-01-25 23:12:00 +09:00

82 lines
1.5 KiB
Nix

{ stdenv
, lib
, fetchFromSourcehut
, hare
, scdoc
, nix-update-script
, makeWrapper
, bash
}:
stdenv.mkDerivation (finalAttrs: {
pname = "haredo";
version = "1.0.5";
outputs = [ "out" "man" ];
src = fetchFromSourcehut {
owner = "~autumnull";
repo = "haredo";
rev = finalAttrs.version;
hash = "sha256-gpui5FVRw3NKyx0AB/4kqdolrl5vkDudPOgjHc/IE4U=";
};
nativeBuildInputs = [
hare
makeWrapper
scdoc
];
enableParallelChecking = true;
doCheck = true;
dontConfigure = true;
preBuild = ''
HARECACHE="$(mktemp -d --tmpdir harecache.XXXXXXXX)"
export HARECACHE
export PREFIX=${builtins.placeholder "out"}
'';
buildPhase = ''
runHook preBuild
./bootstrap.sh
runHook postBuild
'';
checkPhase = ''
runHook preCheck
./bin/haredo ''${enableParallelChecking:+-j$NIX_BUILD_CORES} test
runHook postCheck
'';
installPhase = ''
runHook preInstall
./bootstrap.sh install
runHook postInstall
'';
postFixup = ''
wrapProgram $out/bin/haredo \
--prefix PATH : "${lib.makeBinPath [bash]}"
'';
setupHook = ./setup-hook.sh;
passthru.updateScript = nix-update-script { };
meta = {
description = "A simple and unix-idiomatic build automator";
homepage = "https://sr.ht/~autumnull/haredo/";
license = lib.licenses.wtfpl;
maintainers = with lib.maintainers; [ onemoresuza ];
mainProgram = "haredo";
inherit (hare.meta) platforms badPlatforms;
};
})