2020-03-10 13:00:00 +01:00
|
|
|
{ lib, fetchFromGitLab, buildPythonPackage, pillow, setuptools_scm,
|
|
|
|
setuptools-scm-git-archive , tesseract, cuneiform, isPy3k, substituteAll,
|
|
|
|
pytest, tox }:
|
2017-09-02 03:43:21 +02:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2017-11-09 12:26:09 +01:00
|
|
|
pname = "pyocr";
|
2020-03-10 13:00:00 +01:00
|
|
|
version = "0.7.2";
|
2018-04-11 13:31:32 +02:00
|
|
|
disabled = !isPy3k;
|
2017-09-02 03:43:21 +02:00
|
|
|
|
|
|
|
# Don't fetch from PYPI because it doesn't contain tests.
|
2018-09-10 17:27:56 +02:00
|
|
|
src = fetchFromGitLab {
|
|
|
|
domain = "gitlab.gnome.org";
|
|
|
|
group = "World";
|
|
|
|
owner = "OpenPaperwork";
|
2017-09-02 03:43:21 +02:00
|
|
|
repo = "pyocr";
|
|
|
|
rev = version;
|
2020-03-10 13:00:00 +01:00
|
|
|
sha256 = "09ab86bmizpv94w3mdvdqkjyyvk1vafw3jqhkiw5xx7p180xn3il";
|
2017-09-02 03:43:21 +02:00
|
|
|
};
|
|
|
|
|
2018-09-10 17:27:56 +02:00
|
|
|
patches = [ (substituteAll {
|
|
|
|
src = ./paths.patch;
|
|
|
|
inherit cuneiform tesseract;
|
|
|
|
})
|
|
|
|
];
|
2017-09-02 03:43:21 +02:00
|
|
|
|
2020-03-10 13:00:00 +01:00
|
|
|
buildInputs = [ setuptools_scm setuptools-scm-git-archive ];
|
|
|
|
propagatedBuildInputs = [ pillow ];
|
2018-09-10 17:27:56 +02:00
|
|
|
checkInputs = [ pytest tox ];
|
|
|
|
checkPhase = "pytest";
|
2017-09-02 03:43:21 +02:00
|
|
|
|
|
|
|
meta = {
|
2018-09-10 17:57:27 +02:00
|
|
|
inherit (src.meta) homepage;
|
2017-09-02 03:43:21 +02:00
|
|
|
description = "A Python wrapper for Tesseract and Cuneiform";
|
|
|
|
license = lib.licenses.gpl3Plus;
|
|
|
|
};
|
|
|
|
}
|