alist/3.30.0-5: follow system c/cpp flags

This commit is contained in:
Puqns67 2024-02-02 18:08:00 +08:00
parent 7862de34bc
commit 8f99ce71cd
Signed by: Puqns67
GPG Key ID: 9669DF042554F536

View File

@ -2,7 +2,7 @@
pkgname='alist' pkgname='alist'
pkgver=3.30.0 pkgver=3.30.0
pkgrel=4 pkgrel=5
pkgdesc='A file list/WebDAV program that supports multiple storages, powered by Gin and Solidjs.' pkgdesc='A file list/WebDAV program that supports multiple storages, powered by Gin and Solidjs.'
url="https://github.com/alist-org/alist" url="https://github.com/alist-org/alist"
license=('AGPL-3.0-or-later') license=('AGPL-3.0-or-later')
@ -33,9 +33,15 @@ prepare() {
} }
build() { build() {
export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CFLAGS="${CFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
export CGO_LDFLAGS="${LDFLAGS}"
export GOFLAGS="-v -x -work -modcacherw -trimpath -buildmode=pie -mod=readonly"
cd "${srcdir}/${pkgname}-${pkgver}" cd "${srcdir}/${pkgname}-${pkgver}"
go build -v -x -work -trimpath -buildmode=pie -o "${srcdir}/${pkgname}" \ go build -o "${srcdir}/${pkgname}" \
-ldflags="-w -s \ -ldflags="-w -s -linkmode external \
-X 'github.com/alist-org/alist/v3/internal/conf.BuiltAt=$(date +"%F %T %z")' \ -X 'github.com/alist-org/alist/v3/internal/conf.BuiltAt=$(date +"%F %T %z")' \
-X 'github.com/alist-org/alist/v3/internal/conf.GoVersion=$(go version | sed "s/go version //")' \ -X 'github.com/alist-org/alist/v3/internal/conf.GoVersion=$(go version | sed "s/go version //")' \
-X 'github.com/alist-org/alist/v3/internal/conf.Version=${pkgver}'" -X 'github.com/alist-org/alist/v3/internal/conf.Version=${pkgver}'"