2022-09-30 11:47:45 +00:00
|
|
|
{ buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, lib
|
|
|
|
, packaging
|
|
|
|
, pillow
|
|
|
|
, tesseract
|
|
|
|
, substituteAll
|
2022-06-16 17:23:12 +00:00
|
|
|
, pytestCheckHook
|
2022-09-30 11:47:45 +00:00
|
|
|
, setuptools
|
2022-06-16 17:23:12 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pytesseract";
|
2022-06-16 17:23:12 +00:00
|
|
|
version = "0.3.10";
|
2022-04-15 01:41:22 +00:00
|
|
|
format = "pyproject";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "madmaze";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "sha256-CyKXtaIE/8iPLqi0GHVUgTeJDYZyWBjkRvOKJJKCxZo=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
(substituteAll {
|
|
|
|
src = ./tesseract-binary.patch;
|
|
|
|
drv = tesseract;
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
buildInputs = [
|
|
|
|
tesseract
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
packaging
|
|
|
|
pillow
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://pypi.org/project/pytesseract/";
|
|
|
|
license = licenses.asl20;
|
|
|
|
description = "A Python wrapper for Google Tesseract";
|
2022-06-26 10:26:21 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|