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.

58 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 ../../devel/ninja/ninja-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. -DBUILD_TRAINING_TOOLS=OFF
  30. define Build/InstallDev
  31. $(INSTALL_DIR) $(1)/usr/include
  32. $(CP) $(PKG_INSTALL_DIR)/usr/include/tesseract $(1)/usr/include/
  33. $(INSTALL_DIR) $(1)/usr/lib
  34. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtesseract.so* $(1)/usr/lib/
  35. $(INSTALL_DIR) $(1)/usr/lib/cmake
  36. $(CP) $(PKG_INSTALL_DIR)/usr/cmake/*.cmake $(1)/usr/lib/cmake/
  37. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  38. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/tesseract.pc $(1)/usr/lib/pkgconfig/
  39. endef
  40. define Package/tesseract/install
  41. $(INSTALL_DIR) $(1)/usr/bin
  42. $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
  43. $(INSTALL_DIR) $(1)/usr/lib
  44. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.so.* $(1)/usr/lib/
  45. endef
  46. $(eval $(call BuildPackage,tesseract))