1
0

Makefile 4.9 KB

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