diff options
| author | zhbanito <shpioner@mail.ru> | 2019-07-18 23:59:07 +0300 |
|---|---|---|
| committer | Phil Christensen <philc@microsoft.com> | 2019-07-18 13:59:07 -0700 |
| commit | 122360484648985b205f1385808074e80eceacb6 (patch) | |
| tree | 95f682b243ccd4cc35972f0a66204563614aba52 | |
| parent | 505eae9f6a2e63fb89f3c858a223fec095f01d57 (diff) | |
| download | vcpkg-122360484648985b205f1385808074e80eceacb6.tar.gz vcpkg-122360484648985b205f1385808074e80eceacb6.zip | |
[tesseract] port update to 4.1.0 release (#7227)
| -rw-r--r-- | ports/tesseract/CONTROL | 11 | ||||
| -rw-r--r-- | ports/tesseract/fix-tiff-linkage.patch | 13 | ||||
| -rw-r--r-- | ports/tesseract/leptonica.patch | 13 | ||||
| -rw-r--r-- | ports/tesseract/portfile.cmake | 49 | ||||
| -rw-r--r-- | ports/tesseract/use-vcpkg-icu.patch | 11 | ||||
| -rw-r--r-- | ports/tesseract/ws2-32.patch | 12 |
6 files changed, 65 insertions, 44 deletions
diff --git a/ports/tesseract/CONTROL b/ports/tesseract/CONTROL index df6e60fec..3f04dcf96 100644 --- a/ports/tesseract/CONTROL +++ b/ports/tesseract/CONTROL @@ -1,5 +1,12 @@ Source: tesseract
-Version: 4.0.0-3
+Version: 4.1.0
Homepage: https://github.com/tesseract-ocr/tesseract
Description: An OCR Engine that was developed at HP Labs between 1985 and 1995... and now at Google.
-Build-Depends: leptonica, icu
+Build-Depends: leptonica
+
+Feature: training_tools
+Description: build training tools
+Build-Depends: icu
+
+Feature: cpu_independed
+Description: build on any cpu extension commands support
diff --git a/ports/tesseract/fix-tiff-linkage.patch b/ports/tesseract/fix-tiff-linkage.patch new file mode 100644 index 000000000..f4720c022 --- /dev/null +++ b/ports/tesseract/fix-tiff-linkage.patch @@ -0,0 +1,13 @@ +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/leptonica.patch b/ports/tesseract/leptonica.patch deleted file mode 100644 index 507721d9d..000000000 --- a/ports/tesseract/leptonica.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/cmake/templates/TesseractConfig.cmake.in b/cmake/templates/TesseractConfig.cmake.in -index 13838361..245ca2bc 100644 ---- a/cmake/templates/TesseractConfig.cmake.in -+++ b/cmake/templates/TesseractConfig.cmake.in -@@ -21,6 +21,8 @@ - - include(${CMAKE_CURRENT_LIST_DIR}/TesseractTargets.cmake) - -+find_package(Leptonica REQUIRED) -+ - # ====================================================== - # Version variables: - # ====================================================== diff --git a/ports/tesseract/portfile.cmake b/ports/tesseract/portfile.cmake index 9650db44a..dc03a69e7 100644 --- a/ports/tesseract/portfile.cmake +++ b/ports/tesseract/portfile.cmake @@ -5,24 +5,41 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO tesseract-ocr/tesseract - REF 4.0.0 - SHA512 69e57d4ba1fc43d212fd0fff69a2b5d48a3b37cfee7054fdc083cbb7e04d92317609a32e457229661d70ce8d9b16c9d25e81bfc3861db660dd2c8f292202d447 - HEAD_REF master + REF 4.1.0 + SHA512 d617f5c5b826640b2871dbe3d7973bcc5e66fafd837921a20e009d683806ed50f0f258aa455019d99fc54f5cb65c2fa0380e3a3c92b39ab0684b8799c730b09d PATCHES - use-vcpkg-icu.patch - ws2-32.patch - leptonica.patch + fix-tiff-linkage.patch ) # The built-in cmake FindICU is better file(REMOVE ${SOURCE_PATH}/cmake/FindICU.cmake) +# Handle Static Library Output +if(VCPKG_LIBRARY_LINKAGE EQUAL "static") + list(APPEND OPTIONS_LIST -DSTATIC=ON) +endif() + +# Handle CONTROL +if("training_tools" IN_LIST FEATURES) + list(APPEND OPTIONS_LIST -DBUILD_TRAINING_TOOLS=ON) +else() + list(APPEND OPTIONS_LIST -DBUILD_TRAINING_TOOLS=OFF) +endif() +if("independed_architecture" IN_LIST FEATURES) + list(APPEND OPTIONS_LIST -DTARGET_ARCHITECTURE=none) +else() + list(APPEND OPTIONS_LIST -DTARGET_ARCHITECTURE=auto) +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS -DSTATIC=ON -DUSE_SYSTEM_ICU=True + #any value for vcpkg leptonica link cmake branch select + -DLeptonica_DIR=YES + ${OPTIONS_LIST} ) vcpkg_install_cmake() @@ -35,6 +52,26 @@ set(EXTENSION) if(WIN32) set(EXTENSION ".exe") endif() + +# copy training tools +set(TRAINING_TOOLS_DIR ${CURRENT_PACKAGES_DIR}/tools/tesseract/training) +if("training_tools" IN_LIST FEATURES) + file(COPY ${CURRENT_PACKAGES_DIR}/bin/ambiguous_words${EXTENSION} DESTINATION ${TRAINING_TOOLS_DIR}) + file(COPY ${CURRENT_PACKAGES_DIR}/bin/classifier_tester${EXTENSION} DESTINATION ${TRAINING_TOOLS_DIR}) + file(COPY ${CURRENT_PACKAGES_DIR}/bin/combine_tessdata${EXTENSION} DESTINATION ${TRAINING_TOOLS_DIR}) + file(COPY ${CURRENT_PACKAGES_DIR}/bin/cntraining${EXTENSION} DESTINATION ${TRAINING_TOOLS_DIR}) + file(COPY ${CURRENT_PACKAGES_DIR}/bin/dawg2wordlist${EXTENSION} DESTINATION ${TRAINING_TOOLS_DIR}) + file(COPY ${CURRENT_PACKAGES_DIR}/bin/mftraining${EXTENSION} DESTINATION ${TRAINING_TOOLS_DIR}) + file(COPY ${CURRENT_PACKAGES_DIR}/bin/shapeclustering${EXTENSION} DESTINATION ${TRAINING_TOOLS_DIR}) + file(COPY ${CURRENT_PACKAGES_DIR}/bin/wordlist2dawg${EXTENSION} DESTINATION ${TRAINING_TOOLS_DIR}) + file(COPY ${CURRENT_PACKAGES_DIR}/bin/combine_lang_model${EXTENSION} DESTINATION ${TRAINING_TOOLS_DIR}) + file(COPY ${CURRENT_PACKAGES_DIR}/bin/lstmeval${EXTENSION} DESTINATION ${TRAINING_TOOLS_DIR}) + file(COPY ${CURRENT_PACKAGES_DIR}/bin/lstmtraining${EXTENSION} DESTINATION ${TRAINING_TOOLS_DIR}) + file(COPY ${CURRENT_PACKAGES_DIR}/bin/set_unicharset_properties${EXTENSION} DESTINATION ${TRAINING_TOOLS_DIR}) + file(COPY ${CURRENT_PACKAGES_DIR}/bin/unicharset_extractor${EXTENSION} DESTINATION ${TRAINING_TOOLS_DIR}) + file(COPY ${CURRENT_PACKAGES_DIR}/bin/text2image${EXTENSION} DESTINATION ${TRAINING_TOOLS_DIR}) +endif() + file(COPY ${CURRENT_PACKAGES_DIR}/bin/tesseract${EXTENSION} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/tesseract) vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/tesseract) diff --git a/ports/tesseract/use-vcpkg-icu.patch b/ports/tesseract/use-vcpkg-icu.patch deleted file mode 100644 index 9c75726e1..000000000 --- a/ports/tesseract/use-vcpkg-icu.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/training/CMakeLists.txt Thu Aug 17 02:46:15 2017 -+++ b/training/CMakeLists.txt Thu Aug 17 02:46:15 2017 -@@ -11,7 +11,7 @@ - endif() - - # experimental --if (MSVC AND NOT CPPAN_BUILD) -+if (MSVC AND NOT CPPAN_BUILD AND NOT USE_SYSTEM_ICU) - - include(CheckTypeSize) - check_type_size("void *" SIZEOF_VOID_P) diff --git a/ports/tesseract/ws2-32.patch b/ports/tesseract/ws2-32.patch deleted file mode 100644 index 1d3be8189..000000000 --- a/ports/tesseract/ws2-32.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/viewer/svutil.cpp b/viewer/svutil.cpp
-index 34a2286..bc2a7e1 100644
---- a/viewer/svutil.cpp
-+++ b/viewer/svutil.cpp
-@@ -23,6 +23,7 @@
- #include <stdio.h>
- #ifdef _WIN32
- #include <windows.h>
-+#pragma comment(lib, "Ws2_32.lib")
- struct addrinfo {
- struct sockaddr* ai_addr;
- int ai_addrlen;
|
