# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer : Jaroslav Lichtblau <svetlemodry@archlinux.org>
# Contributor: Martin Wimpress <code@flexion.org>
# Contributor: Sauyon Lee <arch@sauyon.com>

pkgname=godep
pkgver=80
pkgrel=4
epoch=2
pkgdesc="Dependency tool for go"
arch=(x86_64 powerpc64le)
url="https://github.com/tools/godep"
license=('BSD')
depends=('glibc')
makedepends=('git' 'go-pie' 'mercurial')
source=($pkgname-$pkgver.tar.gz::https://github.com/tools/godep/archive/v$pkgver.tar.gz)
sha256sums=('029adc1a0ce5c63cd40b56660664e73456648e5c031ba6c214ba1e1e9fc86cf6')

prepare() {
  export GOPATH="${srcdir}"
  go get golang.org/x/tools/go/vcs
  go get github.com/pmezard/go-difflib/difflib
  go get github.com/kr/fs
  go get github.com/kr/pretty
}

build() {
  cd "${srcdir}"/$pkgname-$pkgver

  GOPATH="${srcdir}" go build \
    -gcflags "all=-trimpath=${PWD}" \
    -asmflags "all=-trimpath=${PWD}" \
    -ldflags "-extldflags ${LDFLAGS}"
}

package() {
  cd "${srcdir}"/$pkgname-$pkgver

  install -Dm755 $pkgname-$pkgver "${pkgdir}"/usr/bin/$pkgname
  install -Dm644 License "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
}
