2016-02-06 13:57:02 +01:00
|
|
|
TERMUX_PKG_HOMEPAGE=https://github.com/tesseract-ocr/tesseract
|
|
|
|
TERMUX_PKG_DESCRIPTION="Tesseract is probably the most accurate open source OCR engine available"
|
2019-01-21 13:53:58 +01:00
|
|
|
TERMUX_PKG_LICENSE="Apache-2.0"
|
2020-12-20 14:16:34 +01:00
|
|
|
TERMUX_PKG_MAINTAINER="@termux"
|
2022-03-01 19:25:57 +01:00
|
|
|
TERMUX_PKG_VERSION=5.1.0
|
2022-04-10 19:22:26 +02:00
|
|
|
TERMUX_PKG_REVISION=3
|
2016-02-06 13:57:02 +01:00
|
|
|
TERMUX_PKG_SRCURL=https://github.com/tesseract-ocr/tesseract/archive/${TERMUX_PKG_VERSION}.tar.gz
|
2022-03-01 19:25:57 +01:00
|
|
|
TERMUX_PKG_SHA256=fdec8528d5a0ecc28ab5fff985e0b8ced60726f6ef33f54126f2868e323d4bd2
|
2021-10-04 12:43:31 +02:00
|
|
|
TERMUX_PKG_AUTO_UPDATE=true
|
2022-04-09 13:36:22 +02:00
|
|
|
TERMUX_PKG_DEPENDS="leptonica, libandroid-glob, libandroid-posix-semaphore, libc++, libicu, libtool, libuuid, pango, zstd"
|
2019-07-20 10:42:33 +02:00
|
|
|
TERMUX_PKG_BREAKS="tesseract-dev"
|
|
|
|
TERMUX_PKG_REPLACES="tesseract-dev"
|
2021-11-09 10:54:31 +01:00
|
|
|
TERMUX_PKG_FORCE_CMAKE=true
|
2021-11-10 09:41:11 +01:00
|
|
|
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
|
2022-01-22 10:13:02 +01:00
|
|
|
-DBUILD_SHARED_LIBS=ON
|
2021-11-10 09:41:11 +01:00
|
|
|
-DUSE_SYSTEM_ICU=on
|
|
|
|
-DTESSDATA_PREFIX=$TERMUX_PREFIX/share
|
|
|
|
"
|
2021-11-09 12:11:07 +01:00
|
|
|
# NEON checks in src/arch/simddetect.cpp don't work for i686 currently
|
|
|
|
TERMUX_PKG_BLACKLISTED_ARCHES="i686"
|
2016-02-06 13:57:02 +01:00
|
|
|
|
2022-04-09 13:36:22 +02:00
|
|
|
termux_step_pre_configure() {
|
|
|
|
LDFLAGS+=" -landroid-posix-semaphore"
|
|
|
|
}
|
|
|
|
|
2016-02-06 13:57:02 +01:00
|
|
|
termux_step_post_make_install() {
|
2016-03-27 13:21:42 +02:00
|
|
|
# download english trained data
|
2021-11-09 10:54:31 +01:00
|
|
|
mkdir -p "${TERMUX_PREFIX}"/share/tessdata
|
|
|
|
cd "${TERMUX_PREFIX}"/share/tessdata
|
2016-02-06 13:57:02 +01:00
|
|
|
rm -f eng.*
|
2018-08-22 08:29:09 +02:00
|
|
|
|
|
|
|
local checksums
|
|
|
|
declare -A checksums
|
|
|
|
checksums[cube.bigrams]=64adf2cc0b2a6705368aa357224d1a6739035d5fe892cd0cc457016df5b4280f
|
|
|
|
checksums[cube.fold]=2b229895623934b493fe69c51fcc387295d91af8b4e43cc51748b3d269a95eed
|
|
|
|
checksums[cube.lm]=a6f769245b0a55f42a3ce157cd19d96828483c3384c6483433ed83579ea16e36
|
|
|
|
checksums[cube.nn]=8f345f1c19772dd71a5214bc94175ccf647c003ab77e4143fde48f11bf3cb0ef
|
|
|
|
checksums[cube.params]=c2aa2854951bd823d89cc86d53a6d9712a6a885de6fbaf650ff3df48bfed85d7
|
|
|
|
checksums[cube.size]=e5f95de7e2754eb2df03451885277ca4573b3770816043ae2e2f09d1f7232604
|
|
|
|
checksums[cube.word-freq]=8d612bef20ae3052fce0b8650575a80d87c94d772ec6d1f0c6a1ad591586ea44
|
|
|
|
checksums[tesseract_cube.nn]=196bedc8a5bc8c30361c2c9518f648b45b498759cb6041827ff6fbfb8da2a8d1
|
|
|
|
checksums[traineddata]=c0515c9f1e0c79e1069fcc05c2b2f6a6841fb5e1082d695db160333c1154f06d
|
|
|
|
|
|
|
|
mkdir -p $TERMUX_PKG_CACHEDIR/tessdata
|
|
|
|
|
2019-02-04 00:14:50 +01:00
|
|
|
termux_download \
|
2019-07-24 14:56:45 +02:00
|
|
|
https://raw.githubusercontent.com/tesseract-ocr/tessdata/4.0.0/eng.traineddata \
|
2019-02-04 00:14:50 +01:00
|
|
|
$TERMUX_PKG_CACHEDIR/tessdata/eng.traineddata \
|
|
|
|
daa0c97d651c19fba3b25e81317cd697e9908c8208090c94c3905381c23fc047
|
|
|
|
cp $TERMUX_PKG_CACHEDIR/tessdata/eng.traineddata .
|
2016-02-06 13:57:02 +01:00
|
|
|
}
|