diff --git a/ports/opencv4/0018-fix-depend-tesseract.patch b/ports/opencv4/0018-fix-depend-tesseract.patch new file mode 100644 index 0000000000..3f873bc59a --- /dev/null +++ b/ports/opencv4/0018-fix-depend-tesseract.patch @@ -0,0 +1,13 @@ +diff --git a/modules/text/cmake/init.cmake b/modules/text/cmake/init.cmake +index 254757e..73194ec 100644 +--- a/modules/text/cmake/init.cmake ++++ b/modules/text/cmake/init.cmake +@@ -4,6 +4,8 @@ OCV_OPTION(WITH_TESSERACT "Include Tesseract OCR library support" (NOT CMAKE_CRO + if(NOT HAVE_TESSERACT + AND (WITH_TESSERACT OR OPENCV_FIND_TESSERACT) + ) ++ find_package(Tesseract CONFIG REQUIRED) ++ set(Tesseract_LIBRARIES Tesseract::libtesseract) + if(NOT Tesseract_FOUND) + find_package(Tesseract QUIET) # Prefer CMake's standard locations (including Tesseract_DIR) + endif() diff --git a/ports/opencv4/portfile.cmake b/ports/opencv4/portfile.cmake index 310f1aecd2..67c440c4b2 100644 --- a/ports/opencv4/portfile.cmake +++ b/ports/opencv4/portfile.cmake @@ -177,6 +177,7 @@ if("contrib" IN_LIST FEATURES) 0013-fix-ceres.patch 0014-fix-ogre.patch 0016-fix-freetype-contrib.patch + 0018-fix-depend-tesseract.patch ) set(BUILD_WITH_CONTRIB_FLAG "-DOPENCV_EXTRA_MODULES_PATH=${CONTRIB_SOURCE_PATH}/modules") @@ -352,6 +353,12 @@ if("qt" IN_LIST FEATURES) list(APPEND ADDITIONAL_BUILD_FLAGS "-DCMAKE_AUTOMOC=ON") endif() +if("contrib" IN_LIST FEATURES) + if(VCPKG_TARGET_IS_UWP) + list(APPEND ADDITIONAL_BUILD_FLAGS "-DWITH_TESSERACT=OFF") + endif() +endif() + vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" OPTIONS diff --git a/ports/opencv4/vcpkg.json b/ports/opencv4/vcpkg.json index c40b7e4a57..d42295f1eb 100644 --- a/ports/opencv4/vcpkg.json +++ b/ports/opencv4/vcpkg.json @@ -1,6 +1,7 @@ { "name": "opencv4", "version": "4.6.0", + "port-version": 1, "description": "computer vision library", "homepage": "https://github.com/opencv/opencv", "license": "Apache-2.0", diff --git a/ports/tesseract/fix-depend-libarchive.patch b/ports/tesseract/fix-depend-libarchive.patch new file mode 100644 index 0000000000..1b57247126 --- /dev/null +++ b/ports/tesseract/fix-depend-libarchive.patch @@ -0,0 +1,14 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index bd2649d..f932913 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -792,7 +792,8 @@ if(OpenCL_FOUND) + target_link_libraries(libtesseract PUBLIC OpenCL::OpenCL) + endif() + if(LibArchive_FOUND) +- target_link_libraries(libtesseract PUBLIC ${LibArchive_LIBRARIES}) ++ find_package(LibArchive REQUIRED) ++ target_link_libraries(libtesseract PRIVATE LibArchive::LibArchive) + endif(LibArchive_FOUND) + if(CURL_FOUND) + if(NOT CURL_LIBRARIES) diff --git a/ports/tesseract/fix-tiff-linkage.patch b/ports/tesseract/fix-tiff-linkage.patch deleted file mode 100644 index f4720c0227..0000000000 --- a/ports/tesseract/fix-tiff-linkage.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index f154663..c07b827 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -431,7 +431,7 @@ endif() - add_executable (tesseract ${tesseractmain_src} ${tesseractmain_rsc}) - target_link_libraries (tesseract libtesseract) - if (HAVE_TIFFIO_H) -- target_link_libraries(tesseract tiff) -+ target_link_libraries(tesseract TIFF::TIFF) - endif() - - if (OPENMP_BUILD AND UNIX) diff --git a/ports/tesseract/fix-timeval.patch b/ports/tesseract/fix-timeval.patch deleted file mode 100644 index 5a3274830d..0000000000 --- a/ports/tesseract/fix-timeval.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/src/ccutil/ocrclass.h b/src/ccutil/ocrclass.h -index d39a6dd..3755632 100644 ---- a/src/ccutil/ocrclass.h -+++ b/src/ccutil/ocrclass.h -@@ -28,6 +28,9 @@ - - #include - #include -+#ifndef _WIN32 -+#include -+#endif - #ifdef _WIN32 - #include // for timeval - #endif diff --git a/ports/tesseract/portfile.cmake b/ports/tesseract/portfile.cmake index 6978f5625d..3764e47ef0 100644 --- a/ports/tesseract/portfile.cmake +++ b/ports/tesseract/portfile.cmake @@ -1,11 +1,13 @@ +if(NOT VCPKG_TARGET_IS_WINDOWS) + set(tesseract_patch fix-depend-libarchive.patch) +endif() + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO tesseract-ocr/tesseract - REF 4.1.1 - SHA512 017723a2268be789fe98978eed02fd294968cc8050dde376dee026f56f2b99df42db935049ae5e72c4519a920e263b40af1a6a40d9942e66608145b3131a71a2 - PATCHES - fix-tiff-linkage.patch - fix-timeval.patch # Remove this patch in the next update + REF 5ad5325a0aa8effc47ca033625b6a51682f82767 #v5.2.0 + SHA512 c6ed442c9deb28772aeb918142dab08d5b55eeeeccb0c1d3f13cf51bb72af227afb7f14c19a5c8db40d6a7b8cfeccb3af08a78adfcd7431e4a06f65372709ceb + PATCHES ${tesseract_patch} ) # The built-in cmake FindICU is better @@ -30,29 +32,34 @@ vcpkg_cmake_configure( ${FEATURE_OPTIONS} -DSTATIC=${BUILD_STATIC} -DUSE_SYSTEM_ICU=True - -DCMAKE_DISABLE_FIND_PACKAGE_LibArchive=ON + -DCMAKE_DISABLE_FIND_PACKAGE_LibArchive=OFF -DCMAKE_DISABLE_FIND_PACKAGE_OpenCL=ON -DLeptonica_DIR=YES -DTARGET_ARCHITECTURE=${TARGET_ARCHITECTURE} + -DSW_BUILD=OFF + MAYBE_UNUSED_VARIABLES + CMAKE_DISABLE_FIND_PACKAGE_OpenCL + STATIC + TARGET_ARCHITECTURE ) vcpkg_cmake_install() vcpkg_copy_pdbs() -vcpkg_cmake_config_fixup(CONFIG_PATH cmake) +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/tesseract) vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/tesseract/TesseractConfig.cmake" - "find_package(Leptonica REQUIRED)" + "find_dependency(Leptonica)" [[ -find_package(Leptonica REQUIRED) -find_package(LibArchive REQUIRED) +find_dependency(Leptonica) +find_dependency(LibArchive) ]] ) vcpkg_copy_tools(TOOL_NAMES tesseract AUTO_CLEAN) if(NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/tesseract.pc" "-ltesseract41" "-ltesseract41d") + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/tesseract.pc" "-ltesseract52" "-ltesseract52d") endif() vcpkg_fixup_pkgconfig() @@ -68,6 +75,7 @@ endif() file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") # Handle copyright file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/ports/tesseract/vcpkg.json b/ports/tesseract/vcpkg.json index fae6a4f4c8..f62bc6cb20 100644 --- a/ports/tesseract/vcpkg.json +++ b/ports/tesseract/vcpkg.json @@ -1,9 +1,9 @@ { "name": "tesseract", - "version": "4.1.1", - "port-version": 11, + "version": "5.2.0", "description": "An OCR Engine that was developed at HP Labs between 1985 and 1995... and now at Google.", "homepage": "https://github.com/tesseract-ocr/tesseract", + "license": "Apache-2.0", "supports": "!(arm & (osx | linux))", "dependencies": [ "leptonica", diff --git a/versions/baseline.json b/versions/baseline.json index 65501d919d..fa4ad6e788 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -5206,7 +5206,7 @@ }, "opencv4": { "baseline": "4.6.0", - "port-version": 0 + "port-version": 1 }, "opendnp3": { "baseline": "3.1.1", @@ -7045,8 +7045,8 @@ "port-version": 0 }, "tesseract": { - "baseline": "4.1.1", - "port-version": 11 + "baseline": "5.2.0", + "port-version": 0 }, "tfhe": { "baseline": "1.0.1", diff --git a/versions/o-/opencv4.json b/versions/o-/opencv4.json index ee86692054..a96d1fe034 100644 --- a/versions/o-/opencv4.json +++ b/versions/o-/opencv4.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "a6c9bded8fc4ad22bea6869caecf2881c8da2d41", + "version": "4.6.0", + "port-version": 1 + }, { "git-tree": "1ff543272c91a32d242ad5320e9ca63b29b34ed2", "version": "4.6.0", diff --git a/versions/t-/tesseract.json b/versions/t-/tesseract.json index e6cb1bf989..1d7f6743ab 100644 --- a/versions/t-/tesseract.json +++ b/versions/t-/tesseract.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "5ea8fcd243e8aa38e1a83eaa1c745fc53a3464cc", + "version": "5.2.0", + "port-version": 0 + }, { "git-tree": "24c99e73eaf335a9abedcfd42163c4968ca07ec3", "version": "4.1.1",