blob: 33391e366e2fe4ab387c5ef1e1151d96a3ac879d (
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=ogen
pkgver=1.9.0
pkgrel=1
pkgdesc="OpenAPI v3 code generator for go"
arch=(x86_64)
url=https://ogen.dev
license=(Apache-2.0)
depends=(glibc)
makedepends=(go)
source=("$pkgname-$pkgver.tar.gz::https://github.com/ogen-go/ogen/archive/v$pkgver.tar.gz")
sha256sums=('7f3f75608290e96c6725bb8cdd75cb76499c263804069b932adf1c8eaee4188b')
prepare() {
cd $pkgname-$pkgver
export GOPATH="$srcdir/gopath"
go mod download
}
check() {
cd $pkgname-$pkgver
export GOPATH="$srcdir/gopath"
go test -mod=readonly -v ./...
}
build() {
cd $pkgname-$pkgver
export GOPATH="$srcdir/gopath"
export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CFLAGS="${CFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
export CGO_LDFLAGS="${LDFLAGS}"
go build -o ogen \
-buildmode=pie \
-trimpath \
-mod=readonly \
-modcacherw \
-ldflags "-linkmode external -extldflags \"${LDFLAGS}\"" \
cmd/ogen/main.go
}
package() {
cd $pkgname-$pkgver
install -Dm0755 $pkgname "$pkgdir/usr/bin/$pkgname"
install -Dm0644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
}
# vim: set ts=2 sw=2 et:
|