summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorEgor Kovetskiy2016-09-08 14:44:50 +0700
committerEgor Kovetskiy2016-09-08 14:44:50 +0700
commit965236fc8612939e8b32d94a44c43dd505f02f6b (patch)
treec7e42b057644ab479a94453fd39fd5f1b6d5c714
downloadaur-965236fc8612939e8b32d94a44c43dd505f02f6b.tar.gz
initial commit
-rw-r--r--.SRCINFO16
-rw-r--r--PKGBUILD65
2 files changed, 81 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..9292c714a53
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,16 @@
+# Generated by mksrcinfo v8
+# Thu Sep 8 07:43:07 UTC 2016
+pkgbase = go-tools-git
+ pkgdesc = golang tools
+ pkgver = autogenerated
+ pkgrel = 1
+ arch = i686
+ arch = x86_64
+ license = GPL
+ makedepends = go
+ makedepends = git
+ source = go-tools-git::git://github.com/golang/tools#branch=master
+ md5sums = SKIP
+
+pkgname = go-tools-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..6564c4094e9
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,65 @@
+# Maintainer: Egor Kovetskiy <e.kovetskiy@office.ngs.ru>
+pkgname=go-tools-git
+pkgver=${PKGVER:-autogenerated}
+pkgrel=${PKGREL:-1}
+pkgdesc="golang tools"
+arch=('i686' 'x86_64')
+license=('GPL')
+depends=(
+)
+makedepends=(
+ 'go'
+ 'git'
+)
+
+source=(
+ "$pkgname::git://github.com/golang/tools#branch=${BRANCH:-master}"
+)
+
+md5sums=(
+ 'SKIP'
+)
+
+backup=(
+)
+
+pkgver() {
+ if [[ "$PKGVER" ]]; then
+ echo "$PKGVER"
+ return
+ fi
+
+ cd "$srcdir/$pkgname"
+ local date=$(git log -1 --format="%cd" --date=short | sed s/-//g)
+ local count=$(git rev-list --count HEAD)
+ local commit=$(git rev-parse --short HEAD)
+ echo "$date.${count}_$commit"
+}
+
+build() {
+ if [ -L "$srcdir/$pkgname" ]; then
+ rm "$srcdir/$pkgname" -rf
+ mv "$srcdir/go/src/$pkgname/" "$srcdir/$pkgname"
+ fi
+
+ rm -rf "$srcdir/go/src"
+ mkdir -p "$srcdir/go/src/golang.org/x/"
+
+ mv "$srcdir/$pkgname" "$srcdir/go/src/golang.org/x/tools/"
+ cd "$srcdir/go/src/golang.org/x/tools/"
+
+ git submodule update --init
+
+ export GOPATH="$srcdir/go"
+ export GOBIN=""
+
+ go get -v \
+ -gcflags "-trimpath $GOPATH/src" \
+ ./cmd/...
+}
+
+package() {
+ find "$srcdir/go/bin/" -type f -executable | while read filename; do
+ install -DT "$filename" "$pkgdir/usr/bin/$(basename $filename)"
+ done
+}