1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonAtLeast,
6 setuptools,
7 pillow,
8 zbar,
9 pytestCheckHook,
10}:
11
12buildPythonPackage rec {
13 pname = "python-zbar";
14 version = "0.23.93";
15 pyproject = true;
16
17 # distutils usage in setup.py
18 disabled = pythonAtLeast "3.12";
19
20 src = fetchFromGitHub {
21 owner = "mchehab";
22 repo = "zbar";
23 rev = "refs/tags/${version}";
24 hash = "sha256-6gOqMsmlYy6TK+iYPIBsCPAk8tYDliZYMYeTOidl4XQ=";
25 };
26
27 postPatch = ''
28 cd python
29 '';
30
31 build-system = [ setuptools ];
32
33 dependencies = [ pillow ];
34
35 buildInputs = [ zbar ];
36
37 nativeCheckInputs = [ pytestCheckHook ];
38
39 disabledTests = [
40 #AssertionError: b'Y800' != 'Y800'
41 "test_format"
42 "test_new"
43 #Requires loading a recording device
44 #zbar.SystemError: <zbar.Processor object at 0x7ffff615a680>
45 "test_processing"
46 # Version too long?
47 # self.assertEqual(len(ver), 2)
48 "test_version"
49 ];
50
51 pythonImportsCheck = [ "zbar" ];
52
53 meta = with lib; {
54 description = "Python bindings for zbar";
55 homepage = "https://github.com/mchehab/zbar";
56 license = licenses.lgpl21Only;
57 maintainers = with maintainers; [ wolfangaukang ];
58 };
59}