diff options
author | Mario Finelli | 2024-02-01 11:56:54 +0100 |
---|---|---|
committer | Mario Finelli | 2024-02-01 11:56:54 +0100 |
commit | 81f192de69cdc120b60ea417dcafe2349e19dfa3 (patch) | |
tree | 49abc309bc670f4dad30cdbee7a79920aaef1d6c /PKGBUILD | |
download | aur-ogen.tar.gz |
Initial commit
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..d7ad0207581a --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,52 @@ +# Maintainer: Mario Finelli <mario at finel dot li> + +pkgname=ogen +pkgver=0.81.2 +pkgrel=1 +pkgdesc="OpenAPI v3 code generator for go" +arch=(x86_64) +url=https://ogen.dev +license=(Apache) +depends=(glibc) +makedepends=(go) +source=("$pkgname-$pkgver.tar.gz::https://github.com/ogen-go/ogen/archive/v$pkgver.tar.gz") +sha256sums=('003465a514e11c17fc0fefb5b3e88b6f5df796b0372ba6a86d996584cbe70486') + +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: |