1{
2 lib,
3 stdenv,
4 asciidoc,
5 fetchFromGitHub,
6 gitMinimal,
7 rustPlatform,
8 installShellFiles,
9 which,
10}:
11
12rustPlatform.buildRustPackage rec {
13 pname = "git-absorb";
14 version = "0.8.0";
15
16 src = fetchFromGitHub {
17 owner = "tummychow";
18 repo = "git-absorb";
19 tag = version;
20 hash = "sha256-O9bJMYhIyCtztswvL0JQ4ZtsAAI9TlHzWDeGdTHEmP4=";
21 };
22
23 nativeBuildInputs = [
24 asciidoc
25 installShellFiles
26 which # used by Documentation/Makefile
27 ];
28
29 cargoHash = "sha256-QBZItmKH9b2KwHR88MotyIT2krZl5QQFLvUmPmbxl4U=";
30
31 nativeCheckInputs = [
32 gitMinimal
33 ];
34
35 postInstall = ''
36 cd Documentation/
37 make
38 installManPage git-absorb.1
39 cd -
40 ''
41 + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
42 installShellCompletion --cmd git-absorb \
43 --bash <($out/bin/git-absorb --gen-completions bash) \
44 --fish <($out/bin/git-absorb --gen-completions fish) \
45 --zsh <($out/bin/git-absorb --gen-completions zsh)
46 '';
47
48 meta = with lib; {
49 homepage = "https://github.com/tummychow/git-absorb";
50 description = "git commit --fixup, but automatic";
51 license = [ licenses.bsd3 ];
52 maintainers = with maintainers; [
53 matthiasbeyer
54 ];
55 mainProgram = "git-absorb";
56 };
57}