From f444d75d80594a30d01fb70ef0e87f94534b2726 Mon Sep 17 00:00:00 2001 From: Luca Bilke Date: Fri, 7 Jun 2024 22:44:22 +0200 Subject: [PATCH] k9s: fix cross-platform builds --- srcpkgs/k9s/template | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/srcpkgs/k9s/template b/srcpkgs/k9s/template index eb361efff77..fd655b1278e 100644 --- a/srcpkgs/k9s/template +++ b/srcpkgs/k9s/template @@ -16,13 +16,28 @@ checksum=597fa2c547437070a8993d1fb6fce91d696bd3731d37230feace3a2d3bfdb198 export LDFLAGS="-fuse-ld=bfd" post_build() { +case "${XBPS_MACHINE}" in + aarch64*) export GOARCH=arm64 ;; + armv5*) export GOARCH=arm; export GOARM=5 ;; + armv6*) export GOARCH=arm; export GOARM=6 ;; + armv7*) export GOARCH=arm; export GOARM=7 ;; + i686*) export GOARCH=386 ;; + x86_64*) export GOARCH=amd64 ;; + ppc64le*) export GOARCH=ppc64le ;; + ppc64*) export GOARCH=ppc64 ;; + ppc*) export GOARCH=ppc ;; + mipsel*) export GOARCH=mipsle ;; + mips*) export GOARCH=mips ;; + riscv64*) export GOARCH=riscv64 ;; + *) broken="Unsupported architecture ${XBPS_TARGET_MACHINE}" ;; +esac for shell in bash zsh fish; do - _build-k9s-xbps/bin/k9s completion $shell >k9s.$shell + go run main.go completion $shell >completion.$shell done } post_install() { for shell in bash zsh fish; do - vcompletion k9s.$shell $shell + vcompletion completion.$shell $shell done }