2021-09-05 19:05:16 +00:00
|
|
|
# Maintainer: George Rawlinson <grawlinson@archlinux.org>
|
|
|
|
|
|
|
|
pkgname=drone-cli
|
2021-09-08 17:32:55 +00:00
|
|
|
pkgver=1.4.0
|
|
|
|
pkgrel=1
|
2021-09-05 19:05:16 +00:00
|
|
|
pkgdesc="Command line interface for Drone CI"
|
|
|
|
arch=('x86_64')
|
|
|
|
url="https://docs.drone.io/cli"
|
|
|
|
license=('Apache')
|
|
|
|
makedepends=('go' 'git')
|
|
|
|
source=("$pkgname-$pkgver.tar.gz::https://github.com/drone/drone-cli/archive/v$pkgver.tar.gz")
|
2021-09-08 17:32:55 +00:00
|
|
|
b2sums=('a894c14c011374df5498bace23d40e7376b112250cbf901419f26eb6434fae12a6c325fde907adc25049c3c712574fa41a34984fd8467417134b755a06bde64e')
|
2021-09-05 19:05:16 +00:00
|
|
|
|
|
|
|
prepare() {
|
|
|
|
cd "$pkgname-$pkgver"
|
|
|
|
|
|
|
|
# create directory for build output
|
|
|
|
mkdir build
|
|
|
|
|
|
|
|
# download dependencies
|
|
|
|
go mod vendor
|
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
|
|
|
cd "$pkgname-$pkgver"
|
|
|
|
|
|
|
|
# set Go flags
|
|
|
|
export CGO_CPPFLAGS="${CPPFLAGS}"
|
|
|
|
export CGO_CFLAGS="${CFLAGS}"
|
|
|
|
export CGO_CXXFLAGS="${CXXFLAGS}"
|
|
|
|
|
|
|
|
go build -v \
|
|
|
|
-trimpath \
|
|
|
|
-buildmode=pie \
|
|
|
|
-mod=vendor \
|
|
|
|
-modcacherw \
|
2021-09-08 01:07:12 +00:00
|
|
|
-ldflags "-linkmode external -extldflags ${LDFLAGS} -X main.version=$pkgver" \
|
2021-09-05 19:05:16 +00:00
|
|
|
-o build \
|
|
|
|
./...
|
|
|
|
}
|
|
|
|
|
|
|
|
check() {
|
|
|
|
cd "$pkgname-$pkgver"
|
|
|
|
go test -v ./...
|
|
|
|
}
|
|
|
|
|
|
|
|
package() {
|
|
|
|
cd "$pkgname-$pkgver"
|
|
|
|
|
|
|
|
# binary
|
|
|
|
install -vDm755 -t "$pkgdir/usr/bin" build/drone
|
|
|
|
|
|
|
|
# documentation
|
|
|
|
install -vDm644 -t "$pkgdir/usr/share/doc/$pkgname" *.md
|
|
|
|
}
|