depot/third_party/nixpkgs/pkgs/by-name/ra/rapidfuzz-cpp/package.nix
Luke Granger-Brown f92e137cfb
Some checks failed
/ combine-systems (push) Blocked by required conditions
/ build (x86_64-linux) (push) Failing after 11m44s
/ build (aarch64-linux) (push) Failing after 11m50s
/ build (push) Failing after 16m42s
Merge commit '1e2ed035f4bebc9adad02b365508ad96f7df87c1' into HEAD
2025-03-02 02:23:32 +00:00

55 lines
1.2 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
cmake,
catch2_3,
python3Packages,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "rapidfuzz-cpp";
version = "3.3.2";
src = fetchFromGitHub {
owner = "rapidfuzz";
repo = "rapidfuzz-cpp";
rev = "v${finalAttrs.version}";
hash = "sha256-AuH0Vq0Le5T9vDCpEviEjfNpwJFnFtqj/taFJy+YoMY=";
};
nativeBuildInputs = [
cmake
];
cmakeFlags = lib.optionals finalAttrs.finalPackage.doCheck [
"-DRAPIDFUZZ_BUILD_TESTING=ON"
];
CXXFLAGS = lib.optionals stdenv.cc.isClang [
# error: no member named 'fill' in namespace 'std'
"-include algorithm"
];
nativeCheckInputs = [
catch2_3
];
passthru = {
tests = {
/**
`python3Packages.levenshtein` crucially depends on `rapidfuzz-cpp`
*/
inherit (python3Packages) levenshtein;
};
};
meta = {
description = "Rapid fuzzy string matching in C++ using the Levenshtein Distance";
homepage = "https://github.com/rapidfuzz/rapidfuzz-cpp";
changelog = "https://github.com/rapidfuzz/rapidfuzz-cpp/blob/${finalAttrs.src.rev}/CHANGELOG.md";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ dotlambda ];
platforms = lib.platforms.unix;
};
})