1{ lib, buildPythonPackage, fetchFromGitHub, cffi, crc32c, pytestCheckHook }:
2
3buildPythonPackage rec {
4 pname = "google-crc32c";
5 version = "1.5.0";
6
7 src = fetchFromGitHub {
8 owner = "googleapis";
9 repo = "python-crc32c";
10 rev = "v${version}";
11 hash = "sha256-Tx7UBIwKzSBbpuqdqGiXTbmBE+1MDRknVe3Zee0UHKQ=";
12 };
13
14 buildInputs = [ crc32c ];
15
16 propagatedBuildInputs = [ cffi ];
17
18 LDFLAGS = "-L${crc32c}/lib";
19 CFLAGS = "-I${crc32c}/include";
20
21 nativeCheckInputs = [ pytestCheckHook crc32c ];
22
23 pythonImportsCheck = [ "google_crc32c" ];
24
25 meta = with lib; {
26 homepage = "https://github.com/googleapis/python-crc32c";
27 description = "Wrapper the google/crc32c hardware-based implementation of the CRC32C hashing algorithm";
28 license = with licenses; [ asl20 ];
29 maintainers = with maintainers; [ freezeboy ];
30 };
31}