1{
2 lib,
3 buildPythonPackage,
4 cffi,
5 crc32c,
6 fetchFromGitHub,
7 pytestCheckHook,
8 pythonOlder,
9 setuptools,
10}:
11
12buildPythonPackage rec {
13 pname = "google-crc32c";
14 version = "1.7.1";
15 pyproject = true;
16
17 disabled = pythonOlder "3.9";
18
19 src = fetchFromGitHub {
20 owner = "googleapis";
21 repo = "python-crc32c";
22 tag = "v${version}";
23 hash = "sha256-YXXoEXnJckF1kqpLXbIbJEcW+le6aeKyc6Y6xmf0SSw=";
24 };
25
26 build-system = [ setuptools ];
27
28 buildInputs = [ crc32c ];
29
30 dependencies = [ cffi ];
31
32 LDFLAGS = "-L${crc32c}/lib";
33 CFLAGS = "-I${crc32c}/include";
34
35 nativeCheckInputs = [
36 pytestCheckHook
37 crc32c
38 ];
39
40 pythonImportsCheck = [ "google_crc32c" ];
41
42 meta = with lib; {
43 description = "Wrapper the google/crc32c hardware-based implementation of the CRC32C hashing algorithm";
44 homepage = "https://github.com/googleapis/python-crc32c";
45 changelog = "https://github.com/googleapis/python-crc32c/blob/v${version}/CHANGELOG.md";
46 license = with licenses; [ asl20 ];
47 maintainers = with maintainers; [ freezeboy ];
48 };
49}