summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/brotlicffi/default.nix
blob: a2aaf2b1dd3f2eb9653d24d69e11073d31411cec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
{
  lib,
  fetchFromGitHub,
  buildPythonPackage,
  cffi,
  # overridden as pkgs.brotli
  brotli,
  setuptools,
  pytestCheckHook,
  hypothesis,
}:

buildPythonPackage rec {
  pname = "brotlicffi";
  version = "1.1.0.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "python-hyper";
    repo = "brotlicffi";
    rev = "v${version}";
    sha256 = "sha256-oW4y1WBJ7+4XwNwwSSR0qUqN03cZYXUYQ6EAwce9dzI=";
  };

  build-system = [ setuptools ];

  buildInputs = [ brotli ];

  propagatedNativeBuildInputs = [ cffi ];

  dependencies = [ cffi ];

  preBuild = ''
    export USE_SHARED_BROTLI=1
  '';

  nativeCheckInputs = [
    pytestCheckHook
    hypothesis
  ];

  # Test data is only available from libbrotli git checkout, not brotli.src
  doCheck = false;

  enabledTestPaths = [ "test/" ];

  pythonImportsCheck = [ "brotlicffi" ];

  meta = {
    description = "Python CFFI bindings to the Brotli library";
    homepage = "https://github.com/python-hyper/brotlicffi";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ fab ];
  };
}