docker: remove -ce suffix, set date and platform

Closes #35012.

Signed-off-by: Chongyu Zhu <i@lembacon.com>
This commit is contained in:
Sebastiaan van Stijn 2018-12-12 00:31:33 +01:00 committed by Chongyu Zhu
parent 609d68ed1b
commit d0e2fc6be7
No known key found for this signature in database
GPG key ID: 1A43E3C9100B38F5

View file

@ -4,6 +4,7 @@ class Docker < Formula
url "https://github.com/docker/docker-ce.git",
:tag => "v18.09.0",
:revision => "4d60db472b2bde6931072ca6467f2667c2590dff"
revision 1
bottle do
cellar :any_skip_relocation
@ -20,8 +21,11 @@ class Docker < Formula
dir.install (buildpath/"components/cli").children
cd dir do
commit = Utils.popen_read("git rev-parse --short HEAD").chomp
ldflags = ["-X github.com/docker/cli/cli.GitCommit=#{commit}",
"-X github.com/docker/cli/cli.Version=#{version}-ce"]
build_time = Utils.popen_read("date -u +'%Y-%m-%dT%H:%M:%SZ' 2> /dev/null").chomp
ldflags = ["-X \"github.com/docker/cli/cli.BuildTime=#{build_time}\"",
"-X github.com/docker/cli/cli.GitCommit=#{commit}",
"-X github.com/docker/cli/cli.Version=#{version}",
"-X \"github.com/docker/cli/cli.PlatformName=Docker Engine - Community\""]
system "go", "build", "-o", bin/"docker", "-ldflags", ldflags.join(" "),
"github.com/docker/cli/cmd/docker"