cfssl shows version instead of "dev"

Closes #46933.

Signed-off-by: Rui Chen <chenrui333@gmail.com>
This commit is contained in:
Arthur Burkart 2019-11-19 22:07:44 +01:00 committed by Rui Chen
parent 11dc4134da
commit e5f1bb0af8

View file

@ -19,9 +19,10 @@ class Cfssl < Formula
ENV["GOPATH"] = buildpath
cfsslpath = buildpath/"src/github.com/cloudflare/cfssl"
cfsslpath.install Dir["{*,.git}"]
ldflags = "-X github.com/cloudflare/cfssl/cli/version.version=#{version}"
cd "src/github.com/cloudflare/cfssl" do
system "go", "build", "-o", "#{bin}/cfssl", "cmd/cfssl/cfssl.go"
system "go", "build", "-o", "#{bin}/cfssljson", "cmd/cfssljson/cfssljson.go"
system "go", "build", "-o", "#{bin}/cfssl", "-ldflags", ldflags, "cmd/cfssl/cfssl.go"
system "go", "build", "-o", "#{bin}/cfssljson", "-ldflags", ldflags, "cmd/cfssljson/cfssljson.go"
system "go", "build", "-o", "#{bin}/cfsslmkbundle", "cmd/mkbundle/mkbundle.go"
end
end