2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
pkgconfig,
|
|
|
|
psutil,
|
|
|
|
pytestCheckHook,
|
|
|
|
python,
|
|
|
|
pythonOlder,
|
|
|
|
setuptools,
|
|
|
|
setuptools-scm,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2024-04-21 15:54:59 +00:00
|
|
|
pname = "lz4";
|
|
|
|
version = "4.3.3";
|
|
|
|
pyproject = true;
|
2022-01-26 04:04:25 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.5";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-26 04:04:25 +00:00
|
|
|
# get full repository in order to run tests
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchFromGitHub {
|
2024-04-21 15:54:59 +00:00
|
|
|
owner = "python-lz4";
|
|
|
|
repo = "python-lz4";
|
2022-08-12 12:06:08 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-ZvGUkb9DoheYY2/sejUhxgh2lS5eoBrFCXR4E0IcFcs=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-01-26 04:04:25 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -i '/pytest-cov/d' setup.py
|
|
|
|
'';
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
build-system = [
|
2022-01-26 04:04:25 +00:00
|
|
|
pkgconfig
|
2023-03-04 12:14:45 +00:00
|
|
|
setuptools-scm
|
2024-04-21 15:54:59 +00:00
|
|
|
setuptools
|
2022-01-26 04:04:25 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"lz4"
|
|
|
|
"lz4.block"
|
|
|
|
"lz4.frame"
|
|
|
|
"lz4.stream"
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-01-26 04:04:25 +00:00
|
|
|
psutil
|
2023-03-04 12:14:45 +00:00
|
|
|
pytestCheckHook
|
2022-01-26 04:04:25 +00:00
|
|
|
];
|
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
# for lz4.steam
|
2024-04-21 15:54:59 +00:00
|
|
|
env.PYLZ4_EXPERIMENTAL = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
# prevent local lz4 directory from getting imported as it lacks native extensions
|
|
|
|
preCheck = ''
|
|
|
|
rm -r lz4
|
|
|
|
export PYTHONPATH=$out/${python.sitePackages}:$PYTHONPATH
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-01-26 04:04:25 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "LZ4 Bindings for Python";
|
|
|
|
homepage = "https://github.com/python-lz4/python-lz4";
|
2023-03-04 12:14:45 +00:00
|
|
|
changelog = "https://github.com/python-lz4/python-lz4/releases/tag/v${version}";
|
2022-01-26 04:04:25 +00:00
|
|
|
license = licenses.bsd3;
|
2023-08-04 22:07:22 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|