homebrew-core/Formula/godep.rb

43 lines
1.3 KiB
Ruby
Raw Normal View History

2015-11-14 10:18:27 +00:00
class Godep < Formula
2016-04-07 16:27:34 +00:00
desc "Dependency tool for go"
2015-11-14 10:18:27 +00:00
homepage "https://godoc.org/github.com/tools/godep"
url "https://github.com/tools/godep/archive/v74.tar.gz"
sha256 "e68c7766c06c59327a4189fb929d390e1cc7a0c4910e33cada54cf40f40ca546"
2016-08-16 02:17:33 +00:00
revision 2
2015-11-14 10:18:27 +00:00
head "https://github.com/tools/godep.git"
2015-11-14 11:12:41 +00:00
bottle do
cellar :any_skip_relocation
2016-08-16 02:57:40 +00:00
sha256 "3ad1ff59294bc1c7470b4b4e9893ef3f588f1e18d4eb2a513ce74ac516b7a614" => :el_capitan
sha256 "40c656af18ba770f68b5507761ab439bbf5a8a7c9449fdec5cb3a3586ebef1d1" => :yosemite
sha256 "5d83bb27d58fff1a4c893a28b092235358f42bbe6eb12108d92c65a79e0f7d89" => :mavericks
2015-11-14 11:12:41 +00:00
end
2015-11-14 11:21:30 +00:00
depends_on "go"
2015-11-14 10:18:27 +00:00
def install
ENV["GOPATH"] = buildpath
(buildpath/"src/github.com/tools/godep").install buildpath.children
cd("src/github.com/tools/godep") { system "go", "build", "-o", bin/"godep" }
2015-11-14 10:18:27 +00:00
end
test do
ENV["GOPATH"] = testpath.realpath
2016-08-16 01:59:35 +00:00
(testpath/"Godeps/Godeps.json").write <<-EOS.undent
2015-11-14 10:18:27 +00:00
{
"ImportPath": "github.com/tools/godep",
2016-08-16 01:59:35 +00:00
"GoVersion": "go1.7",
"Deps": [
{
"ImportPath": "go.googlesource.com/tools",
"Rev": "3fe2afc9e626f32e91aff6eddb78b14743446865"
}
]
2015-11-14 10:18:27 +00:00
}
EOS
2016-08-16 01:59:35 +00:00
system bin/"godep", "restore"
assert File.exist?("src/go.googlesource.com/tools/README")
2015-11-14 10:18:27 +00:00
end
end