[libev] Fix build on windows (#39985)

This commit is contained in:
Alex 2024-07-31 00:20:13 +03:00 committed by GitHub
parent 136a0d8b8c
commit cef7db8009
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 30 additions and 4 deletions

View File

@ -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

View File

@ -7,11 +7,19 @@ vcpkg_download_distfile(ARCHIVE
vcpkg_extract_source_archive( vcpkg_extract_source_archive(
SOURCE_PATH SOURCE_PATH
ARCHIVE "${ARCHIVE}" ARCHIVE "${ARCHIVE}"
PATCHES "0000-event-fix-undefined-struct-timeval.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( vcpkg_configure_make(
SOURCE_PATH "${SOURCE_PATH}" SOURCE_PATH "${SOURCE_PATH}"
AUTOCONFIG AUTOCONFIG
OPTIONS ${LIBEV_LINK_FLAGS}
) )
vcpkg_install_make() vcpkg_install_make()

View File

@ -1,9 +1,8 @@
{ {
"name": "libev", "name": "libev",
"version": "4.33", "version": "4.33",
"port-version": 2, "port-version": 3,
"description": "libev is a high-performance event loop/event model with lots of features.", "description": "libev is a high-performance event loop/event model with lots of features.",
"homepage": "http://software.schmorp.de/pkg/libev.html", "homepage": "http://software.schmorp.de/pkg/libev.html",
"license": "BSD-2-Clause OR GPL-2.0-or-later", "license": "BSD-2-Clause OR GPL-2.0-or-later"
"supports": "!windows"
} }

View File

@ -4414,7 +4414,7 @@
}, },
"libev": { "libev": {
"baseline": "4.33", "baseline": "4.33",
"port-version": 2 "port-version": 3
}, },
"libevent": { "libevent": {
"baseline": "2.1.12+20230128", "baseline": "2.1.12+20230128",

View File

@ -1,5 +1,10 @@
{ {
"versions": [ "versions": [
{
"git-tree": "048b4e081061376e4e6fdcd18670669162f79c7a",
"version": "4.33",
"port-version": 3
},
{ {
"git-tree": "1287c21bdb7398762b3906c5daaab7b537bea188", "git-tree": "1287c21bdb7398762b3906c5daaab7b537bea188",
"version": "4.33", "version": "4.33",