Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at gcc-offload 94 lines 1.8 kB view raw
1{ 2 lib, 3 stdenv, 4 buildPythonPackage, 5 pythonOlder, 6 fetchFromGitHub, 7 cmake, 8 cython, 9 ninja, 10 scikit-build-core, 11 setuptools, 12 numpy, 13 hypothesis, 14 pandas, 15 pytestCheckHook, 16 rapidfuzz-cpp, 17 taskflow, 18}: 19 20buildPythonPackage rec { 21 pname = "rapidfuzz"; 22 version = "3.10.1"; 23 pyproject = true; 24 25 disabled = pythonOlder "3.9"; 26 27 src = fetchFromGitHub { 28 owner = "maxbachmann"; 29 repo = "RapidFuzz"; 30 rev = "refs/tags/v${version}"; 31 hash = "sha256-0L8nkjgWdP/w//M69ZRxYk9If3CIEcnAl9mkJKJ4o1g="; 32 }; 33 34 postPatch = '' 35 substituteInPlace pyproject.toml \ 36 --replace-fail "Cython >=3.0.11, <3.1.0" "Cython" 37 ''; 38 39 build-system = [ 40 cmake 41 cython 42 ninja 43 scikit-build-core 44 ]; 45 46 dontUseCmakeConfigure = true; 47 48 buildInputs = [ 49 rapidfuzz-cpp 50 taskflow 51 ]; 52 53 preBuild = 54 '' 55 export RAPIDFUZZ_BUILD_EXTENSION=1 56 '' 57 + lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) '' 58 export CMAKE_ARGS="-DCMAKE_CXX_COMPILER_AR=$AR -DCMAKE_CXX_COMPILER_RANLIB=$RANLIB" 59 ''; 60 61 optional-dependencies = { 62 all = [ numpy ]; 63 }; 64 65 preCheck = '' 66 export RAPIDFUZZ_IMPLEMENTATION=cpp 67 ''; 68 69 nativeCheckInputs = [ 70 hypothesis 71 pandas 72 pytestCheckHook 73 ]; 74 75 disabledTests = lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) [ 76 # segfaults 77 "test_cdist" 78 ]; 79 80 pythonImportsCheck = [ 81 "rapidfuzz.distance" 82 "rapidfuzz.fuzz" 83 "rapidfuzz.process" 84 "rapidfuzz.utils" 85 ]; 86 87 meta = with lib; { 88 description = "Rapid fuzzy string matching"; 89 homepage = "https://github.com/maxbachmann/RapidFuzz"; 90 changelog = "https://github.com/maxbachmann/RapidFuzz/blob/${src.rev}/CHANGELOG.rst"; 91 license = licenses.mit; 92 maintainers = with maintainers; [ dotlambda ]; 93 }; 94}