2022-09-30 11:47:45 +00:00
|
|
|
{ buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, lib
|
|
|
|
|
|
|
|
# build dependencies
|
|
|
|
, cython
|
|
|
|
, leptonica
|
|
|
|
, pkg-config
|
|
|
|
, tesseract
|
|
|
|
|
|
|
|
# propagates
|
|
|
|
, pillow
|
|
|
|
|
|
|
|
# tests
|
|
|
|
, unittestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "tesserocr";
|
2021-07-24 12:14:16 +00:00
|
|
|
version = "2.5.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-07-24 12:14:16 +00:00
|
|
|
sha256 = "1bmj76gi8401lcqdaaznfmz9yf11myy1bzivqwwq08z3dwzxswck";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cython
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
leptonica
|
|
|
|
tesseract
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
pillow
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"tesserocr"
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-09-30 11:47:45 +00:00
|
|
|
unittestCheckHook
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2022-09-30 11:47:45 +00:00
|
|
|
changelog = "https://github.com/sirfz/tesserocr/releases/tag/v${version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A simple, Pillow-friendly, wrapper around the tesseract-ocr API for Optical Character Recognition (OCR)";
|
|
|
|
homepage = "https://github.com/sirfz/tesserocr";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ mtrsk ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|