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.

57 lines
1.6 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:=1
  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. PKG_FIXUP:=autoreconf
  18. PKG_INSTALL:=1
  19. include $(INCLUDE_DIR)/package.mk
  20. TARGET_LDFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib
  21. define Package/tesseract
  22. MENU:=1
  23. SECTION:=utils
  24. CATEGORY:=Utilities
  25. TITLE:=Tesseract Open Source OCR Engine
  26. URL:=https://github.com/tesseract-ocr/tesseract
  27. DEPENDS:=+libleptonica +libpthread +libstdcpp
  28. endef
  29. TARGET_CFLAGS:=$(filter-out -O%,$(TARGET_CFLAGS)) -O3
  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.{a,so*} $(1)/usr/lib/
  35. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  36. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/tesseract.pc $(1)/usr/lib/pkgconfig/
  37. endef
  38. define Package/tesseract/install
  39. $(INSTALL_DIR) $(1)/usr/bin
  40. $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
  41. $(INSTALL_DIR) $(1)/usr/lib
  42. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.so.* $(1)/usr/lib/
  43. $(INSTALL_DIR) $(1)/usr/share
  44. $(CP) $(PKG_INSTALL_DIR)/usr/share/* $(1)/usr/share/
  45. endef
  46. $(eval $(call BuildPackage,tesseract))