Skip to content

Commit 11c3951

Browse files
authored
Merge pull request Homebrew#264415 from Homebrew/protoc-gen-grpc-web-protobuf30
protoc-gen-grpc-web: add workaround patch for Protobuf 30+
2 parents c49cb3e + daaeb90 commit 11c3951

File tree

3 files changed

+432
-18
lines changed

3 files changed

+432
-18
lines changed

Formula/p/protoc-gen-grpc-web.rb

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,36 @@ class ProtocGenGrpcWeb < Formula
44
url "https://github.com/grpc/grpc-web/archive/refs/tags/2.0.2.tar.gz"
55
sha256 "0f0c8c0c1104306d67dad678be7c14efe52a698795a58b2b72ab67a8bb100c15"
66
license "Apache-2.0"
7-
revision 1
7+
revision 2
88

99
livecheck do
1010
url :stable
1111
regex(/^v?(\d+(?:\.\d+)+)$/i)
1212
end
1313

1414
bottle do
15-
sha256 cellar: :any, arm64_tahoe: "13178dfca8ddd03fc346eed87951e26ad6b16bbc6608e491c00f0476b2fd5f88"
16-
sha256 cellar: :any, arm64_sequoia: "32448216f271a5d1a457d6c0217c99bf2cedf452c35e3562eafc1d0fb6599e05"
17-
sha256 cellar: :any, arm64_sonoma: "3aa8f7c66330e5e3fceb999a510908dc630dc6ffa48f7a723ca3e5d636db97ff"
18-
sha256 cellar: :any, sonoma: "64dc0d89e0174058722346d0899605d216a9e870b1f524f27302f1e56469f385"
19-
sha256 cellar: :any_skip_relocation, arm64_linux: "6ce007070940c0e439c96393516143e1a7a299a1ed7ecc4d6967948cbb773cb7"
20-
sha256 cellar: :any_skip_relocation, x86_64_linux: "6d0104fa8cb7244505031d58e09c2027b25c001f75d5a5b1a8b6b92b3f423b5e"
15+
sha256 cellar: :any, arm64_tahoe: "9af493e95682f631439158b401f97298ce962cb800b7b9124669c771f4a8765d"
16+
sha256 cellar: :any, arm64_sequoia: "eb6bb14dcfe3c1aa89abfdbb933c09f33626c2b6b4c5de5666986692e6364cc1"
17+
sha256 cellar: :any, arm64_sonoma: "b8856c973c1d821803a2616b22275f4c94b5ae4bb3390990e53044fad0a063b4"
18+
sha256 cellar: :any, sonoma: "ec9590373e9414070067925b83954e9920957c631ff740478eeb14775d9b9776"
19+
sha256 cellar: :any_skip_relocation, arm64_linux: "5b32d54f7a13da54578aa4fea781eeb4981343354d839caa42fe5ccaa1722d5a"
20+
sha256 cellar: :any_skip_relocation, x86_64_linux: "a78f69a6baf9b44939f78c40f7b73ea85de1a4fd87f0cddd7f5958eb494fbd70"
2121
end
2222

2323
depends_on "cmake" => :build
2424
depends_on "pkgconf" => :build
2525
depends_on "node" => :test
2626
depends_on "typescript" => :test
2727
depends_on "abseil"
28-
depends_on "protobuf@29"
28+
depends_on "protobuf"
2929
depends_on "protoc-gen-js"
3030

31+
# Workaround to build with Protobuf 30+. Issue ref: https://github.com/grpc/grpc-web/issues/1522
32+
patch do
33+
url "https://raw.githubusercontent.com/Homebrew/homebrew-core/d0b7cf85a11a9acfa1a422305948dff6621bbda9/Patches/protoc-gen-grpc-web/protobuf-30.diff"
34+
sha256 "9c7e0ddf5ba68c179e7b8edc2c48de5b9b9d4801a6c8fd93ee199e27291aeebd"
35+
end
36+
3137
def install
3238
# Workarounds to build with latest `protobuf` which needs Abseil link flags and C++17
3339
ENV.append "LDFLAGS", Utils.safe_popen_read("pkgconf", "--libs", "protobuf").chomp
@@ -57,7 +63,7 @@ def install
5763
rpc RunTest(Test) returns (TestResult);
5864
}
5965
PROTO
60-
protoc = Formula["protobuf@29"].bin/"protoc"
66+
protoc = Formula["protobuf"].bin/"protoc"
6167
system protoc, "test.proto", "--plugin=#{bin}/protoc-gen-grpc-web",
6268
"--js_out=import_style=commonjs:.",
6369
"--grpc-web_out=import_style=typescript,mode=grpcwebtext:."

Formula/p/protoc-gen-js.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@ class ProtocGenJs < Formula
44
url "https://github.com/protocolbuffers/protobuf-javascript/archive/refs/tags/v4.0.1.tar.gz"
55
sha256 "123fac2e86109b24e80ccd356aa914e268bf5863ad1354d224d6ceaed6f5c45b"
66
license "BSD-3-Clause"
7-
revision 1
7+
revision 2
88
head "https://github.com/protocolbuffers/protobuf-javascript.git", branch: "main"
99

1010
bottle do
11-
sha256 cellar: :any, arm64_tahoe: "d2ec3f4def7537a0b7914930359c6be29fe8540c78813c9897f10f52794df587"
12-
sha256 cellar: :any, arm64_sequoia: "5ba804ed8a353281249a393a64267a6e72f6bc549d59b81f1510b48bcc6bc0f4"
13-
sha256 cellar: :any, arm64_sonoma: "77ce1a096a808eef9f954067a31899ade43f1a640469182a99a8e5c907c4e77f"
14-
sha256 cellar: :any, sonoma: "ab22cb0f23d2cf77a1a72f3121e51621df025a53a9684164a06d108dafded777"
15-
sha256 cellar: :any_skip_relocation, arm64_linux: "da7bbee442bef8c90d5234a2999bea748a9836c3ba907831623146d1235a2068"
16-
sha256 cellar: :any_skip_relocation, x86_64_linux: "b62043eda4656354f1e1982fe0313ff73c6f1da1ab6b52d1e296ab0469661801"
11+
sha256 cellar: :any, arm64_tahoe: "ca12ea6599efeedd3cf511a173e37da21b84df144d9735e2507255470d593bed"
12+
sha256 cellar: :any, arm64_sequoia: "205d481940df0d700e1d9c4c3d558a0e99292c2dab5a3326c3f52d1b11f42946"
13+
sha256 cellar: :any, arm64_sonoma: "2bf6a22e1ec1b538178affd2df7b0076e7d9a3e4a26c8187640446a8822b92c6"
14+
sha256 cellar: :any, sonoma: "3eada4b863ae7e2981a9665904cb60d4253c81448f3897c52e5bb07c04b72a8b"
15+
sha256 cellar: :any_skip_relocation, arm64_linux: "c9fe1dc5f351a6ea94d9b632e1349255fed5ab8f388bb7509a9dac29c54f55b9"
16+
sha256 cellar: :any_skip_relocation, x86_64_linux: "4ab4081275b0bafb529632cb95698ecdddf7f912b4a57135d561c6e6f421dd04"
1717
end
1818

1919
depends_on "node" => :build
2020
depends_on "pkgconf" => :build
2121
depends_on "abseil"
22-
depends_on "protobuf@29"
22+
depends_on "protobuf"
2323

2424
# We manually build rather than use Bazel as Bazel will build its own copy of Abseil
2525
# and Protobuf that get statically linked into binary. Check for any upstream changes at
@@ -40,7 +40,7 @@ def install
4040
string name = 2;
4141
}
4242
PROTO
43-
system Formula["protobuf@29"].bin/"protoc", "--js_out=import_style=commonjs:.", "person.proto"
43+
system Formula["protobuf"].bin/"protoc", "--js_out=import_style=commonjs:.", "person.proto"
4444
assert_path_exists testpath/"person_pb.js"
4545
refute_predicate (testpath/"person_pb.js").size, :zero?
4646
end

0 commit comments

Comments
 (0)