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.2.tar.gz b/5.3.2.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..d432fda996313572c7477325bd52c6e9a04006db Binary files /dev/null and b/5.3.2.tar.gz differ diff --git a/tesseract.spec b/tesseract.spec index 9bf609c3aeb566d9b01964186ad5222340126593..1bfd2d8260b1bb080ba8b72c152adefa38da8d64 100644 --- a/tesseract.spec +++ b/tesseract.spec @@ -1,9 +1,7 @@ %define anolis_release 1 -%bcond_with mingw - Name: tesseract -Version: 5.3.0 +Version: 5.3.2 Release: %{anolis_release}%{?dist} Summary: Raw OCR Engine @@ -16,10 +14,8 @@ 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++ @@ -27,6 +23,8 @@ BuildRequires: giflib-devel BuildRequires: leptonica-devel BuildRequires: libicu-devel BuildRequires: libjpeg-turbo-devel +BuildRequires: libcurl-devel +BuildRequires: libarchive-devel BuildRequires: libtool BuildRequires: libtiff-devel BuildRequires: libwebp-devel @@ -35,32 +33,6 @@ BuildRequires: /usr/bin/asciidoc BuildRequires: /usr/bin/xsltproc BuildRequires: openjpeg2-devel -%if %{with mingw} -BuildRequires: mingw32-filesystem >= 95 -BuildRequires: mingw32-gcc -BuildRequires: mingw32-giflib -BuildRequires: mingw32-binutils -BuildRequires: mingw32-icu -BuildRequires: mingw32-leptonica -BuildRequires: mingw32-libgomp -BuildRequires: mingw32-libjpeg-turbo -BuildRequires: mingw32-libtiff -BuildRequires: mingw32-libwebp -BuildRequires: mingw32-pango - -BuildRequires: mingw64-filesystem >= 95 -BuildRequires: mingw64-gcc -BuildRequires: mingw64-giflib -BuildRequires: mingw64-binutils -BuildRequires: mingw64-icu -BuildRequires: mingw64-leptonica -BuildRequires: mingw64-libgomp -BuildRequires: mingw64-libjpeg-turbo -BuildRequires: mingw64-libtiff -BuildRequires: mingw64-libwebp -BuildRequires: mingw64-pango -%endif - Requires: tesseract-langpack-eng @@ -94,43 +66,6 @@ BuildArch: noarch %description doc The %{name}-doc package contains documentation files for %{name}. -%if %{with mingw} -%package -n mingw32-%{name} -Summary: MinGW Windows tesseract-ocr library -BuildArch: noarch - -%description -n mingw32-%{name} -MinGW Windows tesseract-ocr library. - - -%package -n mingw32-%{name}-tools -Summary: MinGW Windows tesseract-ocr library tools -Requires: mingw32-%{name} = %{version}-%{release} -BuildArch: noarch - -%description -n mingw32-%{name}-tools -MinGW Windows tesseract-ocr library tools. - - -%package -n mingw64-%{name} -Summary: MinGW Windows tesseract-ocr library -BuildArch: noarch - -%description -n mingw64-%{name} -MinGW Windows tesseract-ocr library. - - -%package -n mingw64-%{name}-tools -Summary: MinGW Windows tesseract-ocr library tools -Requires: mingw64-%{name} = %{version}-%{release} -BuildArch: noarch - -%description -n mingw64-%{name}-tools -MinGW Windows tesseract-ocr library tools. - -%{?mingw_debug_package} -%endif - %prep %autosetup -p1 -n %{name}-%{version} @@ -145,32 +80,18 @@ for file in doc/*.asc; do asciidoc -b docbook -d manpage -o - $file | XML_CATALOG_FILES=%{_sysconfdir}/xml/catalog xsltproc --nonet -o ${file/.asc/} $man_xslt - done -%if %{with mingw} -# MinGW build -MINGW32_CMAKE_ARGS=-DTESSDATA_PREFIX=%{mingw32_datadir}/%{name} \ -MINGW64_CMAKE_ARGS=-DTESSDATA_PREFIX=%{mingw64_datadir}/%{name} -%mingw_cmake -DSW_BUILD=OFF -%mingw_make_build -%endif - - %install %cmake_install mkdir -p %{buildroot}%{_mandir}/{man1,man5}/ cp -a doc/*.1 %{buildroot}%{_mandir}/man1/ cp -a doc/*.5 %{buildroot}%{_mandir}/man5/ -%if %{with mingw} -%mingw_make_install -%mingw_debug_install_post -%endif - %generate_compatibility_deps %files %license LICENSE %{_bindir}/%{name} -%{_libdir}/lib%{name}.so.5.3.0 +%{_libdir}/lib%{name}.so.%{version} %{_datadir}/%{name}/ %{_mandir}/man1/tesseract.1* %dir %{abidir} @@ -230,39 +151,12 @@ cp -a doc/*.5 %{buildroot}%{_mandir}/man5/ %{abidir}/text2image-option.list %{abidir}/unicharset_extractor-option.list -%if %{with mingw} -%files -n mingw32-%{name} -%license LICENSE -%{mingw32_bindir}/libtesseract-53.dll -%{mingw32_includedir}/tesseract/ -%{mingw32_libdir}/libtesseract.dll.a -%{mingw32_libdir}/libcommon_training.a -%{mingw32_libdir}/libunicharset_training.a -%{mingw32_libdir}/pkgconfig/tesseract.pc -%{mingw32_libdir}/cmake/%{name}/ -%{mingw32_datadir}/%{name}/ - -%files -n mingw32-%{name}-tools -%{mingw32_bindir}/*.exe - -%files -n mingw64-%{name} -%license LICENSE -%{mingw64_bindir}/libtesseract-53.dll -%{mingw64_includedir}/tesseract/ -%{mingw64_libdir}/libtesseract.dll.a -%{mingw64_libdir}/libcommon_training.a -%{mingw64_libdir}/libunicharset_training.a -%{mingw64_libdir}/pkgconfig/tesseract.pc -%{mingw64_libdir}/cmake/%{name}/ -%{mingw64_datadir}/%{name}/ - -%files -n mingw64-%{name}-tools -%{mingw64_bindir}/*.exe -%endif - %files doc -%doc README.md INSTALL ChangeLog CONTRIBUTING.md AUTHORS +%doc README.md ChangeLog CONTRIBUTING.md AUTHORS %changelog +* Wed Jul 12 2023 Funda Wang - 5.3.2-1 +- New version 5.3.2 + * 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..18c7d59f8e74a6cbf7df74675702a5c9f4dce2f8 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.1/CMakeLists.txt tesseract-5.3.1-new/CMakeLists.txt +--- tesseract-5.3.1/CMakeLists.txt 2023-04-01 21:50:30.000000000 +0200 ++++ tesseract-5.3.1-new/CMakeLists.txt 2023-04-03 12:08:00.033581846 +0200 +@@ -361,7 +361,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}) +@@ -831,12 +831,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 +@@ -958,9 +963,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.1/src/training/CMakeLists.txt tesseract-5.3.1-new/src/training/CMakeLists.txt +--- tesseract-5.3.1/src/training/CMakeLists.txt 2023-04-01 21:50:30.000000000 +0200 ++++ tesseract-5.3.1-new/src/training/CMakeLists.txt 2023-04-03 12:08:00.034581845 +0200 @@ -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..a295782124c8ab5087eb4b797b33a37d044476ae --- /dev/null +++ b/tesseract_neon.patch @@ -0,0 +1,33 @@ +diff -rupN --no-dereference tesseract-5.3.1/CMakeLists.txt tesseract-5.3.1-new/CMakeLists.txt +--- tesseract-5.3.1/CMakeLists.txt 2023-04-03 12:08:00.080581809 +0200 ++++ tesseract-5.3.1-new/CMakeLists.txt 2023-04-03 12:08:00.084581806 +0200 +@@ -248,7 +248,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.1/src/arch/simddetect.cpp tesseract-5.3.1-new/src/arch/simddetect.cpp +--- tesseract-5.3.1/src/arch/simddetect.cpp 2023-04-01 21:50:30.000000000 +0200 ++++ tesseract-5.3.1-new/src/arch/simddetect.cpp 2023-04-03 12:08:00.084581806 +0200 +@@ -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);