forked from pool/python-tesserocr
Accepting request 1058411 from home:frispete:branches:devel:languages:python
- Apply 1441bec703cf68161acce5e85907ddd71c47fdc3.patch from upstream project in order to build with Leptonica 1.83.0 - Make tests work again OBS-URL: https://build.opensuse.org/request/show/1058411 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-tesserocr?expand=0&rev=28
This commit is contained in:
31
1441bec703cf68161acce5e85907ddd71c47fdc3.patch
Normal file
31
1441bec703cf68161acce5e85907ddd71c47fdc3.patch
Normal file
@@ -0,0 +1,31 @@
|
||||
From 1441bec703cf68161acce5e85907ddd71c47fdc3 Mon Sep 17 00:00:00 2001
|
||||
From: Stefan Weil <sw@weilnetz.de>
|
||||
Date: Mon, 18 Jul 2022 08:09:15 +0200
|
||||
Subject: [PATCH] Add support for upcoming Leptonica 1.83.0
|
||||
|
||||
Signed-off-by: Stefan Weil <sw@weilnetz.de>
|
||||
---
|
||||
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 <leptonica/pix_internal.h>
|
||||
+ #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.
|
@@ -1,3 +1,10 @@
|
||||
-------------------------------------------------------------------
|
||||
Sat Jan 14 21:46:21 UTC 2023 - Hans-Peter Jansen <hpj@urpla.net>
|
||||
|
||||
- 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
|
||||
|
||||
|
@@ -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'
|
||||
|
Reference in New Issue
Block a user