summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 96688f4fe359cf953091ac622bc4cebe972d8c0e (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
# Maintainer: Fernando Mumbach <fermuch at cryptolab dot net>
_pkgname=qq
pkgname=$_pkgname-git
pkgver=v0.2.1.re.1.ga871a13
pkgrel=2
pkgdesc="jq inspired interoperable config format transcoder with interactive querying; JSON/YAML/TOML/XML/... support; MIT license - git development version"
arch=('i686' 'x86_64')
url="https://github.com/JFryy/qq/"
license=('MIT')
groups=()
depends=()
makedepends=('git' 'go' 'jq')
optdepends=()
provides=("$_pkgname")
conflicts=("$_pkgname")
backup=()
source=("$_pkgname::git+https://github.com/JFryy/qq.git")
md5sums=('SKIP')

pkgver() {
  cd "$srcdir/$_pkgname"
  git describe --tags | sed 's|-|.|g'
}

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

  cd "$srcdir/$_pkgname"
  go build -o "bin/${_pkgname}" "${srcdir}/${_pkgname}"
}

check() {
  cd "${srcdir}/${_pkgname}"
  ./tests/test.sh
}

package() {
  mkdir -p "${pkgdir}/usr/local/bin/"

  cd "${srcdir}/${_pkgname}"
  install -Dm755 ./bin/qq "${pkgdir}/usr/local/bin/${_pkgname}"
}