summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/py-rust-stemmers/default.nix
blob: a9af333fbff275fa0f7ab4bc8aa63ce2477ee727 (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
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  rustPlatform,

  # build-system
  cargo,
  rustc,
}:

buildPythonPackage rec {
  pname = "py-rust-stemmers";
  version = "0.1.5";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "qdrant";
    repo = "py-rust-stemmers";
    tag = "v${version}";
    hash = "sha256-WpTbS8XoOKhyyt1/YGagulopFKiqNI0ETkhjpiX0TL8=";
  };

  cargoDeps = rustPlatform.importCargoLock { lockFile = ./Cargo.lock; };

  postPatch = ''
    ln -s ${./Cargo.lock} Cargo.lock
  '';

  build-system = [
    cargo
    rustPlatform.cargoSetupHook
    rustPlatform.maturinBuildHook
    rustc
  ];

  pythonImportsCheck = [ "py_rust_stemmers" ];

  meta = {
    description = "High-performance Python wrapper around the rust-stemmers library, utilizing the Snowball stemming algorithm";
    homepage = "https://github.com/qdrant/py-rust-stemmers";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ GaetanLepage ];
  };
}