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