summaryrefslogtreecommitdiff
path: root/pkgs/by-name/ia/iamb/package.nix
blob: ef59f9efd7a1134fc09e4345bbd51181aaf42873 (about) (plain)
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
{
  lib,
  stdenv,
  rustPlatform,
  fetchFromGitHub,
  installShellFiles,
  versionCheckHook,
  nix-update-script,
}:

rustPlatform.buildRustPackage rec {
  pname = "iamb";
  version = "0.0.10";

  src = fetchFromGitHub {
    owner = "ulyssa";
    repo = "iamb";
    tag = "v${version}";
    hash = "sha256-cjBSWUBgfwdLnpneJ5XW2TdOFkNc+Rc/wyUp9arZzwg=";
  };

  useFetchCargoVendor = true;
  cargoHash = "sha256-fAre0jrpJ63adcg4AKCYzdQtCsd0MMMcWA0RsoHo6ig=";

  nativeBuildInputs = [ installShellFiles ];

  preBuild = ''
    export HOME=$(mktemp -d)
  '';

  checkFlags = lib.optionals stdenv.hostPlatform.isDarwin [
    # Attempted to create a NULL object.
    "--skip=base::tests::test_complete_cmdbar"
    "--skip=base::tests::test_complete_msgbar"

    # Attempted to create a NULL object.
    "--skip=windows::room::scrollback::tests::test_cursorpos"
    "--skip=windows::room::scrollback::tests::test_dirscroll"
    "--skip=windows::room::scrollback::tests::test_movement"
    "--skip=windows::room::scrollback::tests::test_search_messages"
  ];

  postInstall = ''
    OUT_DIR=$releaseDir/build/iamb-*/out
    installManPage $OUT_DIR/iamb.{1,5}
  '';

  nativeInstallCheckInputs = [
    versionCheckHook
  ];
  versionCheckProgramArg = [ "--version" ];
  doInstallCheck = true;

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

  meta = {
    description = "Matrix client for Vim addicts";
    mainProgram = "iamb";
    homepage = "https://github.com/ulyssa/iamb";
    changelog = "https://github.com/ulyssa/iamb/releases/tag/${src.tag}";
    license = lib.licenses.asl20;
    maintainers = with lib.maintainers; [ meain ];
  };
}