Browse Source

tesseract: Update from 3.05.02 to 4.0.0

android-5
Fredrik Fornwall 6 years ago
parent
commit
e2f1ef50aa
  1. 11
      packages/tesseract/api-Makefile.am.patch
  2. 21
      packages/tesseract/build.sh
  3. 15
      packages/tesseract/src-api-baseapi.cpp.patch
  4. 11
      packages/tesseract/src-ccutils-Makefile.am.patch

11
packages/tesseract/api-Makefile.am.patch

@ -1,11 +0,0 @@
diff -u -r ../tesseract-3.05.01/api/Makefile.am ./api/Makefile.am
--- ../tesseract-3.05.01/api/Makefile.am 2017-06-01 20:06:24.000000000 +0200
+++ ./api/Makefile.am 2017-06-07 10:53:12.835866778 +0200
@@ -77,6 +77,7 @@
endif
tesseract_LDADD = libtesseract.la
+tesseract_LDADD += $(LEPTONICA_LIBS)
tesseract_LDFLAGS = $(OPENCL_LDFLAGS)

21
packages/tesseract/build.sh

@ -1,11 +1,10 @@
TERMUX_PKG_HOMEPAGE=https://github.com/tesseract-ocr/tesseract
TERMUX_PKG_DESCRIPTION="Tesseract is probably the most accurate open source OCR engine available"
TERMUX_PKG_LICENSE="Apache-2.0"
TERMUX_PKG_VERSION=3.05.02
TERMUX_PKG_REVISION=1
TERMUX_PKG_SHA256=494d64ffa7069498a97b909a0e65a35a213989e0184f1ea15332933a90d43445
TERMUX_PKG_VERSION=4.0.0
TERMUX_PKG_SHA256=a1f5422ca49a32e5f35c54dee5112b11b99928fc9f4ee6695cdc6768d69f61dd
TERMUX_PKG_SRCURL=https://github.com/tesseract-ocr/tesseract/archive/${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_DEPENDS="libtool, libuuid, leptonica"
TERMUX_PKG_DEPENDS="libtool, libuuid, leptonica, libandroid-glob"
termux_step_pre_configure() {
# http://blog.matt-swain.com/post/26419042500/installing-tesseract-ocr-on-mac-os-x-lion
@ -34,15 +33,9 @@ termux_step_post_make_install() {
mkdir -p $TERMUX_PKG_CACHEDIR/tessdata
local f
for f in cube.{bigrams,fold,lm,nn,params,size,word-freq} tesseract_cube.nn traineddata; do
# From the tessdata README: "These language data files only work with
# Tesseract 4. They are based on the sources in tesseract-ocr/langdata on GitHub.
# Get language data files for Tesseract 3.04 or 3.05 from the 3.04 tree."
termux_download \
https://raw.githubusercontent.com/tesseract-ocr/tessdata/3.04.00/eng.$f \
$TERMUX_PKG_CACHEDIR/tessdata/eng.$f \
${checksums[$f]}
cp $TERMUX_PKG_CACHEDIR/tessdata/eng.$f .
done
https://raw.githubusercontent.com/tesseract-ocr/tessdata/$TERMUX_PKG_VERSION/eng.traineddata \
$TERMUX_PKG_CACHEDIR/tessdata/eng.traineddata \
daa0c97d651c19fba3b25e81317cd697e9908c8208090c94c3905381c23fc047
cp $TERMUX_PKG_CACHEDIR/tessdata/eng.traineddata .
}

15
packages/tesseract/src-api-baseapi.cpp.patch

@ -0,0 +1,15 @@
diff -u -r ../tesseract-4.0.0/src/api/baseapi.cpp ./src/api/baseapi.cpp
--- ../tesseract-4.0.0/src/api/baseapi.cpp 2018-10-29 08:53:12.000000000 +0000
+++ ./src/api/baseapi.cpp 2019-02-03 22:55:00.470748529 +0000
@@ -206,11 +206,8 @@
image_height_(0) {
const char *locale;
locale = std::setlocale(LC_ALL, nullptr);
- ASSERT_HOST(!strcmp(locale, "C"));
locale = std::setlocale(LC_CTYPE, nullptr);
- ASSERT_HOST(!strcmp(locale, "C"));
locale = std::setlocale(LC_NUMERIC, nullptr);
- ASSERT_HOST(!strcmp(locale, "C"));
}
TessBaseAPI::~TessBaseAPI() {

11
packages/tesseract/src-ccutils-Makefile.am.patch

@ -0,0 +1,11 @@
diff -u -r ../tesseract-4.0.0/src/ccutil/Makefile.am ./src/ccutil/Makefile.am
--- ../tesseract-4.0.0/src/ccutil/Makefile.am 2018-10-29 08:53:12.000000000 +0000
+++ ./src/ccutil/Makefile.am 2019-02-03 22:45:27.364961733 +0000
@@ -1,6 +1,7 @@
SUBDIRS =
AM_CXXFLAGS =
AM_CPPFLAGS =
+AM_LDFLAGS = -landroid-glob
if !NO_TESSDATA_PREFIX
AM_CXXFLAGS += -DTESSDATA_PREFIX=@datadir@
Loading…
Cancel
Save