14 withTesseractSupport ? true,
15 withCuneiformSupport ? stdenv.hostPlatform.isLinux,
18 buildPythonPackage rec {
24 # Don't fetch from PYPI because it doesn't contain tests.
25 src = fetchFromGitLab {
26 domain = "gitlab.gnome.org";
28 owner = "OpenPaperwork";
31 hash = "sha256-gE0+qbHCwpDdxXFY+4rjVU2FbUSfSVrvrVMcWUk+9FU=";
36 ++ (lib.optional withTesseractSupport (substituteAll {
37 src = ./paths-tesseract.patch;
39 tesseractLibraryLocation = "${tesseract}/lib/libtesseract${stdenv.hostPlatform.extensions.sharedLibrary}";
41 ++ (lib.optional stdenv.hostPlatform.isLinux (substituteAll {
42 src = ./paths-cuneiform.patch;
46 propagatedBuildInputs = [ pillow ];
53 nativeCheckInputs = [ pytestCheckHook ];
56 inherit (src.meta) homepage;
57 changelog = "https://gitlab.gnome.org/World/OpenPaperwork/pyocr/-/blob/${version}/ChangeLog";
58 description = "Python wrapper for Tesseract and Cuneiform";
59 license = licenses.gpl3Plus;
60 maintainers = with maintainers; [