diff options
Diffstat (limited to 'vcpkg/ports/libev')
| -rw-r--r-- | vcpkg/ports/libev/0000-event-fix-undefined-struct-timeval.patch | 14 | ||||
| -rw-r--r-- | vcpkg/ports/libev/0001-use-select-with-msvc.patch | 13 | ||||
| -rw-r--r-- | vcpkg/ports/libev/portfile.cmake | 36 | ||||
| -rw-r--r-- | vcpkg/ports/libev/unofficial-libev-config.cmake | 25 | ||||
| -rw-r--r-- | vcpkg/ports/libev/vcpkg.json | 8 |
5 files changed, 96 insertions, 0 deletions
diff --git a/vcpkg/ports/libev/0000-event-fix-undefined-struct-timeval.patch b/vcpkg/ports/libev/0000-event-fix-undefined-struct-timeval.patch new file mode 100644 index 0000000..3ffce5f --- /dev/null +++ b/vcpkg/ports/libev/0000-event-fix-undefined-struct-timeval.patch @@ -0,0 +1,14 @@ +diff --git a/event.c b/event.c +index 5586cd3..a67ca54 100644 +--- a/event.c ++++ b/event.c +@@ -40,6 +40,9 @@ + #include <stddef.h> + #include <stdlib.h> + #include <assert.h> ++#ifdef _WIN32 ++#include <winsock2.h> ++#endif + + #ifdef EV_EVENT_H + # include EV_EVENT_H diff --git a/vcpkg/ports/libev/0001-use-select-with-msvc.patch b/vcpkg/ports/libev/0001-use-select-with-msvc.patch new file mode 100644 index 0000000..989c0b5 --- /dev/null +++ b/vcpkg/ports/libev/0001-use-select-with-msvc.patch @@ -0,0 +1,13 @@ +diff --git a/ev.c b/ev.c +index ec212a1..b80b1e0 100644 +--- a/ev.c ++++ b/ev.c +@@ -90,7 +90,7 @@ + # define EV_USE_NANOSLEEP 0 + # endif + +-# if HAVE_SELECT && HAVE_SYS_SELECT_H ++# if HAVE_SELECT && (HAVE_SYS_SELECT_H || defined(_MSC_VER)) + # ifndef EV_USE_SELECT + # define EV_USE_SELECT EV_FEATURE_BACKENDS + # endif diff --git a/vcpkg/ports/libev/portfile.cmake b/vcpkg/ports/libev/portfile.cmake new file mode 100644 index 0000000..424385b --- /dev/null +++ b/vcpkg/ports/libev/portfile.cmake @@ -0,0 +1,36 @@ +vcpkg_download_distfile(ARCHIVE + URLS "http://dist.schmorp.de/libev/Attic/libev-4.33.tar.gz" + FILENAME "libev-4.33.tar.gz" + SHA512 c662a65360115e0b2598e3e8824cf7b33360c43a96ac9233f6b6ea2873a10102551773cad0e89e738541e75af9fd4f3e3c11cd2f251c5703aa24f193128b896b +) + +vcpkg_extract_source_archive( + SOURCE_PATH + ARCHIVE "${ARCHIVE}" + PATCHES "0000-event-fix-undefined-struct-timeval.patch" + "0001-use-select-with-msvc.patch" +) + +set(LIBEV_LINK_FLAGS "") + +if(VCPKG_TARGET_IS_WINDOWS) + list(APPEND LIBEV_LINK_FLAGS "LDFLAGS=-no-undefined -lws2_32 \$LDFLAGS") +endif() + +vcpkg_configure_make( + SOURCE_PATH "${SOURCE_PATH}" + AUTOCONFIG + OPTIONS ${LIBEV_LINK_FLAGS} +) + +vcpkg_install_make() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") + +file(RENAME "${CURRENT_PACKAGES_DIR}/include" "${CURRENT_PACKAGES_DIR}/include.tmp") +file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/include") +file(RENAME "${CURRENT_PACKAGES_DIR}/include.tmp" "${CURRENT_PACKAGES_DIR}/include/${PORT}") + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/unofficial-libev-config.cmake" + DESTINATION "${CURRENT_PACKAGES_DIR}/share/unofficial-${PORT}") diff --git a/vcpkg/ports/libev/unofficial-libev-config.cmake b/vcpkg/ports/libev/unofficial-libev-config.cmake new file mode 100644 index 0000000..c251558 --- /dev/null +++ b/vcpkg/ports/libev/unofficial-libev-config.cmake @@ -0,0 +1,25 @@ +if(NOT TARGET unofficial::libev::libev) + get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) + get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) + get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) + + add_library(unofficial::libev::libev UNKNOWN IMPORTED) + + set_target_properties(unofficial::libev::libev PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" + ) + + find_library(LIBEV_LIBRARY_DEBUG NAMES ev libev PATHS "${_IMPORT_PREFIX}/debug" PATH_SUFFIXES lib NO_DEFAULT_PATH) + if(EXISTS "${LIBEV_LIBRARY_DEBUG}") + set_property(TARGET unofficial::libev::libev APPEND PROPERTY IMPORTED_CONFIGURATIONS "Debug") + set_target_properties(unofficial::libev::libev PROPERTIES IMPORTED_LOCATION_DEBUG "${LIBEV_LIBRARY_DEBUG}") + endif() + + find_library(LIBEV_LIBRARY_RELEASE NAMES ev libev PATHS "${_IMPORT_PREFIX}/" PATH_SUFFIXES lib NO_DEFAULT_PATH) + if(EXISTS "${LIBEV_LIBRARY_RELEASE}") + set_property(TARGET unofficial::libev::libev APPEND PROPERTY IMPORTED_CONFIGURATIONS "Release") + set_target_properties(unofficial::libev::libev PROPERTIES IMPORTED_LOCATION_RELEASE "${LIBEV_LIBRARY_RELEASE}") + endif() + + unset(_IMPORT_PREFIX) +endif() diff --git a/vcpkg/ports/libev/vcpkg.json b/vcpkg/ports/libev/vcpkg.json new file mode 100644 index 0000000..809227f --- /dev/null +++ b/vcpkg/ports/libev/vcpkg.json @@ -0,0 +1,8 @@ +{ + "name": "libev", + "version": "4.33", + "port-version": 4, + "description": "libev is a high-performance event loop/event model with lots of features.", + "homepage": "http://software.schmorp.de/pkg/libev.html", + "license": "BSD-2-Clause OR GPL-2.0-or-later" +} |