From 8f99ce71cddf8a16292d850219aa748b30edcbda Mon Sep 17 00:00:00 2001 From: Puqns67 Date: Fri, 2 Feb 2024 18:08:00 +0800 Subject: [PATCH] alist/3.30.0-5: follow system c/cpp flags --- packages/alist/PKGBUILD | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/alist/PKGBUILD b/packages/alist/PKGBUILD index cbb2345..08ccf9c 100644 --- a/packages/alist/PKGBUILD +++ b/packages/alist/PKGBUILD @@ -2,7 +2,7 @@ pkgname='alist' pkgver=3.30.0 -pkgrel=4 +pkgrel=5 pkgdesc='A file list/WebDAV program that supports multiple storages, powered by Gin and Solidjs.' url="https://github.com/alist-org/alist" license=('AGPL-3.0-or-later') @@ -33,9 +33,15 @@ prepare() { } 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}" - go build -v -x -work -trimpath -buildmode=pie -o "${srcdir}/${pkgname}" \ - -ldflags="-w -s \ + go build -o "${srcdir}/${pkgname}" \ + -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.GoVersion=$(go version | sed "s/go version //")' \ -X 'github.com/alist-org/alist/v3/internal/conf.Version=${pkgver}'"