summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAxel Gembe2020-03-26 12:51:32 +0700
committerAxel Gembe2020-03-26 12:51:32 +0700
commit437c0397f927ba6f36099b84901fc0a25a72e135 (patch)
tree41211a953478dc987f04cd4b677ec925afc3a869
parent69000af9c040f0d014aaccace3f4d0d4ae49045e (diff)
downloadaur-437c0397f927ba6f36099b84901fc0a25a72e135.tar.gz
Improve build, add trimpath
-rw-r--r--PKGBUILD36
1 files changed, 17 insertions, 19 deletions
diff --git a/PKGBUILD b/PKGBUILD
index a935eef2cc6..8d013ad9b00 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,5 +1,4 @@
# Maintainer: Axel Gembe <derago@gmail.com>
-
pkgname=plexdrive
pkgver=5.0.0
pkgrel=1
@@ -16,27 +15,26 @@ provides=("$pkgname")
conflicts=("$pkgname")
source=(https://github.com/dweidenfeld/plexdrive/archive/5.0.0.tar.gz)
sha256sums=('68763993a3da3d8ccd0dc18b3a5db7ab7ad8d03fde2d9be2ef4829e8356225bd')
-_goroot='/usr/lib/go'
+
+prepare() {
+ mkdir -p gopath/src/github.com/dweidenfeld
+ ln -rTsf $pkgname-$pkgver gopath/src/github.com/dweidenfeld/$pkgname
+ export GOPATH="$srcdir"/gopath
+
+ cd gopath/src/github.com/dweidenfeld/$pkgname
+ go get -v
+}
build() {
- mkdir -p plexdrive/src/github.com/dweidenfeld/plexdrive
- cd plexdrive
- export GOROOT="$_goroot"
- GOPATH=$PWD && export GOPATH
- cp ../plexdrive-${pkgver}/*.go .
- mv ../plexdrive-${pkgver}/* src/github.com/dweidenfeld/plexdrive
- go get bazil.org/fuse
- go get github.com/boltdb/bolt
- go get google.golang.org/api/googleapi
- go get golang.org/x/sys/unix
- go get github.com/ogier/pflag
- go get github.com/claudetech/loggo
- go get golang.org/x/net/context
- go get golang.org/x/oauth2
- go build
+ export GOPATH="$srcdir"/gopath
+ cd gopath/src/github.com/dweidenfeld/$pkgname
+ go build \
+ -trimpath \
+ -o $pkgname \
+ .
}
package() {
- install -d ${pkgdir}/usr/bin
- install -Dm755 ${srcdir}/plexdrive/plexdrive ${pkgdir}/usr/bin/
+ cd $pkgname-$pkgver
+ install -Dm755 $pkgname "$pkgdir"/usr/bin/$pkgname
}