1{ buildPythonPackage, fetchPypi, lib, pillow, tesseract, substituteAll }:
2
3buildPythonPackage rec {
4 pname = "pytesseract";
5 version = "0.2.9";
6
7 src = fetchPypi {
8 inherit pname version;
9 sha256 = "1mjr3pa4fycdsl7xk9s8fpn2vhpgx7mrdnn5h4lyyjhz86195ivg";
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.gpl3;
28 description = "A Python wrapper for Google Tesseract";
29 maintainers = with maintainers; [ ma27 ];
30 };
31}