summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 4197075e1a9cb544c5c29f993165df8a75de461b (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
# Maintainer: Jamison Lahman <jamison+aur@lahman.dev>
# Contributor:
pkgname=json2struct
pkgver=1.9.3
pkgrel=3
pkgdesc="CLI tool to convert JSON to struct type definitions"
arch=('x86_64' 'aarch64')
url="https://github.com/marhaupe/json2struct"
license=('GPL-3.0')
depends=('glibc')
makedepends=('go' 'git')
source=("git+https://github.com/marhaupe/json2struct.git#tag=v$pkgver")
sha256sums=('SKIP')

build() {
  cd "$pkgname" || exit
  go build \
    -trimpath \
    -mod=readonly \
    -modcacherw \
    -ldflags='-s -w' \
    -o $pkgname \
    .
}

package() {
  cd "$pkgname" || exit
  install -Dm 755 $pkgname -t "$pkgdir/usr/bin"
  install -Dm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
  install -Dm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname"
}