2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitLab,
|
|
|
|
pytestCheckHook,
|
|
|
|
setuptools,
|
2022-04-27 09:35:20 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pypng";
|
2024-06-05 15:53:02 +00:00
|
|
|
version = "0.20220715.0";
|
|
|
|
pyproject = true;
|
2022-04-27 09:35:20 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
src = fetchFromGitLab {
|
2022-04-27 09:35:20 +00:00
|
|
|
owner = "drj11";
|
|
|
|
repo = "pypng";
|
2022-09-30 11:47:45 +00:00
|
|
|
rev = "refs/tags/${pname}-${version}";
|
2024-06-05 15:53:02 +00:00
|
|
|
hash = "sha256-tTnsGCAmHexDWm/T5xpHpcBaQcBEqMfTFaoOAeC+pDs=";
|
2022-04-27 09:35:20 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ setuptools ];
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
# pngsuite is imported by code/test_png.py but is not defined in
|
|
|
|
# setup.cfg, so it isn't built - this adds it to py_modules
|
|
|
|
./setup-cfg-pngsuite.patch
|
2022-09-30 11:47:45 +00:00
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# allow tests to use the binaries produced by this package
|
|
|
|
preCheck = ''
|
|
|
|
export PATH="$out/bin:$PATH"
|
|
|
|
'';
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"png"
|
|
|
|
"pngsuite"
|
|
|
|
];
|
2022-04-27 09:35:20 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2022-04-27 09:35:20 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Pure Python library for PNG image encoding/decoding";
|
|
|
|
homepage = "https://github.com/drj11/pypng";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ prusnak ];
|
|
|
|
};
|
|
|
|
}
|