homebrew-core/Formula/buildkit.rb

31 lines
1.2 KiB
Ruby
Raw Normal View History

class Buildkit < Formula
desc "Сoncurrent, cache-efficient, and Dockerfile-agnostic builder toolkit"
homepage "https://github.com/moby/buildkit"
url "https://github.com/moby/buildkit/archive/v0.6.0.tar.gz"
sha256 "ba00debd8ca7ab27a65553b32ae092ce7a5e058fff2d5d3679da07332041b368"
2019-03-18 21:51:15 +00:00
bottle do
cellar :any_skip_relocation
2019-08-01 09:27:18 +00:00
sha256 "8899246f742da7662fd76e8d1f0bef9c6fbf987b069dfd874377b247937cdff9" => :mojave
sha256 "09793da8f770c03cd85965f76fad5422c207c56ea64fdbaf908d89c310d7cdad" => :high_sierra
sha256 "a243c194d9262c6e564b7c8e5f22aad0e57fa43f8de32b81ae243da1ebfa025a" => :sierra
2019-03-18 21:51:15 +00:00
end
depends_on "go" => :build
def install
ENV["GOPATH"] = buildpath
doc.install %w[README.md] + Dir["docs/*.md"]
(buildpath/"src/github.com/moby/buildkit/").install Dir["*"]
ldflags = ["-X github.com/moby/buildkit/version.Version=#{version}",
"-X github.com/moby/buildkit/version.Package=github.com/moby/buildkit"]
system "go", "build", "-o", bin/"buildctl", "-ldflags", ldflags.join(" "), "github.com/moby/buildkit/cmd/buildctl"
end
test do
shell_output("#{bin}/buildctl --addr unix://dev/null --timeout 0 du 2>&1", 1)
end
end