diff --git a/ports/grpc/CONTROL b/ports/grpc/CONTROL index 18475a6fc..7045bd444 100644 --- a/ports/grpc/CONTROL +++ b/ports/grpc/CONTROL @@ -1,4 +1,4 @@ Source: grpc -Version: 1.13.1 +Version: 1.14.1 Build-Depends: zlib, openssl, protobuf, c-ares (!uwp) Description: An RPC library and framework diff --git a/ports/grpc/fix-uwp.patch b/ports/grpc/fix-uwp.patch index a3fb3ef89..f479e4c59 100644 --- a/ports/grpc/fix-uwp.patch +++ b/ports/grpc/fix-uwp.patch @@ -1,109 +1,109 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index f58ee19..dda72e9 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -87,6 +87,9 @@ if(UNIX) - endif() - if(WIN32) - set(_gRPC_PLATFORM_WINDOWS ON) -+ if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") -+ set(_gRPC_PLATFORM_UWP ON) -+ endif() - endif() - - set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) -@@ -152,6 +155,10 @@ file(MAKE_DIRECTORY ${_gRPC_PROTO_GENS_DIR}) - # ``.proto`` files - # - function(protobuf_generate_grpc_cpp) -+ if(_gRPC_PLATFORM_UWP) -+ return() -+ endif() -+ - if(NOT ARGN) - message(SEND_ERROR "Error: PROTOBUF_GENERATE_GRPC_CPP() called without any proto files") - return() -@@ -186,6 +193,7 @@ function(protobuf_generate_grpc_cpp) - endforeach() - endfunction() - -+if(NOT _gRPC_PLATFORM_UWP) - add_custom_target(plugins - DEPENDS - grpc_cpp_plugin -@@ -215,6 +223,8 @@ add_custom_target(tools_cxx - add_custom_target(tools - DEPENDS tools_c tools_cxx) - -+endif() -+ - if (gRPC_BUILD_TESTS) - add_custom_target(buildtests_c) - add_dependencies(buildtests_c algorithm_test) -@@ -3595,7 +3605,6 @@ foreach(_hdr - DESTINATION "${gRPC_INSTALL_INCLUDEDIR}/${_path}" - ) - endforeach() --endif (gRPC_BUILD_CODEGEN) - - - if (gRPC_INSTALL) -@@ -3605,6 +3614,7 @@ if (gRPC_INSTALL) - ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR} - ) - endif() -+endif (gRPC_BUILD_CODEGEN) - - if (gRPC_BUILD_TESTS) - -@@ -3725,7 +3735,7 @@ foreach(_hdr - DESTINATION "${gRPC_INSTALL_INCLUDEDIR}/${_path}" - ) - endforeach() --endif (gRPC_BUILD_CODEGEN) -+ - - - if (gRPC_INSTALL) -@@ -3735,6 +3745,7 @@ if (gRPC_INSTALL) - ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR} - ) - endif() -+endif (gRPC_BUILD_CODEGEN) - - if (gRPC_BUILD_TESTS) - -diff --git a/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc b/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc -index 55efe0e..f538f26 100644 ---- a/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc -+++ b/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc -@@ -60,6 +60,8 @@ bool check_bios_data(const char* bios_data_file) { - - static void init_mu(void) { gpr_mu_init(&g_mu); } - -+#if !defined(WINAPI_FAMILY) || WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP -+ - static bool run_powershell() { - SECURITY_ATTRIBUTES sa; - sa.nLength = sizeof(sa); -@@ -97,8 +99,12 @@ static bool run_powershell() { - CloseHandle(h); - return true; - } -+#endif - - bool grpc_alts_is_running_on_gcp() { -+#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP) -+ g_is_on_compute_engine = false; -+#else - gpr_once_init(&g_once, init_mu); - gpr_mu_lock(&g_mu); - if (!g_compute_engine_detection_done) { -@@ -108,6 +114,7 @@ bool grpc_alts_is_running_on_gcp() { - g_compute_engine_detection_done = true; - } - gpr_mu_unlock(&g_mu); -+#endif - return g_is_on_compute_engine; - } - +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a59fd818e3..774ee2f725 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -89,6 +89,9 @@ if(UNIX) + endif() + if(WIN32) + set(_gRPC_PLATFORM_WINDOWS ON) ++ if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") ++ set(_gRPC_PLATFORM_UWP ON) ++ endif() + endif() + + set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) +@@ -155,6 +158,10 @@ file(MAKE_DIRECTORY ${_gRPC_PROTO_GENS_DIR}) + # ``.proto`` files + # + function(protobuf_generate_grpc_cpp) ++ if(_gRPC_PLATFORM_UWP) ++ return() ++ endif() ++ + if(NOT ARGN) + message(SEND_ERROR "Error: PROTOBUF_GENERATE_GRPC_CPP() called without any proto files") + return() +@@ -189,6 +196,7 @@ function(protobuf_generate_grpc_cpp) + endforeach() + endfunction() + ++if(NOT _gRPC_PLATFORM_UWP) + add_custom_target(plugins + DEPENDS + grpc_cpp_plugin +@@ -218,6 +226,8 @@ add_custom_target(tools_cxx + add_custom_target(tools + DEPENDS tools_c tools_cxx) + ++endif() ++ + if (gRPC_BUILD_TESTS) + add_custom_target(buildtests_c) + add_dependencies(buildtests_c algorithm_test) +@@ -3661,7 +3671,6 @@ foreach(_hdr + DESTINATION "${gRPC_INSTALL_INCLUDEDIR}/${_path}" + ) + endforeach() +-endif (gRPC_BUILD_CODEGEN) + + + if (gRPC_INSTALL) +@@ -3671,6 +3680,7 @@ if (gRPC_INSTALL) + ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR} + ) + endif() ++endif (gRPC_BUILD_CODEGEN) + + if (gRPC_BUILD_TESTS) + +@@ -3793,7 +3803,7 @@ foreach(_hdr + DESTINATION "${gRPC_INSTALL_INCLUDEDIR}/${_path}" + ) + endforeach() +-endif (gRPC_BUILD_CODEGEN) ++ + + + if (gRPC_INSTALL) +@@ -3803,6 +3813,7 @@ if (gRPC_INSTALL) + ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR} + ) + endif() ++endif (gRPC_BUILD_CODEGEN) + + if (gRPC_BUILD_TESTS) + +diff --git a/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc b/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc +index 55efe0e9dd..f538f26edf 100644 +--- a/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc ++++ b/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc +@@ -60,6 +60,8 @@ bool check_bios_data(const char* bios_data_file) { + + static void init_mu(void) { gpr_mu_init(&g_mu); } + ++#if !defined(WINAPI_FAMILY) || WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP ++ + static bool run_powershell() { + SECURITY_ATTRIBUTES sa; + sa.nLength = sizeof(sa); +@@ -97,8 +99,12 @@ static bool run_powershell() { + CloseHandle(h); + return true; + } ++#endif + + bool grpc_alts_is_running_on_gcp() { ++#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP) ++ g_is_on_compute_engine = false; ++#else + gpr_once_init(&g_once, init_mu); + gpr_mu_lock(&g_mu); + if (!g_compute_engine_detection_done) { +@@ -108,6 +114,7 @@ bool grpc_alts_is_running_on_gcp() { + g_compute_engine_detection_done = true; + } + gpr_mu_unlock(&g_mu); ++#endif + return g_is_on_compute_engine; + } + diff --git a/ports/grpc/portfile.cmake b/ports/grpc/portfile.cmake index d53bb9c93..537fa32ae 100644 --- a/ports/grpc/portfile.cmake +++ b/ports/grpc/portfile.cmake @@ -1,10 +1,9 @@ -if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - message(STATUS "Warning: Dynamic building not supported yet. Building static.") - set(VCPKG_LIBRARY_LINKAGE static) -endif() - include(vcpkg_common_functions) +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +# This snippet is a workaround for users who are upgrading from an extremely old version of this +# port, which cloned directly into `src\` if(EXISTS "${CURRENT_BUILDTREES_DIR}/src/.git") file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/src) endif() @@ -12,11 +11,10 @@ endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO grpc/grpc - REF v1.13.1 - SHA512 f44028299d47865814ada2b8b93dc98dc51c8729bedc9c30dd79c04f6ecc3789ff06bbe7555e5d3512d9aec027751761ae10a80a09a94cf85bbd3260d651b356 + REF v1.14.1 + SHA512 f0e4fe9777ebc3316a85cb581edad19fef785cdcd2859b1dc54bf7407aa2ba804718973661595e318ea62463620f30ca828e5d7638798cca154af5e1d456ed1e HEAD_REF master - PATCHES - ${CMAKE_CURRENT_LIST_DIR}/fix-uwp.patch + PATCHES fix-uwp.patch ) if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")