protobuf: depend on six

This switches `protobuf` to depend on `six` as a formula instead of as a
resource.

See #73875.
master
Carlo Cabrera 2021-04-17 17:12:53 +01:00 committed by BrewTestBot
parent 5ebfad8005
commit 473bd9fe5c
No known key found for this signature in database
GPG Key ID: 82D7D104050B0F0F
2 changed files with 6 additions and 14 deletions

View File

@ -4,6 +4,7 @@ class Protobuf < Formula
url "https://github.com/protocolbuffers/protobuf/releases/download/v3.17.0/protobuf-all-3.17.0.tar.gz"
sha256 "96da1cb0648c7c1b2e68ef7089149dce18ecf8d0582a171315b3991a59e629c6"
license "BSD-3-Clause"
revision 1
livecheck do
url :stable
@ -26,11 +27,7 @@ class Protobuf < Formula
end
depends_on "python@3.9" => [:build, :test]
resource "six" do
url "https://files.pythonhosted.org/packages/71/39/171f1c67cd00715f190ba0b100d606d440a28c93c7714febeca8b79af85e/six-1.16.0.tar.gz"
sha256 "1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"
end
depends_on "six"
def install
# Don't build in debug mode. See:
@ -53,18 +50,10 @@ class Protobuf < Formula
ENV.append_to_cflags "-I#{include}"
ENV.append_to_cflags "-L#{lib}"
resource("six").stage do
system Formula["python@3.9"].opt_bin/"python3", *Language::Python.setup_install_args(libexec)
end
chdir "python" do
system Formula["python@3.9"].opt_bin/"python3", *Language::Python.setup_install_args(libexec),
system Formula["python@3.9"].opt_bin/"python3", *Language::Python.setup_install_args(prefix),
"--cpp_implementation"
end
version = Language::Python.major_minor_version Formula["python@3.9"].opt_bin/"python3"
site_packages = "lib/python#{version}/site-packages"
pth_contents = "import site; site.addsitedir('#{libexec/site_packages}')\n"
(prefix/site_packages/"homebrew-protobuf.pth").write pth_contents
end
test do

View File

@ -88,6 +88,9 @@
"poetry": {
"extra_packages": ["importlib-metadata", "typing-extensions"]
},
"protobuf": {
"exclude_packages": ["six"]
},
"regipy": {
"exclude_packages": ["tabulate"]
},