node_exporter: remove gopath

Closes #48072.

Signed-off-by: FX Coudert <fxcoudert@gmail.com>
This commit is contained in:
Caleb Xu 2019-12-19 10:42:49 -05:00 committed by FX Coudert
parent 9c38782bd1
commit 1f2604c4a0

View file

@ -15,19 +15,13 @@ class NodeExporter < Formula
depends_on "go" => :build
def install
ENV["GOPATH"] = buildpath
(buildpath/"src/github.com/prometheus/node_exporter").install buildpath.children
cd "src/github.com/prometheus/node_exporter" do
ldflags = %W[
-X github.com/prometheus/common/version.Version=#{version}
-X github.com/prometheus/common/version.BuildUser=Homebrew
]
system "go", "build", "-o", bin/"node_exporter",
"-ldflags", ldflags.join(" "),
"github.com/prometheus/node_exporter"
prefix.install_metafiles
end
ldflags = %W[
-X github.com/prometheus/common/version.Version=#{version}
-X github.com/prometheus/common/version.BuildUser=Homebrew
]
system "go", "build", "-ldflags", ldflags.join(" "), "-trimpath",
"-o", bin/"node_exporter"
prefix.install_metafiles
end
def caveats; <<~EOS