1{ lib
2, fetchFromGitHub
3, buildPythonPackage
4, pythonOlder
5, cffi
6, brotli
7}:
8
9buildPythonPackage rec {
10 pname = "brotlicffi";
11 version = "1.0.9.2";
12 disabled = pythonOlder "3.6";
13
14 src = fetchFromGitHub {
15 owner = "python-hyper";
16 repo = pname;
17 rev = "v${version}";
18 sha256 = "0qx7an7772brmx1rbbrqzqnkqqvicc70mx740nl31kzzyv4jjs00";
19 };
20
21 buildInputs = [
22 brotli
23 ];
24
25 propagatedNativeBuildInputs = [
26 cffi
27 ];
28
29 propagatedBuildInputs = [
30 cffi
31 ];
32
33 preBuild = ''
34 export USE_SHARED_BROTLI=1
35 '';
36
37 # Test data is not available, only when using libbrotli git checkout
38 doCheck = false;
39
40 pythonImportsCheck = [ "brotlicffi" ];
41
42 meta = with lib; {
43 description = "Python CFFI bindings to the Brotli library";
44 homepage = "https://github.com/python-hyper/brotlicffi";
45 license = licenses.mit;
46 maintainers = with maintainers; [ fab ];
47 };
48}