Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

protobuf: build python bindings for 3.10 too #87287

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 8 additions & 3 deletions Formula/protobuf.rb
Expand Up @@ -4,6 +4,7 @@ class Protobuf < Formula
url "https://github.com/protocolbuffers/protobuf/releases/download/v3.17.3/protobuf-all-3.17.3.tar.gz"
carlocab marked this conversation as resolved.
Show resolved Hide resolved
sha256 "77ad26d3f65222fd96ccc18b055632b0bfedf295cb748b712a98ba1ac0b704b2"
license "BSD-3-Clause"
revision 1

livecheck do
url :stable
Expand All @@ -28,6 +29,8 @@ class Protobuf < Formula
depends_on "libtool" => :build
end

depends_on "python@3.10" => [:build, :test]
# The Python3.9 bindings can be removed when Python3.9 is made keg-only.
depends_on "python@3.9" => [:build, :test]
depends_on "six"

Expand All @@ -54,9 +57,10 @@ def install
ENV.append_to_cflags "-I#{include}"
ENV.append_to_cflags "-L#{lib}"

chdir "python" do
system Formula["python@3.9"].opt_bin/"python3", *Language::Python.setup_install_args(prefix),
"--cpp_implementation"
cd "python" do
["3.9", "3.10"].each do |xy|
system "python#{xy}", *Language::Python.setup_install_args(prefix), "--cpp_implementation"
end
end
end

Expand All @@ -74,5 +78,6 @@ def install
(testpath/"test.proto").write testdata
system bin/"protoc", "test.proto", "--cpp_out=."
system Formula["python@3.9"].opt_bin/"python3", "-c", "import google.protobuf"
system Formula["python@3.10"].opt_bin/"python3", "-c", "import google.protobuf"
end
end