blob: 79cc727f500e50214fa049bce0cfce8f3cdfdf86 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
# Maintainer: Mario Finelli <mario at finel dot li>
pkgname=templ
pkgver=0.3.819
pkgrel=1
pkgdesc="A language for writing HTML user interfaces in Go"
arch=(x86_64)
url=https://templ.guide
license=(MIT)
depends=(glibc)
makedepends=(go)
source=(https://github.com/a-h/templ/archive/v${pkgver}/$pkgname-$pkgver.tar.gz)
sha256sums=('b1eb741291c4c2309d498ef458ef6fbc0eb53a31f46b2690df26e12912e4c8ac')
prepare() {
cd $pkgname-$pkgver
export GOPATH="${srcdir}/gopath"
go mod download
}
build() {
cd $pkgname-$pkgver
export CGO_LDFLAGS="$LDFLAGS"
export CGO_CFLAGS="$CFLAGS"
export CGO_CPPFLAGS="$CPPFLAGS"
export CGO_CXXFLAGS="$CXXFLAGS"
export GOPATH="${srcdir}/gopath"
go build \
-o templ \
-trimpath \
-buildmode=pie \
-mod=readonly \
-ldflags "-linkmode external -extldflags \"${LDFLAGS}\"" \
./cmd/templ
}
check() {
cd $pkgname-$pkgver
export GOPATH="$srcdir/gopath"
# go test -mod=readonly -v ./...
}
package() {
cd $pkgname-$pkgver
install -Dm0755 templ "$pkgdir/usr/bin/templ"
install -vDm0644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
# vim: set ts=2 sw=2 et:
|