Backported GCC 13 build fix. Fixed FTBFS on Fedora 38+.

This commit is contained in:
Vitaly Zaitsev 2023-03-20 21:20:08 +01:00
parent 4718c5afe5
commit cf4bc8fb8b
No known key found for this signature in database
GPG Key ID: BF99FC6DD45AB90A
2 changed files with 35 additions and 1 deletions

View File

@ -8,7 +8,7 @@
Name: tesseract
Version: 5.3.0
Release: 5%{?dist}
Release: 6%{?dist}
Summary: Raw OCR Engine
License: Apache-2.0
@ -24,6 +24,9 @@ Patch0: tesseract_cmake.patch
# Already merged upstream, can be dropped at next release
# https://github.com/tesseract-ocr/tesseract/commit/5e116fa5cad249b8a08d22af652cf52f44fbb8cd
Patch1: tesseract_libdir.patch
# Fixed FTBFS under GCC 13:
# https://github.com/tesseract-ocr/tesseract/commit/2025b53de6b3d97285d7c5f80497493007c586c3
Patch2: tesseract_gcc13.patch
BuildRequires: cmake
@ -246,6 +249,9 @@ cp -a doc/*.5 %{buildroot}%{_mandir}/man5/
%changelog
* Mon Mar 20 2023 Vitaly Zaitsev <vitaly@easycoding.org> - 5.3.0-6
- Backported GCC 13 build fix. Fixed FTBFS on Fedora 38+.
* Fri Feb 03 2023 FeRD (Frank Dana) <ferdnyc@gmail.com> - 5.3.0-5
- Add patch from upstream to fix pkg-config libdir value

28
tesseract_gcc13.patch Normal file
View File

@ -0,0 +1,28 @@
From 2025b53de6b3d97285d7c5f80497493007c586c3 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 30 Jan 2023 11:27:07 -0800
Subject: [PATCH] Fix build with gcc 13 by including <cstdint>
gcc 13 moved some includes around and as a result <cstdint> is
no longer transitively included [1]. Explicitly include it for
int32_t.
[1] https://gcc.gnu.org/gcc-13/porting_to.html#header-dep-changes
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/ccutil/params.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/ccutil/params.h b/src/ccutil/params.h
index f514d8709c..0f3f874357 100644
--- a/src/ccutil/params.h
+++ b/src/ccutil/params.h
@@ -21,6 +21,7 @@
#include <tesseract/export.h> // for TESS_API
+#include <cstdint>
#include <cstdio>
#include <cstring>
#include <string>