homebrew-core/Formula/godep.rb
2019-04-14 18:07:27 +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 16
head "https://github.com/tools/godep.git"
bottle do
cellar :any_skip_relocation
sha256 "3bd56c5ad9b4e3899ef3e64bc0a90a4c152f15ea03979544d357869bb8cdb831" => :mojave
sha256 "88afd48f4db1315219cc314f3e21576f8101239c0eb0c8967dbe355a6a0a8f20" => :high_sierra
sha256 "e213a67a0d6e8a65d6cf0e27936c108cc518ce242a638576bd5fda43f9058271" => :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