2017-02-14 02:58:10 +00:00
|
|
|
class Grpc < Formula
|
|
|
|
desc "Next generation open source RPC library and framework"
|
|
|
|
homepage "http://www.grpc.io/"
|
2017-05-20 00:41:23 +00:00
|
|
|
url "https://github.com/grpc/grpc/archive/v1.3.4.tar.gz"
|
|
|
|
sha256 "c12ca2693a3b3d80cadb15f1618d9ca6c83fe8c64a32b058a95ff8dce39b3e82"
|
2017-02-14 02:58:10 +00:00
|
|
|
head "https://github.com/grpc/grpc.git"
|
|
|
|
|
2017-02-19 00:52:50 +00:00
|
|
|
bottle do
|
2017-05-20 01:20:27 +00:00
|
|
|
sha256 "9fe63a1c7e439e8f34441ca008c826d4e94a8898f1b18f0d296de73fa7fab7a3" => :sierra
|
|
|
|
sha256 "8621bf534885be3ab9eb883f45a4f6d69d40d11c43ea28436f58d700a66dc2aa" => :el_capitan
|
|
|
|
sha256 "3928a79098204c36e146b1f521a46bf90d77ead9213ebf9eb6558ee45b0bf7d4" => :yosemite
|
2017-02-19 00:52:50 +00:00
|
|
|
end
|
|
|
|
|
2017-04-28 05:19:39 +00:00
|
|
|
depends_on "autoconf" => :build
|
|
|
|
depends_on "automake" => :build
|
|
|
|
depends_on "libtool" => :build
|
2017-05-06 10:48:08 +00:00
|
|
|
depends_on "c-ares"
|
|
|
|
depends_on "openssl"
|
2017-05-02 06:22:09 +00:00
|
|
|
depends_on "protobuf"
|
2017-05-18 19:36:04 +00:00
|
|
|
depends_on "gflags"
|
|
|
|
|
|
|
|
resource "gtest" do
|
|
|
|
url "https://github.com/google/googletest/archive/release-1.8.0.tar.gz"
|
|
|
|
sha256 "58a6f4277ca2bc8565222b3bbd58a177609e9c488e8a72649359ba51450db7d8"
|
|
|
|
end
|
2017-02-14 02:58:10 +00:00
|
|
|
|
|
|
|
def install
|
|
|
|
system "make", "install", "prefix=#{prefix}"
|
|
|
|
|
|
|
|
system "make", "install-plugins", "prefix=#{prefix}"
|
2017-05-18 19:36:04 +00:00
|
|
|
|
|
|
|
(buildpath/"third_party/googletest").install resource("gtest")
|
|
|
|
system "make", "grpc_cli", "prefix=#{prefix}"
|
|
|
|
bin.install "bins/opt/grpc_cli"
|
2017-02-14 02:58:10 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/"test.cpp").write <<-EOS.undent
|
|
|
|
#include <grpc/grpc.h>
|
|
|
|
int main() {
|
|
|
|
grpc_init();
|
|
|
|
grpc_shutdown();
|
|
|
|
return GRPC_STATUS_OK;
|
|
|
|
}
|
|
|
|
EOS
|
2017-04-28 05:19:39 +00:00
|
|
|
system ENV.cc, "test.cpp", "-I#{include}", "-L#{lib}", "-lgrpc", "-o", "test"
|
2017-02-14 02:58:10 +00:00
|
|
|
system "./test"
|
|
|
|
end
|
|
|
|
end
|