tesseract: update to 5.3.3
authorRosen Penev <rosenp@gmail.com>
Thu, 16 Nov 2023 19:18:18 +0000 (11:18 -0800)
committerRosen Penev <rosenp@gmail.com>
Fri, 1 Dec 2023 19:20:30 +0000 (11:20 -0800)
Fixes compilation with GCC13.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
utils/tesseract/Makefile
utils/tesseract/patches/010-cmake.patch
utils/tesseract/patches/020-musl.patch [deleted file]

index db43e08e6b5f7d7038a56c92c46d43bcc057a149..faed81050f4cc88ae9e3916d308441c8d0043585 100644 (file)
@@ -7,12 +7,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=tesseract
-PKG_VERSION:=4.1.1
-PKG_RELEASE:=3
+PKG_VERSION:=5.3.3
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/tesseract-ocr/tesseract/tar.gz/$(PKG_VERSION)?
-PKG_HASH:=2a66ff0d8595bff8f04032165e6c936389b1e5727c3ce5a27b3e059d218db1cb
+PKG_HASH:=dc4329f85f41191b2d813b71b528ba6047745813474e583ccce8795ff2ff5681
 
 PKG_MAINTAINER:=Valentin Kivachuk <vk18496@gmail.com>
 PKG_LICENSE:=Apache-2.0
@@ -36,15 +36,17 @@ TARGET_CFLAGS:=$(filter-out -O%,$(TARGET_CFLAGS)) -O3
 
 CMAKE_OPTIONS += \
        -DAUTO_OPTIMIZE=OFF \
-       -DBUILD_TRAINING_TOOLS=OFF
+       -DBUILD_SHARED_LIBS=ON \
+       -DBUILD_TRAINING_TOOLS=OFF \
+       -DDISABLE_CURL=ON
 
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/include
        $(CP) $(PKG_INSTALL_DIR)/usr/include/tesseract $(1)/usr/include/
        $(INSTALL_DIR) $(1)/usr/lib
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtesseract.so* $(1)/usr/lib/
-       $(INSTALL_DIR) $(1)/usr/lib/cmake
-       $(CP) $(PKG_INSTALL_DIR)/usr/cmake/*.cmake $(1)/usr/lib/cmake/
+       $(INSTALL_DIR) $(1)/usr/lib/cmake/tesseract
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/cmake/tesseract/*.cmake $(1)/usr/lib/cmake/tesseract
        $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/tesseract.pc $(1)/usr/lib/pkgconfig/
 endef
index 2a9f88c79ef6eca2f863a030269a4603809bb34a..d6064660df5d46dc4cbc14184c35466e89e51759 100644 (file)
@@ -1,18 +1,27 @@
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -252,15 +252,6 @@ set(AVX2_OPT OFF)
- set(FMA_OPT OFF)
- set(SSE41_OPT OFF)
- set(MARCH_NATIVE_OPT OFF)
--foreach(flag ${_enable_vector_unit_list})  # from OptimizeForArchitecture()
--    string(TOUPPER "${flag}" flag)
--    string(REPLACE "\." "_" flag "${flag}")
--    set(simd_flags "${simd_flags} -D${flag}")
--    string(REPLACE "_" "" flag "${flag}")
--    if("${flag}" MATCHES "AVX|AVX2|FMA|SSE41")
--        set("${flag}_OPT" ON)
+--- a/cmake/CheckFunctions.cmake
++++ b/cmake/CheckFunctions.cmake
+@@ -29,24 +29,6 @@ function(check_leptonica_tiff_support)
+   "  return ret_val;}\n")
+   if(${CMAKE_VERSION} VERSION_LESS "3.25")
+     message(STATUS "Testing TIFF support in Leptonica is available with CMake >= 3.25 (you have ${CMAKE_VERSION}))")
+-  else()
+-    set(CMAKE_TRY_COMPILE_CONFIGURATION ${CMAKE_BUILD_TYPE})
+-    try_run(
+-      LEPT_TIFF_RESULT
+-      LEPT_TIFF_COMPILE_SUCCESS
+-      SOURCE_FROM_CONTENT tiff_test.cpp "${TIFF_TEST}"
+-      CMAKE_FLAGS "-DINCLUDE_DIRECTORIES=${Leptonica_INCLUDE_DIRS}"
+-      LINK_LIBRARIES ${Leptonica_LIBRARIES}
+-      COMPILE_OUTPUT_VARIABLE
+-      COMPILE_OUTPUT)
+-    if(NOT LEPT_TIFF_COMPILE_SUCCESS)
+-      message(STATUS "COMPILE_OUTPUT: ${COMPILE_OUTPUT}")
+-      message(STATUS "Leptonica_INCLUDE_DIRS: ${Leptonica_INCLUDE_DIRS}")
+-      message(STATUS "Leptonica_LIBRARIES: ${Leptonica_LIBRARIES}")
+-      message(STATUS "LEPT_TIFF_RESULT: ${LEPT_TIFF_RESULT}")
+-      message(STATUS "LEPT_TIFF_COMPILE: ${LEPT_TIFF_COMPILE}")
+-      message(WARNING "Failed to compile test")
 -    endif()
--endforeach(flag)
- if (NOT MSVC)
-    set(MARCH_NATIVE_FLAGS "${MARCH_NATIVE_FLAGS} -O3 -ffast-math")
- endif()
+   endif()
+ endfunction(check_leptonica_tiff_support)
diff --git a/utils/tesseract/patches/020-musl.patch b/utils/tesseract/patches/020-musl.patch
deleted file mode 100644 (file)
index 821a51d..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/src/ccutil/ocrclass.h
-+++ b/src/ccutil/ocrclass.h
-@@ -28,6 +28,7 @@
- #include <chrono>
- #include <ctime>
-+#include <sys/time.h>
- #ifdef _WIN32
- #include <winsock2.h> // for timeval
- #endif