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.0.0
  9. PKG_RELEASE:=2
  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:=a1f5422ca49a32e5f35c54dee5112b11b99928fc9f4ee6695cdc6768d69f61dd
  13. PKG_MAINTAINER:=Valentin Kivachuk <vk18496@gmail.com>
  14. PKG_LICENSE:=Apache-2.0
  15. PKG_LICENSE_FILES:=LICENSE
  16. PKG_BUILD_PARALLEL:=1
  17. CMAKE_BINARY_SUBDIR:=openwrt-build
  18. include $(INCLUDE_DIR)/package.mk
  19. include $(INCLUDE_DIR)/cmake.mk
  20. define Package/tesseract
  21. MENU:=1
  22. SECTION:=utils
  23. CATEGORY:=Utilities
  24. TITLE:=Tesseract Open Source OCR Engine
  25. URL:=https://github.com/tesseract-ocr/tesseract
  26. DEPENDS:=+libleptonica +libpthread +libstdcpp
  27. endef
  28. TARGET_CFLAGS:=$(filter-out -O%,$(TARGET_CFLAGS)) -O3
  29. CMAKE_OPTIONS += \
  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))