about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/pyocr/default.nix
blob: df20d3bb6c47d2336f7bd3c1f82f5b99896c82cd (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
{ lib
, fetchFromGitLab
, buildPythonPackage
, pillow
, setuptools-scm
, setuptools-scm-git-archive
, tesseract
, cuneiform
, isPy3k
, substituteAll
, pytestCheckHook
, tox
}:

buildPythonPackage rec {
  pname = "pyocr";
  version = "0.7.2";
  disabled = !isPy3k;

  # Don't fetch from PYPI because it doesn't contain tests.
  src = fetchFromGitLab {
    domain = "gitlab.gnome.org";
    group = "World";
    owner = "OpenPaperwork";
    repo = "pyocr";
    rev = version;
    sha256 = "09ab86bmizpv94w3mdvdqkjyyvk1vafw3jqhkiw5xx7p180xn3il";
  };

  patches = [
    (substituteAll {
      src = ./paths.patch;
      inherit cuneiform tesseract;
    })
  ];

  SETUPTOOLS_SCM_PRETEND_VERSION = version;

  buildInputs = [ setuptools-scm setuptools-scm-git-archive ];

  propagatedBuildInputs = [ pillow ];

  checkInputs = [ pytestCheckHook ];

  meta = with lib; {
    inherit (src.meta) homepage;
    description = "A Python wrapper for Tesseract and Cuneiform";
    license = licenses.gpl3Plus;
    maintainers = with maintainers; [ ];
  };
}