python3Packages.brotlicffi: modernize

This commit is contained in:
FliegendeWurst 2025-03-29 18:43:06 +01:00 committed by Martin Weinelt
parent 58d5a15620
commit 2d0bfdc3ce
No known key found for this signature in database
GPG key ID: 87C1E9888F856759

View file

@ -4,35 +4,48 @@
buildPythonPackage,
pythonOlder,
cffi,
# overriden as pkgs.brotli
brotli,
setuptools,
pytestCheckHook,
hypothesis,
}:
buildPythonPackage rec {
pname = "brotlicffi";
version = "1.1.0.0";
format = "setuptools";
pyproject = true;
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "python-hyper";
repo = pname;
repo = "brotlicffi";
rev = "v${version}";
sha256 = "sha256-oW4y1WBJ7+4XwNwwSSR0qUqN03cZYXUYQ6EAwce9dzI=";
};
build-system = [ setuptools ];
buildInputs = [ brotli ];
propagatedNativeBuildInputs = [ cffi ];
propagatedBuildInputs = [ cffi ];
dependencies = [ cffi ];
preBuild = ''
export USE_SHARED_BROTLI=1
'';
# Test data is not available, only when using libbrotli git checkout
nativeCheckInputs = [
pytestCheckHook
hypothesis
];
# Test data is only available from libbrotli git checkout, not brotli.src
doCheck = false;
pytestFlagsArray = [ "test/" ];
pythonImportsCheck = [ "brotlicffi" ];
meta = with lib; {