addpkg: go-task 3.12.0-1

This commit is contained in:
George Rawlinson 2022-05-02 19:32:21 +12:00
parent 2e8dcb003f
commit c31e1fa571
Signed by: grawlinson
GPG key ID: E0959FEA8B550539
2 changed files with 72 additions and 0 deletions

66
go-task/PKGBUILD Normal file
View file

@ -0,0 +1,66 @@
# Maintainer: George Rawlinson <grawlinson@archlinux.org>
pkgname=go-task
pkgver=3.12.0
pkgrel=1
pkgdesc='A task runner/simpler Make alternative written in Go'
arch=('x86_64')
url='https://taskfile.dev'
license=('MIT')
depends=('glibc')
makedepends=('git' 'go')
options=('!lto')
install=go-task.install
_commit='f2abc13ce2e26017b69ea7de1327aa8be7892da5'
source=("$pkgname::git+https://github.com/go-task/task#commit=$_commit")
md5sums=('SKIP')
pkgver() {
cd "$pkgname"
git describe --tags | sed 's/^v//'
}
prepare() {
cd "$pkgname"
# download dependencies
go mod download
}
build() {
cd "$pkgname"
# set Go flags
export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CFLAGS="${CFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
go build -v \
-trimpath \
-buildmode=pie \
-mod=readonly \
-modcacherw \
-ldflags "-linkmode external -extldflags ${LDFLAGS} \
-X main.version=${pkgver}" \
-o go-task \
./cmd/...
}
check() {
cd "$pkgname"
go test -v ./...
}
package() {
cd "$pkgname"
# binary
install -vDm755 -t "$pkgdir/usr/bin" go-task
# XXX: completions require a bit of massaging, so they're not packaged yet
# license
install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
}

6
go-task/go-task.install Normal file
View file

@ -0,0 +1,6 @@
post_install() {
cat >&2 <<-EOF
The binary name has been changed to 'go-task' in order to avoid conflicts
with community/task.
EOF
}