aboutsummaryrefslogblamecommitdiffstats
path: root/community/go-task/APKBUILD
blob: c123e5b196e500ce3f8d699db01b95deb8a98d55 (plain) (tree)
1
2
3
4
5
6
7
8
9
10


                                                   

             
                                                         



                           

                    
                             






                                                                                                  

                               


                                               


                                     






                                                                      




                                                                                          
                                      




                                                      
                                                                                   






                                                                            

 
        
                                                               





                                                        
            
                                                                                                                                                       
                                                                                                                                                                    
 
# Contributor: Kevin Daudt <kdaudt@alpinelinux.org>
# Maintainer: Kevin Daudt <kdaudt@alpinelinux.org>
pkgname=go-task
pkgver=3.18.0
pkgrel=0
pkgdesc="Task runner written in Go, installed as go-task"
url="https://taskfile.dev/"
arch="all"
license="MIT"
makedepends="go"
subpackages="
	$pkgname-doc
	$pkgname-task::noarch
	$pkgname-bashcomp::noarch
	$pkgname-fishcomp::noarch
	$pkgname-zshcomp::noarch
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/go-task/task/archive/refs/tags/v$pkgver.tar.gz
	completion-rename-to-go-task.patch
	"
builddir="$srcdir/task-$pkgver"

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

export GOFLAGS="$GOFLAGS -modcacherw"

prepare() {
	default_prepare

	sed -i 's/complete -F _task task/complete -F _task go-task/' \
		completion/bash/task.bash
}

build() {
	go build -v -ldflags="-X main.version=$pkgver" github.com/go-task/task/v3/cmd/task
}

check() {
	go build -o bin/ ./cmd/sleepit
	go test -v ./...
}

package() {
	install -Dm0755 task "$pkgdir"/usr/bin/go-task
	install -Dm0644 docs/docs/usage.md "$pkgdir"/usr/share/doc/go-task/usage.md

	install -Dm0644 completion/bash/task.bash \
		"$pkgdir"/usr/share/bash-completion/completions/go-task.bash
	install -Dm0644 completion/fish/task.fish \
		"$pkgdir"/usr/share/fish/completions/go-task.fish
	install -Dm0644 completion/zsh/_task \
		"$pkgdir"/usr/share/zsh/site-functions/_go_task
}

task() {
	pkgdesc="Task runner, written in Go, installed as task"
	depends="!task"

	mkdir -p "$subpkgdir/usr/bin"
	ln -s /usr/bin/go-task "$subpkgdir/usr/bin/task"
}

sha512sums="
8cdc3b8424f3df5f57948a53374ecc3a40c537bdefc261e7d55ee2a0662ab9db7d7c08ee71820cf13a563a551fbc4a844b5d62b50e6265122cab277bf1d57816  go-task-3.18.0.tar.gz
270fdb68bae58a46e75f22a58c590e1c453b897d1a6e67ab4404bd93fb950a19787abf1a064cc4f12ea47eeb227eed744d1b84a23a2d48c8057126f78b987f59  completion-rename-to-go-task.patch
"