homebrew-core/Formula/godep.rb

50 lines
1.6 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"
license "BSD-3-Clause"
revision 42
head "https://github.com/tools/godep.git"
bottle do
cellar :any_skip_relocation
sha256 "5b45501518691f47fe24b01610aeca28e042edb9330276449b21d982a04780b0" => :big_sur
sha256 "782f348e415f6f3d41b19f1c6c7b531c8e397ac50560bed30894dad6402c9048" => :catalina
sha256 "1b6409ac0394b28d044107c11da263b863b5f800504058751c85108398fff79a" => :mojave
sha256 "ed88d3864defb8f4773327d81be0f23c154669b4025a20ed5f92647c5b145d1a" => :high_sierra
end
deprecate! date: "2018-01-26", because: :repo_archived
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