homebrew-core/Formula/godep.rb
2019-04-05 23:40:23 +02:00

45 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"
revision 14
head "https://github.com/tools/godep.git"
bottle do
cellar :any_skip_relocation
sha256 "ce9c92e8689cd07b2f7f3c3ce857096c6e8662d48b1bf07db3e87f24f708bd9a" => :mojave
sha256 "8d5d34bd9c435142cd6effd884d1b541b39b20c03c5515a203b8876a70aebffc" => :high_sierra
sha256 "d6737aad150935a77dd754bc86edc62b6a6261e4bae58c0fc2a4daa7bbfbcf1d" => :sierra
end
depends_on "go"
def install
ENV["GOPATH"] = buildpath
(buildpath/"src/github.com/tools/godep").install buildpath.children
cd "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