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