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.

108 lines
2.4 KiB

  1. #
  2. # Copyright (C) 2007-2015 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=protobuf
  9. PKG_VERSION:=3.5.1
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-cpp-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://github.com/google/protobuf/releases/download/v$(PKG_VERSION)
  13. PKG_HASH:=c28dba8782da2cfea1e11c61d335958c31a9c1bc553063546af9cbe98f204092
  14. PKG_LICENSE:=BSD-3-Clause
  15. PKG_LICENSE_FILES:=LICENSE
  16. PKG_BUILD_DEPENDS:=protobuf/host
  17. PKG_USE_MIPS16:=0# MIPS16 prevents protobuf's usage of the 'sync' asm-opcode
  18. PKG_INSTALL:=1
  19. include $(INCLUDE_DIR)/package.mk
  20. include $(INCLUDE_DIR)/host-build.mk
  21. define Package/protobuf/Default
  22. SECTION:=libs
  23. CATEGORY:=Libraries
  24. TITLE:=A structured data encoding library
  25. URL:=https://github.com/google/protobuf
  26. DEPENDS:=+zlib +libpthread +libstdcpp
  27. MAINTAINER:=Ken Keys <kkeys@caida.org>
  28. endef
  29. define Package/protobuf
  30. $(call Package/protobuf/Default)
  31. DEPENDS+=+protobuf-lite
  32. endef
  33. define Package/protobuf-lite
  34. $(call Package/protobuf/Default)
  35. endef
  36. define Package/protobuf/description/Default
  37. Protocol Buffers are a way of encoding structured data in an efficient
  38. yet extensible format. Google uses Protocol Buffers for almost all
  39. of its internal RPC protocols and file formats.
  40. endef
  41. define Package/protobuf/description
  42. $(call Package/protobuf/description/Default)
  43. This package provides the libprotoc, libprotobuf, and libprotobuf-lite
  44. libraries. For a much smaller protobuf package, see "protobuf-lite".
  45. endef
  46. define Package/protobuf-lite/description
  47. $(call Package/protobuf/description/Default)
  48. This package provides the libprotobuf-lite library.
  49. endef
  50. CONFIGURE_ARGS += --with-protoc=$(STAGING_DIR_HOSTPKG)/bin/protoc
  51. define Build/InstallDev
  52. $(INSTALL_DIR) \
  53. $(1)/usr/lib \
  54. $(1)/usr/include
  55. $(CP) \
  56. $(PKG_INSTALL_DIR)/usr/include/* \
  57. $(1)/usr/include/
  58. $(CP) \
  59. $(PKG_INSTALL_DIR)/usr/lib/* \
  60. $(1)/usr/lib/
  61. endef
  62. define Package/protobuf-lite/install
  63. $(INSTALL_DIR) \
  64. $(1)/usr/lib
  65. $(CP) \
  66. $(PKG_INSTALL_DIR)/usr/lib/libprotobuf-lite.so* \
  67. $(1)/usr/lib/
  68. endef
  69. define Package/protobuf/install
  70. $(INSTALL_DIR) \
  71. $(1)/usr/lib
  72. $(CP) \
  73. $(PKG_INSTALL_DIR)/usr/lib/libprotoc.so* \
  74. $(1)/usr/lib/
  75. $(CP) \
  76. $(PKG_INSTALL_DIR)/usr/lib/libprotobuf.so* \
  77. $(1)/usr/lib/
  78. endef
  79. $(eval $(call BuildPackage,protobuf))
  80. $(eval $(call BuildPackage,protobuf-lite))
  81. $(eval $(call HostBuild))