blob: 08592c674395a7803c83daff291c9b00249f4408 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
{
stdenv,
lib,
fetchFromSourcehut,
hareHook,
scdoc,
nix-update-script,
makeWrapper,
bash,
substituteAll,
}:
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=";
};
patches = [
# Use nix store's bash instead of sh. `@bash@/bin/sh` is used, since haredo expects a posix shell.
(substituteAll {
src = ./001-use-nix-store-sh.patch;
inherit bash;
})
];
nativeBuildInputs = [
hareHook
makeWrapper
scdoc
];
enableParallelChecking = true;
env.PREFIX = builtins.placeholder "out";
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
dontConfigure = true;
buildPhase = ''
runHook preBuild
hare build -o bin/haredo ./src
scdoc <doc/haredo.1.scd >doc/haredo.1
runHook postBuild
'';
checkPhase = ''
runHook preCheck
./bin/haredo ''${enableParallelChecking:+-j$NIX_BUILD_CORES} test
runHook postCheck
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
mkdir -p $out/share/man/man1
cp ./bin/haredo $out/bin
cp ./doc/haredo.1 $out/share/man/man1
runHook postInstall
'';
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 (hareHook.meta) platforms badPlatforms;
};
})
|