@@ -5,7 +5,7 @@ class Grpc < Formula
55 tag : "v1.78.1" ,
66 revision : "5b6492ea90b2b867a6adad1b10a6edda28e860d1"
77 license "Apache-2.0"
8- revision 1
8+ revision 2
99 compatibility_version 1
1010 head "https://github.com/grpc/grpc.git" , branch : "master"
1111
@@ -34,7 +34,7 @@ class Grpc < Formula
3434 depends_on "abseil"
3535 depends_on "c-ares"
3636 depends_on "openssl@3"
37- depends_on "protobuf@33" # https://github.com/grpc/grpc/issues/41755
37+ depends_on "protobuf"
3838 depends_on "re2"
3939
4040 on_macos do
@@ -50,13 +50,18 @@ class Grpc < Formula
5050 cause "Requires C++17 features not yet implemented"
5151 end
5252
53+ # Apply open PR to support building grpc_cli with Protobuf 34+
54+ # PR ref: https://github.com/grpc/grpc/pull/41775
55+ patch do
56+ url "https://github.com/grpc/grpc/commit/168b069208538e58a72bf46a6410f9ac0d24019a.patch?full_index=1"
57+ sha256 "406731204b925c3ba57c8dc84da573b2755c3365cd59c1f0a04c1791f7db6565"
58+ end
59+
5360 def install
5461 args = %W[
5562 -DCMAKE_CXX_STANDARD=17
56- -DCMAKE_CXX_STANDARD_REQUIRED=TRUE
5763 -DCMAKE_INSTALL_RPATH=#{ rpath }
5864 -DBUILD_SHARED_LIBS=ON
59- -DgRPC_BUILD_TESTS=OFF
6065 -DgRPC_INSTALL=ON
6166 -DgRPC_ABSL_PROVIDER=package
6267 -DgRPC_CARES_PROVIDER=package
@@ -65,7 +70,7 @@ def install
6570 -DgRPC_ZLIB_PROVIDER=package
6671 -DgRPC_RE2_PROVIDER=package
6772 ]
68- system "cmake" , "-S" , "." , "-B" , "_build" , *args , *std_cmake_args
73+ system "cmake" , "-S" , "." , "-B" , "_build" , "-DgRPC_BUILD_TESTS=OFF" , *args , *std_cmake_args
6974 system "cmake" , "--build" , "_build"
7075 system "cmake" , "--install" , "_build"
7176
@@ -76,19 +81,12 @@ def install
7681 # The following are installed manually, so need to use CMAKE_*_LINKER_FLAGS
7782 # TODO: `grpc_cli` is a huge pain to install. Consider removing it.
7883 linker_flags = %W[ -rpath #{ rpath } ]
79- args = %W[
84+ grpc_cli_args = %W[
8085 -DCMAKE_EXE_LINKER_FLAGS=-Wl,#{ linker_flags . join ( "," ) }
8186 -DCMAKE_SHARED_LINKER_FLAGS=-Wl,#{ linker_flags . join ( "," ) }
82- -DBUILD_SHARED_LIBS=ON
8387 -DgRPC_BUILD_TESTS=ON
84- -DgRPC_ABSL_PROVIDER=package
85- -DgRPC_CARES_PROVIDER=package
86- -DgRPC_PROTOBUF_PROVIDER=package
87- -DgRPC_SSL_PROVIDER=package
88- -DgRPC_ZLIB_PROVIDER=package
89- -DgRPC_RE2_PROVIDER=package
9088 ]
91- system "cmake" , "-S" , "." , "-B" , "_build-grpc_cli" , *args , *std_cmake_args
89+ system "cmake" , "-S" , "." , "-B" , "_build-grpc_cli" , *args , *grpc_cli_args , * std_cmake_args
9290 system "cmake" , "--build" , "_build-grpc_cli" , "--target" , "grpc_cli"
9391 bin . install "_build-grpc_cli/grpc_cli"
9492 lib . install ( buildpath /"_build-grpc_cli" ) . glob ( shared_library ( "libgrpc++_test_config" , "*" ) )
@@ -105,7 +103,6 @@ def install
105103 CPP
106104
107105 ENV . prepend_path "PKG_CONFIG_PATH" , Formula [ "openssl@3" ] . opt_lib /"pkgconfig"
108- ENV . prepend_path "PKG_CONFIG_PATH" , Formula [ "protobuf@33" ] . opt_lib /"pkgconfig"
109106 ENV . prepend_path "PKG_CONFIG_PATH" , Formula [ "zlib-ng-compat" ] . opt_lib /"pkgconfig" if OS . linux?
110107 flags = shell_output ( "pkgconf --cflags --libs libcares protobuf re2 grpc++" ) . chomp . split
111108 system ENV . cc , "test.cpp" , "-L#{ Formula [ "abseil" ] . opt_lib } " , *flags , "-o" , "test"
0 commit comments