Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 lib,
3 rustPlatform,
4 fetchFromGitHub,
5 stdenv,
6 pkg-config,
7 installShellFiles,
8 installShellCompletions ? stdenv.buildPlatform.canExecute stdenv.hostPlatform,
9 installManPages ? stdenv.buildPlatform.canExecute stdenv.hostPlatform,
10 notmuch,
11 buildNoDefaultFeatures ? false,
12 buildFeatures ? [ ],
13}:
14
15rustPlatform.buildRustPackage rec {
16 # Learn more about available cargo features at:
17 # - <https://pimalaya.org/neverest/cli/latest/installation.html#cargo>
18 # - <https://git.sr.ht/~soywod/neverest-cli/tree/master/item/Cargo.toml#L18>
19 inherit buildNoDefaultFeatures buildFeatures;
20
21 pname = "neverest";
22 version = "1.0.0-beta";
23
24 src = fetchFromGitHub {
25 owner = "pimalaya";
26 repo = "neverest";
27 rev = "v${version}";
28 hash = "sha256-3PSJyhxrOCiuHUeVHO77+NecnI5fN5EZfPhYizuYvtE=";
29 };
30
31 cargoHash = "sha256-K+LKRokfE8i4Huti0aQm4UrpConTcxVwJ2DyeOLjNKA=";
32
33 nativeBuildInputs = [
34 pkg-config
35 ]
36 ++ lib.optional (installManPages || installShellCompletions) installShellFiles;
37
38 buildInputs = lib.optional (builtins.elem "notmuch" buildFeatures) notmuch;
39
40 # TODO: unit tests temporarily broken, remove this line for the next
41 # beta.2 release
42 doCheck = false;
43
44 postInstall =
45 lib.optionalString installManPages ''
46 mkdir -p $out/man
47 $out/bin/neverest man $out/man
48 installManPage $out/man/*
49 ''
50 + lib.optionalString installShellCompletions ''
51 installShellCompletion --cmd neverest \
52 --bash <($out/bin/neverest completion bash) \
53 --fish <($out/bin/neverest completion fish) \
54 --zsh <($out/bin/neverest completion zsh)
55 '';
56
57 meta = {
58 description = "CLI to synchronize, backup and restore emails";
59 mainProgram = "neverest";
60 homepage = "https://pimalaya.org/neverest/cli/v${version}/";
61 changelog = "https://git.sr.ht/~soywod/neverest-cli/tree/v${version}/item/CHANGELOG.md";
62 license = lib.licenses.mit;
63 maintainers = with lib.maintainers; [ soywod ];
64 };
65}