mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-28 02:52:03 +08:00
[libevent] Upgrade to version 2.1.10 (#6969)
This commit is contained in:
parent
1ce24dd0db
commit
7401e2ff64
13
ports/fizz/fix-build_error.patch
Normal file
13
ports/fizz/fix-build_error.patch
Normal file
@ -0,0 +1,13 @@
|
||||
diff --git a/fizz/CMakeLists.txt b/fizz/CMakeLists.txt
|
||||
index 7f8769a..debac4e 100644
|
||||
--- a/fizz/CMakeLists.txt
|
||||
+++ b/fizz/CMakeLists.txt
|
||||
@@ -81,7 +81,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()
|
@ -8,7 +8,9 @@ vcpkg_from_github(
|
||||
REF 6d26a1be8d7a20d8d89c374ee3dc5c452d18c18d
|
||||
SHA512 bc6aa17a97fdfc53d0a247b876cbd1fea8214608b7e463dcf21e34df65015fe77e617c5a6c6bfa84b87e60e56b6aeb89aa2d8d774f97fc1f76f415869948a48a
|
||||
HEAD_REF master
|
||||
PATCHES find-zlib.patch
|
||||
PATCHES
|
||||
find-zlib.patch
|
||||
fix-build_error.patch
|
||||
)
|
||||
|
||||
# Prefer installed config files
|
||||
|
@ -1,5 +1,5 @@
|
||||
Source: libevent
|
||||
Version: 2.1.8-5
|
||||
Version: 2.1.10
|
||||
Build-Depends: openssl
|
||||
Homepage: https://github.com/libevent/libevent
|
||||
Description: An event notification library
|
||||
|
36
ports/libevent/fix-arm_build.patch
Normal file
36
ports/libevent/fix-arm_build.patch
Normal file
@ -0,0 +1,36 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 44b6e18..19c024f 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -322,7 +322,7 @@ endif()
|
||||
# Winsock.
|
||||
if(WIN32)
|
||||
set(CMAKE_EXTRA_INCLUDE_FILES winsock2.h ws2tcpip.h)
|
||||
- set(CMAKE_REQUIRED_LIBRARIES ws2_32.lib)
|
||||
+ set(CMAKE_REQUIRED_LIBRARIES ws2_32.lib advapi32.lib shell32.lib)
|
||||
set(CMAKE_REQUIRED_DEFINITIONS -FIwinsock2.h -FIws2tcpip.h)
|
||||
endif()
|
||||
if (SOLARIS)
|
||||
diff --git a/cmake/AddEventLibrary.cmake b/cmake/AddEventLibrary.cmake
|
||||
index 411ca9d..869735e 100644
|
||||
--- a/cmake/AddEventLibrary.cmake
|
||||
+++ b/cmake/AddEventLibrary.cmake
|
||||
@@ -73,6 +73,8 @@ macro(add_event_library LIB_NAME)
|
||||
list(APPEND ADD_EVENT_LIBRARY_TARGETS "${LIB_NAME}_static")
|
||||
|
||||
set(ADD_EVENT_LIBRARY_INTERFACE "${LIB_NAME}_static")
|
||||
+
|
||||
+ target_link_libraries("${LIB_NAME}_static" PRIVATE ${CMAKE_REQUIRED_LIBRARIES})
|
||||
endif()
|
||||
|
||||
if (${EVENT_LIBRARY_SHARED})
|
||||
@@ -81,7 +83,8 @@ macro(add_event_library LIB_NAME)
|
||||
target_link_libraries("${LIB_NAME}_shared"
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
${LIB_PLATFORM}
|
||||
- ${LIB_LIBRARIES})
|
||||
+ ${LIB_LIBRARIES}
|
||||
+ ${CMAKE_REQUIRED_LIBRARIES})
|
||||
|
||||
if (EVENT_SHARED_FLAGS)
|
||||
set_event_shared_lib_flags("${LIB_NAME}" "${EVENT_SHARED_FLAGS}")
|
26
ports/libevent/fix-file_path.patch
Normal file
26
ports/libevent/fix-file_path.patch
Normal file
@ -0,0 +1,26 @@
|
||||
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
|
||||
--- a/cmake/AddEventLibrary.cmake
|
||||
+++ b/cmake/AddEventLibrary.cmake
|
||||
@@ -113,7 +113,7 @@ macro(add_event_library LIB_NAME)
|
||||
EXPORT LibeventTargets
|
||||
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
|
||||
)
|
@ -1,36 +0,0 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index b4a34f3d..4bd80d84 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -1343,10 +1343,10 @@ endif()
|
||||
set(EVENT_INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH "Installation directory for CMake files")
|
||||
|
||||
# Make sure the paths are absolute.
|
||||
-foreach(p LIB BIN INCLUDE CMAKE)
|
||||
+foreach(p INCLUDE CMAKE)
|
||||
set(var EVENT_INSTALL_${p}_DIR)
|
||||
if(NOT IS_ABSOLUTE "${${var}}")
|
||||
- set(${var} "${CMAKE_INSTALL_PREFIX}/${${var}}")
|
||||
+ set(${var}_FULL "${CMAKE_INSTALL_PREFIX}/${${var}}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
@@ -1371,15 +1371,15 @@ configure_file(${PROJECT_SOURCE_DIR}/cmake/LibeventConfigBuildTree.cmake.in
|
||||
# Generate the config file for the installation tree.
|
||||
file(RELATIVE_PATH
|
||||
REL_INCLUDE_DIR
|
||||
- "${EVENT_INSTALL_CMAKE_DIR}"
|
||||
- "${EVENT_INSTALL_INCLUDE_DIR}") # Calculate the relative directory from the Cmake dir.
|
||||
+ "${EVENT_INSTALL_CMAKE_DIR_FULL}"
|
||||
+ "${EVENT_INSTALL_INCLUDE_DIR_FULL}") # Calculate the relative directory from the Cmake dir.
|
||||
|
||||
# Note the EVENT_CMAKE_DIR is defined in LibeventConfig.cmake.in,
|
||||
# we escape it here so it's evaluated when it is included instead
|
||||
# so that the include dirs are givenrelative to where the
|
||||
# config file is located.
|
||||
set(EVENT__INCLUDE_DIRS
|
||||
- "\${EVENT_CMAKE_DIR}/${REL_INCLUDE_DIR}")
|
||||
+ "\${EVENT_CMAKE_DIR_FULL}/${REL_INCLUDE_DIR}")
|
||||
|
||||
configure_file(${PROJECT_SOURCE_DIR}/cmake/LibeventConfig.cmake.in
|
||||
${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/LibeventConfig.cmake
|
@ -7,17 +7,25 @@ endif()
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO libevent/libevent
|
||||
REF release-2.1.8-stable
|
||||
SHA512 0d5c872dc797b69ab8ea4b83aebcbac20735b8c6f5adfcc2950aa4d6013d240f5fac3376e817da75ae0ccead50cec0d931619e135a050add438777457b086549
|
||||
REF release-2.1.10-stable
|
||||
SHA512 8c336df258f7a12164da739b0ea68bebcc8b2ea4f4a839300aa1c5edfb673ac5d6517f882ba04ab35d406489ddd682a319e39fa6784ac0cab73227d42e503a55
|
||||
PATCHES
|
||||
"fix-target-files.patch"
|
||||
fix-file_path.patch
|
||||
fix-arm_build.patch
|
||||
)
|
||||
|
||||
if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
||||
set(LIBEVENT_LIB_TYPE SHARED)
|
||||
else()
|
||||
set(LIBEVENT_LIB_TYPE STATIC)
|
||||
endif()
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
OPTIONS
|
||||
-DEVENT_INSTALL_CMAKE_DIR:PATH=share/libevent
|
||||
-DEVENT__LIBRARY_TYPE=${LIBEVENT_LIB_TYPE}
|
||||
-DEVENT__DISABLE_BENCHMARK=ON
|
||||
-DEVENT__DISABLE_TESTS=ON
|
||||
-DEVENT__DISABLE_REGRESS=ON
|
||||
@ -28,7 +36,14 @@ vcpkg_install_cmake()
|
||||
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
|
||||
vcpkg_fixup_cmake_targets()
|
||||
if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "windows" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH cmake TARGET_PATH share/libevent)
|
||||
elseif (VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake TARGET_PATH share)
|
||||
elseif (VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake TARGET_PATH share)
|
||||
endif()
|
||||
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libevent)
|
||||
|
Loading…
Reference in New Issue
Block a user