diff options
| author | Daniel Harrison | 2015-03-14 22:14:50 -0400 |
|---|---|---|
| committer | Tim D. Smith | 2015-03-16 23:12:15 -0700 |
| commit | a33c74123c4f139b4ecbc217af6dc512b9140d34 (patch) | |
| tree | dc7c616e1d64b639ef092808d9640bd430c5056f /Library/Formula | |
| parent | 05d393f0604cbef3548e654ff404d7ab19007ffe (diff) | |
| download | homebrew-a33c74123c4f139b4ecbc217af6dc512b9140d34.tar.bz2 | |
protobuf 3.0.0-alpha-2 (devel)
Support the 3.0.0-alpha versions of protobuf. Notably, they are required for gRPC.
Closes #37731.
Signed-off-by: Tim D. Smith <git@tim-smith.us>
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/protobuf.rb | 42 |
1 files changed, 33 insertions, 9 deletions
diff --git a/Library/Formula/protobuf.rb b/Library/Formula/protobuf.rb index 5ab34201c..a9c3b39ab 100644 --- a/Library/Formula/protobuf.rb +++ b/Library/Formula/protobuf.rb @@ -39,6 +39,17 @@ class Protobuf < Formula url 'https://github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.bz2' sha1 '6421ee86d8fb4e39f21f56991daa892a3e8d314b' + devel do + url "https://github.com/google/protobuf/archive/v3.0.0-alpha-2.tar.gz" + sha256 "46df8649e2a0ce736e37f8f347f92b32a9b8b54d672bf60bd8f6f4d24d283390" + + version "3.0.0-alpha-2" + + depends_on "autoconf" => :build + depends_on "automake" => :build + depends_on "libtool" => :build + end + bottle do cellar :any revision 1 @@ -68,6 +79,7 @@ class Protobuf < Formula ENV.universal_binary if build.universal? ENV.cxx11 if build.cxx11? + system "./autogen.sh" if build.devel? system "./configure", "--disable-debug", "--disable-dependency-tracking", "--prefix=#{prefix}", "--with-zlib" @@ -90,15 +102,27 @@ class Protobuf < Formula end test do - def testdata; <<-EOS.undent - package test; - message TestCase { - required string name = 4; - } - message Test { - repeated TestCase case = 1; - } - EOS + testdata = if devel? + <<-EOS.undent + syntax = "proto3"; + package test; + message TestCase { + optional string name = 4; + } + message Test { + repeated TestCase case = 1; + } + EOS + else + <<-EOS.undent + package test; + message TestCase { + required string name = 4; + } + message Test { + repeated TestCase case = 1; + } + EOS end (testpath/"test.proto").write(testdata) system "protoc", "test.proto", "--cpp_out=." |
