cjson: bump to version 1.4.3
[buildroot-gz.git] / package / tesseract-ocr / tesseract-ocr.mk
blob76ca930d8ef749659bcb65159da95211b79b9c20
1 ################################################################################
3 # tesseract-ocr
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 = \
24 --disable-opencl
26 # Language data files download
27 ifeq ($(BR2_PACKAGE_TESSERACT_OCR_LANG_ENG),y)
28 TESSERACT_OCR_DATA_FILES += eng.traineddata
29 endif
31 ifeq ($(BR2_PACKAGE_TESSERACT_OCR_LANG_FRA),y)
32 TESSERACT_OCR_DATA_FILES += fra.traineddata
33 endif
35 ifeq ($(BR2_PACKAGE_TESSERACT_OCR_LANG_DEU),y)
36 TESSERACT_OCR_DATA_FILES += deu.traineddata
37 endif
39 ifeq ($(BR2_PACKAGE_TESSERACT_OCR_LANG_SPA),y)
40 TESSERACT_OCR_DATA_FILES += spa.traineddata
41 endif
43 ifeq ($(BR2_PACKAGE_TESSERACT_OCR_LANG_CHI_SIM),y)
44 TESSERACT_OCR_DATA_FILES += chi_sim.traineddata
45 endif
47 ifeq ($(BR2_PACKAGE_TESSERACT_OCR_LANG_CHI_TRA),y)
48 TESSERACT_OCR_DATA_FILES += chi_tra.traineddata
49 endif
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
57 mkdir -p $(@D)/m4
58 endef
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)
68 endef
70 TESSERACT_OCR_POST_INSTALL_TARGET_HOOKS += TESSERACT_OCR_INSTALL_LANG_DATA
72 $(eval $(autotools-package))