From 95a77a2225fdad184b678e6c107586be5bec1e04 Mon Sep 17 00:00:00 2001 From: Alexander Bayandin Date: Thu, 7 Jan 2021 16:50:23 +0000 Subject: [PATCH 01/16] darksky-weather: deprecate gopath --- Formula/darksky-weather.rb | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/Formula/darksky-weather.rb b/Formula/darksky-weather.rb index 420a81d8b9238..5ada23acf0668 100644 --- a/Formula/darksky-weather.rb +++ b/Formula/darksky-weather.rb @@ -17,16 +17,12 @@ class DarkskyWeather < Formula depends_on "go" => :build def install - ENV["GOPATH"] = HOMEBREW_CACHE/"go_cache" - (buildpath/"src/github.com/genuinetools/weather").install buildpath.children - - cd "src/github.com/genuinetools/weather" do - project = "github.com/genuinetools/weather" - ldflags = ["-X #{project}/version.GITCOMMIT=homebrew", - "-X #{project}/version.VERSION=v#{version}"] - system "go", "build", "-o", bin/"weather", "-ldflags", ldflags.join(" ") - prefix.install_metafiles - end + project = "github.com/genuinetools/weather" + ldflags = ["-s -w", + "-X #{project}/version.GITCOMMIT=homebrew", + "-X #{project}/version.VERSION=v#{version}"] + system "go", "build", *std_go_args, "-ldflags", ldflags.join(" ") + mv bin/"darksky-weather", bin/"weather" end test do From 0d4debc68851ad51a7ad551e2ffabae8a7bd050e Mon Sep 17 00:00:00 2001 From: Alexander Bayandin Date: Thu, 7 Jan 2021 16:50:23 +0000 Subject: [PATCH 02/16] dehydrated: deprecate gopath --- Formula/dehydrated.rb | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/Formula/dehydrated.rb b/Formula/dehydrated.rb index 34b46c38bb964..13edb7cabdef1 100644 --- a/Formula/dehydrated.rb +++ b/Formula/dehydrated.rb @@ -1,25 +1,15 @@ class Dehydrated < Formula desc "LetsEncrypt/acme client implemented as a shell-script" homepage "https://dehydrated.io" - url "https://github.com/lukas2511/dehydrated/archive/v0.7.0.tar.gz" + url "https://github.com/dehydrated-io/dehydrated/archive/v0.7.0.tar.gz" sha256 "1c5f12c2e57e64b1762803f82f0f7e767a72e65a6ce68e4d1ec197e61b9dc4f9" license "MIT" - bottle do - cellar :any_skip_relocation - sha256 "4b9332dca6c3e4d9b480836fa0655fa6982f516e55578ce73d7628560da90ade" => :big_sur - sha256 "28a03e3c28568d6d71869669a5902d67c62466f1c7e38ec4348b825a8e0b615e" => :arm64_big_sur - sha256 "9dd59ec022c69ea48b0ffc7bc04ee3104cc7138a69d62f4cd0f39e8f8e511cc1" => :catalina - sha256 "aee673b9f0911f72f685cc2cd55018b0d0d1db9a87e9896c4c488f434eda6449" => :mojave - end + bottle :unneeded def install - ENV["GOPATH"] = buildpath - (buildpath/"src/github.com/lukas2511/dehydrated").install buildpath.children - cd "src/github.com/lukas2511/dehydrated" do - bin.install "dehydrated" - prefix.install_metafiles - end + bin.install "dehydrated" + man1.install "docs/man/dehydrated.1" end test do From e944eaf306d4c3d4c3e554d929ca5c1676989782 Mon Sep 17 00:00:00 2001 From: Alexander Bayandin Date: Thu, 7 Jan 2021 16:50:23 +0000 Subject: [PATCH 03/16] docker-ls: deprecate gopath --- Formula/docker-ls.rb | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/Formula/docker-ls.rb b/Formula/docker-ls.rb index 4c5665bcbf648..c4e6d15b4c242 100644 --- a/Formula/docker-ls.rb +++ b/Formula/docker-ls.rb @@ -17,16 +17,10 @@ class DockerLs < Formula depends_on "go" => :build def install - ENV["GOPATH"] = buildpath + system "go", "generate", "./lib" - (buildpath/"src/github.com/mayflower/docker-ls").install buildpath.children - - system "go", "generate", "github.com/mayflower/docker-ls/lib" - - cd "src/github.com/mayflower/docker-ls" do - system "go", "build", "-o", bin/"docker-ls", "./cli/docker-ls" - system "go", "build", "-o", bin/"docker-rm", "./cli/docker-rm" - prefix.install_metafiles + %w[docker-ls docker-rm].each do |name| + system "go", "build", "-trimpath", "-o", bin/name, "-ldflags", "-s -w", "./cli/#{name}" end end From cce625e198e65c2afa6966ba196302a2542d0e76 Mon Sep 17 00:00:00 2001 From: Alexander Bayandin Date: Thu, 7 Jan 2021 16:50:23 +0000 Subject: [PATCH 04/16] docker-machine-parallels: deprecate gopath --- Formula/docker-machine-parallels.rb | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/Formula/docker-machine-parallels.rb b/Formula/docker-machine-parallels.rb index caadc8e87e730..8fbe3d292f2d4 100644 --- a/Formula/docker-machine-parallels.rb +++ b/Formula/docker-machine-parallels.rb @@ -1,8 +1,9 @@ class DockerMachineParallels < Formula desc "Parallels Driver for Docker Machine" homepage "https://github.com/Parallels/docker-machine-parallels" - url "https://github.com/Parallels/docker-machine-parallels/archive/v2.0.1.tar.gz" - sha256 "af52903482bff0f13200cc5aca39037cd8625cc663120e1e4d3be13aeda2720d" + url "https://github.com/Parallels/docker-machine-parallels.git", + tag: "v2.0.1", + revision: "a1c3d495487413bdd24a562c0edee1af1cfc2f0f" license "MIT" head "https://github.com/Parallels/docker-machine-parallels.git" @@ -19,17 +20,8 @@ class DockerMachineParallels < Formula depends_on "docker-machine" def install - ENV["GOPATH"] = buildpath - - path = buildpath/"src/github.com/Parallels/docker-machine-parallels" - path.install Dir["*"] - - cd path do - system "make", "build" - bin.install "bin/docker-machine-driver-parallels" - end - - prefix.install_metafiles path + system "make", "build" + bin.install "bin/docker-machine-driver-parallels" end test do From c4926dd01f64fc9cba22d32a35638f1d2931164d Mon Sep 17 00:00:00 2001 From: Alexander Bayandin Date: Thu, 7 Jan 2021 16:50:23 +0000 Subject: [PATCH 05/16] fzf: deprecate gopath --- Formula/fzf.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Formula/fzf.rb b/Formula/fzf.rb index a8caced94d4b9..364ef2a1c9990 100644 --- a/Formula/fzf.rb +++ b/Formula/fzf.rb @@ -19,8 +19,7 @@ class Fzf < Formula uses_from_macos "ncurses" def install - ENV["GOPATH"] = HOMEBREW_CACHE/"go_cache" - system "go", "build", "-o", bin/"fzf", "-ldflags", "-X main.version=#{version} -X main.revision=brew" + system "go", "build", *std_go_args, "-ldflags", "-s -w -X main.version=#{version} -X main.revision=brew" prefix.install "install", "uninstall" (prefix/"shell").install %w[bash zsh fish].map { |s| "shell/key-bindings.#{s}" } From 8a8fcb765638818c12a3169425515d7dcdb0ee8d Mon Sep 17 00:00:00 2001 From: Alexander Bayandin Date: Thu, 7 Jan 2021 16:50:23 +0000 Subject: [PATCH 06/16] go-statik: deprecate gopath --- Formula/go-statik.rb | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Formula/go-statik.rb b/Formula/go-statik.rb index 5d641f3f0ee73..069c98e4afa2c 100644 --- a/Formula/go-statik.rb +++ b/Formula/go-statik.rb @@ -19,13 +19,8 @@ class GoStatik < Formula conflicts_with "statik", because: "both install `statik` binaries" def install - ENV["GOPATH"] = HOMEBREW_CACHE/"go_cache" - (buildpath/"src/github.com/rakyll/statik").install buildpath.children - - cd "src/github.com/rakyll/statik" do - system "go", "build", "-o", bin/"statik" - prefix.install_metafiles - end + system "go", "build", *std_go_args, "-ldflags", "-s -w" + mv bin/"go-statik", bin/"statik" end test do From 0b270ffb4153b41839a5707d74ed8523ad32d448 Mon Sep 17 00:00:00 2001 From: Alexander Bayandin Date: Thu, 7 Jan 2021 16:50:23 +0000 Subject: [PATCH 07/16] hcloud: deprecate gopath --- Formula/hcloud.rb | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/Formula/hcloud.rb b/Formula/hcloud.rb index 6ee35a4d51f25..f4002c7eb427d 100644 --- a/Formula/hcloud.rb +++ b/Formula/hcloud.rb @@ -17,15 +17,8 @@ class Hcloud < Formula depends_on "go" => :build def install - ENV["GOPATH"] = HOMEBREW_CACHE/"go_cache" - (buildpath/"src/github.com/hetznercloud/cli").install buildpath.children - - cd "src/github.com/hetznercloud/cli" do - ldflags = "-w -X github.com/hetznercloud/cli/cli.Version=v#{version}" - system "go", "build", "-o", bin/"hcloud", "-ldflags", ldflags, - "./cmd/hcloud" - prefix.install_metafiles - end + ldflags = "-s -w -X github.com/hetznercloud/cli/cli.Version=v#{version}" + system "go", "build", *std_go_args, "-ldflags", ldflags, "./cmd/hcloud" output = Utils.safe_popen_read("#{bin}/hcloud", "completion", "bash") (bash_completion/"hcloud").write output From ea574ac9f9398fbd41efc2599944e154f8430a1a Mon Sep 17 00:00:00 2001 From: Alexander Bayandin Date: Thu, 7 Jan 2021 16:50:23 +0000 Subject: [PATCH 08/16] iamy: deprecate gopath --- Formula/iamy.rb | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Formula/iamy.rb b/Formula/iamy.rb index 3c443a375bf81..b63f9841bc647 100644 --- a/Formula/iamy.rb +++ b/Formula/iamy.rb @@ -20,14 +20,8 @@ class Iamy < Formula depends_on "awscli" def install - ENV["GOPATH"] = buildpath - src = buildpath/"src/github.com/99designs/iamy" - src.install buildpath.children - src.cd do - system "go", "build", "-o", bin/"iamy", "-ldflags", - "-X main.Version=v#{version}" - prefix.install_metafiles - end + system "go", "build", *std_go_args, "-ldflags", + "-s -w -X main.Version=v#{version}" end test do From 130e8d2a87e992b12d956a3fa5b8586699e19a3a Mon Sep 17 00:00:00 2001 From: Alexander Bayandin Date: Thu, 7 Jan 2021 16:50:24 +0000 Subject: [PATCH 09/16] jd: deprecate gopath --- Formula/jd.rb | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Formula/jd.rb b/Formula/jd.rb index e644d3355ac05..bb25ccee1e4a3 100644 --- a/Formula/jd.rb +++ b/Formula/jd.rb @@ -16,14 +16,7 @@ class Jd < Formula depends_on "go" => :build def install - ENV["GOPATH"] = buildpath - dir = buildpath/"src/github.com/josephburnett/jd" - dir.install buildpath.children - - cd dir do - system "go", "build", "-o", bin/"jd" - prefix.install_metafiles - end + system "go", "build", *std_go_args, "-ldflags", "-s -w" end test do From 9c1488f3659bd1eddbeaf727dce4ad0fc27c77bb Mon Sep 17 00:00:00 2001 From: Alexander Bayandin Date: Thu, 7 Jan 2021 16:50:24 +0000 Subject: [PATCH 10/16] megacmd: deprecate gopath --- Formula/megacmd.rb | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Formula/megacmd.rb b/Formula/megacmd.rb index 227ec071734e1..26d2ab3166561 100644 --- a/Formula/megacmd.rb +++ b/Formula/megacmd.rb @@ -19,12 +19,7 @@ class Megacmd < Formula depends_on "go" => :build def install - ENV["GOPATH"] = buildpath - (buildpath/"src/github.com/t3rm1n4l/megacmd").install buildpath.children - cd "src/github.com/t3rm1n4l/megacmd" do - system "go", "build", "-o", bin/"megacmd" - prefix.install_metafiles - end + system "go", "build", *std_go_args, "-ldflags", "-s -w" end test do From 1a155e32f4b4dc8bdd3507a22c9861dc470507cc Mon Sep 17 00:00:00 2001 From: Alexander Bayandin Date: Thu, 7 Jan 2021 16:50:24 +0000 Subject: [PATCH 11/16] mkcert: deprecate gopath --- Formula/mkcert.rb | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Formula/mkcert.rb b/Formula/mkcert.rb index af54ac9a3866c..f8eaf2d42d139 100644 --- a/Formula/mkcert.rb +++ b/Formula/mkcert.rb @@ -16,13 +16,7 @@ class Mkcert < Formula depends_on "go" => :build def install - ENV["GOPATH"] = HOMEBREW_CACHE/"go_cache" - (buildpath/"src/github.com/FiloSottile/mkcert").install buildpath.children - - cd "src/github.com/FiloSottile/mkcert" do - system "go", "build", "-o", bin/"mkcert", "-ldflags", "-X main.Version=v#{version}" - prefix.install_metafiles - end + system "go", "build", *std_go_args, "-ldflags", "-s -w -X main.Version=v#{version}" end test do From 1e0c609ec7112e839d26b1a009be58eb01195ece Mon Sep 17 00:00:00 2001 From: Alexander Bayandin Date: Thu, 7 Jan 2021 16:50:24 +0000 Subject: [PATCH 12/16] scmpuff: deprecate gopath --- Formula/scmpuff.rb | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Formula/scmpuff.rb b/Formula/scmpuff.rb index 5a368bcd7838a..7bb1fbe533219 100644 --- a/Formula/scmpuff.rb +++ b/Formula/scmpuff.rb @@ -18,13 +18,7 @@ class Scmpuff < Formula depends_on "go" => :build def install - ENV["GOPATH"] = HOMEBREW_CACHE/"go_cache" - (buildpath/"src/github.com/mroth/scmpuff").install buildpath.children - cd "src/github.com/mroth/scmpuff" do - system "go", "build", "-ldflags", "-X main.VERSION=#{version}", - "-o", bin/"scmpuff" - prefix.install_metafiles - end + system "go", "build", *std_go_args, "-ldflags", "-s -v -X main.VERSION=#{version}" end test do From 259b0cbe695e574fc0a6efbf2fea33e6be595b92 Mon Sep 17 00:00:00 2001 From: Alexander Bayandin Date: Thu, 7 Jan 2021 16:50:24 +0000 Subject: [PATCH 13/16] slackcat: deprecate gopath --- Formula/slackcat.rb | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Formula/slackcat.rb b/Formula/slackcat.rb index 7c2c4ab436ecb..3bca6fa80e466 100644 --- a/Formula/slackcat.rb +++ b/Formula/slackcat.rb @@ -18,14 +18,7 @@ class Slackcat < Formula depends_on "go" => :build def install - ENV["GOPATH"] = buildpath - - src = buildpath/"src/github.com/vektorlab/slackcat" - src.install buildpath.children - src.cd do - system "go", "build", "-o", bin/"slackcat", "-ldflags", "-X main.version=#{version}" - prefix.install_metafiles - end + system "go", "build", *std_go_args, "-ldflags", "-s -w -X main.version=#{version}" end test do From b6bd654363db26f3520773d6e318c043fe412da0 Mon Sep 17 00:00:00 2001 From: Alexander Bayandin Date: Thu, 7 Jan 2021 16:50:24 +0000 Subject: [PATCH 14/16] ssllabs-scan: deprecate gopath --- Formula/ssllabs-scan.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Formula/ssllabs-scan.rb b/Formula/ssllabs-scan.rb index 8b1602932052b..c52150757a5c6 100644 --- a/Formula/ssllabs-scan.rb +++ b/Formula/ssllabs-scan.rb @@ -18,8 +18,7 @@ class SsllabsScan < Formula depends_on "go" => :build def install - ENV["GOPATH"] = buildpath - system "go", "build", "-o", bin/"ssllabs-scan", "ssllabs-scan-v3.go" + system "go", "build", *std_go_args, "-ldflags", "-s -w", "ssllabs-scan-v3.go" end def caveats From c906b31afcb89794946d57f24696fb9b5d8938d8 Mon Sep 17 00:00:00 2001 From: Alexander Bayandin Date: Thu, 7 Jan 2021 16:50:24 +0000 Subject: [PATCH 15/16] up: deprecate gopath --- Formula/up.rb | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Formula/up.rb b/Formula/up.rb index 2fa6745235e77..3a4187f2092c6 100644 --- a/Formula/up.rb +++ b/Formula/up.rb @@ -17,14 +17,7 @@ class Up < Formula depends_on "go" => :build def install - ENV["GOPATH"] = HOMEBREW_CACHE/"go_cache" - dir = buildpath/"src/github.com/akavel/up" - dir.install buildpath.children - - cd dir do - system "go", "build", "-o", bin/"up", "up.go" - prefix.install_metafiles - end + system "go", "build", *std_go_args, "-ldflags", "-s -w", "up.go" end test do From f2c9b523b6cae25ef326b8c423576376ee9b944d Mon Sep 17 00:00:00 2001 From: Alexander Bayandin Date: Thu, 7 Jan 2021 16:50:24 +0000 Subject: [PATCH 16/16] velero: deprecate gopath --- Formula/velero.rb | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/Formula/velero.rb b/Formula/velero.rb index 34476ca8be9fd..69a2e2e66af68 100644 --- a/Formula/velero.rb +++ b/Formula/velero.rb @@ -17,26 +17,18 @@ class Velero < Formula depends_on "go" => :build def install - ENV["GOPATH"] = buildpath - dir = buildpath/"src/github.com/vmware-tanzu/velero" - dir.install buildpath.children - [buildpath/".brew_home"] - - cd dir do - system "go", "build", "-o", bin/"velero", "-installsuffix", "static", - "-ldflags", - "-X github.com/vmware-tanzu/velero/pkg/buildinfo.Version=v#{version}", - "./cmd/velero" - - # Install bash completion - output = Utils.safe_popen_read("#{bin}/velero", "completion", "bash") - (bash_completion/"velero").write output - - # Install zsh completion - output = Utils.safe_popen_read("#{bin}/velero", "completion", "zsh") - (zsh_completion/"_velero").write output - - prefix.install_metafiles - end + system "go", "build", *std_go_args, "-installsuffix", "static", + "-ldflags", + "-s -w -X github.com/vmware-tanzu/velero/pkg/buildinfo.Version=v#{version}", + "./cmd/velero" + + # Install bash completion + output = Utils.safe_popen_read("#{bin}/velero", "completion", "bash") + (bash_completion/"velero").write output + + # Install zsh completion + output = Utils.safe_popen_read("#{bin}/velero", "completion", "zsh") + (zsh_completion/"_velero").write output end test do