diff --git a/1441bec703cf68161acce5e85907ddd71c47fdc3.patch b/1441bec703cf68161acce5e85907ddd71c47fdc3.patch new file mode 100644 index 0000000..edeb124 --- /dev/null +++ b/1441bec703cf68161acce5e85907ddd71c47fdc3.patch @@ -0,0 +1,31 @@ +From 1441bec703cf68161acce5e85907ddd71c47fdc3 Mon Sep 17 00:00:00 2001 +From: Stefan Weil +Date: Mon, 18 Jul 2022 08:09:15 +0200 +Subject: [PATCH] Add support for upcoming Leptonica 1.83.0 + +Signed-off-by: Stefan Weil +--- + tesseract5.pxd | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/tesseract5.pxd b/tesseract5.pxd +index 21ad667..aa7e52d 100644 +--- a/tesseract5.pxd ++++ b/tesseract5.pxd +@@ -54,6 +54,16 @@ cdef extern from "leptonica/allheaders.h" nogil: + L_SEVERITY_ERROR = 5 # Print error and higher messages + L_SEVERITY_NONE = 6 # Highest severity: print no messages + ++cdef extern from *: ++ """ ++ #if (LIBLEPT_MAJOR_VERSION > 1) || (LIBLEPT_MINOR_VERSION > 82) ++ // The public API of Leptonica 1.83.0 hides details of some data ++ // structures which are used by tesserocr (see Pix, Box, ... above). ++ // Get those details by including a private header file. ++ #include ++ #endif ++ """ ++ + cdef extern from "tesseract/publictypes.h" namespace "tesseract" nogil: + cdef enum PolyBlockType: + PT_UNKNOWN # Type is not yet known. Keep as the first element. diff --git a/python-tesserocr.changes b/python-tesserocr.changes index 9bfe60c..eacde56 100644 --- a/python-tesserocr.changes +++ b/python-tesserocr.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Sat Jan 14 21:46:21 UTC 2023 - Hans-Peter Jansen + +- Apply 1441bec703cf68161acce5e85907ddd71c47fdc3.patch from upstream + project in order to build with Leptonica 1.83.0 +- Make tests work again + ------------------------------------------------------------------- Fri Nov 11 13:26:52 UTC 2022 - pgajdos@suse.com diff --git a/python-tesserocr.spec b/python-tesserocr.spec index f47521d..897ecc9 100644 --- a/python-tesserocr.spec +++ b/python-tesserocr.spec @@ -1,7 +1,7 @@ # # spec file for package python-tesserocr # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,6 +24,7 @@ License: MIT Group: Development/Languages/Python URL: https://github.com/sirfz/tesserocr Source: https://files.pythonhosted.org/packages/source/t/tesserocr/tesserocr-%{version}.tar.gz +Patch1: 1441bec703cf68161acce5e85907ddd71c47fdc3.patch BuildRequires: %{python_module Cython} BuildRequires: %{python_module Pillow} BuildRequires: %{python_module devel} @@ -51,6 +52,7 @@ GIL while processing an image in tesseract. %prep %setup -q -n tesserocr-%{version} +%patch1 -p1 %build %python_build @@ -59,6 +61,7 @@ GIL while processing an image in tesseract. %python_install %check +export TESSDATA_PREFIX=/usr/share/tessdata %python_exec setup.py develop --user # test_LSTM_choices failure: https://github.com/sirfz/tesserocr/issues/214 %pytest -k 'not test_LSTM_choices'