aboutsummaryrefslogtreecommitdiff
path: root/ports/libevent
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2019-11-22 09:47:40 -0800
committerGitHub <noreply@github.com>2019-11-22 09:47:40 -0800
commit45f4b820e5743b89bca3508ba2028cdd5d8bbd17 (patch)
treef874a8c4a7392309bdbb86447288597ec0a4a281 /ports/libevent
parent62d67d3bf8eeff1afa8009041fd08b8822676b7b (diff)
parent8831e8f25f1ff6546ee4a5291b91d599421637b3 (diff)
downloadvcpkg-45f4b820e5743b89bca3508ba2028cdd5d8bbd17.tar.gz
vcpkg-45f4b820e5743b89bca3508ba2028cdd5d8bbd17.zip
Merge branch 'master' into vcpkg_nuget
Diffstat (limited to 'ports/libevent')
-rw-r--r--ports/libevent/CONTROL9
-rw-r--r--ports/libevent/fix-crt_linkage.patch13
-rw-r--r--ports/libevent/fix-file_path.patch26
-rw-r--r--ports/libevent/fix-target-files.patch36
-rw-r--r--ports/libevent/portfile.cmake36
5 files changed, 78 insertions, 42 deletions
diff --git a/ports/libevent/CONTROL b/ports/libevent/CONTROL
index 2534bf1f6..59ee136dd 100644
--- a/ports/libevent/CONTROL
+++ b/ports/libevent/CONTROL
@@ -1,5 +1,12 @@
Source: libevent
-Version: 2.1.8-5
+Version: 2.1.11-1
Build-Depends: openssl
Homepage: https://github.com/libevent/libevent
Description: An event notification library
+
+Feature: openssl
+Description: Support for openssl
+Build-Depends: openssl
+
+Feature: thread
+Description: Support for thread \ No newline at end of file
diff --git a/ports/libevent/fix-crt_linkage.patch b/ports/libevent/fix-crt_linkage.patch
new file mode 100644
index 000000000..b766b4556
--- /dev/null
+++ b/ports/libevent/fix-crt_linkage.patch
@@ -0,0 +1,13 @@
+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()
+
diff --git a/ports/libevent/fix-file_path.patch b/ports/libevent/fix-file_path.patch
new file mode 100644
index 000000000..179700b7e
--- /dev/null
+++ b/ports/libevent/fix-file_path.patch
@@ -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
+ )
diff --git a/ports/libevent/fix-target-files.patch b/ports/libevent/fix-target-files.patch
deleted file mode 100644
index d1b2d5970..000000000
--- a/ports/libevent/fix-target-files.patch
+++ /dev/null
@@ -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
diff --git a/ports/libevent/portfile.cmake b/ports/libevent/portfile.cmake
index 28028ce3c..e04e5f58d 100644
--- a/ports/libevent/portfile.cmake
+++ b/ports/libevent/portfile.cmake
@@ -7,17 +7,32 @@ endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libevent/libevent
- REF release-2.1.8-stable
- SHA512 0d5c872dc797b69ab8ea4b83aebcbac20735b8c6f5adfcc2950aa4d6013d240f5fac3376e817da75ae0ccead50cec0d931619e135a050add438777457b086549
+ REF release-2.1.11-stable
+ SHA512 a34ca4ad4d55a989a4f485f929d0ed2438d070d0e12a19d90c2b12783a562419c64db6a2603b093d958a75246d14ffefc8730c69c90b1b2f48339bde947f0e02
PATCHES
- "fix-target-files.patch"
+ fix-file_path.patch
+ fix-crt_linkage.patch
)
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ INVERTED_FEATURES
+ openssl EVENT__DISABLE_OPENSSL
+ thread EVENT__DISABLE_THREAD_SUPPORT
+)
+
+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
+ OPTIONS ${FEATURE_OPTIONS}
-DEVENT_INSTALL_CMAKE_DIR:PATH=share/libevent
+ -DEVENT__LIBRARY_TYPE=${LIBEVENT_LIB_TYPE}
+ -DVCPKG_CRT_LINKAGE=${VCPKG_CRT_LINKAGE}
-DEVENT__DISABLE_BENCHMARK=ON
-DEVENT__DISABLE_TESTS=ON
-DEVENT__DISABLE_REGRESS=ON
@@ -26,9 +41,20 @@ 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)
+if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
+ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
+endif()
-vcpkg_fixup_cmake_targets()
vcpkg_copy_pdbs()
file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libevent)