homebrew-core/Formula/godep.rb
2018-01-26 22:11:47 -08:00

44 lines
1.4 KiB
Ruby

class Godep < Formula
desc "Dependency tool for go"
homepage "https://godoc.org/github.com/tools/godep"
url "https://github.com/tools/godep/archive/v80.tar.gz"
sha256 "029adc1a0ce5c63cd40b56660664e73456648e5c031ba6c214ba1e1e9fc86cf6"
head "https://github.com/tools/godep.git"
bottle do
cellar :any_skip_relocation
sha256 "af4eb38c6aa8ae5e67ba2f19a205e73c0dc52c2a9e7a4f4173f5759f0b59d881" => :high_sierra
sha256 "c8d3def64818a265560752b1810e7b0992a5ccb58121260266e11cad6ca5e8c5" => :sierra
sha256 "7c4996e04bb6bf2faa4716104f35f313e2bb1cf1d3c8116be2d5d814c613f94b" => :el_capitan
end
depends_on "go"
def install
ENV["GOPATH"] = buildpath
(buildpath/"src/github.com/tools/godep").install buildpath.children
cd buildpath/"src/github.com/tools/godep" do
system "go", "build", "-o", bin/"godep"
prefix.install_metafiles
end
end
test do
ENV["GOPATH"] = testpath.realpath
(testpath/"Godeps/Godeps.json").write <<~EOS
{
"ImportPath": "github.com/tools/godep",
"GoVersion": "go1.8",
"Deps": [
{
"ImportPath": "golang.org/x/tools/cover",
"Rev": "3fe2afc9e626f32e91aff6eddb78b14743446865"
}
]
}
EOS
system bin/"godep", "restore"
assert_predicate testpath/"src/golang.org/x/tools/README", :exist?,
"Failed to find 'src/golang.org/x/tools/README!' file"
end
end