about summary refs log tree commit diff
path: root/pkgs/tools/text/languagetool-rust/default.nix
blob: 013a246868248a5949936f8cffe12cde0cb26042 (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
{ lib
, stdenv
, fetchFromGitHub
, rustPlatform
, installShellFiles
, pkg-config
, openssl
, Security
}:

rustPlatform.buildRustPackage rec {
  pname = "languagetool-rust";
  version = "2.1.3";

  src = fetchFromGitHub {
    owner = "jeertmans";
    repo = pname;
    rev = "v${version}";
    hash = "sha256-iiJSdr7TF1f8/Ve+OKbTDHYWdFkd2IEOzp7Lhlpwb50=";
  };

  cargoHash = "sha256-oCRlWYCTmJWTi6LCDEKimsLmqm3JTaQEsKJXrvQP/p8=";

  buildFeatures = [ "full" ];

  nativeBuildInputs = [ installShellFiles pkg-config ];
  buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ Security ];

  checkFlags = [
    # requires network access
    "--skip=server::tests::test_server_check_data"
    "--skip=server::tests::test_server_check_text"
    "--skip=server::tests::test_server_languages"
    "--skip=server::tests::test_server_ping"
    "--skip=test_match_positions_1"
    "--skip=test_match_positions_2"
    "--skip=test_match_positions_3"
    "--skip=test_match_positions_4"
    "--skip=src/lib/lib.rs"
    "--skip=test_basic_check_data"
    "--skip=test_basic_check_file"
    "--skip=test_basic_check_files"
    "--skip=test_basic_check_piped"
    "--skip=test_basic_check_text"
    "--skip=test_check_with_dict"
    "--skip=test_check_with_dicts"
    "--skip=test_check_with_disabled_categories"
    "--skip=test_check_with_disabled_category"
    "--skip=test_check_with_disabled_rule"
    "--skip=test_check_with_disabled_rules"
    "--skip=test_check_with_enabled_categories"
    "--skip=test_check_with_enabled_category"
    "--skip=test_check_with_enabled_only_category"
    "--skip=test_check_with_enabled_only_rule"
    "--skip=test_check_with_enabled_only_without_enabled"
    "--skip=test_check_with_enabled_rule"
    "--skip=test_check_with_enabled_rules"
    "--skip=test_check_with_language"
    "--skip=test_check_with_picky_level"
    "--skip=test_check_with_preferred_variant"
    "--skip=test_check_with_preferred_variants"
    "--skip=test_check_with_unexisting_language"
    "--skip=test_check_with_username_and_key"
    "--skip=test_languages"
    "--skip=test_ping"
    "--skip=test_words"
    "--skip=test_words_add"
    "--skip=test_words_delete"
  ];

  postInstall = ''
    installShellCompletion --cmd ltrs \
      --bash <($out/bin/ltrs completions bash) \
      --fish <($out/bin/ltrs completions fish) \
      --zsh <($out/bin/ltrs completions zsh)
  '';

  meta = with lib; {
    description = "LanguageTool API in Rust";
    homepage = "https://github.com/jeertmans/languagetool-rust";
    license = licenses.mit;
    maintainers = with maintainers; [ name-snrl ];
    mainProgram = "ltrs";
  };
}