Skip to content

Commit

Permalink
devel/grpc142: Fix build with protobuf 22+
Browse files Browse the repository at this point in the history
  • Loading branch information
sunpoet committed Dec 14, 2023
1 parent cb3185c commit 1957504
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
1 change: 1 addition & 0 deletions devel/grpc142/Makefile
Expand Up @@ -33,6 +33,7 @@ CMAKE_ARGS= -DCMAKE_CXX_STANDARD=17 \
-DgRPC_SSL_PROVIDER=package \
-DgRPC_ZLIB_PROVIDER=package
CMAKE_ON= BUILD_SHARED_LIBS
LDFLAGS+= -labsl_hash -labsl_raw_hash_set
USE_LDCONFIG= yes

PLIST_SUB= SHLIB_MAJOR=${PORTVERSION:R} \
Expand Down
66 changes: 66 additions & 0 deletions devel/grpc142/files/patch-protobuf
@@ -0,0 +1,66 @@
--- CMakeLists.txt.orig 2021-11-16 23:39:48 UTC
+++ CMakeLists.txt
@@ -191,7 +191,7 @@ endif()

# Add c++11 flags
if (NOT DEFINED CMAKE_CXX_STANDARD)
- set(CMAKE_CXX_STANDARD 11)
+ set(CMAKE_CXX_STANDARD 17)
else()
if (CMAKE_CXX_STANDARD LESS 11)
message(FATAL_ERROR "CMAKE_CXX_STANDARD is less than 11, please specify at least SET(CMAKE_CXX_STANDARD 11)")
--- src/compiler/config_protobuf.h.orig 2021-11-16 23:39:48 UTC
+++ src/compiler/config_protobuf.h
@@ -50,7 +50,7 @@
#endif

#ifndef GRPC_CUSTOM_CSHARP_GETCLASSNAME
-#include <google/protobuf/compiler/csharp/csharp_names.h>
+#include <google/protobuf/compiler/csharp/names.h>
#define GRPC_CUSTOM_CSHARP_GETCLASSNAME \
::google::protobuf::compiler::csharp::GetClassName
#define GRPC_CUSTOM_CSHARP_GETFILENAMESPACE \
--- src/compiler/objective_c_generator.cc.orig 2021-11-16 23:39:48 UTC
+++ src/compiler/objective_c_generator.cc
@@ -22,7 +22,7 @@
#include <set>
#include <sstream>

-#include <google/protobuf/compiler/objectivec/objectivec_helpers.h>
+#include <google/protobuf/compiler/objectivec/names.h>

#include "src/compiler/config.h"
#include "src/compiler/objective_c_generator_helpers.h"
--- src/compiler/objective_c_generator_helpers.h.orig 2021-11-16 23:39:48 UTC
+++ src/compiler/objective_c_generator_helpers.h
@@ -21,7 +21,7 @@

#include <map>

-#include <google/protobuf/compiler/objectivec/objectivec_helpers.h>
+#include <google/protobuf/compiler/objectivec/names.h>

#include "src/compiler/config.h"
#include "src/compiler/generator_helpers.h"
--- src/compiler/objective_c_plugin.cc.orig 2021-11-16 23:39:48 UTC
+++ src/compiler/objective_c_plugin.cc
@@ -20,7 +20,7 @@

#include <memory>

-#include <google/protobuf/compiler/objectivec/objectivec_helpers.h>
+#include <google/protobuf/compiler/objectivec/names.h>

#include "src/compiler/config.h"
#include "src/compiler/objective_c_generator.h"
--- include/grpcpp/impl/codegen/config_protobuf.h.orig 2021-11-16 23:39:48 UTC
+++ include/grpcpp/impl/codegen/config_protobuf.h
@@ -69,7 +69,7 @@
#include <google/protobuf/util/json_util.h>
#include <google/protobuf/util/type_resolver_util.h>
#define GRPC_CUSTOM_JSONUTIL ::google::protobuf::util
-#define GRPC_CUSTOM_UTIL_STATUS ::google::protobuf::util::Status
+#define GRPC_CUSTOM_UTIL_STATUS ::absl::Status
#endif

namespace grpc {

0 comments on commit 1957504

Please sign in to comment.