From 14708a09a9ade27dce3329ee8453a8a2724f94b6 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 18 Apr 2018 16:32:10 -0700 Subject: [PATCH] [grpc] Fix build for linux Fix --- ports/grpc/CONTROL | 2 +- ports/grpc/disable-csharp-ext-2.patch | 20 ++++++++++++++++++++ ports/grpc/portfile.cmake | 9 +++++++-- 3 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 ports/grpc/disable-csharp-ext-2.patch diff --git a/ports/grpc/CONTROL b/ports/grpc/CONTROL index 088d9336e0..6f8f18467f 100644 --- a/ports/grpc/CONTROL +++ b/ports/grpc/CONTROL @@ -1,4 +1,4 @@ Source: grpc -Version: 1.10.1 +Version: 1.10.1-1 Build-Depends: zlib, openssl, protobuf, c-ares Description: An RPC library and framework diff --git a/ports/grpc/disable-csharp-ext-2.patch b/ports/grpc/disable-csharp-ext-2.patch new file mode 100644 index 0000000000..1bc863105c --- /dev/null +++ b/ports/grpc/disable-csharp-ext-2.patch @@ -0,0 +1,20 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0dc0bd3..7f702cc 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -4699,6 +4699,7 @@ endif (gRPC_BUILD_TESTS) + + option(gRPC_INSTALL_CSHARP_EXT "" ON) + ++if(gRPC_INSTALL_CSHARP_EXT) + add_library(grpc_csharp_ext SHARED + src/csharp/ext/grpc_csharp_ext.c + ) +@@ -4741,6 +4742,7 @@ if (gRPC_INSTALL AND gRPC_INSTALL_CSHARP_EXT) + ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR} + ) + endif() ++endif() + + if (gRPC_BUILD_TESTS) + diff --git a/ports/grpc/portfile.cmake b/ports/grpc/portfile.cmake index f68f67e640..54f2948962 100644 --- a/ports/grpc/portfile.cmake +++ b/ports/grpc/portfile.cmake @@ -22,6 +22,7 @@ vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} PATCHES ${CMAKE_CURRENT_LIST_DIR}/disable-csharp-ext.patch + ${CMAKE_CURRENT_LIST_DIR}/disable-csharp-ext-2.patch ) if(VCPKG_CRT_LINKAGE STREQUAL static) @@ -66,8 +67,12 @@ if(TOOLS) vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/grpc) endif() -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) +if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) +else() + SET(VCPKG_POLICY_EMPTY_PACKAGE enabled) # Leave the executable files in bin/ and debug/bin +endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) vcpkg_copy_pdbs()