Skip to content

Commit

Permalink
nomad: add dynamic option.
Browse files Browse the repository at this point in the history
Add option “with-dynamic” to nomad, in order to optionally build with
CGO_ENABLED. This is a common use case for some VPN users on macOS:
#7238
  • Loading branch information
ProbablyRusty authored and MikeMcQuaid committed Dec 10, 2016
1 parent ce04ef2 commit 137e626
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Formula/nomad.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@ class Nomad < Formula
sha256 "f292943027d1ee394312ec6286ef3ef944a6cdcac882b6086801d12eda7864ba" => :yosemite
end

option "with-dynamic", "Build dynamic binary with CGO_ENABLED=1"

depends_on "go" => :build

def install
ENV["GOPATH"] = buildpath
(buildpath/"src/github.com/hashicorp/nomad").install buildpath.children
cd "src/github.com/hashicorp/nomad" do
if build.with? "dynamic" then ENV["CGO_ENABLED"] = "1" end
system "go", "build", "-o", bin/"nomad"
prefix.install_metafiles
end
Expand Down

0 comments on commit 137e626

Please sign in to comment.