about summary refs log tree commit diff
path: root/pkgs/by-name/ab/aba/package.nix
blob: 6cf7ec2544bc03232110bde71f5554798bd21271 (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
{ fetchFromSourcehut
, just
, lib
, nix-update-script
, rustPlatform
, scdoc
}:
let
  version = "0.8.0";
in
rustPlatform.buildRustPackage {
  pname = "aba";
  inherit version;

  src = fetchFromSourcehut {
    owner = "~onemoresuza";
    repo = "aba";
    rev = version;
    hash = "sha256-2zVQNchL4DFh2v2/kwupJTBSmXiKqlxzUMrP9TbfCMs=";
  };

  cargoHash = "sha256-YhSzbfcEIJjKWlyYq1lK70qt4f/Z71n7hgaaZ/D/U80=";

  nativeBuildInputs = [
    just
    scdoc
  ];

  postPatch = ''
    # Let only nix strip the binary by disabling cargo's `strip = true`, like
    # buildRustPackage does when not using just's setup hooks.
    sed -i '/strip[[:space:]]*=[[:space:]]*true/s/true/false/' ./Cargo.toml
  '';

  preBuild = ''
    justFlagsArray+=(
      PREFIX=${builtins.placeholder "out"}
      MANIFEST_OPTS="--frozen --locked --profile=release"
      INSTALL_OPTS="--no-track"
    )
  '';

  # There are no tests
  doCheck = false;
  dontUseJustCheck = true;

  passthru.updateScript = nix-update-script { };

  meta = {
    description = "An address book for aerc";
    homepage = "https://sr.ht/~onemoresuza/aba/";
    changelog = "https://git.sr.ht/~onemoresuza/aba/tree/main/item/CHANGELOG.md";
    downloadPage = "https://git.sr.ht/~onemoresuza/aba/refs/${version}";
    maintainers = with lib.maintainers; [ onemoresuza ];
    license = lib.licenses.isc;
    mainProgram = "aba";
  };
}