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/rsocket | |
Diffstat (limited to 'vcpkg/ports/rsocket')
| -rw-r--r-- | vcpkg/ports/rsocket/fix-c2665.patch | 13 | ||||
| -rw-r--r-- | vcpkg/ports/rsocket/fix-cmake-config.patch | 26 | ||||
| -rw-r--r-- | vcpkg/ports/rsocket/fix-find-dependencies.patch | 94 | ||||
| -rw-r--r-- | vcpkg/ports/rsocket/fix-folly.patch | 13 | ||||
| -rw-r--r-- | vcpkg/ports/rsocket/fix-rsockserver-build-error.patch | 153 | ||||
| -rw-r--r-- | vcpkg/ports/rsocket/fix-yarpl.patch | 48 | ||||
| -rw-r--r-- | vcpkg/ports/rsocket/portfile.cmake | 47 | ||||
| -rw-r--r-- | vcpkg/ports/rsocket/use-cpp-17.patch | 13 | ||||
| -rw-r--r-- | vcpkg/ports/rsocket/vcpkg.json | 30 |
9 files changed, 437 insertions, 0 deletions
diff --git a/vcpkg/ports/rsocket/fix-c2665.patch b/vcpkg/ports/rsocket/fix-c2665.patch new file mode 100644 index 0000000..ffd48ed --- /dev/null +++ b/vcpkg/ports/rsocket/fix-c2665.patch @@ -0,0 +1,13 @@ +diff --git a/rsocket/RSocketServer.cpp b/rsocket/RSocketServer.cpp +index 3a9f6b2..e749eb1 100644 +--- a/rsocket/RSocketServer.cpp ++++ b/rsocket/RSocketServer.cpp +@@ -30,7 +30,7 @@ RSocketServer::RSocketServer( + std::shared_ptr<RSocketStats> stats) + : duplexConnectionAcceptor_(std::move(connectionAcceptor)), + setupResumeAcceptors_([] { +- return new rsocket::SetupResumeAcceptor{ ++ return rsocket::SetupResumeAcceptor{ + folly::EventBaseManager::get()->getExistingEventBase()}; + }), + connectionSet_(std::make_unique<ConnectionSet>()), diff --git a/vcpkg/ports/rsocket/fix-cmake-config.patch b/vcpkg/ports/rsocket/fix-cmake-config.patch new file mode 100644 index 0000000..d3bf7b8 --- /dev/null +++ b/vcpkg/ports/rsocket/fix-cmake-config.patch @@ -0,0 +1,26 @@ +diff --git a/cmake/rsocket-config.cmake.in b/cmake/rsocket-config.cmake.in +index d5579a85..ea12752a 100644 +--- a/cmake/rsocket-config.cmake.in ++++ b/cmake/rsocket-config.cmake.in +@@ -4,7 +4,7 @@ + @PACKAGE_INIT@ + + if(NOT TARGET rsocket::ReactiveSocket) +- include("${PACKAGE_PREFIX_DIR}/lib/cmake/rsocket/rsocket-exports.cmake") ++ include("${CMAKE_CURRENT_LIST_DIR}/rsocket-exports.cmake") + endif() + + if (NOT rsocket_FIND_QUIETLY) +diff --git a/yarpl/cmake/yarpl-config.cmake.in b/yarpl/cmake/yarpl-config.cmake.in +index d557b213..1b83fffc 100644 +--- a/yarpl/cmake/yarpl-config.cmake.in ++++ b/yarpl/cmake/yarpl-config.cmake.in +@@ -4,7 +4,7 @@ + @PACKAGE_INIT@ + + if(NOT TARGET yarpl::yarpl) +- include("${PACKAGE_PREFIX_DIR}/lib/cmake/yarpl/yarpl-exports.cmake") ++ include("${CMAKE_CURRENT_LIST_DIR}/yarpl-exports.cmake") + endif() + + set(YARPL_LIBRARIES yarpl::yarpl) diff --git a/vcpkg/ports/rsocket/fix-find-dependencies.patch b/vcpkg/ports/rsocket/fix-find-dependencies.patch new file mode 100644 index 0000000..287a6fa --- /dev/null +++ b/vcpkg/ports/rsocket/fix-find-dependencies.patch @@ -0,0 +1,94 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f69e907..22570b5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -124,7 +124,7 @@ option(BUILD_BENCHMARKS "Build benchmarks" ON) + option(BUILD_EXAMPLES "Build examples" ON) + option(BUILD_TESTS "Build tests" ON) + +-enable_testing() ++#enable_testing() + + include(ExternalProject) + include(CTest) +@@ -172,7 +172,9 @@ endif() + + if("${BUILD_TYPE_LOWER}" MATCHES "debug") + message("debug mode was set") ++ if (NOT WIN32) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unreachable-code") ++ endif() + else() + message("release mode was set") + endif() +@@ -181,18 +183,25 @@ if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") + set(TEST_CXX_FLAGS ${TEST_CXX_FLAGS} -Wno-inconsistent-missing-override) + endif() + +-find_library(DOUBLE-CONVERSION double-conversion) ++find_package(double-conversion CONFIG REQUIRED) + + find_package(OpenSSL REQUIRED) + +-find_package(Gflags REQUIRED) ++find_package(gflags CONFIG REQUIRED) + +-# find glog::glog to satisfy the folly dep. +-find_package(Glog REQUIRED) ++find_package(ZLIB REQUIRED) + +-find_package(fmt CONFIG REQUIRED) ++if (BUILD_SHARED_LIBS) ++ set(gflags gflags_shared) ++else() ++ set(gflags gflags_static) ++endif() + +-include_directories(SYSTEM ${OPENSSL_INCLUDE_DIR}) ++# find glog::glog to satisfy the folly dep. ++find_package(folly CONFIG REQUIRED) ++#find_package(glog CONFIG REQUIRED) ++# ++#find_package(fmt CONFIG REQUIRED) + + include_directories(SYSTEM ${GFLAGS_INCLUDE_DIR}) + +@@ -327,7 +336,7 @@ target_compile_options( + ReactiveSocket + PRIVATE ${EXTRA_CXX_FLAGS}) + +-enable_testing() ++#enable_testing() + + install(TARGETS ReactiveSocket EXPORT rsocket-exports DESTINATION lib) + install(DIRECTORY rsocket DESTINATION include FILES_MATCHING PATTERN "*.h") +@@ -470,7 +479,7 @@ if(BUILD_TESTS) + ${GMOCK_LIBS} # This also needs the preceding `add_dependencies` + glog::glog + gflags +- ${DOUBLE-CONVERSION}) ++ double-conversion::double-conversion) + + # Download the latest TCK drivers JAR. + set(TCK_DRIVERS_JAR rsocket-tck-drivers-0.9.10.jar) +diff --git a/yarpl/CMakeLists.txt b/yarpl/CMakeLists.txt +index f4159b8..8c01ffb 100644 +--- a/yarpl/CMakeLists.txt ++++ b/yarpl/CMakeLists.txt +@@ -53,8 +53,14 @@ endif() + # Using NDEBUG in Release builds. + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG") + +-find_package(Gflags REQUIRED) +-find_package(Glog REQUIRED) ++find_package(gflags CONFIG REQUIRED) ++if (BUILD_SHARED_LIBS) ++ set(gflags gflags_shared) ++else() ++ set(gflags gflags_static) ++endif() ++ ++find_package(glog CONFIG REQUIRED) + find_package(fmt CONFIG REQUIRED) + + IF(NOT FOLLY_VERSION) diff --git a/vcpkg/ports/rsocket/fix-folly.patch b/vcpkg/ports/rsocket/fix-folly.patch new file mode 100644 index 0000000..05d0031 --- /dev/null +++ b/vcpkg/ports/rsocket/fix-folly.patch @@ -0,0 +1,13 @@ +diff --git a/rsocket/transports/tcp/TcpConnectionAcceptor.cpp b/rsocket/transports/tcp/TcpConnectionAcceptor.cpp +index 12ac289f..c37f621a 100644 +--- a/rsocket/transports/tcp/TcpConnectionAcceptor.cpp ++++ b/rsocket/transports/tcp/TcpConnectionAcceptor.cpp +@@ -31,7 +31,7 @@ class TcpConnectionAcceptor::SocketCallback + + void connectionAccepted( + folly::NetworkSocket fdNetworkSocket, +- const folly::SocketAddress& address) noexcept override { ++ const folly::SocketAddress& address, AcceptInfo info) noexcept override { + int fd = fdNetworkSocket.toFd(); + + VLOG(2) << "Accepting TCP connection from " << address << " on FD " << fd; diff --git a/vcpkg/ports/rsocket/fix-rsockserver-build-error.patch b/vcpkg/ports/rsocket/fix-rsockserver-build-error.patch new file mode 100644 index 0000000..b7dd672 --- /dev/null +++ b/vcpkg/ports/rsocket/fix-rsockserver-build-error.patch @@ -0,0 +1,153 @@ +diff --git a/rsocket/RSocketServer.cpp b/rsocket/RSocketServer.cpp +index 1e20281..3a9f6b2 100644 +--- a/rsocket/RSocketServer.cpp ++++ b/rsocket/RSocketServer.cpp +@@ -125,7 +125,7 @@ void RSocketServer::acceptConnection( + weakConSet = std::weak_ptr<ConnectionSet>(connectionSet_), + scheduledResponder = useScheduledResponder_]( + std::unique_ptr<DuplexConnection> conn, +- SetupParameters params) mutable { ++ SetupParameters params) mutable noexcept{ + if (auto connectionSet = weakConSet.lock()) { + RSocketServer::onRSocketSetup( + serviceHandler, +@@ -135,12 +135,15 @@ void RSocketServer::acceptConnection( + std::move(params)); + } + }, +- std::bind( +- &RSocketServer::onRSocketResume, +- this, +- serviceHandler, +- std::placeholders::_1, +- std::placeholders::_2)); ++ [this, serviceHandler=serviceHandler]( ++ std::unique_ptr<DuplexConnection> connection, ++ ResumeParameters resumeParameters) mutable noexcept{ ++ this->onRSocketResume( ++ serviceHandler, ++ std::move(connection), ++ resumeParameters ++ ); ++ }); + } + + void RSocketServer::onRSocketSetup( +@@ -206,7 +209,7 @@ void RSocketServer::onRSocketSetup( + void RSocketServer::onRSocketResume( + std::shared_ptr<RSocketServiceHandler> serviceHandler, + std::unique_ptr<DuplexConnection> connection, +- ResumeParameters resumeParams) { ++ ResumeParameters resumeParams) noexcept{ + auto result = serviceHandler->onResume(resumeParams.token); + if (result.hasError()) { + stats_->resumeFailedNoState(); +diff --git a/rsocket/RSocketServer.h b/rsocket/RSocketServer.h +index 39dae66..e2346ef 100644 +--- a/rsocket/RSocketServer.h ++++ b/rsocket/RSocketServer.h +@@ -118,7 +118,7 @@ class RSocketServer { + void onRSocketResume( + std::shared_ptr<RSocketServiceHandler> serviceHandler, + std::unique_ptr<DuplexConnection> connection, +- rsocket::ResumeParameters setupPayload); ++ rsocket::ResumeParameters setupPayload)noexcept; + + const std::unique_ptr<ConnectionAcceptor> duplexConnectionAcceptor_; + bool started{false}; +diff --git a/yarpl/flowable/AsyncGeneratorShim.h b/yarpl/flowable/AsyncGeneratorShim.h +index 72d212c..79a09f1 100644 +--- a/yarpl/flowable/AsyncGeneratorShim.h ++++ b/yarpl/flowable/AsyncGeneratorShim.h +@@ -96,7 +96,7 @@ class AsyncGeneratorShim { + value.emplace(std::move(*item)); + } + } catch (const std::exception& ex) { +- value.emplaceException(std::current_exception(), ex); ++ value.emplaceException(std::current_exception()); + } catch (...) { + value.emplaceException(std::current_exception()); + } +diff --git a/yarpl/flowable/Flowable.h b/yarpl/flowable/Flowable.h +index 9dff78b..bccd70d 100644 +--- a/yarpl/flowable/Flowable.h ++++ b/yarpl/flowable/Flowable.h +@@ -494,7 +494,7 @@ std::shared_ptr<Flowable<T>> Flowable<T>::fromGenerator( + } + } catch (const std::exception& ex) { + subscriber.onError( +- folly::exception_wrapper(std::current_exception(), ex)); ++ folly::exception_wrapper(std::current_exception())); + } catch (...) { + subscriber.onError(std::runtime_error( + "Flowable::fromGenerator() threw from Subscriber:onNext()")); +diff --git a/yarpl/flowable/FlowableOperator.h b/yarpl/flowable/FlowableOperator.h +index 314ba7f..fe63504 100644 +--- a/yarpl/flowable/FlowableOperator.h ++++ b/yarpl/flowable/FlowableOperator.h +@@ -178,7 +178,7 @@ class MapOperator : public FlowableOperator<U, D> { + this->subscriberOnNext(flowable->function_(std::move(value))); + } + } catch (const std::exception& exn) { +- folly::exception_wrapper ew{std::current_exception(), exn}; ++ folly::exception_wrapper ew{std::current_exception()}; + this->terminateErr(std::move(ew)); + } + } +@@ -190,7 +190,7 @@ class MapOperator : public FlowableOperator<U, D> { + } + } catch (const std::exception& exn) { + this->terminateErr( +- folly::exception_wrapper{std::current_exception(), exn}); ++ folly::exception_wrapper{std::current_exception()}); + } + } + +@@ -570,7 +570,7 @@ class FlatMapOperator : public FlowableOperator<T, R> { + try { + mappedStream = flowable_->function_(std::move(value)); + } catch (const std::exception& exn) { +- folly::exception_wrapper ew{std::current_exception(), exn}; ++ folly::exception_wrapper ew{std::current_exception()}; + { + std::lock_guard<std::mutex> g(onErrorExGuard_); + onErrorEx_ = ew; +diff --git a/yarpl/flowable/Subscriber.h b/yarpl/flowable/Subscriber.h +index d1dc3b5..582f9c4 100644 +--- a/yarpl/flowable/Subscriber.h ++++ b/yarpl/flowable/Subscriber.h +@@ -301,7 +301,7 @@ class Base : public LambdaSubscriber<T> { + next_(std::move(value)); + } catch (const std::exception& exn) { + this->cancel(); +- auto ew = folly::exception_wrapper{std::current_exception(), exn}; ++ auto ew = folly::exception_wrapper{std::current_exception()}; + LOG(ERROR) << "'next' method should not throw: " << ew.what(); + onErrorImpl(ew); + return; +diff --git a/yarpl/observable/ObservableOperator.h b/yarpl/observable/ObservableOperator.h +index 451c6bd..0e60b48 100644 +--- a/yarpl/observable/ObservableOperator.h ++++ b/yarpl/observable/ObservableOperator.h +@@ -196,7 +196,7 @@ class MapOperator : public ObservableOperator<U, D> { + try { + this->observerOnNext(observable_->function_(std::move(value))); + } catch (const std::exception& exn) { +- folly::exception_wrapper ew{std::current_exception(), exn}; ++ folly::exception_wrapper ew{std::current_exception()}; + this->terminateErr(std::move(ew)); + } + } +diff --git a/yarpl/single/SingleOperator.h b/yarpl/single/SingleOperator.h +index 0b3e739..4defd64 100644 +--- a/yarpl/single/SingleOperator.h ++++ b/yarpl/single/SingleOperator.h +@@ -197,7 +197,7 @@ class MapOperator : public SingleOperator<U, D> { + auto map_operator = this->getOperator(); + this->observerOnSuccess(map_operator->function_(std::move(value))); + } catch (const std::exception& exn) { +- folly::exception_wrapper ew{std::current_exception(), exn}; ++ folly::exception_wrapper ew{std::current_exception()}; + this->observerOnError(std::move(ew)); + } + } diff --git a/vcpkg/ports/rsocket/fix-yarpl.patch b/vcpkg/ports/rsocket/fix-yarpl.patch new file mode 100644 index 0000000..ddc5c28 --- /dev/null +++ b/vcpkg/ports/rsocket/fix-yarpl.patch @@ -0,0 +1,48 @@ +diff --git a/rsocket/transports/tcp/TcpConnectionFactory.cpp b/rsocket/transports/tcp/TcpConnectionFactory.cpp +index b970cd75..cba4405e 100644 +--- a/rsocket/transports/tcp/TcpConnectionFactory.cpp ++++ b/rsocket/transports/tcp/TcpConnectionFactory.cpp +@@ -41,7 +41,7 @@ class ConnectCallback : public folly::AsyncSocket::ConnectCallback { + DCHECK(evb); + + if (sslContext) { +-#if !FOLLY_OPENSSL_HAS_ALPN ++#if 0 + // setAdvertisedNextProtocols() is unavailable + #error ALPN is required for rsockets. \ + Your version of OpenSSL is likely too old. +diff --git a/yarpl/CMakeLists.txt b/yarpl/CMakeLists.txt +index f4159b82..33364f58 100644 +--- a/yarpl/CMakeLists.txt ++++ b/yarpl/CMakeLists.txt +@@ -9,7 +9,7 @@ set(CMAKE_MODULE_PATH + ${CMAKE_MODULE_PATH} + ) + +-add_definitions(-std=c++14) ++add_definitions(-std=c++17) + option(BUILD_TESTS "BUILD_TESTS" ON) + + # Generate compilation database +@@ -17,7 +17,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS 1) + + # Common configuration for all build modes. + if (NOT MSVC) +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-unused-parameter") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-weak-vtables -Wno-padded") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer") +diff --git a/yarpl/flowable/Flowable_FromObservable.h b/yarpl/flowable/Flowable_FromObservable.h +index e191ad7c..ce8565c8 100644 +--- a/yarpl/flowable/Flowable_FromObservable.h ++++ b/yarpl/flowable/Flowable_FromObservable.h +@@ -180,7 +180,7 @@ class BufferBackpressureStrategy : public BackpressureStrategyBase<T> { + static constexpr size_t kNoLimit = 0; + + explicit BufferBackpressureStrategy(size_t bufferSizeLimit = kNoLimit) +- : buffer_(folly::in_place, bufferSizeLimit) {} ++ : buffer_(std::in_place, bufferSizeLimit) {} + + private: + using Super = BackpressureStrategyBase<T>; diff --git a/vcpkg/ports/rsocket/portfile.cmake b/vcpkg/ports/rsocket/portfile.cmake new file mode 100644 index 0000000..fab0ca1 --- /dev/null +++ b/vcpkg/ports/rsocket/portfile.cmake @@ -0,0 +1,47 @@ +# yarpl only support static build in Windows +if (VCPKG_TARGET_IS_WINDOWS) + vcpkg_check_linkage(ONLY_STATIC_LIBRARY) +endif() + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO rsocket/rsocket-cpp + REF 45ed594ebd6701f40795c31ec922d784ec7fc921 + SHA512 51871253524b93a9622fa0f562019605b6034e4089cd955810050b4d43ff020813d632ea1e91bcaca0a8659638908c51df6eb686ba4f6583d4c15c04d5dc35bd + HEAD_REF master + PATCHES + fix-cmake-config.patch + fix-find-dependencies.patch + use-cpp-17.patch + fix-folly.patch + fix-rsockserver-build-error.patch + fix-yarpl.patch + fix-c2665.patch +) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DBUILD_EXAMPLES=OFF + -DBUILD_TESTS=OFF + -DBUILD_BENCHMARKS=OFF +) + +vcpkg_cmake_install() + +vcpkg_copy_pdbs() + +vcpkg_cmake_config_fixup(PACKAGE_NAME yarpl CONFIG_PATH lib/cmake/yarpl DO_NOT_DELETE_PARENT_CONFIG_PATH) +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/rsocket) + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share") + +file(REMOVE_RECURSE + "${CURRENT_PACKAGES_DIR}/include/yarpl/perf" + "${CURRENT_PACKAGES_DIR}/include/yarpl/cmake" + "${CURRENT_PACKAGES_DIR}/include/yarpl/test" + "${CURRENT_PACKAGES_DIR}/include/rsocket/examples" + "${CURRENT_PACKAGES_DIR}/include/rsocket/test" +) + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/vcpkg/ports/rsocket/use-cpp-17.patch b/vcpkg/ports/rsocket/use-cpp-17.patch new file mode 100644 index 0000000..4ef2f8a --- /dev/null +++ b/vcpkg/ports/rsocket/use-cpp-17.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 22570b5..15a750b 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -154,7 +154,7 @@ if(BUILD_TESTS)
+
+ endif()
+
+-set(CMAKE_CXX_STANDARD 14)
++set(CMAKE_CXX_STANDARD 17)
+
+ include(CheckCXXCompilerFlag)
+
diff --git a/vcpkg/ports/rsocket/vcpkg.json b/vcpkg/ports/rsocket/vcpkg.json new file mode 100644 index 0000000..3bace5a --- /dev/null +++ b/vcpkg/ports/rsocket/vcpkg.json @@ -0,0 +1,30 @@ +{ + "name": "rsocket", + "version-string": "2021.08.30.00", + "port-version": 5, + "description": "C++ implementation of RSocket http://rsocket.io", + "homepage": "https://github.com/rsocket/rsocket-cpp", + "dependencies": [ + "boost-context", + "boost-filesystem", + "boost-program-options", + "boost-regex", + "boost-system", + "boost-thread", + "double-conversion", + "fmt", + "folly", + "gflags", + "glog", + "openssl", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + }, + "zlib" + ] +} |