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.

129 lines
3.4 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.4
  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:=c593001a89f5a85dd2ddf564805deb860e02471171b3f204944857336295c3e5
  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/default-config
  33. config LIBZMQ_$(2)_WITH_OPENPGM
  34. depends on PACKAGE_libzmq-$(1)
  35. bool "enable openpgm support for libzmq-$(1)"
  36. default n
  37. endef
  38. define Package/libzmq-nc
  39. $(call Package/libzmq/default)
  40. VARIANT:=nc
  41. DEPENDS+=+LIBZMQ_NC_WITH_OPENPGM:openpgm
  42. endef
  43. define Package/libzmq-curve
  44. $(call Package/libzmq/default)
  45. VARIANT:=curve
  46. TITLE+= (CurveZMQ)
  47. DEPENDS+=+libsodium +LIBZMQ_CURVE_WITH_OPENPGM:openpgm
  48. endef
  49. define Package/libzmq-nc/description
  50. This package contains the ZeroMQ messaging engine shared library.
  51. endef
  52. define Package/libzmq-curve/description
  53. $(call Package/libzmq-nc/description)
  54. Includes CurveZMQ security by libsodium.
  55. endef
  56. define Package/libzmq-nc/config
  57. $(call Package/libzmq/default-config,nc,NC)
  58. endef
  59. define Package/libzmq-curve/config
  60. $(call Package/libzmq/default-config,curve,CURVE)
  61. endef
  62. CMAKE_OPTIONS += \
  63. -DA2X_EXECUTABLE=OFF \
  64. -DASCIIDOC_EXECUTABLE=OFF \
  65. -DBUILD_STATIC=OFF \
  66. -DCMAKE_SKIP_INSTALL_RPATH=ON \
  67. -DZMQ_HAVE_SOCK_CLOEXEC=ON \
  68. -DZMQ_HAVE_SO_KEEPALIVE=ON \
  69. -DZMQ_HAVE_TCP_KEEPCNT=ON \
  70. -DZMQ_HAVE_TCP_KEEPIDLE=ON \
  71. -DZMQ_HAVE_TCP_KEEPINTVL=ON \
  72. -DZMQ_HAVE_TCP_KEEPALIVE=ON \
  73. -DENABLE_CURVE=ON \
  74. -DENABLE_EVENTFD=ON \
  75. -DPOLLER=epoll \
  76. -DRT_LIBRARY=OFF \
  77. -DZMQ_BUILD_TESTS=OFF \
  78. -DWITH_LIBBSD=O$(if $(CONFIG_USE_GLIBC),N,FF)
  79. ifeq ($(BUILD_VARIANT),curve)
  80. CMAKE_OPTIONS += -DWITH_LIBSODIUM=ON
  81. else
  82. CMAKE_OPTIONS += -DWITH_LIBSODIUM=OFF
  83. endif
  84. ifeq ($(CONFIG_LIBZMQ_NC_WITH_OPENPGM),y)
  85. CMAKE_OPTIONS += -DWITH_OPENPGM=ON
  86. else ifeq ($(CONFIG_LIBZMQ_CURVE_WITH_OPENPGM),y)
  87. CMAKE_OPTIONS += -DWITH_OPENPGM=ON
  88. else
  89. CMAKE_OPTIONS += -DWITH_OPENPGM=OFF
  90. endif
  91. define Build/InstallDev
  92. $(INSTALL_DIR) $(1)/usr/include
  93. $(CP) $(PKG_INSTALL_DIR)/usr/include/zmq.h $(1)/usr/include
  94. $(CP) $(PKG_INSTALL_DIR)/usr/include/zmq_utils.h $(1)/usr/include
  95. $(INSTALL_DIR) $(1)/usr/lib
  96. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libzmq.so* $(1)/usr/lib/
  97. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  98. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libzmq.pc $(1)/usr/lib/pkgconfig/
  99. $(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/libzmq.pc
  100. $(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/libzmq.pc
  101. endef
  102. define Package/libzmq-nc/install
  103. $(INSTALL_DIR) $(1)/usr/lib
  104. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libzmq.so.* $(1)/usr/lib/
  105. endef
  106. Package/libzmq-curve/install=$(Package/libzmq-nc/install)
  107. $(eval $(call BuildPackage,libzmq-nc))
  108. $(eval $(call BuildPackage,libzmq-curve))