1{ buildPythonPackage, fetchPypi, lib, pillow, tesseract, substituteAll }:
2
3buildPythonPackage rec {
4 pname = "pytesseract";
5 version = "0.3.8";
6
7 src = fetchPypi {
8 inherit pname version;
9 sha256 = "sha256-YUigHkN1dghi6PVupxjiK10TsoFFTfRuqNrJgHeT/Fo=";
10 };
11
12 patches = [
13 (substituteAll {
14 src = ./tesseract-binary.patch;
15 drv = tesseract;
16 })
17 ];
18
19 buildInputs = [ tesseract ];
20 propagatedBuildInputs = [ pillow ];
21
22 # the package doesn't have any tests.
23 doCheck = false;
24
25 meta = with lib; {
26 homepage = "https://pypi.org/project/pytesseract/";
27 license = licenses.asl20;
28 description = "A Python wrapper for Google Tesseract";
29 maintainers = with maintainers; [ ma27 ];
30 };
31}