You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.7 KiB

  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. include $(TOPDIR)/rules.mk
  7. PKG_NAME:=tesseract
  8. PKG_VERSION:=4.1.1
  9. PKG_RELEASE:=$(AUTORELEASE)
  10. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  11. PKG_SOURCE_URL:=https://codeload.github.com/tesseract-ocr/tesseract/tar.gz/$(PKG_VERSION)?
  12. PKG_HASH:=2a66ff0d8595bff8f04032165e6c936389b1e5727c3ce5a27b3e059d218db1cb
  13. PKG_MAINTAINER:=Valentin Kivachuk <vk18496@gmail.com>
  14. PKG_LICENSE:=Apache-2.0
  15. PKG_LICENSE_FILES:=LICENSE
  16. CMAKE_BINARY_SUBDIR:=openwrt-build
  17. include $(INCLUDE_DIR)/package.mk
  18. include $(INCLUDE_DIR)/cmake.mk
  19. define Package/tesseract
  20. MENU:=1
  21. SECTION:=utils
  22. CATEGORY:=Utilities
  23. TITLE:=Tesseract Open Source OCR Engine
  24. URL:=https://github.com/tesseract-ocr/tesseract
  25. DEPENDS:=+libleptonica +libarchive +libpthread +libstdcpp
  26. endef
  27. TARGET_CFLAGS:=$(filter-out -O%,$(TARGET_CFLAGS)) -O3
  28. CMAKE_OPTIONS += \
  29. -DAUTO_OPTIMIZE=OFF \
  30. -DBUILD_TRAINING_TOOLS=OFF
  31. define Build/InstallDev
  32. $(INSTALL_DIR) $(1)/usr/include
  33. $(CP) $(PKG_INSTALL_DIR)/usr/include/tesseract $(1)/usr/include/
  34. $(INSTALL_DIR) $(1)/usr/lib
  35. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtesseract.so* $(1)/usr/lib/
  36. $(INSTALL_DIR) $(1)/usr/lib/cmake
  37. $(CP) $(PKG_INSTALL_DIR)/usr/cmake/*.cmake $(1)/usr/lib/cmake/
  38. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  39. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/tesseract.pc $(1)/usr/lib/pkgconfig/
  40. endef
  41. define Package/tesseract/install
  42. $(INSTALL_DIR) $(1)/usr/bin
  43. $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
  44. $(INSTALL_DIR) $(1)/usr/lib
  45. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.so.* $(1)/usr/lib/
  46. endef
  47. $(eval $(call BuildPackage,tesseract))