diff options
author | Yang Bai | 2015-07-02 18:11:15 +0800 |
---|---|---|
committer | Yang Bai | 2015-07-02 18:11:15 +0800 |
commit | c915a08d7b500933ab9a760a5a5305db1e1c5e76 (patch) | |
tree | 8e5933647b1ecb17c26053a398577de3645bd3bb /PKGBUILD | |
download | aur-gocode-bin.tar.gz |
20150420-1
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..b651f57f8050 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,47 @@ +# Maintainer: Yang Bai <hamo.by@gmail.com> +# Contributor: Daniel YC Lin <dlin.tw at> gmail.com> +# Contributor: Daniel Micay <danielmicay@gmail.com> +# Contributor: Dave Reisner <d@falconindy.com> + +pkgname=gocode-bin +pkgver=20150420 +pkgrel=1 +pkgdesc="An autocompletion/refactoring daemon for the Go programming language (binary only)" +arch=(i686 x86_64) +url="https://github.com/nsf/gocode" +license=('GPL') +depends=('go') +provides=('gocode') +conflicts=('gocode') +install= +makedepends=('git') +#optdepends= + +_gitroot="https://github.com/nsf/gocode.git" +_gitname="gocode" + +build() { + cd "$srcdir" + msg "Connecting to GIT server...." + if [[ -d "$_gitname" ]]; then + cd "$_gitname" && git pull origin + msg "The local files are updated." + else + git clone "$_gitroot" "$_gitname" + fi + msg "GIT checkout done or server timeout" + msg "Starting build..." + + rm -rf "$srcdir/$_gitname-build" + git clone "$srcdir/$_gitname" "$srcdir/$_gitname-build" + cd "$srcdir/$_gitname-build" + if [ -z "GOROOT" ] ; then + source /etc/profile.d/go.sh + fi + GOPATH=$srcdir go build -o gocode +} + +package() { + cd "$srcdir/$_gitname-build" + install -Dm755 gocode $pkgdir/usr/bin/gocode +} |