diff --git a/5.3.0.tar.gz b/5.3.0.tar.gz deleted file mode 100644 index bdd10e12e9471b1d6633e1f12bc25ce3292a0e9f..0000000000000000000000000000000000000000 Binary files a/5.3.0.tar.gz and /dev/null differ diff --git a/5.3.4.tar.gz b/5.3.4.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..6667ce77f5983a72947ff03add4c10980e287906 Binary files /dev/null and b/5.3.4.tar.gz differ diff --git a/tesseract.spec b/tesseract.spec index 9bf609c3aeb566d9b01964186ad5222340126593..ffdf798baf814c1247613f3f61c11c21519e4ed3 100644 --- a/tesseract.spec +++ b/tesseract.spec @@ -3,7 +3,7 @@ %bcond_with mingw Name: tesseract -Version: 5.3.0 +Version: 5.3.4 Release: %{anolis_release}%{?dist} Summary: Raw OCR Engine @@ -16,10 +16,9 @@ Source0: https://github.com/tesseract-ocr/tesseract/archive/refs/tags/%{ve # Honour TESSDATA_PREFIX # Build training libs statically Patch0: tesseract_cmake.patch -# Generate correct libdir path in /usr/lib64/pkgconfig/tesseract.pc -# Already merged upstream, can be dropped at next release -# https://github.com/tesseract-ocr/tesseract/commit/5e116fa5cad249b8a08d22af652cf52f44fbb8cd -Patch1: tesseract_libdir.patch +# Don't assume neon available on arm64/aarch64 +Patch1: tesseract_neon.patch + BuildRequires: cmake BuildRequires: gcc-c++ @@ -170,7 +169,7 @@ cp -a doc/*.5 %{buildroot}%{_mandir}/man5/ %files %license LICENSE %{_bindir}/%{name} -%{_libdir}/lib%{name}.so.5.3.0 +%{_libdir}/lib%{name}.so.5.3.4 %{_datadir}/%{name}/ %{_mandir}/man1/tesseract.1* %dir %{abidir} @@ -264,5 +263,12 @@ cp -a doc/*.5 %{buildroot}%{_mandir}/man5/ %doc README.md INSTALL ChangeLog CONTRIBUTING.md AUTHORS %changelog +* Thu Mar 20 2025 mgb01105731 - 5.3.4-1 +- Update to 5.3.4 from 5.3.0 +- Remove patch as the new version of tarball already includes changes +- Add patches to Don't assume neon available on arm64/aarch64 + [Patches cherry-pick from c10s. Original changelog: + - Update to 5.3.1(5.3.1-1)] + * Fri Mar 17 2023 happy_orange - 5.3.0-1 - package init from upstream diff --git a/tesseract_cmake.patch b/tesseract_cmake.patch index 8cacfd648b1cd747ba2ebdef09ec0a10fc63204b..44d04da37b66fabbf6b3a37eb996f4fb90403f33 100644 --- a/tesseract_cmake.patch +++ b/tesseract_cmake.patch @@ -1,7 +1,7 @@ -diff -rupN --no-dereference tesseract-5.3.0/CMakeLists.txt tesseract-5.3.0-new/CMakeLists.txt ---- tesseract-5.3.0/CMakeLists.txt 2022-12-22 14:57:57.000000000 +0100 -+++ tesseract-5.3.0-new/CMakeLists.txt 2022-12-23 10:33:09.303707322 +0100 -@@ -345,7 +345,7 @@ elseif(UNIX) +diff -rupN --no-dereference tesseract-5.3.4/CMakeLists.txt tesseract-5.3.4-new/CMakeLists.txt +--- tesseract-5.3.4/CMakeLists.txt 2024-01-18 08:48:04.000000000 +0100 ++++ tesseract-5.3.4-new/CMakeLists.txt 2024-01-21 09:25:25.006991375 +0100 +@@ -365,7 +365,7 @@ elseif(UNIX) set(LIB_pthread pthread) endif() elseif(WIN32) @@ -10,37 +10,45 @@ diff -rupN --no-dereference tesseract-5.3.0/CMakeLists.txt tesseract-5.3.0-new/C endif() add_definitions("-DCMAKE_BUILD") -@@ -812,11 +812,14 @@ set_target_properties(libtesseract - set_target_properties(libtesseract - PROPERTIES SOVERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}) +@@ -853,12 +853,17 @@ set_target_properties( + libtesseract PROPERTIES SOVERSION + ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}) --if(WIN32) -+if(MSVC) - set_target_properties(libtesseract - PROPERTIES OUTPUT_NAME tesseract${VERSION_MAJOR}${VERSION_MINOR}) - set_target_properties(libtesseract - PROPERTIES DEBUG_OUTPUT_NAME tesseract${VERSION_MAJOR}${VERSION_MINOR}d) -+elseif(MINGW) +-set_target_properties( +- libtesseract +- PROPERTIES +- OUTPUT_NAME +- tesseract$<$:${VERSION_MAJOR}${VERSION_MINOR}$<$:d>> +-) ++if(MINGW) + set_target_properties(libtesseract PROPERTIES SUFFIX "-${VERSION_MAJOR}${VERSION_MINOR}${CMAKE_SHARED_LIBRARY_SUFFIX}") + set_target_properties(libtesseract PROPERTIES OUTPUT_NAME tesseract) - else() - set_target_properties(libtesseract PROPERTIES OUTPUT_NAME tesseract) - endif() -@@ -931,9 +934,9 @@ install( ++else() ++ set_target_properties( ++ libtesseract ++ PROPERTIES ++ OUTPUT_NAME ++ tesseract$<$:${VERSION_MAJOR}${VERSION_MINOR}$<$:d>> ++ ) ++endif() + + if(SW_BUILD) + target_link_libraries(libtesseract PUBLIC org.sw.demo.danbloomberg.leptonica +@@ -980,9 +985,9 @@ install( if(INSTALL_CONFIGS) - install(FILES ${TESSERACT_CONFIGS} -- DESTINATION ${CMAKE_INSTALL_PREFIX}/share/tessdata/configs) -+ DESTINATION ${TESSDATA_PREFIX}/tessdata/configs) - install(FILES ${TESSERACT_TESSCONFIGS} -- DESTINATION ${CMAKE_INSTALL_PREFIX}/share/tessdata/tessconfigs) -+ DESTINATION ${TESSDATA_PREFIX}/tessdata/tessconfigs) + install(FILES ${TESSERACT_CONFIGS} +- DESTINATION ${CMAKE_INSTALL_PREFIX}/share/tessdata/configs) ++ DESTINATION ${TESSDATA_PREFIX}/tessdata/configs) + install(FILES ${TESSERACT_TESSCONFIGS} +- DESTINATION ${CMAKE_INSTALL_PREFIX}/share/tessdata/tessconfigs) ++ DESTINATION ${TESSDATA_PREFIX}/tessdata/tessconfigs) endif() # ############################################################################## -diff -rupN --no-dereference tesseract-5.3.0/src/training/CMakeLists.txt tesseract-5.3.0-new/src/training/CMakeLists.txt ---- tesseract-5.3.0/src/training/CMakeLists.txt 2022-12-22 14:57:57.000000000 +0100 -+++ tesseract-5.3.0-new/src/training/CMakeLists.txt 2022-12-23 10:33:09.303707322 +0100 +diff -rupN --no-dereference tesseract-5.3.4/src/training/CMakeLists.txt tesseract-5.3.4-new/src/training/CMakeLists.txt +--- tesseract-5.3.4/src/training/CMakeLists.txt 2024-01-18 08:48:04.000000000 +0100 ++++ tesseract-5.3.4-new/src/training/CMakeLists.txt 2024-01-21 09:25:25.010991182 +0100 @@ -115,7 +115,7 @@ if(NOT DISABLED_LEGACY_ENGINE) common/trainingsampleset.h) endif() @@ -59,7 +67,7 @@ diff -rupN --no-dereference tesseract-5.3.0/src/training/CMakeLists.txt tesserac if(SW_BUILD) target_link_libraries(unicharset_training PUBLIC common_training org.sw.demo.unicode.icu.i18n) -@@ -378,7 +378,7 @@ if(ICU_FOUND) +@@ -377,7 +377,7 @@ if(ICU_FOUND) file(GLOB pango_training_src pango/*) diff --git a/tesseract_libdir.patch b/tesseract_libdir.patch deleted file mode 100644 index b3565d4a2b991c61dcc4a12bc760e0c14cba7da2..0000000000000000000000000000000000000000 --- a/tesseract_libdir.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 5e116fa5cad249b8a08d22af652cf52f44fbb8cd Mon Sep 17 00:00:00 2001 -From: Frank Dana -Date: Thu, 2 Feb 2023 19:57:59 -0500 -Subject: [PATCH] Fix libdir in tesseract.pc from CMake - -tesseract.pc.cmake was hardcoding libdir to -`{prefix}/lib`, which is wrong for systems that use -`/usr/lib64/` on 64-bit. `CMAKE_INSTALL_LIBDIR` -is already expected to contain the libdir path -relative to the install prefix. ---- - tesseract.pc.cmake | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/tesseract.pc.cmake b/tesseract.pc.cmake -index 7f36ce19..5469a398 100644 ---- a/tesseract.pc.cmake -+++ b/tesseract.pc.cmake -@@ -1,6 +1,6 @@ - prefix=@CMAKE_INSTALL_PREFIX@ - exec_prefix=${prefix}/bin --libdir=${prefix}/lib -+libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ - includedir=${prefix}/include - - Name: @tesseract_NAME@ --- -2.39.1 - diff --git a/tesseract_neon.patch b/tesseract_neon.patch new file mode 100644 index 0000000000000000000000000000000000000000..6453efb93b6ef78832d1e37bcb06d5d84cd35c74 --- /dev/null +++ b/tesseract_neon.patch @@ -0,0 +1,33 @@ +diff -rupN --no-dereference tesseract-5.3.4/CMakeLists.txt tesseract-5.3.4-new/CMakeLists.txt +--- tesseract-5.3.4/CMakeLists.txt 2024-01-21 09:25:25.058988861 +0100 ++++ tesseract-5.3.4-new/CMakeLists.txt 2024-01-21 09:25:25.068988378 +0100 +@@ -249,7 +249,7 @@ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "a + set(HAVE_AVX512F FALSE) + set(HAVE_FMA FALSE) + set(HAVE_SSE4_1 FALSE) +- set(HAVE_NEON TRUE) ++ check_cxx_compiler_flag("-mfpu=neon" HAVE_NEON) + + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "arm.*") + +diff -rupN --no-dereference tesseract-5.3.4/src/arch/simddetect.cpp tesseract-5.3.4-new/src/arch/simddetect.cpp +--- tesseract-5.3.4/src/arch/simddetect.cpp 2024-01-18 08:48:04.000000000 +0100 ++++ tesseract-5.3.4-new/src/arch/simddetect.cpp 2024-01-21 09:25:25.071988233 +0100 +@@ -254,7 +254,7 @@ SIMDDetect::SIMDDetect() { + // SSE detected. + SetDotProduct(DotProductSSE, &IntSimdMatrix::intSimdMatrixSSE); + #endif +-#if defined(HAVE_NEON) || defined(__aarch64__) ++#if defined(HAVE_NEON) + } else if (neon_available_) { + // NEON detected. + SetDotProduct(DotProductNEON, &IntSimdMatrix::intSimdMatrixNEON); +@@ -311,7 +311,7 @@ void SIMDDetect::Update() { + } else if (dotproduct == "accelerate") { + SetDotProduct(DotProductAccelerate, IntSimdMatrix::intSimdMatrix); + #endif +-#if defined(HAVE_NEON) || defined(__aarch64__) ++#if defined(HAVE_NEON) + } else if (dotproduct == "neon" && neon_available_) { + // NEON selected by config variable. + SetDotProduct(DotProductNEON, &IntSimdMatrix::intSimdMatrixNEON);