summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/python-zbar/default.nix
blob: b77cffd6820a8c0744836c745f0bd24730db6380 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  setuptools,
  pillow,
  zbar,
  pytestCheckHook,
}:

buildPythonPackage rec {
  pname = "python-zbar";
  version = "0.23.93";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "mchehab";
    repo = "zbar";
    tag = version;
    hash = "sha256-6gOqMsmlYy6TK+iYPIBsCPAk8tYDliZYMYeTOidl4XQ=";
  };

  postPatch = ''
    cd python
  '';

  build-system = [ setuptools ];

  dependencies = [ pillow ];

  buildInputs = [ zbar ];

  nativeCheckInputs = [ pytestCheckHook ];

  disabledTests = [
    #AssertionError: b'Y800' != 'Y800'
    "test_format"
    "test_new"
    #Requires loading a recording device
    #zbar.SystemError: <zbar.Processor object at 0x7ffff615a680>
    "test_processing"
    # Version too long?
    # self.assertEqual(len(ver), 2)
    "test_version"
  ];

  pythonImportsCheck = [ "zbar" ];

  meta = {
    description = "Python bindings for zbar";
    homepage = "https://github.com/mchehab/zbar";
    license = lib.licenses.lgpl21Only;
    maintainers = [ ];
  };
}