From c31e1fa57153cc64b034ebbbcc95dc134e0507d0 Mon Sep 17 00:00:00 2001 From: George Rawlinson Date: Mon, 2 May 2022 19:32:21 +1200 Subject: [PATCH] addpkg: go-task 3.12.0-1 --- go-task/PKGBUILD | 66 +++++++++++++++++++++++++++++++++++++++++ go-task/go-task.install | 6 ++++ 2 files changed, 72 insertions(+) create mode 100644 go-task/PKGBUILD create mode 100644 go-task/go-task.install diff --git a/go-task/PKGBUILD b/go-task/PKGBUILD new file mode 100644 index 0000000..f75470c --- /dev/null +++ b/go-task/PKGBUILD @@ -0,0 +1,66 @@ +# Maintainer: George Rawlinson + +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 +} diff --git a/go-task/go-task.install b/go-task/go-task.install new file mode 100644 index 0000000..a38b85b --- /dev/null +++ b/go-task/go-task.install @@ -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 +}