From 1e0f4c3184daa6a81a217654b23aadcb621eafda Mon Sep 17 00:00:00 2001 From: Michael Cho Date: Wed, 27 Nov 2024 14:30:02 -0500 Subject: [PATCH] apache-pulsar: build with `protoc-gen-grpc-java` --- Formula/a/apache-pulsar.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Formula/a/apache-pulsar.rb b/Formula/a/apache-pulsar.rb index 6e18046b5af14f..8ec28772488d1a 100644 --- a/Formula/a/apache-pulsar.rb +++ b/Formula/a/apache-pulsar.rb @@ -14,10 +14,15 @@ class ApachePulsar < Formula end depends_on "maven" => :build - depends_on arch: :x86_64 # https://github.com/grpc/grpc-java/issues/7690 + depends_on "protoc-gen-grpc-java" => :build depends_on "openjdk@21" def install + # Avoid using pre-built `protoc-gen-grpc-java` + grpc_java_files = ["pulsar-client/pom.xml", "pulsar-functions/proto/pom.xml"] + plugin_artifact = "io.grpc:protoc-gen-grpc-java:${protoc-gen-grpc-java.version}:exe:${os.detected.classifier}" + inreplace grpc_java_files, %r{#{Regexp.escape(plugin_artifact)}\s*}, "" + java_home_env = Language::Java.java_home_env("21") with_env(TMPDIR: buildpath, **java_home_env) do system "mvn", "clean", "package", "-DskipTests", "-Pcore-modules"