2021-12-06 16:07:01 +00:00
|
|
|
{ lib
|
2022-12-17 10:02:37 +00:00
|
|
|
, stdenv
|
2021-12-06 16:07:01 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pythonOlder
|
2022-04-27 09:35:20 +00:00
|
|
|
, cmake
|
|
|
|
, cython
|
2021-12-06 16:07:01 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, rapidfuzz
|
2022-07-14 12:49:19 +00:00
|
|
|
, rapidfuzz-cpp
|
2022-04-27 09:35:20 +00:00
|
|
|
, scikit-build
|
2021-12-06 16:07:01 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "levenshtein";
|
2022-12-28 21:21:41 +00:00
|
|
|
version = "0.20.9";
|
2022-04-27 09:35:20 +00:00
|
|
|
format = "pyproject";
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "maxbachmann";
|
|
|
|
repo = "Levenshtein";
|
2022-07-14 12:49:19 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2022-12-28 21:21:41 +00:00
|
|
|
hash = "sha256-BPfv3XsAaspLGmztllUYLq6VMKaW+s/Pp18RQmSrilc=";
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
cython
|
|
|
|
scikit-build
|
|
|
|
];
|
|
|
|
|
|
|
|
dontUseCmakeConfigure = true;
|
2021-12-19 01:06:50 +00:00
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
buildInputs = [
|
|
|
|
rapidfuzz-cpp
|
|
|
|
];
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = toString (lib.optionals (stdenv.cc.isClang && stdenv.isDarwin) [
|
2022-12-17 10:02:37 +00:00
|
|
|
"-fno-lto" # work around https://github.com/NixOS/nixpkgs/issues/19098
|
2023-03-04 12:14:45 +00:00
|
|
|
]);
|
2022-12-17 10:02:37 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
rapidfuzz
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-12-06 16:07:01 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"Levenshtein"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Functions for fast computation of Levenshtein distance and string similarity";
|
|
|
|
homepage = "https://github.com/maxbachmann/Levenshtein";
|
2023-01-20 10:41:00 +00:00
|
|
|
changelog = "https://github.com/maxbachmann/Levenshtein/blob/${version}/HISTORY.md";
|
2021-12-06 16:07:01 +00:00
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|