2022-04-27 09:35:20 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
2022-06-16 17:23:12 +00:00
|
|
|
, catch2_3
|
2024-02-07 01:22:34 +00:00
|
|
|
, python3Packages
|
2022-04-27 09:35:20 +00:00
|
|
|
}:
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2022-04-27 09:35:20 +00:00
|
|
|
pname = "rapidfuzz-cpp";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "3.0.5";
|
2022-04-27 09:35:20 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2024-04-21 15:54:59 +00:00
|
|
|
owner = "rapidfuzz";
|
2022-04-27 09:35:20 +00:00
|
|
|
repo = "rapidfuzz-cpp";
|
2023-04-12 12:48:02 +00:00
|
|
|
rev = "v${finalAttrs.version}";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-8s2Jd1fI8iNmFyMbCEaGZdpqvYFB1tVNZ41ICLN4AeI=";
|
2022-04-27 09:35:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
];
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
cmakeFlags = lib.optionals finalAttrs.finalPackage.doCheck [
|
2022-04-27 09:35:20 +00:00
|
|
|
"-DRAPIDFUZZ_BUILD_TESTING=ON"
|
|
|
|
];
|
|
|
|
|
2022-11-02 22:02:43 +00:00
|
|
|
CXXFLAGS = lib.optionals stdenv.cc.isClang [
|
|
|
|
# error: no member named 'fill' in namespace 'std'
|
|
|
|
"-include algorithm"
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-06-16 17:23:12 +00:00
|
|
|
catch2_3
|
2022-04-27 09:35:20 +00:00
|
|
|
];
|
|
|
|
|
2024-02-07 01:22:34 +00:00
|
|
|
passthru = {
|
|
|
|
tests = {
|
|
|
|
/** `python3Packages.levenshtein` crucially depends on `rapidfuzz-cpp` */
|
|
|
|
inherit (python3Packages) levenshtein;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
meta = {
|
|
|
|
description = "Rapid fuzzy string matching in C++ using the Levenshtein Distance";
|
2024-04-21 15:54:59 +00:00
|
|
|
homepage = "https://github.com/rapidfuzz/rapidfuzz-cpp";
|
|
|
|
changelog = "https://github.com/rapidfuzz/rapidfuzz-cpp/blob/${finalAttrs.src.rev}/CHANGELOG.md";
|
2022-04-27 09:35:20 +00:00
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = with lib.maintainers; [ dotlambda ];
|
|
|
|
platforms = lib.platforms.unix;
|
|
|
|
};
|
2023-04-12 12:48:02 +00:00
|
|
|
})
|