From f37cf0a7bee332425bd4dc8c97e5d813c0c2f15c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niccol=C3=B2=20Belli?= Date: Thu, 9 Mar 2023 13:05:54 +0100 Subject: [PATCH] feat: add ppc64le support --- Makefile | 4 ++++ package.json | 1 + pkg/package-format/appimage/appImage.go | 2 +- scripts/build.sh | 3 +++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 95916f7..57f5c6d 100644 --- a/Makefile +++ b/Makefile @@ -13,11 +13,15 @@ ifeq ($(OS),Windows_NT) endif else UNAME_S := $(shell uname -s) + UNAME_M := $(shell uname -m) ifeq ($(UNAME_S),Linux) ifeq ($(UNAME_M),riscv64) OS_ARCH := linux_riscv64 else ifeq ($(UNAME_M),loongarch64) OS_ARCH := linux_loong64 + # uname -m returns ppc64le on little endian systems, so we check if it contains ppc64 instead of an exact match + else ifneq (,$(findstring ppc64,$(UNAME_M))) + OS_ARCH := linux_ppc64 else OS_ARCH := linux_amd64 endif diff --git a/package.json b/package.json index 1ec421c..b8c2e98 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "linux/ia32/app-builder", "linux/loong64/app-builder", "linux/riscv64/app-builder", + "linux/ppc64/app-builder", "linux/x64/app-builder", "mac/app-builder", "mac/app-builder_amd64", diff --git a/pkg/package-format/appimage/appImage.go b/pkg/package-format/appimage/appImage.go index 76151d4..0a459df 100644 --- a/pkg/package-format/appimage/appImage.go +++ b/pkg/package-format/appimage/appImage.go @@ -38,7 +38,7 @@ func ConfigureCommand(app *kingpin.Application) { appDir: command.Flag("app", "The app dir.").Short('a').Required().String(), stageDir: command.Flag("stage", "The stage dir.").Short('s').Required().String(), output: command.Flag("output", "The output file.").Short('o').Required().String(), - arch: command.Flag("arch", "The arch.").Default("x64").Enum("x64", "ia32", "armv7l", "arm64", "riscv64", "loong64"), + arch: command.Flag("arch", "The arch.").Default("x64").Enum("x64", "ia32", "armv7l", "arm64", "riscv64", "ppc64", "loong64"), template: command.Flag("template", "The template file.").String(), license: command.Flag("license", "The license file.").String(), diff --git a/scripts/build.sh b/scripts/build.sh index d096f3d..8849c98 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -19,6 +19,9 @@ GOOS=linux GOARCH=amd64 go build -ldflags='-s -w' -o linux/x64/app-builder mkdir -p linux/riscv64 GOOS=linux GOARCH=riscv64 go build -ldflags='-s -w' -o linux/riscv64/app-builder +mkdir -p linux/ppc64 +GOOS=linux GOARCH=ppc64 go build -ldflags='-s -w' -o linux/ppc64/app-builder + mkdir -p linux/arm GOOS=linux GOARCH=arm go build -ldflags='-s -w' -o linux/arm/app-builder