1{ lib
2, stdenv
3, fetchFromGitHub
4, cmake
5, catch2_3
6}:
7
8stdenv.mkDerivation rec {
9 pname = "rapidfuzz-cpp";
10 version = "1.10.1";
11
12 src = fetchFromGitHub {
13 owner = "maxbachmann";
14 repo = "rapidfuzz-cpp";
15 rev = "v${version}";
16 hash = "sha256-c9ESzsDcoUw5XAEZDHdG8jazjI5Oyqic1gaT0qGQsbI=";
17 };
18
19 patches = [
20 ./dont-fetch-project-options.patch
21 ];
22
23 nativeBuildInputs = [
24 cmake
25 ];
26
27 cmakeFlags = lib.optionals doCheck [
28 "-DRAPIDFUZZ_BUILD_TESTING=ON"
29 ];
30
31 CXXFLAGS = lib.optionals stdenv.cc.isClang [
32 # error: no member named 'fill' in namespace 'std'
33 "-include algorithm"
34 ];
35
36 checkInputs = [
37 catch2_3
38 ];
39
40 doCheck = true;
41
42 meta = {
43 description = "Rapid fuzzy string matching in C++ using the Levenshtein Distance";
44 homepage = "https://github.com/maxbachmann/rapidfuzz-cpp";
45 changelog = "https://github.com/maxbachmann/rapidfuzz-cpp/blob/${src.rev}/CHANGELOG.md";
46 license = lib.licenses.mit;
47 maintainers = with lib.maintainers; [ dotlambda ];
48 platforms = lib.platforms.unix;
49 };
50}