2021-08-05 21:33:18 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, buildPythonPackage
|
|
|
|
, pythonOlder
|
|
|
|
, cffi
|
|
|
|
, brotli
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "brotlicffi";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "1.1.0.0";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
2023-11-16 04:20:00 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2021-08-05 21:33:18 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "python-hyper";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-11-16 04:20:00 +00:00
|
|
|
sha256 = "sha256-oW4y1WBJ7+4XwNwwSSR0qUqN03cZYXUYQ6EAwce9dzI=";
|
2021-08-05 21:33:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
brotli
|
|
|
|
];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
propagatedNativeBuildInputs = [
|
|
|
|
cffi
|
|
|
|
];
|
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
cffi
|
|
|
|
];
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
export USE_SHARED_BROTLI=1
|
|
|
|
'';
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
# Test data is not available, only when using libbrotli git checkout
|
2021-08-05 21:33:18 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "brotlicffi" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python CFFI bindings to the Brotli library";
|
|
|
|
homepage = "https://github.com/python-hyper/brotlicffi";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|