diff options
author | Mattéo Delabre | 2020-12-06 15:40:58 +0100 |
---|---|---|
committer | Mattéo Delabre | 2020-12-06 15:40:58 +0100 |
commit | 28fb31499625d5c2b2310ee877fb814383d13a5a (patch) | |
tree | 4032089cf91f74bb6a64568e4167ecee389d3d97 | |
parent | b1b919c6a4918af73ee55ea827bfeb23ffe628f0 (diff) | |
download | aur-28fb31499625d5c2b2310ee877fb814383d13a5a.tar.gz |
Improve PKGBUILD
-rw-r--r-- | .SRCINFO | 6 | ||||
-rw-r--r-- | PKGBUILD | 42 |
2 files changed, 19 insertions, 29 deletions
@@ -1,13 +1,13 @@ pkgbase = rmapi pkgdesc = Access reMarkable tablet files through the Cloud API pkgver = 0.0.12 - pkgrel = 1 + pkgrel = 2 url = https://github.com/juruen/rmapi arch = x86_64 license = AGPL3 - makedepends = go-pie + makedepends = go depends = glibc - source = https://github.com/juruen/rmapi/archive/v0.0.12.tar.gz + source = rmapi-0.0.12.tar.gz::https://github.com/juruen/rmapi/archive/v0.0.12.tar.gz sha256sums = SKIP pkgname = rmapi @@ -1,42 +1,32 @@ # Maintainer: Mattéo Delabre <spam@delab.re> pkgname=rmapi pkgver=0.0.12 -pkgrel=1 -pkgdesc="Access reMarkable tablet files through the Cloud API" +pkgrel=2 +pkgdesc='Access reMarkable tablet files through the Cloud API' arch=('x86_64') -url="https://github.com/juruen/rmapi" +url='https://github.com/juruen/rmapi' license=('AGPL3') depends=('glibc') -makedepends=('go-pie') -source=("$url/archive/v$pkgver.tar.gz") +makedepends=('go') +source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz") sha256sums=('SKIP') -_ref="${url#"https://"}" - prepare() { - export GOPATH="$srcdir"/gopath - mkdir -p "$GOPATH" - - ref_base="$(dirname "$_ref")" - mkdir -p "$GOPATH"/src/"$ref_base" - mv "$pkgname-$pkgver" "$GOPATH"/src/"$_ref" - - cd "$GOPATH"/src/"$_ref" - go get -v -t -d -a ./... + cd "$pkgname-$pkgver" + mkdir -p build/ } build() { - export GOPATH="$srcdir"/gopath - cd "$GOPATH"/src/"$_ref" - - go build \ - -gcflags "all=-trimpath=$GOPATH" \ - -asmflags "all=-trimpath=$GOPATH" \ - -ldflags "-extldflags $LDFLAGS" \ - -v . + cd "$pkgname-$pkgver" + export CGO_CPPFLAGS="${CPPFLAGS}" + export CGO_CFLAGS="${CFLAGS}" + export CGO_CXXFLAGS="${CXXFLAGS}" + export CGO_LDFLAGS="${LDFLAGS}" + export GOFLAGS='-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw' + go build -o build . } package() { - cd "$GOPATH"/src/"$_ref" - install -Dm755 $pkgname "$pkgdir"/usr/bin/$pkgname + cd "$pkgname-$pkgver" + install -Dm755 build/"$pkgname" "$pkgdir"/usr/bin/"$pkgname" } |