Merge pull request #17303 from CarlosDerSeher/feature_bt_agent
[feed/packages.git] / utils / tesseract / Makefile
1 # Copyright (C) 2019 Valentin Kivachuk <vk18496@gmail.com>
2 #
3 # This is free software, licensed under the GNU General Public License v2.
4 # See /LICENSE for more information.
5 #
6
7 include $(TOPDIR)/rules.mk
8
9 PKG_NAME:=tesseract
10 PKG_VERSION:=4.1.1
11 PKG_RELEASE:=$(AUTORELEASE)
12
13 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
14 PKG_SOURCE_URL:=https://codeload.github.com/tesseract-ocr/tesseract/tar.gz/$(PKG_VERSION)?
15 PKG_HASH:=2a66ff0d8595bff8f04032165e6c936389b1e5727c3ce5a27b3e059d218db1cb
16
17 PKG_MAINTAINER:=Valentin Kivachuk <vk18496@gmail.com>
18 PKG_LICENSE:=Apache-2.0
19 PKG_LICENSE_FILES:=LICENSE
20
21 CMAKE_BINARY_SUBDIR:=openwrt-build
22
23 include $(INCLUDE_DIR)/package.mk
24 include $(INCLUDE_DIR)/cmake.mk
25
26 define Package/tesseract
27 MENU:=1
28 SECTION:=utils
29 CATEGORY:=Utilities
30 TITLE:=Tesseract Open Source OCR Engine
31 URL:=https://github.com/tesseract-ocr/tesseract
32 DEPENDS:=+libleptonica +libarchive +libpthread +libstdcpp
33 endef
34
35 TARGET_CFLAGS:=$(filter-out -O%,$(TARGET_CFLAGS)) -O3
36
37 CMAKE_OPTIONS += \
38 -DAUTO_OPTIMIZE=OFF \
39 -DBUILD_TRAINING_TOOLS=OFF
40
41 define Build/InstallDev
42 $(INSTALL_DIR) $(1)/usr/include
43 $(CP) $(PKG_INSTALL_DIR)/usr/include/tesseract $(1)/usr/include/
44 $(INSTALL_DIR) $(1)/usr/lib
45 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtesseract.so* $(1)/usr/lib/
46 $(INSTALL_DIR) $(1)/usr/lib/cmake
47 $(CP) $(PKG_INSTALL_DIR)/usr/cmake/*.cmake $(1)/usr/lib/cmake/
48 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
49 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/tesseract.pc $(1)/usr/lib/pkgconfig/
50 endef
51
52 define Package/tesseract/install
53 $(INSTALL_DIR) $(1)/usr/bin
54 $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
55 $(INSTALL_DIR) $(1)/usr/lib
56 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.so.* $(1)/usr/lib/
57 endef
58
59 $(eval $(call BuildPackage,tesseract))