[libevent] update to 2.1.12 (#12277)

* [libevent] update to 2.1.12

* fix path in LibeventConfig.cmake.in

* configure crt runtime

* patch target file

* try to fix evpp build on unix

* try to fix evpp build on unix

* try to fix evpp build on unix

* try to fix evpp build on unix

* fix file patching

* code review

* fix fizz:x64-windows build
This commit is contained in:
DailyShana 2020-08-01 02:21:44 +08:00 committed by GitHub
parent 0a8857d260
commit faf2d6ffb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 66 additions and 84 deletions

View File

@ -1,5 +1,6 @@
Source: evpp
Version: 0.7.0-3
Version: 0.7.0
Port-Version: 4
Homepage: https://github.com/Qihoo360/evpp
Description: A modern C++ network library based on libevent for developing high performance network services in TCP/UDP/HTTP protocols.
Build-Depends: glog, libevent (windows), libevent[openssl] (!windows), rapidjson, concurrentqueue (!windows), boost-lockfree (!windows)

View File

@ -11,7 +11,7 @@ index 7872fc8..2a06614 100644
+ find_path(GLOG_INCLUDE_DIRS logging.h PATH_SUFFIXES glog)
+ find_package(Libevent CONFIG REQUIRED)
+ list(APPEND DEPENDENT_INCLUDE_DIRS "${GLOG_INCLUDE_DIRS}/../")
+ SET(DEPENDENT_LIBRARIES event_static event_core_static event_extra_static event_openssl_static glog::glog pthread)
+ SET(DEPENDENT_LIBRARIES libevent::core libevent::extra libevent::openssl glog::glog pthread)
else (UNIX)
SET(DEPENDENT_LIBRARIES event glog)
endif (UNIX)
@ -24,7 +24,7 @@ index 469ed1c..8219424 100644
if (UNIX)
-set(LIBRARIES evpp_concurrentqueue event glog pthread)
+set(LIBRARIES evpp_concurrentqueue event_static event_core_static event_extra_static event_openssl_static glog::glog pthread)
+set(LIBRARIES evpp_concurrentqueue libevent::core libevent::extra libevent::openssl glog::glog pthread)
link_directories("/home/s/safe/lib" ${PROJECT_BUILD_DIR}/lib)
else(UNIX)
set(LIBRARIES evpp_static event glog)
@ -36,7 +36,7 @@ index 1148616..0356b71 100644
add_executable(benchmark_http_libevent libevent_http_bench.c)
-target_link_libraries(benchmark_http_libevent event)
+target_link_libraries(benchmark_http_libevent event_static event_core_static event_extra_static event_openssl_static)
+target_link_libraries(benchmark_http_libevent libevent::core libevent::extra libevent::openssl)
diff --git a/benchmark/ioevent/libevent/CMakeLists.txt b/benchmark/ioevent/libevent/CMakeLists.txt
index dfa51a3..de4849d 100644
--- a/benchmark/ioevent/libevent/CMakeLists.txt
@ -45,7 +45,7 @@ index dfa51a3..de4849d 100644
add_executable(benchmark_ioevent_libevent libevent_ioevent_bench.c)
-target_link_libraries(benchmark_ioevent_libevent event)
+target_link_libraries(benchmark_ioevent_libevent event_static event_core_static event_extra_static event_openssl_static)
+target_link_libraries(benchmark_ioevent_libevent libevent::core libevent::extra libevent::openssl)
diff --git a/benchmark/throughput/libevent/CMakeLists.txt b/benchmark/throughput/libevent/CMakeLists.txt
index 21dab84..aefe698 100644
--- a/benchmark/throughput/libevent/CMakeLists.txt
@ -53,11 +53,11 @@ index 21dab84..aefe698 100644
@@ -1,5 +1,5 @@
add_executable(benchmark_tcp_libevent_client client.c)
-target_link_libraries(benchmark_tcp_libevent_client event)
+target_link_libraries(benchmark_tcp_libevent_client event_static event_core_static event_extra_static event_openssl_static)
+target_link_libraries(benchmark_tcp_libevent_client libevent::core libevent::extra libevent::openssl)
add_executable(benchmark_tcp_libevent_server server.c)
-target_link_libraries(benchmark_tcp_libevent_server event)
+target_link_libraries(benchmark_tcp_libevent_server event_static event_core_static event_extra_static event_openssl_static)
+target_link_libraries(benchmark_tcp_libevent_server libevent::core libevent::extra libevent::openssl)
diff --git a/examples/recipes/self_control_timer/basic_01/CMakeLists.txt b/examples/recipes/self_control_timer/basic_01/CMakeLists.txt
index 7834db4..82294c5 100644
--- a/examples/recipes/self_control_timer/basic_01/CMakeLists.txt
@ -67,7 +67,7 @@ index 7834db4..82294c5 100644
add_executable(example_recipes_self_control_timer_basic_01 ${SRCS})
-target_link_libraries(example_recipes_self_control_timer_basic_01 event)
+target_link_libraries(example_recipes_self_control_timer_basic_01 event_static event_core_static event_extra_static event_openssl_static)
+target_link_libraries(example_recipes_self_control_timer_basic_01 libevent::core libevent::extra libevent::openssl)
@ -80,7 +80,7 @@ index a8be419..0329ccc 100644
add_executable(example_recipes_self_control_timer_basic_02 ${SRCS})
-target_link_libraries(example_recipes_self_control_timer_basic_02 event)
+target_link_libraries(example_recipes_self_control_timer_basic_02 event_static event_core_static event_extra_static event_openssl_static)
+target_link_libraries(example_recipes_self_control_timer_basic_02 libevent::core libevent::extra libevent::openssl)
@ -93,7 +93,7 @@ index 1cae9bb..218b771 100644
add_executable(example_recipes_self_control_timer_cancel_03 ${SRCS})
-target_link_libraries(example_recipes_self_control_timer_cancel_03 event)
+target_link_libraries(example_recipes_self_control_timer_cancel_03 event_static event_core_static event_extra_static event_openssl_static)
+target_link_libraries(example_recipes_self_control_timer_cancel_03 libevent::core libevent::extra libevent::openssl)
@ -106,7 +106,7 @@ index 749c584..e7c658e 100644
add_executable(example_recipes_self_control_timer_periodic_04 ${SRCS})
-target_link_libraries(example_recipes_self_control_timer_periodic_04 event)
+target_link_libraries(example_recipes_self_control_timer_periodic_04 event_static event_core_static event_extra_static event_openssl_static)
+target_link_libraries(example_recipes_self_control_timer_periodic_04 libevent::core libevent::extra libevent::openssl)

View File

@ -1,4 +1,5 @@
Source: fizz
Version: 2020.02.03.00
Port-Version: 1
Build-Depends: folly, openssl, libsodium, zlib, fmt
Description: a TLS 1.3 implementation by Facebook

View File

@ -1,13 +0,0 @@
diff --git a/fizz/CMakeLists.txt b/fizz/CMakeLists.txt
index ccbbbb6..ee10c90 100644
--- a/fizz/CMakeLists.txt
+++ b/fizz/CMakeLists.txt
@@ -86,7 +86,7 @@ if(TARGET event)
message(STATUS "Found libevent from package config")
list(APPEND FIZZ_SHINY_DEPENDENCIES event)
else()
- find_package(Libevent MODULE REQUIRED)
+ find_package(Libevent CONFIG REQUIRED)
list(APPEND FIZZ_LINK_LIBRARIES ${LIBEVENT_LIB})
list(APPEND FIZZ_INCLUDE_DIRECTORIES ${LIBEVENT_INCLUDE_DIR})
endif()

View File

@ -8,13 +8,11 @@ vcpkg_from_github(
HEAD_REF master
PATCHES
find-zlib.patch
fix-build_error.patch
)
# Prefer installed config files
file(REMOVE
${SOURCE_PATH}/fizz/cmake/FindGflags.cmake
${SOURCE_PATH}/fizz/cmake/FindLibevent.cmake
${SOURCE_PATH}/fizz/cmake/FindGlog.cmake
)

View File

@ -1,5 +1,5 @@
Source: libevent
Version: 2.1.11-5
Version: 2.1.12
Homepage: https://github.com/libevent/libevent
Description: An event notification library
Supports: !uwp

View File

@ -1,13 +1,13 @@
diff --git a/cmake/LibeventConfig.cmake.in b/cmake/LibeventConfig.cmake.in
index 5422336..d436100 100644
index 7b808c3..fbf67be 100644
--- a/cmake/LibeventConfig.cmake.in
+++ b/cmake/LibeventConfig.cmake.in
@@ -8,7 +8,7 @@
@@ -58,7 +58,7 @@ endif()
# Get the path of the current file.
get_filename_component(LIBEVENT_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
-get_filename_component(_INSTALL_PREFIX "${LIBEVENT_CMAKE_DIR}/../../.." ABSOLUTE)
+get_filename_component(_INSTALL_PREFIX "${LIBEVENT_CMAKE_DIR}/../.." ABSOLUTE)
# Set the include directories.
-set(LIBEVENT_INCLUDE_DIRS "@EVENT_INSTALL_INCLUDE_DIR@")
+set(LIBEVENT_INCLUDE_DIRS "${LIBEVENT_CMAKE_DIR}/../../include")
# Include the project Targets file, this contains definitions for IMPORTED targets.
include(${LIBEVENT_CMAKE_DIR}/LibeventTargets.cmake)
macro(message_if_needed _flag _msg)
if (NOT ${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY)

View File

@ -1,13 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bf333f3..5bc2a54 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -230,7 +230,7 @@ endif()
if (${MSVC})
set(msvc_static_runtime OFF)
- if ("${EVENT_LIBRARY_TYPE}" STREQUAL "STATIC")
+ if ("${VCPKG_CRT_LINKAGE}" STREQUAL "STATIC")
set(msvc_static_runtime ON)
endif()

View File

@ -1,26 +1,22 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6e91c08..44b6e18 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1430,7 +1430,7 @@ configure_file(${PROJECT_SOURCE_DIR}/cmake/LibeventConfigBuildTree.cmake.in
# Calculate the relative directory from the Cmake dir.
file(RELATIVE_PATH
REL_INCLUDE_DIR
- "${EVENT_INSTALL_CMAKE_DIR}"
+ "${CURRENT_PACKAGES_DIR}/${EVENT_INSTALL_CMAKE_DIR}"
"${CMAKE_INSTALL_PREFIX}/include")
# Note the LIBEVENT_CMAKE_DIR is defined in LibeventConfig.cmake.in,
diff --git a/cmake/AddEventLibrary.cmake b/cmake/AddEventLibrary.cmake
index 9de4484..411ca9d 100644
index 04f5837..95d9808 100644
--- a/cmake/AddEventLibrary.cmake
+++ b/cmake/AddEventLibrary.cmake
@@ -113,7 +113,7 @@ macro(add_event_library LIB_NAME)
EXPORT LibeventTargets
@@ -42,7 +42,7 @@ macro(export_install_target TYPE LIB_NAME OUTER_INCLUDES)
install(TARGETS "${LIB_NAME}_${TYPE}"
LIBRARY DESTINATION "lib" COMPONENT lib
ARCHIVE DESTINATION "lib" COMPONENT lib
- RUNTIME DESTINATION "lib" COMPONENT lib
+ RUNTIME DESTINATION "bin" COMPONENT bin
PUBLIC_HEADER DESTINATION "include/event2"
COMPONENT dev
)
else()
@@ -69,7 +69,7 @@ macro(export_install_target TYPE LIB_NAME OUTER_INCLUDES)
EXPORT LibeventTargets-${TYPE}
LIBRARY DESTINATION "lib" COMPONENT lib
ARCHIVE DESTINATION "lib" COMPONENT lib
- RUNTIME DESTINATION "lib" COMPONENT lib
+ RUNTIME DESTINATION "bin" COMPONENT bin
COMPONENT dev
)
endif()

View File

@ -3,11 +3,10 @@ vcpkg_fail_port_install(MESSAGE "${PORT} does not currently support UWP" ON_TARG
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libevent/libevent
REF release-2.1.11-stable
SHA512 a34ca4ad4d55a989a4f485f929d0ed2438d070d0e12a19d90c2b12783a562419c64db6a2603b093d958a75246d14ffefc8730c69c90b1b2f48339bde947f0e02
REF release-2.1.12-stable
SHA512 5d6c6f0072f69a68b190772d4c973ce8f33961912032cdc104ad0854c0950f9d7e28bc274ca9df23897937f0cd8e45d1f214543d80ec271c5a6678814a7f195e
PATCHES
fix-file_path.patch
fix-crt_linkage.patch
fix-LibeventConfig_cmake_in_path.patch
)
@ -23,13 +22,18 @@ else()
set(LIBEVENT_LIB_TYPE STATIC)
endif()
if(VCPKG_CRT_LINKAGE STREQUAL "static")
set(LIBEVENT_STATIC_RUNTIME ON)
else()
set(LIBEVENT_STATIC_RUNTIME OFF)
endif()
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS ${FEATURE_OPTIONS}
-DEVENT_INSTALL_CMAKE_DIR:PATH=share/libevent
-DEVENT__LIBRARY_TYPE=${LIBEVENT_LIB_TYPE}
-DVCPKG_CRT_LINKAGE=${VCPKG_CRT_LINKAGE}
-DEVENT__MSVC_STATIC_RUNTIME=${LIBEVENT_STATIC_RUNTIME}
-DEVENT__DISABLE_BENCHMARK=ON
-DEVENT__DISABLE_TESTS=ON
-DEVENT__DISABLE_REGRESS=ON
@ -38,20 +42,28 @@ vcpkg_configure_cmake(
vcpkg_install_cmake()
if (VCPKG_TARGET_IS_WINDOWS)
vcpkg_fixup_cmake_targets(CONFIG_PATH cmake TARGET_PATH share/libevent)
else ()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake TARGET_PATH share)
endif()
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/libevent/)
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/event_rpcgen.py ${CURRENT_PACKAGES_DIR}/tools/libevent/event_rpcgen.py)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
endif()
set(_target_suffix)
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
set(_target_suffix static)
else()
set(_target_suffix shared)
endif()
vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/libevent/LibeventTargets-${_target_suffix}.cmake
"${CURRENT_PACKAGES_DIR}"
"${CURRENT_INSTALLED_DIR}"
)
vcpkg_copy_pdbs()
#Handle copyright