diff options
author | Axel Gembe | 2020-03-26 12:51:32 +0700 |
---|---|---|
committer | Axel Gembe | 2020-03-26 12:51:32 +0700 |
commit | 437c0397f927ba6f36099b84901fc0a25a72e135 (patch) | |
tree | 41211a953478dc987f04cd4b677ec925afc3a869 | |
parent | 69000af9c040f0d014aaccace3f4d0d4ae49045e (diff) | |
download | aur-437c0397f927ba6f36099b84901fc0a25a72e135.tar.gz |
Improve build, add trimpath
-rw-r--r-- | PKGBUILD | 36 |
1 files changed, 17 insertions, 19 deletions
@@ -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 } |