1 ################################################################################
5 ################################################################################
7 TESSERACT_OCR_VERSION
= 3.05.00
8 TESSERACT_OCR_DATA_VERSION
= 3.04.00
9 TESSERACT_OCR_SITE
= $(call github
,tesseract-ocr
,tesseract
,$(TESSERACT_OCR_VERSION
))
10 TESSERACT_OCR_LICENSE
= Apache-2.0
11 TESSERACT_OCR_LICENSE_FILES
= COPYING
13 # Source from github, no configure script provided
14 TESSERACT_OCR_AUTORECONF
= YES
16 # cairo, pango and icu are optional dependencies, but only needed for
17 # building training tools, which are only built explicitly with "make
18 # training", which is not done by this package.
19 TESSERACT_OCR_DEPENDENCIES
= leptonica host-pkgconf
20 TESSERACT_OCR_INSTALL_STAGING
= YES
21 TESSERACT_OCR_CONF_ENV
= \
22 LIBLEPT_HEADERSDIR
=$(STAGING_DIR
)/usr
/include/leptonica
23 TESSERACT_OCF_CONF_OPTS
= \
26 # Language data files download
27 ifeq ($(BR2_PACKAGE_TESSERACT_OCR_LANG_ENG
),y
)
28 TESSERACT_OCR_DATA_FILES
+= eng.traineddata
31 ifeq ($(BR2_PACKAGE_TESSERACT_OCR_LANG_FRA
),y
)
32 TESSERACT_OCR_DATA_FILES
+= fra.traineddata
35 ifeq ($(BR2_PACKAGE_TESSERACT_OCR_LANG_DEU
),y
)
36 TESSERACT_OCR_DATA_FILES
+= deu.traineddata
39 ifeq ($(BR2_PACKAGE_TESSERACT_OCR_LANG_SPA
),y
)
40 TESSERACT_OCR_DATA_FILES
+= spa.traineddata
43 ifeq ($(BR2_PACKAGE_TESSERACT_OCR_LANG_CHI_SIM
),y
)
44 TESSERACT_OCR_DATA_FILES
+= chi_sim.traineddata
47 ifeq ($(BR2_PACKAGE_TESSERACT_OCR_LANG_CHI_TRA
),y
)
48 TESSERACT_OCR_DATA_FILES
+= chi_tra.traineddata
51 TESSERACT_OCR_EXTRA_DOWNLOADS
= \
52 $(addprefix https
://github.com
/tesseract-ocr
/tessdata
/raw
/$(TESSERACT_OCR_DATA_VERSION
)/,\
53 $(TESSERACT_OCR_DATA_FILES
))
55 define TESSERACT_OCR_PRECONFIGURE
56 # Autoreconf step fails due to missing m4 directory
60 TESSERACT_OCR_PRE_CONFIGURE_HOOKS
+= TESSERACT_OCR_PRECONFIGURE
62 # Language data files installation
63 define TESSERACT_OCR_INSTALL_LANG_DATA
64 $(foreach langfile
,$(TESSERACT_OCR_DATA_FILES
), \
65 $(INSTALL
) -D
-m
0644 $(DL_DIR
)/$(langfile
) \
66 $(TARGET_DIR
)/usr
/share
/tessdata
/$(langfile
)
70 TESSERACT_OCR_POST_INSTALL_TARGET_HOOKS
+= TESSERACT_OCR_INSTALL_LANG_DATA
72 $(eval
$(autotools-package
))