Makefile 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. #
  2. # Copyright (C) 2011-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:=libevent2
  9. PKG_VERSION:=2.1.11
  10. PKG_RELEASE:=2
  11. PKG_SOURCE:=libevent-$(PKG_VERSION)-stable.tar.gz
  12. PKG_SOURCE_URL:=https://github.com/libevent/libevent/releases/download/release-$(PKG_VERSION)-stable
  13. PKG_HASH:=a65bac6202ea8c5609fd5c7e480e6d25de467ea1917c08290c521752f147283d
  14. PKG_BUILD_DIR:=$(BUILD_DIR)/libevent-$(PKG_VERSION)-stable
  15. PKG_MAINTAINER:=Jo-Philipp Wich <[email protected]>
  16. PKG_LICENSE:=BSD-3-Clause
  17. PKG_LICENSE_FILES:=LICENSE
  18. PKG_CPE_ID:=cpe:/a:libevent_project:libevent
  19. PKG_CONFIG_DEPENDS:= \
  20. CONFIG_PACKAGE_libevent2-openssl \
  21. CONFIG_PACKAGE_libevent2-mbedtls
  22. include $(INCLUDE_DIR)/package.mk
  23. include $(INCLUDE_DIR)/cmake.mk
  24. define Package/libevent2/Default
  25. SECTION:=libs
  26. CATEGORY:=Libraries
  27. TITLE:=Event notification
  28. URL:=http://libevent.org
  29. ABI_VERSION:=7
  30. endef
  31. define Package/libevent2/Default/description
  32. The libevent API provides a mechanism to execute a callback function
  33. when a specific event occurs on a file descriptor or after a timeout
  34. has been reached. Furthermore, libevent also support callbacks due
  35. to signals or regular timeouts.
  36. libevent is meant to replace the event loop found in event driven
  37. network servers. An application just needs to call event_dispatch()
  38. and then add or remove events dynamically without having to change
  39. the event loop.
  40. endef
  41. define Package/libevent2
  42. $(call Package/libevent2/Default)
  43. TITLE+= library (version 2.1)
  44. endef
  45. define Package/libevent2/description
  46. $(call Package/libevent2/Default/description)
  47. This package contains the libevent shared library historically
  48. containing both the core & extra libraries.
  49. endef
  50. define Package/libevent2-core
  51. $(call Package/libevent2/Default)
  52. TITLE+= core library (version 2.1)
  53. endef
  54. define Package/libevent2-core/description
  55. $(call Package/libevent2/Default/description)
  56. This package contains the libevent core shared library for the event,
  57. buffer & utility functions.
  58. endef
  59. define Package/libevent2-extra
  60. $(call Package/libevent2/Default)
  61. TITLE+= extra library (version 2.1)
  62. DEPENDS+=+libevent2-core
  63. endef
  64. define Package/libevent2-extra/description
  65. $(call Package/libevent2/Default/description)
  66. This package contains the libevent extra shared library for specific
  67. protocols including HTTP, DNS & RPC.
  68. endef
  69. define Package/libevent2-openssl
  70. $(call Package/libevent2/Default)
  71. TITLE+= OpenSSL library (version 2.1)
  72. DEPENDS+=+libopenssl +libevent2-core
  73. endef
  74. define Package/libevent2-openssl/description
  75. $(call Package/libevent2/Default/description)
  76. This package contains the libevent OpenSSL shared library for encrypted
  77. bufferevents.
  78. endef
  79. define Package/libevent2-pthreads
  80. $(call Package/libevent2/Default)
  81. TITLE+= Pthreads library (version 2.1)
  82. DEPENDS+=+libpthread +libevent2-core
  83. endef
  84. define Package/libevent2-pthreads/description
  85. $(call Package/libevent2/Default/description)
  86. This package contains the libevent Pthreads shared library for
  87. threading & locking.
  88. endef
  89. TARGET_CFLAGS += $(FPIC) -ffunction-sections -fdata-sections -flto
  90. TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed -flto
  91. CMAKE_OPTIONS += \
  92. -DEVENT__DISABLE_BENCHMARK:BOOL=ON \
  93. -DEVENT__DISABLE_DEBUG_MODE:BOOL=ON \
  94. -DEVENT__DISABLE_REGRESS:BOOL=ON \
  95. -DEVENT__DISABLE_SAMPLES:BOOL=ON \
  96. $(if $(CONFIG_PACKAGE_libevent2-openssl),-DEVENT__DISABLE_OPENSSL:BOOL=OFF,-DEVENT__DISABLE_OPENSSL:BOOL=ON) \
  97. $(if $(CONFIG_PACKAGE_libevent2-pthreads),-DEVENT__DISABLE_THREAD_SUPPORT:BOOL=OFF,-DEVENT__DISABLE_THREAD_SUPPORT:BOOL=ON) \
  98. -DEVENT__DISABLE_TESTS:BOOL=ON \
  99. -DBUILD_TESTING:BOOL=OFF
  100. define Build/InstallDev
  101. $(call Build/InstallDev/cmake,$(1))
  102. $(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/libevent*.pc
  103. $(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/libevent*.pc
  104. endef
  105. define Package/libevent2/install
  106. $(INSTALL_DIR) $(1)/usr/lib
  107. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libevent-2.1.so.* $(1)/usr/lib/
  108. endef
  109. define Package/libevent2-core/install
  110. $(INSTALL_DIR) $(1)/usr/lib
  111. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libevent_core-2.1.so.* $(1)/usr/lib/
  112. endef
  113. define Package/libevent2-extra/install
  114. $(INSTALL_DIR) $(1)/usr/lib
  115. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libevent_extra-2.1.so.* $(1)/usr/lib/
  116. endef
  117. define Package/libevent2-openssl/install
  118. $(INSTALL_DIR) $(1)/usr/lib
  119. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libevent_openssl-2.1.so.* $(1)/usr/lib/
  120. endef
  121. define Package/libevent2-pthreads/install
  122. $(INSTALL_DIR) $(1)/usr/lib
  123. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libevent_pthreads-2.1.so.* $(1)/usr/lib/
  124. endef
  125. $(eval $(call BuildPackage,libevent2))
  126. $(eval $(call BuildPackage,libevent2-core))
  127. $(eval $(call BuildPackage,libevent2-extra))
  128. $(eval $(call BuildPackage,libevent2-openssl))
  129. $(eval $(call BuildPackage,libevent2-pthreads))