Commit 2fca5274 authored by Michal Berger's avatar Michal Berger Committed by Tomasz Zawadzki
Browse files

scripts/pkgdep: Make golang-related installers aware of FreeBSD



Make sure install_golang() can fetch proper package for FreeBSD.
Also, skip install_protoc() under FreeBSD since protobuf doesn't
provide release package for it (it can be installed via pkg but
we can't really guarantee the right version, hence not putting it
in as a dependency).

Change-Id: I50e07cdabc924e0e99805a46ca79a754a5f213b4
Signed-off-by: default avatarMichal Berger <michal.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/20087


Reviewed-by: default avatarKrzysztof Karas <krzysztof.karas@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
parent ade920a0
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -177,7 +177,7 @@ install_protoc() {

install_golang() {
	local GOVERSION=${GOVERSION:-1.21.1}
	local godir gopkg gover arch
	local godir gopkg gover arch os

	read -r _ _ gover _ < <(go version) || true
	gover=${gover#go}
@@ -192,10 +192,11 @@ install_golang() {
	fi
	mkdir -p "${godir}"
	arch=amd64
	os=$(uname -s)
	if [[ "$(uname -m)" == "aarch64" ]]; then
		arch=arm64
	fi
	gopkg=go${GOVERSION}.linux-${arch}.tar.gz
	gopkg=go${GOVERSION}.${os,,}-${arch}.tar.gz
	echo "installing go v${GOVERSION} to ${godir}/bin"
	curl -sL https://go.dev/dl/${gopkg} | tar -C "${godir}" -xzf - --strip 1
	if ! "${godir}/bin/go" version; then
@@ -268,6 +269,6 @@ fi

if [[ $INSTALL_GOLANG == true ]]; then
	install_golang
	install_protoc
	[[ $(uname -s) == Linux ]] && install_protoc
	install_golangci_lint
fi