diff options
Diffstat (limited to 'vcpkg/ports/fbthrift')
| -rw-r--r-- | vcpkg/ports/fbthrift/fix-deps.patch | 63 | ||||
| -rw-r--r-- | vcpkg/ports/fbthrift/fix-test.patch | 16 | ||||
| -rw-r--r-- | vcpkg/ports/fbthrift/folly-has-liburing.diff | 13 | ||||
| -rw-r--r-- | vcpkg/ports/fbthrift/portfile.cmake | 97 | ||||
| -rw-r--r-- | vcpkg/ports/fbthrift/vcpkg.json | 35 |
5 files changed, 224 insertions, 0 deletions
diff --git a/vcpkg/ports/fbthrift/fix-deps.patch b/vcpkg/ports/fbthrift/fix-deps.patch new file mode 100644 index 0000000..457c9de --- /dev/null +++ b/vcpkg/ports/fbthrift/fix-deps.patch @@ -0,0 +1,63 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c6b2b2a810..787a83bb1c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -105,24 +105,26 @@ endif () + + # Find required dependencies for thrift/lib + if (THRIFT_LIB_ONLY OR build_all) +- find_package(Gflags REQUIRED) +- find_package(Glog REQUIRED) ++ find_package(gflags CONFIG REQUIRED) ++ set(LIBGFLAGS_LIBRARY gflags::gflags) ++ find_package(glog CONFIG REQUIRED) ++ set(GLOG_LIBRARIES glog::glog) + find_package(folly CONFIG REQUIRED) + find_package(fizz CONFIG REQUIRED) + find_package(wangle CONFIG REQUIRED) + find_package(ZLIB REQUIRED) +- find_package(Zstd REQUIRED) ++ find_package(zstd CONFIG REQUIRED) ++ if(TARGET zstd::libzstd_shared) ++ set(ZSTD_LIBRARIES zstd::libzstd_shared) ++ elseif(TARGET zstd::libzstd_static) ++ set(ZSTD_LIBRARIES zstd::libzstd_static) ++ endif() + find_package(Xxhash REQUIRED) + find_package(mvfst CONFIG REQUIRED) + # https://cmake.org/cmake/help/v3.9/module/FindThreads.html + set(THREADS_PREFER_PTHREAD_FLAG ON) + find_package(Threads) + include_directories( +- ${LIBGFLAGS_INCLUDE_DIR} +- ${GLOG_INCLUDE_DIRS} +- ${OPENSSL_INCLUDE_DIR} +- ${ZSTD_INCLUDE_DIRS} +- ${Xxhash_INCLUDE_DIR} + ) + add_definitions("-DTHRIFT_HAVE_LIBSNAPPY=0") + if (THRIFT_LIB_ONLY) +diff --git a/thrift/cmake/FBThriftConfig.cmake.in b/thrift/cmake/FBThriftConfig.cmake.in +index 5464fa1665..3dd2763629 100644 +--- a/thrift/cmake/FBThriftConfig.cmake.in ++++ b/thrift/cmake/FBThriftConfig.cmake.in +@@ -29,9 +29,16 @@ else() + set_and_check(FBTHRIFT_COMPILER "@PACKAGE_BIN_INSTALL_DIR@/thrift1") + endif() + +-find_dependency(Xxhash REQUIRED) +-find_dependency(ZLIB REQUIRED) +-find_package(mvfst CONFIG REQUIRED) ++find_dependency(xxHash CONFIG) ++find_dependency(ZLIB) ++find_dependency(mvfst CONFIG) ++find_dependency(fizz CONFIG) ++find_dependency(fmt CONFIG) ++find_dependency(folly CONFIG) ++find_dependency(gflags CONFIG) ++find_dependency(glog CONFIG) ++find_dependency(wangle CONFIG) ++find_dependency(zstd CONFIG) + + if (NOT TARGET FBThrift::thriftcpp2) + include("${FBTHRIFT_CMAKE_DIR}/FBThriftTargets.cmake") diff --git a/vcpkg/ports/fbthrift/fix-test.patch b/vcpkg/ports/fbthrift/fix-test.patch new file mode 100644 index 0000000..918ea51 --- /dev/null +++ b/vcpkg/ports/fbthrift/fix-test.patch @@ -0,0 +1,16 @@ +diff --git a/thrift/lib/cpp2/CMakeLists.txt b/thrift/lib/cpp2/CMakeLists.txt
+index 439f0814..3374dd34 100644
+--- a/thrift/lib/cpp2/CMakeLists.txt
++++ b/thrift/lib/cpp2/CMakeLists.txt
+@@ -15,11 +15,6 @@
+ # Set the cpp2 directory
+ set(LIB_CPP2_HOME ${CMAKE_CURRENT_SOURCE_DIR})
+
+-if (enable_tests)
+- add_subdirectory(protocol/test)
+-endif ()
+-add_subdirectory(test)
+-
+ #######
+ # CMAKE variables only have local/subdirectory scope
+ # So even though this is defined in ../thrift/CMakeLists.txt as a variable
diff --git a/vcpkg/ports/fbthrift/folly-has-liburing.diff b/vcpkg/ports/fbthrift/folly-has-liburing.diff new file mode 100644 index 0000000..755a121 --- /dev/null +++ b/vcpkg/ports/fbthrift/folly-has-liburing.diff @@ -0,0 +1,13 @@ +diff --git a/thrift/lib/cpp2/security/SSLUtil.cpp b/thrift/lib/cpp2/security/SSLUtil.cpp +index 52a15b6..515e5b5 100644 +--- a/thrift/lib/cpp2/security/SSLUtil.cpp ++++ b/thrift/lib/cpp2/security/SSLUtil.cpp +@@ -133,7 +133,7 @@ folly::AsyncSocketTransport::UniquePtr moveToPlaintext(FizzSocket* fizzSock) { + + auto sock = fizzSock->template getUnderlyingTransport<folly::AsyncSocket>(); + folly::AsyncSocketTransport::UniquePtr plaintextTransport; +-#if defined(__linux__) && __has_include(<liburing.h>) ++#if defined(__linux__) && FOLLY_HAS_LIBURING + if (!sock && + fizzSock->template getUnderlyingTransport<folly::AsyncIoUringSocket>()) { + // `AsyncFdSocket` currently lacks uring support, so hardcode `AsyncSocket` diff --git a/vcpkg/ports/fbthrift/portfile.cmake b/vcpkg/ports/fbthrift/portfile.cmake new file mode 100644 index 0000000..aef64a4 --- /dev/null +++ b/vcpkg/ports/fbthrift/portfile.cmake @@ -0,0 +1,97 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO facebook/fbthrift + REF "v${VERSION}" + SHA512 957b58b32b7cd7cbf58ebe1e65f8c9befbe5d48d8fa33ea36ff40a04f6c34f362d88c03d0060fa6681cd7fc8b5aa7063fbd9c16ded23df0fb091031bcb0668c1 + HEAD_REF main + PATCHES + fix-deps.patch + fix-test.patch + folly-has-liburing.diff +) + +file(REMOVE "${SOURCE_PATH}/thrift/cmake/FindGMock.cmake") +file(REMOVE "${SOURCE_PATH}/thrift/cmake/FindOpenSSL.cmake") +file(REMOVE "${SOURCE_PATH}/thrift/cmake/FindZstd.cmake") +file(REMOVE "${SOURCE_PATH}/build/fbcode_builder/CMake/FindGflags.cmake") +file(REMOVE "${SOURCE_PATH}/build/fbcode_builder/CMake/FindGlog.cmake") +file(REMOVE "${SOURCE_PATH}/build/fbcode_builder/CMake/FindGMock.cmake") +file(REMOVE "${SOURCE_PATH}/build/fbcode_builder/CMake/FindLibEvent.cmake") +file(REMOVE "${SOURCE_PATH}/build/fbcode_builder/CMake/FindSodium.cmake") +file(REMOVE "${SOURCE_PATH}/build/fbcode_builder/CMake/FindZstd.cmake") + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + "-Dthriftpy=OFF" +) +vcpkg_cmake_install() +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/fbthrift) + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +# There should be no empty directories in vcpkg/packages/fbthrift_x64-linux +file(REMOVE_RECURSE + "${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp/test" + "${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp/transport/test" + "${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp/util/test" + "${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp2/async/metadata/test" + "${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp2/debug_thrift_data_difference/test" + "${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp2/detail/test" + "${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp2/dynamic/test" + "${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp2/folly_dynamic/test" + "${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp2/frozen/test" + "${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp2/patch/test" + "${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp2/protocol/detail/test" + "${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp2/protocol/test" + "${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp2/protocol/tool" + "${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp2/reflection/demo" + "${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp2/reflection/docs" + "${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp2/runtime/test" + "${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp2/schema/test" + "${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp2/security/extensions/test" + "${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp2/security/test" + "${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp2/server/test" + "${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp2/test" + "${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp2/transport/core/test" + "${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp2/transport/http2/common/test" + "${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp2/transport/http2/server/test" + "${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp2/transport/http2/test" + "${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp2/transport/inmemory/test" + "${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp2/transport/rocket/client/test" + "${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp2/transport/rocket/compression/test" + "${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp2/transport/rocket/framing/parser/test" + "${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp2/transport/rocket/payload/test" + "${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp2/transport/rocket/server/test" + "${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp2/util/gtest/test" + "${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp2/util/test" + "${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp2/visitation/test" + "${CURRENT_PACKAGES_DIR}/include/thrift/lib/py3/benchmark" + "${CURRENT_PACKAGES_DIR}/include/thrift/lib/py3/test" + "${CURRENT_PACKAGES_DIR}/include/thrift/lib/python/any/test" + "${CURRENT_PACKAGES_DIR}/include/thrift/lib/python/benchmark" + "${CURRENT_PACKAGES_DIR}/include/thrift/lib/python/capi/benchmark" + "${CURRENT_PACKAGES_DIR}/include/thrift/lib/python/conformance" + "${CURRENT_PACKAGES_DIR}/include/thrift/lib/python/conformance/test" + "${CURRENT_PACKAGES_DIR}/include/thrift/lib/python/server/test" + "${CURRENT_PACKAGES_DIR}/include/thrift/lib/python/test/adapters" + "${CURRENT_PACKAGES_DIR}/include/thrift/lib/python/test/cpp_conversion" + "${CURRENT_PACKAGES_DIR}/include/thrift/lib/thrift/annotation" +) + +vcpkg_copy_tools(TOOL_NAMES thrift1 AUTO_CLEAN) +vcpkg_copy_pdbs() + +if(EXISTS "${CURRENT_PACKAGES_DIR}/share/fbthrift/FBThriftConfig.cmake") + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/fbthrift/FBThriftConfig.cmake" + "${PACKAGE_PREFIX_DIR}/lib/cmake/fbthrift" "${PACKAGE_PREFIX_DIR}/share/fbthrift") + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/fbthrift/FBThriftConfig.cmake" + "${PACKAGE_PREFIX_DIR}/bin/thrift1.exe" "${PACKAGE_PREFIX_DIR}/tools/fbthrift/thrift1.exe") + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/fbthrift/FBThriftConfig.cmake" + "${PACKAGE_PREFIX_DIR}/bin/thrift1" "${PACKAGE_PREFIX_DIR}/tools/fbthrift/thrift1") +endif() + +# Only used internally and removed in master +vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/fbthrift/FBThriftTargets.cmake" "LOCATION_HH=\\\"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/thrift/compiler/location.hh\\\"" "" IGNORE_UNCHANGED) + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/vcpkg/ports/fbthrift/vcpkg.json b/vcpkg/ports/fbthrift/vcpkg.json new file mode 100644 index 0000000..ba0793e --- /dev/null +++ b/vcpkg/ports/fbthrift/vcpkg.json @@ -0,0 +1,35 @@ +{ + "name": "fbthrift", + "version-string": "2025.05.19.00", + "description": "Facebook's branch of Apache Thrift, including a new C++ server.", + "homepage": "https://github.com/facebook/fbthrift", + "license": "Apache-2.0", + "supports": "x64 & static", + "dependencies": [ + "boost-context", + "boost-filesystem", + "boost-program-options", + "boost-regex", + "boost-system", + "boost-thread", + "fizz", + "fmt", + "folly", + "gflags", + "glog", + "mvfst", + "openssl", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + }, + "wangle", + "xxhash", + "zlib", + "zstd" + ] +} |