wtplan: fix build with modern go

This commit is contained in:
Đoàn Trần Công Danh 2022-11-17 23:07:57 +07:00
parent a0e0b6de6c
commit 192aa2cdd1

View file

@ -15,13 +15,21 @@ checksum=31c66181f815889828eb2bd3739d6b23582ec75a5a8d6c6bf76c2a6679112bb4
do_build() { do_build() {
export GOPATH=$(pwd) export GOPATH=$(pwd)
export VERSIONSTR=$version export VERSIONSTR=$version
go generate wtplan go generate ./src/wtplan/main.go
go generate wtplan-web go generate ./src/wtplan-web/main.go
cat <<-EOF >src/wtplan/version.go
package main
var version = \`wtplan ${version}\`
EOF
. $XBPS_COMMONDIR/environment/build-style/go.sh . $XBPS_COMMONDIR/environment/build-style/go.sh
GOPATH=$(pwd) GOPATH=$(pwd)
# Without -buildmode=pie, build failure on armv6hf-musl # Without -buildmode=pie, build failure on armv6hf-musl
go build -buildmode=pie wtplan go build -buildmode=pie -o wtplan \
go build -buildmode=pie wtplan-web ./src/wtplan/main.go ./src/wtplan/version.go
go build -buildmode=pie -o wtplan-web \
-ldflags "-X main.version=$version" \
./src/wtplan-web/main.go ./src/wtplan-web/textfiles.go
} }
post_install() { post_install() {