1{ buildPythonPackage 2, fetchFromGitHub 3, lib 4, packaging 5, pillow 6, tesseract 7, substituteAll 8, pytestCheckHook 9, setuptools 10}: 11 12buildPythonPackage rec { 13 pname = "pytesseract"; 14 version = "0.3.13"; 15 format = "pyproject"; 16 17 src = fetchFromGitHub { 18 owner = "madmaze"; 19 repo = pname; 20 rev = "refs/tags/v${version}"; 21 hash = "sha256-gQMeck6ojlIwyiOCBBhzHHrjQfBMelVksVGd+fyxWZk="; 22 }; 23 24 patches = [ 25 (substituteAll { 26 src = ./tesseract-binary.patch; 27 drv = tesseract; 28 }) 29 ]; 30 31 nativeBuildInputs = [ 32 setuptools 33 ]; 34 35 buildInputs = [ 36 tesseract 37 ]; 38 39 propagatedBuildInputs = [ 40 packaging 41 pillow 42 ]; 43 44 nativeCheckInputs = [ pytestCheckHook ]; 45 46 meta = with lib; { 47 homepage = "https://pypi.org/project/pytesseract/"; 48 license = licenses.asl20; 49 description = "A Python wrapper for Google Tesseract"; 50 maintainers = with maintainers; [ ]; 51 }; 52}