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