Skip to content

Commit

Permalink
build: update protobuf to 3.11.0 and gRPC to 1.25.0
Browse files Browse the repository at this point in the history
Signed-off-by: Lorenzo Fontana <lo@linux.com>
  • Loading branch information
fntlnz committed Nov 29, 2019
1 parent 1b05f0e commit 3004c25
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -568,8 +568,8 @@ else()
set(PROTOBUF_LIB "${PROTOBUF_SRC}/target/lib/libprotobuf.a")
ExternalProject_Add(protobuf
DEPENDS openssl zlib
URL "https://github.com/google/protobuf/releases/download/v3.5.0/protobuf-cpp-3.5.0.tar.gz"
URL_MD5 "e4ba8284a407712168593e79e6555eb2"
URL "https://github.com/protocolbuffers/protobuf/releases/download/v3.11.0/protobuf-cpp-3.11.0.tar.gz"
URL_MD5 "14396a19f7f21aeb2e3a51a8c31a383a"
# TODO what if using system zlib?
CONFIGURE_COMMAND /usr/bin/env CPPFLAGS=-I${ZLIB_INCLUDE} LDFLAGS=-L${ZLIB_SRC} ./configure --with-zlib --prefix=${PROTOBUF_SRC}/target
BUILD_COMMAND ${CMD_MAKE}
Expand Down Expand Up @@ -617,16 +617,16 @@ endif()

ExternalProject_Add(grpc
DEPENDS protobuf zlib c-ares openssl
URL "https://github.com/grpc/grpc/archive/v1.8.1.tar.gz"
URL_MD5 "2fc42c182a0ed1b48ad77397f76bb3bc"
URL "https://github.com/grpc/grpc/archive/v1.25.0.tar.gz"
URL_MD5 "3a875f7b3f0e3bdd3a603500bcef3d41"
CONFIGURE_COMMAND ""
# TODO what if using system openssl, protobuf or cares?
BUILD_COMMAND CFLAGS=-Wno-implicit-fallthrough HAS_SYSTEM_ZLIB=false LDFLAGS=-static PATH=${PROTOC_DIR}:$ENV{PATH} PKG_CONFIG_PATH=${OPENSSL_BUNDLE_DIR}:${PROTOBUF_SRC}:${CARES_SRC} PKG_CONFIG=${PKG_CONFIG_EXECUTABLE} make grpc_cpp_plugin static_cxx static_c
BUILD_IN_SOURCE 1
BUILD_BYPRODUCTS ${GRPC_LIB} ${GRPCPP_LIB}
# TODO s390x support
# TODO what if using system zlib
PATCH_COMMAND rm -rf third_party/zlib && ln -s ${ZLIB_SRC} third_party/zlib && curl -L https://download.sysdig.com/dependencies/grpc-1.8.1-Makefile.patch | patch
PATCH_COMMAND rm -rf third_party/zlib && ln -s ${ZLIB_SRC} third_party/zlib && curl -L ${PROJECT_SOURCE_DIR}/cmake/patch/grpc-1.25.0-Makefile.patch | patch
INSTALL_COMMAND "")
endif()

Expand Down
12 changes: 12 additions & 0 deletions cmake/patch/grpc-1.25.0-Makefile.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/Makefile b/Makefile
index dd4ced8112..d6abccda82 100644
--- a/Makefile
+++ b/Makefile
@@ -839,6 +839,7 @@ ifneq ($(LDFLAGS_PROTOBUF_PKG_CONFIG),)
LDFLAGS_PROTOBUF_PKG_CONFIG += $(shell $(PKG_CONFIG) --libs-only-L protobuf | sed s/L/Wl,-rpath,/)
endif
endif
+LDFLAGS := $(LDFLAGS_PROTOBUF_PKG_CONFIG) $(LDFLAGS)
else
PC_LIBS_GRPCXX = -lprotobuf
endif

0 comments on commit 3004c25

Please sign in to comment.