nixpkgs/pkgs/development/python-modules/brotlicffi/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

58 lines
1.1 KiB
Nix
Raw Normal View History

{
lib,
fetchFromGitHub,
buildPythonPackage,
pythonOlder,
cffi,
2025-06-02 15:54:57 +02:00
# overridden as pkgs.brotli
brotli,
2025-03-29 18:43:06 +01:00
setuptools,
pytestCheckHook,
hypothesis,
}:
buildPythonPackage rec {
pname = "brotlicffi";
version = "1.1.0.0";
2025-03-29 18:43:06 +01:00
pyproject = true;
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "python-hyper";
2025-03-29 18:43:06 +01:00
repo = "brotlicffi";
rev = "v${version}";
sha256 = "sha256-oW4y1WBJ7+4XwNwwSSR0qUqN03cZYXUYQ6EAwce9dzI=";
};
2025-03-29 18:43:06 +01:00
build-system = [ setuptools ];
buildInputs = [ brotli ];
propagatedNativeBuildInputs = [ cffi ];
2025-03-29 18:43:06 +01:00
dependencies = [ cffi ];
preBuild = ''
export USE_SHARED_BROTLI=1
'';
2025-03-29 18:43:06 +01:00
nativeCheckInputs = [
pytestCheckHook
hypothesis
];
# Test data is only available from libbrotli git checkout, not brotli.src
doCheck = false;
2025-03-29 18:43:06 +01:00
pytestFlagsArray = [ "test/" ];
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 ];
};
}