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.

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