diff --git a/Formula/shfmt.rb b/Formula/shfmt.rb index 996e887501..b6d9474ebe 100644 --- a/Formula/shfmt.rb +++ b/Formula/shfmt.rb @@ -1,8 +1,8 @@ class Shfmt < Formula desc "Autoformat shell script source code" homepage "https://github.com/mvdan/sh" - url "https://github.com/mvdan/sh/archive/v2.6.4.tar.gz" - sha256 "72c8e5833e61a31a4595bbd8a77bfb0a8ade9c60603638be70ea801e309d39fe" + url "https://github.com/mvdan/sh/archive/v3.0.0.tar.gz" + sha256 "8bfd0d4b4d532d0b6ecd77f94c91d1f6da47b26a4453ed5c7567826113424116" head "https://github.com/mvdan/sh.git" bottle do @@ -16,10 +16,10 @@ class Shfmt < Formula depends_on "go" => :build def install - ENV["GOPATH"] = buildpath + ENV["CGO_ENABLED"] = "0" (buildpath/"src/mvdan.cc").mkpath ln_sf buildpath, buildpath/"src/mvdan.cc/sh" - system "go", "build", "-a", "-tags", "production brew", "-o", "#{bin}/shfmt", "mvdan.cc/sh/cmd/shfmt" + system "go", "build", "-a", "-tags", "production brew", "-ldflags", "-w -s -extldflags '-static'", "-o", "#{bin}/shfmt", "mvdan.cc/sh/cmd/shfmt" end test do