From 65f289bea73dc5e2d81ee88c283a88c9a304e5ff Mon Sep 17 00:00:00 2001 From: Manfred Touron Date: Sun, 6 Nov 2016 20:19:56 +0100 Subject: [PATCH] Add Homebrew support #3 --- contrib/homebrew/protoc-gen-gotemplate.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 contrib/homebrew/protoc-gen-gotemplate.rb diff --git a/contrib/homebrew/protoc-gen-gotemplate.rb b/contrib/homebrew/protoc-gen-gotemplate.rb new file mode 100644 index 0000000..74241a5 --- /dev/null +++ b/contrib/homebrew/protoc-gen-gotemplate.rb @@ -0,0 +1,20 @@ +require "language/go" + +class ProtocGenGotemplate < Formula + desc "protocol generator + golang text/template (protobuf)" + homepage "https://github.com/moul/protoc-gen-gotemplate" + url "https://github.com/moul/protoc-gen-gotemplate/archive/v1.0.0.tar.gz" + sha256 "1ff57cd8513f1e871cf71dc8f2099bf64204af0df1b7397370827083e95bbb82" + head "https://github.com/moul/protoc-gen-gotemplate.git" + + depends_on "go" => :build + + def install + ENV["GOPATH"] = buildpath + ENV["GOBIN"] = buildpath + ENV["GO15VENDOREXPERIMENT"] = "1" + (buildpath/"src/github.com/moul/protoc-gen-gotemplate").install Dir["*"] + + system "go", "build", "-o", "#{bin}/protoc-gen-gotemplate", "-v", "github.com/moul/protoc-gen-gotemplate" + end +end