From 4015728d912d4c5483eb2942b8039c60de9631e9 Mon Sep 17 00:00:00 2001 From: Levi Zim Date: Tue, 12 Sep 2023 15:39:44 +0800 Subject: [PATCH] feat: add Linux riscv64 support (#90) --- Makefile | 6 +++++- pkg/package-format/appimage/appImage.go | 2 +- scripts/build.sh | 3 +++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 957e613..f5a5116 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,11 @@ ifeq ($(OS),Windows_NT) else UNAME_S := $(shell uname -s) ifeq ($(UNAME_S),Linux) - OS_ARCH := linux_amd64 + ifeq ($(UNAME_M),riscv64) + OS_ARCH := linux_riscv64 + else + OS_ARCH := linux_amd64 + endif endif ifeq ($(UNAME_S),Darwin) OS_ARCH := darwin_$(shell uname -m) diff --git a/pkg/package-format/appimage/appImage.go b/pkg/package-format/appimage/appImage.go index 4df4f8c..52eb53f 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"), + arch: command.Flag("arch", "The arch.").Default("x64").Enum("x64", "ia32", "armv7l", "arm64", "riscv64"), 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 c97e616..92d4e1a 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -18,6 +18,9 @@ GOOS=linux GOARCH=386 go build -ldflags='-s -w' -o linux/ia32/app-builder .. mkdir -p linux/x64 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/arm GOOS=linux GOARCH=arm go build -ldflags='-s -w' -o linux/arm/app-builder ..