1{ lib, fetchFromGitLab, buildPythonPackage, pillow, setuptools_scm,
2setuptools-scm-git-archive , tesseract, cuneiform, isPy3k, substituteAll,
3pytest, tox }:
4
5buildPythonPackage rec {
6 pname = "pyocr";
7 version = "0.7.2";
8 disabled = !isPy3k;
9
10 # Don't fetch from PYPI because it doesn't contain tests.
11 src = fetchFromGitLab {
12 domain = "gitlab.gnome.org";
13 group = "World";
14 owner = "OpenPaperwork";
15 repo = "pyocr";
16 rev = version;
17 sha256 = "09ab86bmizpv94w3mdvdqkjyyvk1vafw3jqhkiw5xx7p180xn3il";
18 };
19
20 patches = [ (substituteAll {
21 src = ./paths.patch;
22 inherit cuneiform tesseract;
23 })
24 ];
25
26 buildInputs = [ setuptools_scm setuptools-scm-git-archive ];
27 propagatedBuildInputs = [ pillow ];
28 checkInputs = [ pytest tox ];
29 checkPhase = "pytest";
30
31 meta = {
32 inherit (src.meta) homepage;
33 description = "A Python wrapper for Tesseract and Cuneiform";
34 license = lib.licenses.gpl3Plus;
35 };
36}