forked from alexeyxo/protobuf-swift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprotobuf-swift.rb
32 lines (29 loc) · 845 Bytes
/
protobuf-swift.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
class ProtobufSwift < Formula
homepage "https://github.com/alexeyxo/protobuf-swift"
url "https://github.com/alexeyxo/protobuf-swift/archive/1.6.tar.gz"
sha256 "1581301212fd8c3aa735e3a9a42444e4f5cb86ac9caf5f477a917f4dfe0eb2e1"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
depends_on "protobuf"
def install
system "./autogen.sh"
system "./configure", "--prefix=#{prefix}"
system "make"
system "make", "install"
end
test do
testdata = <<-EOS.undent
enum Flavor{
CHOCOLATE = 1;
VANILLA = 2;
}
message IceCreamCone {
optional int32 scoops = 1;
optional Flavor flavor = 2;
}
EOS
(testpath/"test.proto").write(testdata)
system "protoc", "test.proto", "--swift_out=."
end
end