summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 43af0ae1dd638ba9b2d2352a2d686a357eb9d7cf (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
pkgname=swag
pkgver=1.16.3
pkgrel=2
pkgdesc='Automatically generate RESTful API documentation with Swagger 2.0 for Go.'
arch=('x86_64')
url="https://github.com/swaggo/swag"
license=('MIT')
makedepends=('go')
source=("https://github.com/swaggo/swag/archive/refs/tags/v$pkgver.tar.gz")
sha256sums=('c297b7e502fb7884282d4fa074af4fc015a8be26a4a47116ed53746596dd3078')

build() {
  cd "$pkgname-$pkgver"
  export CGO_CPPFLAGS="${CPPFLAGS}"
  export CGO_CFLAGS="${CFLAGS}"
  export CGO_CXXFLAGS="${CXXFLAGS}"
  export CGO_LDFLAGS="${LDFLAGS}"
  export GOFLAGS="-buildmode=pie -ldflags=-linkmode=external -mod=readonly -modcacherw"
  make build
}

check() {
  cd "$pkgname-$pkgver"
  make test
}

package() {
  cd "$pkgname-$pkgver"
  install -Dm755 swag "$pkgdir/usr/bin/swag"
}