mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-03-20 13:02:31 +01:00
46 lines
1.5 KiB
Plaintext
46 lines
1.5 KiB
Plaintext
maintainer="Hoang Nguyen <folliekazetani@protonmail.com>"
|
|
pkgname=templ
|
|
pkgver=0.3.833
|
|
pkgrel=1
|
|
pkgdesc="Language for writing HTML user interface in Go"
|
|
url="https://templ.guide/"
|
|
arch="all"
|
|
license="MIT"
|
|
makedepends="go"
|
|
checkdepends="gopls"
|
|
source="$pkgname-$pkgver.tar.gz::https://github.com/a-h/templ/archive/refs/tags/v$pkgver.tar.gz"
|
|
options="net" # download Go modules
|
|
|
|
# /cmd/templ/lspcmd: hangs on s390x, fails on riscv64 and loongarch64, fails on ppc64le occasionally
|
|
# /cmd/templ/generatecmd/testwatch: panics on 32-bit platforms (unaligned 64-bit atomic operation)
|
|
case "$CARCH" in
|
|
armhf|armv7|loongarch64|ppc64le|riscv64|s390x|x86) options="$options !check";;
|
|
esac
|
|
|
|
export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
|
|
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
|
|
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"
|
|
|
|
build() {
|
|
echo "$pkgver" > .version
|
|
go build -v ./cmd/templ
|
|
}
|
|
|
|
check() {
|
|
./templ generate -include-version=false
|
|
|
|
# Removing -trimpath is needed for tests inside cmd/templ/generatecmd/testwatch and cmd/templ/lspcmd.
|
|
# The tests create template files relative to the current directory and try to watch those files.
|
|
# TestCompletion test fails with our custom GOMODCACHE value.
|
|
unset GOMODCACHE
|
|
GOFLAGS="${GOFLAGS/-trimpath/}" go test ./...
|
|
}
|
|
|
|
package() {
|
|
install -Dm755 $pkgname -t "$pkgdir"/usr/bin/
|
|
}
|
|
|
|
sha512sums="
|
|
121e9416d0717cc8c4d264132d8afb5b6bd3c50651bfedeedf63bbcfa7a1b475ff12dc9d5f9ac348305bbcade2e30c947d5445b14e2d424d21dad0afba71d4b8 templ-0.3.833.tar.gz
|
|
"
|