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

pkgname=ergo-git
pkgver=0.4.0.r6.ga9d20c6
pkgrel=1
pkgdesc="List of utilities for the daily developer workflow"
arch=('x86_64')
url='https://github.com/beatlabs/ergo'
license=('BSD')
provides=('ergo')
depends=('glibc')
makedepends=('go' 'git')
source=("git+${url}")
sha256sums=('SKIP')

pkgver() {
  cd "${srcdir}/ergo"
  git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cd "${srcdir}/ergo"
  mkdir -p $srcdir/go
  export GOPATH="${srcdir}"/go
  export PATH=$PATH:$GOPATH/bin
  go get -d -v ./...
}

build() {
  export GOPATH="${srcdir}"/go
  export PATH=$PATH:$GOPATH/bin
  cd "${srcdir}/ergo/cmd/cli"
  go build -mod=mod -v -o "${srcdir}/ergo-bin"
}

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