homebrew-core/Formula/godep.rb
2018-08-25 15:41:07 +08:00

46 lines
1.5 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 6
head "https://github.com/tools/godep.git"
bottle do
cellar :any_skip_relocation
sha256 "08bfecaa9bf6720bcd05e620107696c6307c88b2f045beb2392c40022a5901fc" => :mojave
sha256 "849a9b5f6942ebd4142fa75cb760ab704aa4780e4097bf813013fddc734545b7" => :high_sierra
sha256 "0f651271969937ac3fa0c59f72017974dd29a04ee1642c51267e379896b1b1f9" => :sierra
sha256 "5268cd6f95210ad128e82ed2bf935ccf5cbb19ee30fb82b2e4f8731b1233192b" => :el_capitan
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