Skip to content

Commit

Permalink
tesseract: install shared libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
termux-pacman-bot committed Oct 1, 2022
1 parent 5a5af64 commit 5695829
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 4 deletions.
3 changes: 2 additions & 1 deletion packages/tesseract/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ TERMUX_PKG_DESCRIPTION="Tesseract is probably the most accurate open source OCR
TERMUX_PKG_LICENSE="Apache-2.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=5.2.0
TERMUX_PKG_REVISION=1
TERMUX_PKG_REVISION=2
TERMUX_PKG_SRCURL=https://github.com/tesseract-ocr/tesseract/archive/${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=eba4deb2f92a3f89a6623812074af8c53b772079525b3c263aa70bbf7b748b3c
TERMUX_PKG_AUTO_UPDATE=true
Expand All @@ -15,6 +15,7 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
-DBUILD_SHARED_LIBS=ON
-DUSE_SYSTEM_ICU=on
-DTESSDATA_PREFIX=$TERMUX_PREFIX/share
-DOPENMP_BUILD=ON
"

termux_step_pre_configure() {
Expand Down
57 changes: 54 additions & 3 deletions packages/tesseract/src-training-CMakeLists.txt.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,32 @@
--- ./src/training/CMakeLists.txt.orig 2022-02-16 20:32:23.235233044 +0000
+++ ./src/training/CMakeLists.txt 2022-02-16 20:34:18.595048181 +0000
@@ -252,7 +252,7 @@
diff -uNr tesseract-5.2.0/src/training/CMakeLists.txt tesseract-5.2.0.mod/src/training/CMakeLists.txt
--- tesseract-5.2.0/src/training/CMakeLists.txt 2022-07-07 05:15:49.000000000 +0900
+++ tesseract-5.2.0.mod/src/training/CMakeLists.txt 2022-09-30 13:12:18.222593892 +0900
@@ -108,13 +108,14 @@
common/trainingsampleset.h)
endif()

-add_library(common_training ${COMMON_TRAINING_SRC})
+add_library(common_training SHARED ${COMMON_TRAINING_SRC})
target_include_directories(common_training PUBLIC common
${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(common_training PUBLIC libtesseract)
generate_export_header(common_training EXPORT_MACRO_NAME
TESS_COMMON_TRAINING_API)
project_group(common_training "Training Tools")
+install(TARGETS common_training DESTINATION lib)

# ##############################################################################
# EXECUTABLE ambiguous_words
@@ -242,7 +243,7 @@

file(GLOB unicharset_training_src unicharset/*)

- add_library(unicharset_training ${unicharset_training_src})
+ add_library(unicharset_training SHARED ${unicharset_training_src})
if(SW_BUILD)
target_link_libraries(unicharset_training
PUBLIC common_training org.sw.demo.unicode.icu.i18n)
@@ -252,7 +253,7 @@
PkgConfig::ICU)
else()
target_link_libraries(unicharset_training PUBLIC common_training
Expand All @@ -9,3 +35,28 @@
endif()
endif()
target_include_directories(unicharset_training
@@ -260,6 +261,7 @@
generate_export_header(unicharset_training EXPORT_MACRO_NAME
TESS_UNICHARSET_TRAINING_API)
project_group(unicharset_training "Training Tools")
+ install(TARGETS unicharset_training DESTINATION lib)

# ############################################################################
# EXECUTABLE combine_lang_model
@@ -361,7 +363,7 @@

file(GLOB pango_training_src pango/*)

- add_library(pango_training ${pango_training_src})
+ add_library(pango_training SHARED ${pango_training_src})
target_link_libraries(pango_training PUBLIC unicharset_training)
if(SW_BUILD)
target_link_libraries(pango_training
@@ -383,6 +385,7 @@
generate_export_header(pango_training EXPORT_MACRO_NAME
TESS_PANGO_TRAINING_API)
project_group(pango_training "Training Tools")
+ install(TARGETS pango_training DESTINATION lib)

# ##########################################################################
# EXECUTABLE text2image

0 comments on commit 5695829

Please sign in to comment.