2024-01-02 11:29:13 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromSourcehut
|
|
|
|
, hare
|
|
|
|
, scdoc
|
|
|
|
, nix-update-script
|
2024-01-25 14:12:00 +00:00
|
|
|
, makeWrapper
|
|
|
|
, bash
|
2024-01-02 11:29:13 +00:00
|
|
|
}:
|
|
|
|
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
|
2024-01-25 14:12:00 +00:00
|
|
|
makeWrapper
|
2024-01-02 11:29:13 +00:00
|
|
|
scdoc
|
|
|
|
];
|
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
enableParallelChecking = true;
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
dontConfigure = true;
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
preBuild = ''
|
|
|
|
HARECACHE="$(mktemp -d --tmpdir harecache.XXXXXXXX)"
|
|
|
|
export HARECACHE
|
|
|
|
export PREFIX=${builtins.placeholder "out"}
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
|
|
|
|
|
|
|
./bootstrap.sh
|
|
|
|
|
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
./bin/haredo ''${enableParallelChecking:+-j$NIX_BUILD_CORES} test
|
2024-01-02 11:29:13 +00:00
|
|
|
|
|
|
|
runHook postCheck
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
./bootstrap.sh install
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
postFixup = ''
|
|
|
|
wrapProgram $out/bin/haredo \
|
|
|
|
--prefix PATH : "${lib.makeBinPath [bash]}"
|
|
|
|
'';
|
2024-01-02 11:29:13 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
})
|