summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorTaco de Wolff2024-03-24 10:22:25 -0300
committerTaco de Wolff2024-03-24 10:22:25 -0300
commit69d92c6b9719068029bea8f1c136a25cd5a8f63a (patch)
tree7303f9726ec6397b5d67436d3cfc0f928b51268d
parentd0a5df232869a4746c892c1af62d1366471e3d99 (diff)
downloadaur-69d92c6b9719068029bea8f1c136a25cd5a8f63a.tar.gz
Use CGO_ENABLED for non-x86-64 architectures
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD10
2 files changed, 7 insertions, 5 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 8f13e25a22c2..fb47f7321642 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -3,7 +3,7 @@ pkgbase = minify
pkgver = 2.20.19
pkgrel = 1
url = https://github.com/tdewolff/minify
- arch = x86_64
+ arch = any
license = MIT
makedepends = go
optdepends = bash-completion: command-line autocomplete with bash
diff --git a/PKGBUILD b/PKGBUILD
index 6cb398d82910..926974d74465 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -6,7 +6,7 @@ pkgname=minify
pkgver=2.20.19
pkgrel=1
pkgdesc="Minifier CLI for HTML, CSS, JS, JSON, SVG and XML"
-arch=('x86_64')
+arch=('any')
url="https://github.com/tdewolff/minify"
license=('MIT')
makedepends=('go')
@@ -21,9 +21,11 @@ prepare() {
build() {
cd "$pkgname-$pkgver"
- export CGO_ENABLED=0
+ if [ "$CARCH" == "x86_64" ]; then
+ export CGO_ENABLED=0
+ fi
go build -trimpath -buildmode=pie -mod=readonly -modcacherw \
- -ldflags "-X 'main.Version=v$pkgver'" -o build ./cmd/minify
+ -ldflags "-linkmode external -extldflags \"${LDFLAGS}\" -X 'main.Version=v$pkgver'" -o build/minify ./cmd/minify
}
check() {
@@ -33,7 +35,7 @@ check() {
package() {
cd "$pkgname-$pkgver"
- install -Dm755 "build/$pkgname" "$pkgdir/usr/bin/$pkgname"
+ install -Dm755 build/minify "$pkgdir/usr/bin/$pkgname"
install -Dm644 "LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
install -Dm644 "cmd/minify/bash_completion" "$pkgdir/usr/share/bash-completion/completions/$pkgname"
source cmd/minify/bash_completion