1{ lib, buildPythonPackage, isPy3k, fetchFromGitHub, cffi, crc32c, pytestCheckHook }:
2
3buildPythonPackage rec {
4 pname = "google-crc32c";
5 version = "1.0.0";
6
7 disabled = !isPy3k;
8
9 src = fetchFromGitHub {
10 owner = "googleapis";
11 repo = "python-crc32c";
12 rev = "v${version}";
13 sha256 = "0n3ggsxmk1fhq0kz6p5rcj4gypfb05i26fcn7lsawakgl7fzxqyl";
14 };
15
16 buildInputs = [ crc32c ];
17 propagatedBuildInputs = [ cffi ];
18
19 LDFLAGS = "-L${crc32c}/lib";
20 CFLAGS = "-I${crc32c}/include";
21
22 checkInputs = [ pytestCheckHook crc32c ];
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}