2021-09-18 10:52:07 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitLab
|
|
|
|
, buildPythonPackage
|
|
|
|
, pillow
|
|
|
|
, setuptools-scm
|
|
|
|
, setuptools-scm-git-archive
|
|
|
|
, tesseract
|
|
|
|
, cuneiform
|
|
|
|
, isPy3k
|
|
|
|
, substituteAll
|
|
|
|
, pytestCheckHook
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
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";
|
|
|
|
};
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
patches = [
|
|
|
|
(substituteAll {
|
|
|
|
src = ./paths.patch;
|
|
|
|
inherit cuneiform tesseract;
|
|
|
|
})
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
SETUPTOOLS_SCM_PRETEND_VERSION = version;
|
|
|
|
|
2021-06-04 09:07:49 +00:00
|
|
|
buildInputs = [ setuptools-scm setuptools-scm-git-archive ];
|
2021-09-18 10:52:07 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [ pillow ];
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
checkInputs = [ pytestCheckHook ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit (src.meta) homepage;
|
|
|
|
description = "A Python wrapper for Tesseract and Cuneiform";
|
2021-09-18 10:52:07 +00:00
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
maintainers = with maintainers; [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|