summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 30a6dcf8c113b643de12ff08873caa5bdaa881f4 (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: Jakub "Kubuxu" Sztandera  <kubuxu@protonmail.ch>
# vim: set expandtab ts=2 sw=2:

pkgname=gx-go
pkgver=0.2.0
pkgrel=1
epoch=
pkgdesc="A tool to use with the gx package manager for packages written in go."
arch=('i686' 'x86_64' 'armv7h')
url="https://github.com/whyrusleeping/$pkgname"
license=('MIT')
makedepends=('git' 'go')
source=("git+${url}.git")
md5sums=('SKIP')

pkgver_DISABLED() {
  # Renable after tags are placed in the repo.
  cd "$srcdir/$pkgname"
  git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  mkdir -p "$srcdir"/src/github.com/whyrusleeping/
  ln -fs "$srcdir/$pkgname" "$srcdir"/src/github.com/whyrusleeping/"$pkgname"
}

build() {
  # Required for go get
  export GOPATH="$srcdir"
  cd "$srcdir"/src/github.com/whyrusleeping/"$pkgname"

  msg2 'Installing dependencies...'
  go get -v 

  msg2 'Building binary...'
  go install -v 
}

package() {
  msg2 'Packaging binary...'
  install -Dm 755 bin/gx-go "${pkgdir}/usr/bin/gx-go"

  msg2 'Packaging auxiliary files...'
  cd "$pkgname"
  install -Dm 644 -t "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE
}