Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ports/grpc/snprintf.patch → ports/grpc/00006-snprintf.patch
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
diff --git a/src/core/tsi/alts/crypt/aes_gcm.cc b/src/core/tsi/alts/crypt/aes_gcm.cc
index 02b1ac4492..191f462277 100644
index b761224..70d1696 100644
--- a/src/core/tsi/alts/crypt/aes_gcm.cc
+++ b/src/core/tsi/alts/crypt/aes_gcm.cc
@@ -26,6 +26,7 @@
@@ -25,6 +25,7 @@
#include <openssl/err.h>
#include <openssl/evp.h>
#include <openssl/hmac.h>
#include <string.h>
+#include <cstdio>

#include <grpc/support/alloc.h>
Comment thread
JonLiu1993 marked this conversation as resolved.
Outdated
Expand Down
32 changes: 12 additions & 20 deletions ports/grpc/00009-use-system-upb.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c87e35a..24b619f 100644
index 1c3146b..ae06ea3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -84,6 +84,9 @@ set_property(CACHE gRPC_SSL_PROVIDER PROPERTY STRINGS "module" "package")
Expand All @@ -12,32 +12,23 @@ index c87e35a..24b619f 100644
set(gRPC_PROTOBUF_PACKAGE_TYPE "" CACHE STRING "Algorithm for searching protobuf package")
set_property(CACHE gRPC_PROTOBUF_PACKAGE_TYPE PROPERTY STRINGS "CONFIG" "MODULE")

@@ -2079,7 +2082,6 @@ target_link_libraries(grpc
gpr
${_gRPC_SSL_LIBRARIES}
address_sorting
@@ -1504,7 +1507,6 @@ target_link_libraries(gpr
absl::synchronization
absl::time
absl::optional
- upb
)
if(_gRPC_PLATFORM_IOS OR _gRPC_PLATFORM_MAC)
target_link_libraries(grpc "-framework CoreFoundation")
@@ -2624,7 +2626,6 @@ target_link_libraries(grpc_unsecure
absl::statusor
gpr
address_sorting
- upb
)
if(_gRPC_PLATFORM_IOS OR _gRPC_PLATFORM_MAC)
target_link_libraries(grpc_unsecure "-framework CoreFoundation")
@@ -3805,7 +3806,7 @@ if(gRPC_INSTALL)
endif()
if(_gRPC_PLATFORM_ANDROID)
target_link_libraries(gpr
@@ -3927,6 +3929,7 @@ endif()

endif()
-
+if (gRPC_UPB_PROVIDER STREQUAL "module")
add_library(upb
third_party/upb/upb/decode_fast.c
third_party/upb/upb/decode.c
@@ -3863,7 +3864,7 @@ if(gRPC_INSTALL)
@@ -3984,7 +3987,7 @@ if(gRPC_INSTALL)
)
endif()

Expand All @@ -59,7 +50,7 @@ index 3623f4a..df6ced5 100644
# Targets
include(${CMAKE_CURRENT_LIST_DIR}/gRPCTargets.cmake)
diff --git a/cmake/upb.cmake b/cmake/upb.cmake
index f2a0e50..c1c65f5 100644
index f2a0e50..ac6d397 100644
--- a/cmake/upb.cmake
+++ b/cmake/upb.cmake
@@ -12,9 +12,21 @@
Expand All @@ -84,3 +75,4 @@ index f2a0e50..c1c65f5 100644
+ set(upb ${_gRPC_UPB_LIBRARIES})
+ set(_gRPC_FIND_UPB "if(NOT upb_FOUND)\n find_package(upb CONFIG REQUIRED)\nendif()")
+endif()
\ No newline at end of file
26 changes: 13 additions & 13 deletions ports/grpc/00010-add-feature-absl-sync.patch
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 24b619f..f7a11b9 100644
index ae06ea3..8b64438 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2076,6 +2076,8 @@ target_link_libraries(grpc
@@ -2180,6 +2180,8 @@ target_link_libraries(grpc
${_gRPC_UPB_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
absl::flat_hash_map
+ absl::time
+ absl::synchronization
+ absl::synchronization
Comment thread
JonLiu1993 marked this conversation as resolved.
Outdated
absl::inlined_vector
absl::bind_front
absl::statusor
@@ -2623,6 +2625,8 @@ target_link_libraries(grpc_unsecure
@@ -2733,6 +2735,8 @@ target_link_libraries(grpc_unsecure
${_gRPC_UPB_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
absl::flat_hash_map
absl::inlined_vector
+ absl::time
+ absl::synchronization
+ absl::synchronization
absl::inlined_vector
absl::bind_front
absl::statusor
gpr
address_sorting
diff --git a/cmake/abseil-cpp.cmake b/cmake/abseil-cpp.cmake
index 078d495..b6f50bd 100644
index c89ba26..68ae4fd 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.
@@ -35,3 +35,6 @@ elseif(gRPC_ABSL_PROVIDER STREQUAL "package")
find_package(absl REQUIRED CONFIG)
set(_gRPC_FIND_ABSL "if(NOT absl_FOUND)\n find_package(absl CONFIG)\nendif()")
endif()
set(_gRPC_FIND_ABSL "if(NOT TARGET absl::strings)\n find_package(absl CONFIG)\nendif()")
+ if (gRPC_ABSL_SYNC_ENABLE)
+ add_definitions(-DGPR_ABSEIL_SYNC=1)
+ endif()
endif()
\ No newline at end of file
8 changes: 4 additions & 4 deletions ports/grpc/00014-pkgconfig-upbdefs.patch
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3808016..059a16b 100644
index 01988c2..b304cc9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -15516,7 +15516,7 @@ generate_pkgconfig(
@@ -17705,7 +17705,7 @@ generate_pkgconfig(
"high performance general RPC framework"
"${gRPC_CORE_VERSION}"
"gpr openssl"
- "-lgrpc -laddress_sorting -lre2 -lupb -lcares -lz -labsl_statusor -labsl_status -labsl_raw_hash_set -labsl_hashtablez_sampler -labsl_synchronization -labsl_time -labsl_time_zone -labsl_civil_time -labsl_graphcycles_internal -labsl_symbolize -labsl_demangle_internal -labsl_malloc_internal -labsl_stacktrace -labsl_debugging_internal -labsl_exponential_biased -labsl_cord -labsl_str_format_internal -labsl_hash -labsl_bad_variant_access -labsl_bad_optional_access -labsl_strings -labsl_strings_internal -labsl_base -labsl_spinlock_wait -labsl_int128 -labsl_city -labsl_throw_delegate -labsl_raw_logging_internal -labsl_log_severity"
"gpr openssl absl_base absl_bind_front absl_cord absl_core_headers absl_flat_hash_map absl_inlined_vector absl_memory absl_optional absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_variant"
- "-lgrpc -laddress_sorting -lre2 -lupb -lcares -lz"
+ "-lgrpc -lgrpc_upbdefs -laddress_sorting -lre2 -lupb_fastdecode -lupb_json -lupb_pb -lupb_handlers -lupb_textformat -lupb_reflection -lupb -lcares -lz -labsl_statusor -labsl_status -labsl_raw_hash_set -labsl_hashtablez_sampler -labsl_synchronization -labsl_time -labsl_time_zone -labsl_civil_time -labsl_graphcycles_internal -labsl_symbolize -labsl_demangle_internal -labsl_malloc_internal -labsl_stacktrace -labsl_debugging_internal -labsl_exponential_biased -labsl_cord -labsl_str_format_internal -labsl_hash -labsl_bad_variant_access -labsl_bad_optional_access -labsl_strings -labsl_strings_internal -labsl_base -labsl_spinlock_wait -labsl_int128 -labsl_city -labsl_throw_delegate -labsl_raw_logging_internal -labsl_log_severity"
Comment thread
JonLiu1993 marked this conversation as resolved.
Outdated
""
"grpc.pc")
Expand Down
29 changes: 14 additions & 15 deletions ports/grpc/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO grpc/grpc
REF 44c40ac23023b7b3dd82744372c06817cc203898 # v1.37.0
SHA512 dacd85b3a94cb759a086239aa2661f1b93728a1554ebc0f10c42aeb49c0d6309963832324773c3a153c3d2fcf807cb55b0e197b128e0a4e199c9e19a3976abd6
REF fc662b7964384b701af5bd3ce6994d2180080eb4 # v1.41.0
SHA512 ebb534b5d55f1a84c5ee2ea75f2ef871819d278966dec2610877c2f8ddd87bae80a63cbab0393fb37b81844f261327848821ac641b55963583288e6ec3b94e62
HEAD_REF master
PATCHES
00001-fix-uwp.patch
Expand All @@ -17,7 +17,7 @@ vcpkg_from_github(
00009-use-system-upb.patch
00010-add-feature-absl-sync.patch
00011-fix-csharp_plugin.patch
snprintf.patch
00006-snprintf.patch
00012-fix-use-cxx17.patch
00013-build-upbdefs.patch
00014-pkgconfig-upbdefs.patch
Expand All @@ -43,9 +43,8 @@ vcpkg_check_features(
codegen gRPC_BUILD_CODEGEN
)

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS ${FEATURE_OPTIONS}
-DgRPC_INSTALL=ON
-DgRPC_BUILD_TESTS=OFF
Expand All @@ -59,20 +58,20 @@ vcpkg_configure_cmake(
-DgRPC_RE2_PROVIDER=package
-DgRPC_PROTOBUF_PACKAGE_TYPE=CONFIG
-DgRPC_CARES_PROVIDER=${cares_CARES_PROVIDER}
-DgRPC_GFLAGS_PROVIDER=none
-DgRPC_BENCHMARK_PROVIDER=none
-DgRPC_INSTALL_CSHARP_EXT=OFF
-DgRPC_INSTALL_BINDIR:STRING=bin
-DgRPC_INSTALL_LIBDIR:STRING=lib
-DgRPC_INSTALL_INCLUDEDIR:STRING=include
-DgRPC_INSTALL_CMAKEDIR:STRING=share/grpc
-D_gRPC_PROTOBUF_PROTOC_EXECUTABLE=${CURRENT_HOST_INSTALLED_DIR}/tools/protobuf/protoc${VCPKG_HOST_EXECUTABLE_SUFFIX}
-DPROTOBUF_PROTOC_EXECUTABLE=${CURRENT_HOST_INSTALLED_DIR}/tools/protobuf/protoc${VCPKG_HOST_EXECUTABLE_SUFFIX}
-D_gRPC_PROTOBUF_PROTOC_EXECUTABLE="${CURRENT_HOST_INSTALLED_DIR}/tools/protobuf/protoc${VCPKG_HOST_EXECUTABLE_SUFFIX}"
-DPROTOBUF_PROTOC_EXECUTABLE="${CURRENT_HOST_INSTALLED_DIR}/tools/protobuf/protoc${VCPKG_HOST_EXECUTABLE_SUFFIX}"
MAYBE_UNUSED_VARIABLES
gRPC_MSVC_STATIC_RUNTIME
)

vcpkg_install_cmake(ADD_BIN_TO_PATH)
vcpkg_cmake_install(ADD_BIN_TO_PATH)

vcpkg_fixup_cmake_targets()
vcpkg_cmake_config_fixup()

if (gRPC_BUILD_CODEGEN)
vcpkg_copy_tools(
Expand All @@ -87,14 +86,14 @@ if (gRPC_BUILD_CODEGEN)
grpc_ruby_plugin
)
else()
configure_file(${CMAKE_CURRENT_LIST_DIR}/gRPCTargets-vcpkg-tools.cmake ${CURRENT_PACKAGES_DIR}/share/grpc/gRPCTargets-vcpkg-tools.cmake @ONLY)
configure_file("${CMAKE_CURRENT_LIST_DIR}/gRPCTargets-vcpkg-tools.cmake" "${CURRENT_PACKAGES_DIR}/share/grpc/gRPCTargets-vcpkg-tools.cmake" @ONLY)
endif()

# Ignore the C# extension DLL in bin/
SET(VCPKG_POLICY_EMPTY_PACKAGE enabled)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

vcpkg_copy_pdbs()

file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake" @ONLY)
11 changes: 9 additions & 2 deletions ports/grpc/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "grpc",
"version-semver": "1.37.0",
"port-version": 4,
"version-semver": "1.41.0",
"description": "An RPC library and framework",
"homepage": "https://github.com/grpc/grpc",
"dependencies": [
Expand All @@ -25,6 +24,14 @@
},
"re2",
"upb",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
},
"zlib"
],
"features": {
Expand Down
41 changes: 7 additions & 34 deletions ports/upb/add-all-libs-target.patch
Original file line number Diff line number Diff line change
@@ -1,52 +1,25 @@
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index 0155a7b..7850b2d 100644
index b4f43f9..c90968f 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -66,7 +66,7 @@ endif()
enable_testing()

add_library(port INTERFACE)
-add_library(descriptor_upbproto INTERFACE)
+add_library(descriptor_upb_proto INTERFACE)
add_library(upb
../upb/decode.c
../upb/decode.int.h
@@ -167,6 +167,25 @@ target_link_libraries(upb_json
upb_pb)
add_library(wyhash INTERFACE)
@@ -137,4 +137,20 @@ add_library(table INTERFACE)
target_link_libraries(table INTERFACE
port)

+add_library(all_libs INTERFACE)
+target_link_libraries(all_libs
+ INTERFACE
+ upb
+ fastdecode
+ upb_json
+ upb_pb
+ utf8_range
+ json
+ port
+ table
+ descriptor_upb_proto
+ handlers
+ reflection
+ textformat
+)
+set_target_properties(reflection PROPERTIES OUTPUT_NAME upb_reflection)
+set_target_properties(handlers PROPERTIES OUTPUT_NAME upb_handlers)
+set_target_properties(fastdecode PROPERTIES OUTPUT_NAME upb_fastdecode)
+set_target_properties(textformat PROPERTIES OUTPUT_NAME upb_textformat)
+
install(
DIRECTORY ../upb
DESTINATION include
@@ -184,9 +203,11 @@ install(TARGETS
upb_pb
port
table
- descriptor_upbproto
+ descriptor_upb_proto
handlers
reflection
+ textformat
+ all_libs
EXPORT upb-config
)
install(EXPORT upb-config NAMESPACE upb:: DESTINATION share/upb)

26 changes: 9 additions & 17 deletions ports/upb/add-cmake-install.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index d4cbcc9..a6b432f 100644
index c90968f..50637ec 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -8,7 +8,7 @@ else()
Expand All @@ -11,17 +11,9 @@ index d4cbcc9..a6b432f 100644
cmake_policy(SET CMP0048 NEW)

project(upb)
@@ -62,6 +62,7 @@ endif()
enable_testing()

add_library(port INTERFACE)
+add_library(descriptor_upbproto INTERFACE)
add_library(upb
../upb/decode.c
../upb/decode.int.h
@@ -162,4 +163,27 @@ target_link_libraries(upb_json
upb_pb)
add_library(wyhash INTERFACE)
@@ -154,3 +154,27 @@ set_target_properties(reflection PROPERTIES OUTPUT_NAME upb_reflection)
set_target_properties(fastdecode PROPERTIES OUTPUT_NAME upb_fastdecode)
set_target_properties(textformat PROPERTIES OUTPUT_NAME upb_textformat)

+install(
+ DIRECTORY ../upb
Expand All @@ -35,15 +27,15 @@ index d4cbcc9..a6b432f 100644
+target_include_directories(upb PUBLIC $<INSTALL_INTERFACE:include>)
+install(TARGETS
+ upb
+ utf8_range
+ fastdecode
+ upb_json
+ upb_pb
+ json
+ port
+ table
+ descriptor_upbproto
+ handlers
+ descriptor_upb_proto
+ reflection
+ textformat
+ all_libs
+ EXPORT upb-config
+)
+install(EXPORT upb-config NAMESPACE upb:: DESTINATION share/upb)

33 changes: 33 additions & 0 deletions ports/upb/fix-cmakelists.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index 6b4c50d..b4f43f9 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -66,6 +66,10 @@ endif()
enable_testing()

add_library(port INTERFACE)
+add_library(descriptor_upb_proto INTERFACE)
+add_library(utf8_range
+ ../third_party/utf8_range/utf8_range.c
+ ../third_party/utf8_range/utf8_range.h)
add_library(upb
../upb/decode.c
../upb/decode_internal.h
@@ -84,7 +88,7 @@ add_library(upb
target_link_libraries(upb
fastdecode
port
- /third_party/utf8_range)
+ utf8_range)
add_library(fastdecode
../upb/decode.h
../upb/decode_internal.h
@@ -96,7 +100,7 @@ add_library(fastdecode
target_link_libraries(fastdecode
port
table
- /third_party/utf8_range)
+ utf8_range)
add_library(generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me INTERFACE)
target_link_libraries(generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me INTERFACE
table
Loading