Date: Tuesday, January 8, 2019 @ 23:04:12 Author: ffy00 Revision: 421067
upgpkg: arduino-cli 0.3.3.alpha.preview-1 Modified: arduino-cli/trunk/PKGBUILD ----------+ PKGBUILD | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2019-01-08 23:03:29 UTC (rev 421066) +++ PKGBUILD 2019-01-08 23:04:12 UTC (rev 421067) @@ -9,22 +9,30 @@ url='https://github.com/arduino/arduino-cli' license=('GPL3') groups=('arduino') -depends=('glibc') makedepends=('go-pie' 'git') source=("$pkgname-$pkgver.tar.gz::https://github.com/arduino/arduino-cli/archive/$_pkgver.tar.gz") sha512sums=('217ec44db600e9667c15b201064448fe8eda86e9708969c7df5931bfe52529e62ec9133dce7ef3a9fb304965d3a0e3177dd54997d515e853114a00ed1226fc21') -build() { - cd $pkgname-$_pkgver +prepare(){ + export GOPATH="$srcdir"/gopath + mkdir -p "$GOPATH"/src/github.com/arduino + ln -rTsf "$pkgname-$_pkgver" "$GOPATH"/src/github.com/arduino/arduino-cli + cd "$GOPATH"/src/github.com/arduino/arduino-cli +} + +build(){ export GOPATH="$srcdir"/gopath - export GOBIN="$GOPATH"/bin - mkdir -p $GOBIN + cd "$GOPATH"/src/github.com/arduino/arduino-cli - go get - go install + go build \ + -gcflags "all=-trimpath=$GOPATH" \ + -asmflags "all=-trimpath=$GOPATH" \ + -ldflags "-extldflags $LDFLAGS" \ + . } package() { - install -Dm 755 gopath/bin/arduino-cli-$_pkgver "$pkgdir"/usr/bin/arduino-cli + install -Dm 755 $pkgname-$_pkgver/$pkgname "$pkgdir"/usr/bin/$pkgname } +