44 lines
1.4 KiB
Ruby
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/v79.tar.gz"
|
|
sha256 "3dd2e6c4863077762498af98fa0c8dc5fedffbca6a5c0c4bb42b452c8268383d"
|
|
revision 5
|
|
|
|
head "https://github.com/tools/godep.git"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "1f6bd3efc87edb29f57a1aa6b845a16edf56b0610017d071bae857e21ec4a3aa" => :sierra
|
|
sha256 "d57f07b80218a02851c8b58e13f31af1c29892f5667622ff6620aaa467a3a5f5" => :el_capitan
|
|
sha256 "3501adaa7d374a1875212aa00ce100ec962993a6514be7af88a64782d6218b54" => :yosemite
|
|
end
|
|
|
|
depends_on "go"
|
|
|
|
def install
|
|
ENV["GOPATH"] = buildpath
|
|
(buildpath/"src/github.com/tools/godep").install buildpath.children
|
|
cd("src/github.com/tools/godep") { system "go", "build", "-o", bin/"godep" }
|
|
end
|
|
|
|
test do
|
|
ENV["GOPATH"] = testpath.realpath
|
|
(testpath/"Godeps/Godeps.json").write <<-EOS.undent
|
|
{
|
|
"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
|