Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions Formula/newrelic-infra-agent.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
class NewrelicInfraAgent < Formula
desc "New Relic infrastructure agent"
homepage "https://github.com/newrelic/infrastructure-agent"
url "https://github.com/newrelic/infrastructure-agent/archive/refs/tags/1.20.2.tar.gz"
sha256 "83f521ed6ed903d9fdbeed8eb59b6b488ce5492fe305d38a7096d4c2f017138d"
url "https://github.com/newrelic/infrastructure-agent.git",
tag: "1.20.2",
revision: "d30d434995dc539e38ab84f8324f1a07d0f552ff"
license "Apache-2.0"
revision 1
head "https://github.com/newrelic/infrastructure-agent.git", branch: "master"

bottle do
Expand All @@ -13,20 +15,22 @@ class NewrelicInfraAgent < Formula
sha256 cellar: :any_skip_relocation, x86_64_linux: "80a1f2d22913a89ec427d20a8e03579b6de3f74e23ecf7db99546d513eec35f6"
end

depends_on "go" => :build
# https://github.com/newrelic/infrastructure-agent/issues/723
depends_on "[email protected]" => :build
# https://github.com/newrelic/infrastructure-agent/issues/695
depends_on arch: :x86_64

def install
goarch = Hardware::CPU.arm? ? "arm64" : "amd64"
ENV["VERSION"] = version.to_s
ENV["GOOS"] = if OS.mac?
os = if OS.mac?
ENV["CGO_ENABLED"] = "1"
"darwin"
else
ENV["CGO_ENABLED"] = "0"
"linux"
end
ENV["GOOS"] = os
system "make", "dist-for-os"
bin.install "dist/#{os}-newrelic-infra_#{os}_#{goarch}/newrelic-infra"
bin.install "dist/#{os}-newrelic-infra-ctl_#{os}_#{goarch}/newrelic-infra-ctl"
Expand Down