aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>2020-05-21 05:20:37 +0800
committerGitHub <noreply@github.com>2020-05-20 14:20:37 -0700
commitac2233abc693459d2fb83fac5442cae4bdbf5a24 (patch)
treeb8e022c3b9984507a97b8cf2832e91a956925ae4
parent92ea5970ed80db5f609bcf2686001745a18cc748 (diff)
downloadvcpkg-ac2233abc693459d2fb83fac5442cae4bdbf5a24.tar.gz
vcpkg-ac2233abc693459d2fb83fac5442cae4bdbf5a24.zip
[grpc] Add feature absl-sync (#10307)
* [grpc] Update to 1.28.0 and add feature absl-sync * Update to 1.28.1 and fix linkage issues
-rw-r--r--ports/grpc/00010-add-feature-absl-sync.patch25
-rw-r--r--ports/grpc/CONTROL5
-rw-r--r--ports/grpc/portfile.cmake15
3 files changed, 39 insertions, 6 deletions
diff --git a/ports/grpc/00010-add-feature-absl-sync.patch b/ports/grpc/00010-add-feature-absl-sync.patch
new file mode 100644
index 000000000..e16b1c2e3
--- /dev/null
+++ b/ports/grpc/00010-add-feature-absl-sync.patch
@@ -0,0 +1,25 @@
+diff --git a/cmake/abseil-cpp.cmake b/cmake/abseil-cpp.cmake
+index 078d495..b6f50bd 100644
+--- a/cmake/abseil-cpp.cmake
++++ b/cmake/abseil-cpp.cmake
+@@ -37,4 +37,7 @@ elseif(gRPC_ABSL_PROVIDER STREQUAL "package")
+ # Use "CONFIG" as there is no built-in cmake module for absl.
+ find_package(absl REQUIRED CONFIG)
+ set(_gRPC_FIND_ABSL "if(NOT absl_FOUND)\n find_package(absl CONFIG)\nendif()")
++ if (gRPC_ABSL_SYNC_ENABLE)
++ add_definitions(-DGPR_ABSEIL_SYNC=1)
++ endif()
+ endif()
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index df1703c..7667662 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1464,6 +1464,8 @@ target_link_libraries(gpr
+ absl::str_format
+ absl::strings
+ absl::optional
++ absl::time
++ absl::synchronization
+ )
+ if(_gRPC_PLATFORM_ANDROID)
+ target_link_libraries(gpr
diff --git a/ports/grpc/CONTROL b/ports/grpc/CONTROL
index 452fc7c45..8c1df3be4 100644
--- a/ports/grpc/CONTROL
+++ b/ports/grpc/CONTROL
@@ -1,5 +1,8 @@
Source: grpc
-Version: 1.28.1
+Version: 1.28.1-1
Build-Depends: zlib, openssl, protobuf, c-ares (!uwp), upb, abseil
Homepage: https://github.com/grpc/grpc
Description: An RPC library and framework
+
+Feature: absl-sync
+Description: Use abseil synchronization module \ No newline at end of file
diff --git a/ports/grpc/portfile.cmake b/ports/grpc/portfile.cmake
index 6edddb739..39f1e6733 100644
--- a/ports/grpc/portfile.cmake
+++ b/ports/grpc/portfile.cmake
@@ -5,8 +5,8 @@ endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO grpc/grpc
- REF v1.28.1
- SHA512 5cc4993470e2df21447d032ddeb65ab4175bb8acad5a06fdd22564068b80a5be255ef0e44d36732642d39dc3eaec02a93d2aaf6e369ad5dc43ff99b5023f357b
+ REF cb81fe0dfaa424eb50de26fb7c904a27a78c3f76 #v1.28.1
+ SHA512 ff33c1afe413475846f53fd6b6921323019a6da2218fe4827e43e390e04ea073d8e56b0a9b32015233106a6d90a83eff0fa631df37a96036a9c810a4dc32ea4f
HEAD_REF master
PATCHES
00001-fix-uwp.patch
@@ -15,6 +15,7 @@ vcpkg_from_github(
00004-link-gdi32-on-windows.patch
00005-fix-uwp-error.patch
00009-use-system-upb.patch
+ 00010-add-feature-absl-sync.patch
snprintf.patch
)
@@ -33,10 +34,14 @@ else()
set(cares_CARES_PROVIDER "package")
endif()
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ absl-sync gRPC_ABSL_SYNC_ENABLE
+)
+
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
- OPTIONS
+ OPTIONS ${FEATURE_OPTIONS}
-DgRPC_INSTALL=ON
-DgRPC_BUILD_TESTS=OFF
-DgRPC_STATIC_LINKING=${gRPC_STATIC_LINKING}
@@ -53,13 +58,13 @@ vcpkg_configure_cmake(
-DgRPC_INSTALL_BINDIR:STRING=tools/grpc
-DgRPC_INSTALL_LIBDIR:STRING=lib
-DgRPC_INSTALL_INCLUDEDIR:STRING=include
- -DgRPC_INSTALL_CMAKEDIR:STRING=share/grpc
+ -DgRPC_INSTALL_CMAKEDIR:STRING=share/gRPC
-DgRPC_BUILD_CODEGEN=${gRPC_BUILD_CODEGEN}
)
vcpkg_install_cmake(ADD_BIN_TO_PATH)
-vcpkg_fixup_cmake_targets()
+vcpkg_fixup_cmake_targets(CONFIG_PATH share/gRPC TARGET_PATH share/gRPC)
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/grpc RENAME copyright)