diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/libgossip | |
Diffstat (limited to 'vcpkg/ports/libgossip')
| -rw-r--r-- | vcpkg/ports/libgossip/fix-dependencies.patch | 28 | ||||
| -rw-r--r-- | vcpkg/ports/libgossip/portfile.cmake | 26 | ||||
| -rw-r--r-- | vcpkg/ports/libgossip/remove-export-headers.patch | 12 | ||||
| -rw-r--r-- | vcpkg/ports/libgossip/support-uwp.patch | 28 | ||||
| -rw-r--r-- | vcpkg/ports/libgossip/vcpkg.json | 18 |
5 files changed, 112 insertions, 0 deletions
diff --git a/vcpkg/ports/libgossip/fix-dependencies.patch b/vcpkg/ports/libgossip/fix-dependencies.patch new file mode 100644 index 0000000..7684388 --- /dev/null +++ b/vcpkg/ports/libgossip/fix-dependencies.patch @@ -0,0 +1,28 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5d6f2f9..fd8d384 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -30,7 +30,7 @@ add_library(libgossip ${LIBGOSSIP_CORE_SRC}) + add_library(libgossip::core ALIAS libgossip) + + # Handle ASIO dependency +-setup_bundled_asio() ++find_package(asio CONFIG REQUIRED) + + # Network library + set(LIBGOSSIP_NET_SRC src/net/udp_transport.cpp src/net/tcp_transport.cpp +@@ -41,10 +41,10 @@ add_library(libgossip_net ${LIBGOSSIP_NET_SRC}) + add_library(libgossip::network ALIAS libgossip_net) + + # Find and link ASIO +-if(ASIO_FOUND) +- target_include_directories( +- libgossip_net PUBLIC $<BUILD_INTERFACE:${ASIO_INCLUDE_DIR}> +- $<INSTALL_INTERFACE:include>) ++if(1) ++ target_link_libraries( ++ libgossip_net PUBLIC $<BUILD_INTERFACE:asio::asio> ++ ) + else() + message(FATAL_ERROR "ASIO is required for the network library") + endif() diff --git a/vcpkg/ports/libgossip/portfile.cmake b/vcpkg/ports/libgossip/portfile.cmake new file mode 100644 index 0000000..3fd4ca1 --- /dev/null +++ b/vcpkg/ports/libgossip/portfile.cmake @@ -0,0 +1,26 @@ +if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_check_linkage(ONLY_STATIC_LIBRARY) # DLL broken in 1.1.2.0 +endif() + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO caomengxuan666/libgossip + REF "v${VERSION}" + SHA512 64320a74b1be5270bba2ea213c7a76900626d54afe4b6a0381dfdf0b2d5a64cab0e8e00234f3c75f232a6d1b4579931cbf3bc8b92503fccf7b815973ab2ed010 + HEAD_REF main + PATCHES + fix-dependencies.patch + remove-export-headers.patch + support-uwp.patch +) +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DBUILD_TESTS=OFF + -DBUILD_EXAMPLES=OFF + -DBUILD_PYTHON_BINDINGS=OFF +) +vcpkg_cmake_install() +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/libgossip) +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/vcpkg/ports/libgossip/remove-export-headers.patch b/vcpkg/ports/libgossip/remove-export-headers.patch new file mode 100644 index 0000000..3901cb2 --- /dev/null +++ b/vcpkg/ports/libgossip/remove-export-headers.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index dd29ed7..271b03a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -112,7 +112,6 @@ configure_package_config_file( + install( + FILES ${CMAKE_CURRENT_BINARY_DIR}/libgossipConfig.cmake + ${CMAKE_CURRENT_BINARY_DIR}/libgossipConfigVersion.cmake +- ${CMAKE_CURRENT_BINARY_DIR}/libgossip_export.h + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libgossip) + + # Process examples if enabled diff --git a/vcpkg/ports/libgossip/support-uwp.patch b/vcpkg/ports/libgossip/support-uwp.patch new file mode 100644 index 0000000..8786b67 --- /dev/null +++ b/vcpkg/ports/libgossip/support-uwp.patch @@ -0,0 +1,28 @@ +diff --git a/src/net/tcp_transport.cpp b/src/net/tcp_transport.cpp +index 90c6e31..0ad2b07 100644 +--- a/src/net/tcp_transport.cpp ++++ b/src/net/tcp_transport.cpp +@@ -1,4 +1,9 @@ + #include "net/tcp_transport.hpp" ++ ++// For UWP applications ++#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP) ++#define ASIO_WINDOWS_APP ++#endif + #include <asio.hpp> + #include <chrono> + #include <functional> +diff --git a/src/net/udp_transport.cpp b/src/net/udp_transport.cpp +index f958a88..fc56509 100644 +--- a/src/net/udp_transport.cpp ++++ b/src/net/udp_transport.cpp +@@ -1,4 +1,9 @@ + #include "net/udp_transport.hpp" ++ ++// For UWP applications ++#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP) ++#define ASIO_WINDOWS_APP ++#endif + #include <asio.hpp> + #include <chrono> + #include <functional> diff --git a/vcpkg/ports/libgossip/vcpkg.json b/vcpkg/ports/libgossip/vcpkg.json new file mode 100644 index 0000000..532d34d --- /dev/null +++ b/vcpkg/ports/libgossip/vcpkg.json @@ -0,0 +1,18 @@ +{ + "name": "libgossip", + "version": "1.1.2.0", + "description": "A C++17 implementation of the Gossip protocol, designed for decentralized distributed systems.", + "homepage": "https://github.com/caomengxuan666/libgossip", + "license": "MIT", + "dependencies": [ + "asio", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} |