diff --git a/Formula/octant.rb b/Formula/octant.rb index 8993819174a44..6bdc58bf6a815 100644 --- a/Formula/octant.rb +++ b/Formula/octant.rb @@ -1,3 +1,5 @@ +require "language/node" + class Octant < Formula desc "Kubernetes introspection tool for developers" homepage "https://octant.dev" @@ -28,29 +30,21 @@ class Octant < Formula end def install - ENV["GOPATH"] = buildpath ENV["GOFLAGS"] = "-mod=vendor" - ENV.append_path "PATH", HOMEBREW_PREFIX/"bin" - - dir = buildpath/"src/github.com/vmware-tanzu/octant" - dir.install buildpath.children + Language::Node.setup_npm_environment - cd "src/github.com/vmware-tanzu/octant" do - system "go", "run", "build.go", "go-install" - ENV.prepend_path "PATH", buildpath/"bin" + system "go", "run", "build.go", "go-install" + system "go", "run", "build.go", "web-build" - system "go", "run", "build.go", "web-build" + ldflags = ["-X main.version=#{version}", + "-X main.gitCommit=#{Utils.git_head}", + "-X main.buildTime=#{time.iso8601}"].join(" ") - ldflags = ["-X \"main.version=#{version}\"", - "-X \"main.gitCommit=#{Utils.git_head}\"", - "-X \"main.buildTime=#{time.iso8601}\""].join(" ") + tags = "embedded exclude_graphdriver_devicemapper exclude_graphdriver_btrfs containers_image_openpgp" - tags = "embedded exclude_graphdriver_devicemapper exclude_graphdriver_btrfs containers_image_openpgp" - - system "go", "build", *std_go_args(ldflags: ldflags), - "-tags", tags, "-v", "./cmd/octant" - end + system "go", "build", *std_go_args(ldflags: ldflags), + "-tags", tags, "-v", "./cmd/octant" end test do diff --git a/Formula/openshift-cli.rb b/Formula/openshift-cli.rb index 1c3b924a8284f..ea2e9358e0d1e 100644 --- a/Formula/openshift-cli.rb +++ b/Formula/openshift-cli.rb @@ -46,25 +46,20 @@ def install "linux" end - ENV["GOPATH"] = buildpath - dir = buildpath/"src/github.com/openshift/oc" - dir.install buildpath.children - [buildpath/".brew_home"] - cd dir do - args = ["cross-build-#{os}-#{arch}"] - args << if build.stable? - "WHAT=cmd/oc" - else - "WHAT=staging/src/github.com/openshift/oc/cmd/oc" - end - args << "SHELL=/bin/bash" if OS.linux? + args = ["cross-build-#{os}-#{arch}"] + args << if build.stable? + "WHAT=cmd/oc" + else + "WHAT=staging/src/github.com/openshift/oc/cmd/oc" + end + args << "SHELL=/bin/bash" if OS.linux? - system "make", *args - bin.install "_output/bin/#{os}_#{arch}/oc" + system "make", *args + bin.install "_output/bin/#{os}_#{arch}/oc" - bash_completion.install "contrib/completions/bash/oc" - zsh_completion.install "contrib/completions/zsh/oc" => "_oc" - end + bash_completion.install "contrib/completions/bash/oc" + zsh_completion.install "contrib/completions/zsh/oc" => "_oc" end test do