Simply detection of PROTOC archive file name

The introduction of a new ARCH variable was unnecessary, as ARCH already
exists. That said, the .zip provided for PROTOC isn't a natural fit
here either, as upsream uses `aarch_64` rather than `aarch64`.

In stead, I've used `notdir` to get the filename from the
already-defined `PROTOC_URL`.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
Jonathon Anderson
2023-09-01 02:49:40 -06:00
parent 41f86f7f58
commit 87bcec1cb2
2 changed files with 2 additions and 4 deletions

View File

@@ -30,8 +30,8 @@ $(GO_TOOLS_BIN):
$(GOLANGCI_LINT):
curl -qq -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(TOOLS_BIN) $(GOLANGCI_LINT_VERSION)
$(PROTOC):
cd $(PWD)/$(TOOLS_DIR) && curl -LO $(PROTOC_URL) && unzip protoc-24.0-linux-$(ARCHITECTURE_CPU).zip
$(PROTOC): $(TOOLS_DIR)
cd $(TOOLS_DIR) && curl -LO $(PROTOC_URL) && unzip -o $(notdir $(PROTOC_URL))
$(PROTOC_GEN_GRPC_GATEWAY):
curl -L $(PROTOC_GEN_GRPC_GATEWAY_URL) -o $(PROTOC_GEN_GRPC_GATEWAY)

View File

@@ -83,8 +83,6 @@ CONFIG := $(shell pwd)
# helper functions
godeps=$(shell go list -deps -f '{{if not .Standard}}{{ $$dep := . }}{{range .GoFiles}}{{$$dep.Dir}}/{{.}} {{end}}{{end}}' $(1) | sed "s%${PWD}/%%g")
ARCHITECTURE_CPU=$(shell lscpu | grep 'Architecture' | cut -d':' -f2 | xargs)
# use GOPROXY for older git clients and speed up downloads
GOPROXY ?= https://proxy.golang.org
export GOPROXY