fix: change ldflags
This commit is contained in:
@@ -11,8 +11,34 @@ makedepends=('go')
|
|||||||
source=("https://github.com/christian-korneck/docker-pushrm/archive/v${pkgver}.zip")
|
source=("https://github.com/christian-korneck/docker-pushrm/archive/v${pkgver}.zip")
|
||||||
sha512sums=('aef19964c740b4d9b512b696759cd4b31793ced91f066864e534242d74694a796ee9930a809c2b5a6779238e32572642ab05fa5a7f8cf1062d0a9dd5f40c52d8')
|
sha512sums=('aef19964c740b4d9b512b696759cd4b31793ced91f066864e534242d74694a796ee9930a809c2b5a6779238e32572642ab05fa5a7f8cf1062d0a9dd5f40c52d8')
|
||||||
|
|
||||||
|
prepare() {
|
||||||
|
cd ${srcdir}/${pkgname}-${pkgver}
|
||||||
|
|
||||||
|
export GOPATH="${srcdir}"
|
||||||
|
|
||||||
|
env | sort | grep -E '^C?GO'
|
||||||
|
|
||||||
|
go mod download -modcacherw
|
||||||
|
}
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
cd ${srcdir}/${pkgname}-${pkgver} && go build
|
cd ${srcdir}/${pkgname}-${pkgver}
|
||||||
|
|
||||||
|
# https://wiki.archlinux.org/title/Go_package_guidelines
|
||||||
|
export CGO_CPPFLAGS="${CPPFLAGS}"
|
||||||
|
export CGO_CFLAGS="${CFLAGS}"
|
||||||
|
export CGO_CXXFLAGS="${CXXFLAGS}"
|
||||||
|
export CGO_LDFLAGS="${LDFLAGS}"
|
||||||
|
export GOPATH="${srcdir}"
|
||||||
|
|
||||||
|
go build \
|
||||||
|
-trimpath \
|
||||||
|
-buildmode=pie \
|
||||||
|
-mod=readonly \
|
||||||
|
-modcacherw \
|
||||||
|
-ldflags "-linkmode external" \
|
||||||
|
-o $pkgname \
|
||||||
|
.
|
||||||
}
|
}
|
||||||
|
|
||||||
package() {
|
package() {
|
||||||
|
|||||||
Reference in New Issue
Block a user