summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 19f292286c37a3df3320b83f226646d1b2c2f32b (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
# Maintainer: Dimitris Kiziridis <ragouel at outlook dot com>

pkgname=apicompat-git
_pkgname=apicompat
pkgver=r125.5f916b1
pkgrel=1
pkgdesc="Checks recent changes to a Go project for backwards incompatible changes"
arch=('x86_64')
url='https://abicheck.bradleyf.id.au'
license=('MIT')
provides=('apicompat')
makedepends=('git' 'go')
source=("git+https://github.com/bradleyfalzon/apicompat")
md5sums=('SKIP')

pkgver() {
  cd "${srcdir}/${_pkgname}"
   ( set -o pipefail
    git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
  )
  
}

build() {
  cd "${srcdir}/${_pkgname}"
  mkdir -p $srcdir/go
  export GOPATH="${srcdir}"/go
  export PATH=$PATH:$GOPATH/bin
  go get -d -v ./...
  cd cmd/apicompat
  go build -v -o "${srcdir}/${_pkgname}-bin"
}

package() {
  cd "${srcdir}/${_pkgname}"
  install -Dm755 ../${_pkgname}-bin "${pkgdir}/usr/bin/${_pkgname}"
  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${_pkgname}/LICENSE"
  go clean -modcache #Remove go libraries
}