2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
pythonAtLeast,
|
|
|
|
setuptools,
|
|
|
|
pillow,
|
|
|
|
zbar,
|
|
|
|
pytestCheckHook,
|
2023-02-09 11:40:11 +00:00
|
|
|
}:
|
2022-03-10 19:12:11 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "python-zbar";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "0.23.93";
|
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
# distutils usage in setup.py
|
|
|
|
disabled = pythonAtLeast "3.12";
|
2022-03-10 19:12:11 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mchehab";
|
|
|
|
repo = "zbar";
|
2024-04-21 15:54:59 +00:00
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
hash = "sha256-6gOqMsmlYy6TK+iYPIBsCPAk8tYDliZYMYeTOidl4XQ=";
|
2022-03-10 19:12:11 +00:00
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
postPatch = ''
|
|
|
|
cd python
|
|
|
|
'';
|
2023-02-09 11:40:11 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
build-system = [ setuptools ];
|
|
|
|
|
|
|
|
dependencies = [ pillow ];
|
2022-03-10 19:12:11 +00:00
|
|
|
|
|
|
|
buildInputs = [ zbar ];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2022-03-10 19:12:11 +00:00
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
#AssertionError: b'Y800' != 'Y800'
|
|
|
|
"test_format"
|
|
|
|
"test_new"
|
|
|
|
#Requires loading a recording device
|
|
|
|
#zbar.SystemError: <zbar.Processor object at 0x7ffff615a680>
|
|
|
|
"test_processing"
|
2024-04-21 15:54:59 +00:00
|
|
|
# Version too long?
|
|
|
|
# self.assertEqual(len(ver), 2)
|
|
|
|
"test_version"
|
2022-03-10 19:12:11 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "zbar" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python bindings for zbar";
|
|
|
|
homepage = "https://github.com/mchehab/zbar";
|
|
|
|
license = licenses.lgpl21Only;
|
|
|
|
maintainers = with maintainers; [ wolfangaukang ];
|
|
|
|
};
|
|
|
|
}
|