Commit ac7c0ee7 authored by name_snrl's avatar name_snrl
Browse files

languagetool-rust: init at 2.1.1

parent 537c6ede
Loading
Loading
Loading
Loading
+56 −0
Original line number Diff line number Diff line
{ lib
, stdenv
, fetchFromGitHub
, rustPlatform
, installShellFiles
, pkg-config
, openssl
, Security
}:

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

  src = fetchFromGitHub {
    owner = "jeertmans";
    repo = pname;
    rev = "v${version}";
    hash = "sha256-tgx1LcVAlBcgYAdtn4n5TiLzinmOImLoatGowUFHpUM=";
  };

  cargoHash = "sha256-8Q+Li4wLkS9/HlSdtfOFnojtUBojO3oUpNHkyOu5clA=";

  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"
  ];

  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";
  };
}
+4 −0
Original line number Diff line number Diff line
@@ -5311,6 +5311,10 @@ with pkgs;
  languagetool = callPackage ../tools/text/languagetool {  };
  languagetool-rust = callPackage ../tools/text/languagetool-rust {
    inherit (darwin.apple_sdk.frameworks) Security;
  };
  ldtk = callPackage ../applications/editors/ldtk { };
  lepton = callPackage ../tools/graphics/lepton { };