2021-09-18 10:52:07 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitLab
|
|
|
|
, buildPythonPackage
|
|
|
|
, pillow
|
|
|
|
, tesseract
|
|
|
|
, cuneiform
|
|
|
|
, isPy3k
|
|
|
|
, substituteAll
|
|
|
|
, pytestCheckHook
|
2023-11-16 04:20:00 +00:00
|
|
|
, setuptools
|
|
|
|
, setuptools-scm
|
2021-09-18 10:52:07 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyocr";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "0.8.5";
|
2020-04-24 23:36:52 +00:00
|
|
|
disabled = !isPy3k;
|
2023-11-16 04:20:00 +00:00
|
|
|
format = "pyproject";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# 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;
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-gE0+qbHCwpDdxXFY+4rjVU2FbUSfSVrvrVMcWUk+9FU=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
patches = [
|
|
|
|
(substituteAll {
|
|
|
|
src = ./paths.patch;
|
|
|
|
inherit cuneiform tesseract;
|
|
|
|
})
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
env.SETUPTOOLS_SCM_PRETEND_VERSION = version;
|
2021-09-18 10:52:07 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [ pillow ];
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
nativeBuildInputs = [ setuptools setuptools-scm ];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2021-09-18 10:52:07 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit (src.meta) homepage;
|
2023-11-16 04:20:00 +00:00
|
|
|
changelog = "https://gitlab.gnome.org/World/OpenPaperwork/pyocr/-/blob/${version}/ChangeLog";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A Python wrapper for Tesseract and Cuneiform";
|
2021-09-18 10:52:07 +00:00
|
|
|
license = licenses.gpl3Plus;
|
2022-09-11 15:47:08 +00:00
|
|
|
maintainers = with maintainers; [ symphorien ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|