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.

106 lines
2.8 KiB

  1. #
  2. # Copyright (C) 2016 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. # This Makefile for ZeroMQ
  8. #
  9. include $(TOPDIR)/rules.mk
  10. PKG_NAME:=zeromq
  11. PKG_VERSION:=4.3.3
  12. PKG_RELEASE:=2
  13. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  14. PKG_SOURCE_URL:=https://github.com/zeromq/libzmq/releases/download/v$(PKG_VERSION)
  15. PKG_HASH:=9d9285db37ae942ed0780c016da87060497877af45094ff9e1a1ca736e3875a2
  16. PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
  17. PKG_LICENSE:=GPL-3.0-or-later
  18. PKG_LICENSE_FILES:=LICENCE.txt
  19. PKG_CPE_ID:=cpe:/a:zeromq:libzmq
  20. PKG_BUILD_PARALLEL:=1
  21. CMAKE_BINARY_SUBDIR:=openwrt-build
  22. include $(INCLUDE_DIR)/package.mk
  23. include $(INCLUDE_DIR)/cmake.mk
  24. define Package/libzmq/default
  25. TITLE:=ZeroMQ - Message Queue engine
  26. URL:=http://www.zeromq.org/
  27. SECTION:=libs
  28. CATEGORY:=Libraries
  29. DEPENDS:=+libuuid +libpthread +librt +libstdcpp +USE_GLIBC:libbsd
  30. PROVIDES:=libzmq
  31. endef
  32. define Package/libzmq-nc
  33. $(call Package/libzmq/default)
  34. VARIANT:=nc
  35. endef
  36. define Package/libzmq-curve
  37. $(call Package/libzmq/default)
  38. VARIANT:=curve
  39. TITLE+= (CurveZMQ)
  40. DEPENDS+=+libsodium
  41. endef
  42. define Package/libzmq-nc/description
  43. This package contains the ZeroMQ messaging engine shared library.
  44. endef
  45. define Package/libzmq-curve/description
  46. $(call Package/libzmq-nc/description)
  47. Includes CurveZMQ security by libsodium.
  48. endef
  49. CMAKE_OPTIONS += \
  50. -DA2X_EXECUTABLE=OFF \
  51. -DASCIIDOC_EXECUTABLE=OFF \
  52. -DBUILD_STATIC=OFF \
  53. -DCMAKE_SKIP_INSTALL_RPATH=ON \
  54. -DZMQ_HAVE_SOCK_CLOEXEC=ON \
  55. -DZMQ_HAVE_SO_KEEPALIVE=ON \
  56. -DZMQ_HAVE_TCP_KEEPCNT=ON \
  57. -DZMQ_HAVE_TCP_KEEPIDLE=ON \
  58. -DZMQ_HAVE_TCP_KEEPINTVL=ON \
  59. -DZMQ_HAVE_TCP_KEEPALIVE=ON \
  60. -DENABLE_CURVE=ON \
  61. -DENABLE_EVENTFD=ON \
  62. -DPOLLER=epoll \
  63. -DRT_LIBRARY=OFF \
  64. -DWITH_OPENPGM=OFF \
  65. -DZMQ_BUILD_TESTS=OFF \
  66. -DWITH_LIBBSD=O$(if $(CONFIG_USE_GLIBC),N,FF)
  67. ifeq ($(BUILD_VARIANT),curve)
  68. CMAKE_OPTIONS += -DWITH_LIBSODIUM=ON
  69. else
  70. CMAKE_OPTIONS += -DWITH_LIBSODIUM=OFF
  71. endif
  72. define Build/InstallDev
  73. $(INSTALL_DIR) $(1)/usr/include
  74. $(CP) $(PKG_INSTALL_DIR)/usr/include/zmq.h $(1)/usr/include
  75. $(CP) $(PKG_INSTALL_DIR)/usr/include/zmq_utils.h $(1)/usr/include
  76. $(INSTALL_DIR) $(1)/usr/lib
  77. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libzmq.so* $(1)/usr/lib/
  78. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  79. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libzmq.pc $(1)/usr/lib/pkgconfig/
  80. $(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/libzmq.pc
  81. $(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/libzmq.pc
  82. endef
  83. define Package/libzmq-nc/install
  84. $(INSTALL_DIR) $(1)/usr/lib
  85. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libzmq.so.* $(1)/usr/lib/
  86. endef
  87. Package/libzmq-curve/install=$(Package/libzmq-nc/install)
  88. $(eval $(call BuildPackage,libzmq-nc))
  89. $(eval $(call BuildPackage,libzmq-curve))