at master 55 lines 1.2 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchFromGitHub, 5 cmake, 6 catch2_3, 7 python3Packages, 8}: 9 10stdenv.mkDerivation (finalAttrs: { 11 pname = "rapidfuzz-cpp"; 12 version = "3.3.3"; 13 14 src = fetchFromGitHub { 15 owner = "rapidfuzz"; 16 repo = "rapidfuzz-cpp"; 17 rev = "v${finalAttrs.version}"; 18 hash = "sha256-uyOkp+a08V+4Hvwp1OY6XMMd37z5RI+W5G4URu6FQtU="; 19 }; 20 21 nativeBuildInputs = [ 22 cmake 23 ]; 24 25 cmakeFlags = lib.optionals finalAttrs.finalPackage.doCheck [ 26 "-DRAPIDFUZZ_BUILD_TESTING=ON" 27 ]; 28 29 CXXFLAGS = lib.optionals stdenv.cc.isClang [ 30 # error: no member named 'fill' in namespace 'std' 31 "-include algorithm" 32 ]; 33 34 nativeCheckInputs = [ 35 catch2_3 36 ]; 37 38 passthru = { 39 tests = { 40 /** 41 `python3Packages.levenshtein` crucially depends on `rapidfuzz-cpp` 42 */ 43 inherit (python3Packages) levenshtein; 44 }; 45 }; 46 47 meta = { 48 description = "Rapid fuzzy string matching in C++ using the Levenshtein Distance"; 49 homepage = "https://github.com/rapidfuzz/rapidfuzz-cpp"; 50 changelog = "https://github.com/rapidfuzz/rapidfuzz-cpp/blob/${finalAttrs.src.rev}/CHANGELOG.md"; 51 license = lib.licenses.mit; 52 maintainers = with lib.maintainers; [ dotlambda ]; 53 platforms = lib.platforms.unix; 54 }; 55})