homebrew-core/Formula/godep.rb
2018-05-02 10:38:39 +10: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 4
head "https://github.com/tools/godep.git"
bottle do
cellar :any_skip_relocation
sha256 "818bc212a5311585397e3e960f7ecfc2404d2218f7e6e81af829072e2964921d" => :high_sierra
sha256 "a08ef0e83ba0e50affc89853be89e44b4bab81c445edd78b535126991c1bddae" => :sierra
sha256 "94b8145c5723da9042f56e0b9ed7172f94a5d72b50368617231f7e4c43a40e70" => :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