Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at flake-libs 58 lines 1.2 kB view raw
1{ 2 lib, 3 buildPythonPackage, 4 pythonOlder, 5 fetchFromGitHub, 6 rustPlatform, 7 pytestCheckHook, 8 pytest-benchmark, 9 nix-update-script, 10}: 11let 12 pname = "fastcrc"; 13 version = "0.3.2"; 14 15 src = fetchFromGitHub { 16 owner = "overcat"; 17 repo = "fastcrc"; 18 tag = "v${version}"; 19 hash = "sha256-yLrv/zqsjgygJAIJtztwxlm4s9o9EBVsCyx1jUXd7hA="; 20 }; 21in 22buildPythonPackage { 23 inherit pname version src; 24 pyproject = true; 25 26 disabled = pythonOlder "3.7"; 27 28 nativeBuildInputs = with rustPlatform; [ 29 cargoSetupHook 30 maturinBuildHook 31 ]; 32 33 cargoDeps = rustPlatform.fetchCargoVendor { 34 inherit pname version src; 35 hash = "sha256-9Vap8E71TkBIf4eIB2lapUqcMukdsHX4LR7U8AD77SU="; 36 }; 37 38 pythonImportsCheck = [ "fastcrc" ]; 39 40 nativeCheckInputs = [ 41 pytestCheckHook 42 pytest-benchmark 43 ]; 44 45 # Python source files interfere with testing 46 preCheck = '' 47 rm -r fastcrc 48 ''; 49 50 passthru.updateScript = nix-update-script { }; 51 52 meta = { 53 description = "Hyper-fast Python module for computing CRC(8, 16, 32, 64) checksum"; 54 homepage = "https://fastcrc.readthedocs.io/en/latest/"; 55 license = lib.licenses.mit; 56 maintainers = with lib.maintainers; [ pluiedev ]; 57 }; 58}