about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/python-zbar/default.nix
blob: 4d85b26875cd7db0dcd80583f7f6d1c4b9524e84 (plain) (blame)
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
, pillow
, zbar
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "python-zbar";
  version = "0.23.90";
  format = "setuptools";

  src = fetchFromGitHub {
    owner = "mchehab";
    repo = "zbar";
    rev = version;
    hash = "sha256-FvV7TMc4JbOiRjWLka0IhtpGGqGm5fis7h870OmJw2U=";
  };

  patches = [
    # python: enum: fix build for Python 3.11
    # https://github.com/mchehab/zbar/pull/231
    # the patch is reworked as it does not cleanly apply
    ./0001-python-enum-fix-build-for-Python-3.11.patch
  ];

  propagatedBuildInputs = [ pillow ];

  buildInputs = [ zbar ];

  nativeCheckInputs = [ pytestCheckHook ];

  preBuild = ''
    cd python
  '';

  disabledTests = [
    #AssertionError: b'Y800' != 'Y800'
    "test_format"
    "test_new"
    #Requires loading a recording device
    #zbar.SystemError: <zbar.Processor object at 0x7ffff615a680>
    "test_processing"
  ];

  pythonImportsCheck = [ "zbar" ];

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