46 lines
1.4 KiB
Ruby
46 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 7
|
|
|
|
head "https://github.com/tools/godep.git"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "f83000a103b133c51b8952a3ab70fba74af093065ccecc7b08bae448f23846c5" => :high_sierra
|
|
sha256 "90ddc04dfdb72a7c9256ddd4a17f0328687bc0f1dc55baef0781219571f6cf22" => :sierra
|
|
sha256 "01297fd7e96d248df83b9208368eb5459ac262d718cef043dd13a0e86e42b024" => :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.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
|