chore(main/gdu): fix arm, i686 and x86_64 build

* Now requires CGO for non AArch64 architectures.
* Fix version number.
* Disable static linking which does not work with liblog.
This commit is contained in:
Biswapriyo Nath 2024-04-21 15:42:51 +00:00 committed by Chongyun Lee
parent 17b19d5494
commit 63d1ec411f
2 changed files with 13 additions and 1 deletions

View File

@ -0,0 +1,11 @@
--- a/Makefile
+++ b/Makefile
@@ -7,7 +7,7 @@
DATE := $(shell date +'%Y-%m-%d')
GOFLAGS ?= -buildmode=pie -trimpath -mod=readonly -modcacherw -pgo=default.pgo
GOFLAGS_STATIC ?= -trimpath -mod=readonly -modcacherw -pgo=default.pgo
-LDFLAGS := -s -w -extldflags '-static' \
+LDFLAGS := -s -w -extldflags '$(LDFLAGS)' \
-X '$(PACKAGE)/build.Version=$(VERSION)' \
-X '$(PACKAGE)/build.User=$(shell id -u -n)' \
-X '$(PACKAGE)/build.Time=$(shell LC_ALL=en_US.UTF-8 date)'

View File

@ -10,8 +10,9 @@ TERMUX_PKG_BUILD_IN_SRC=true
termux_step_make() {
termux_setup_golang
sed -i 's|CGO_ENABLED=0|CGO_ENABLED=1|g' Makefile
make build
make build VERSION=$TERMUX_PKG_VERSION
make gdu.1
}