# Contributor: solidnerd # Maintainer: solidnerd pkgname=glab pkgver=1.31.0 pkgrel=3 pkgdesc="Open source GitLab CLI tool written in Go" url="https://gitlab.com/gitlab-org/cli" arch="all" license="MIT" depends="git" makedepends="go" options="!check" subpackages=" $pkgname-bash-completion $pkgname-zsh-completion $pkgname-fish-completion " source="$pkgname-$pkgver.tar.gz::https://gitlab.com/gitlab-org/cli/-/archive/v$pkgver/cli-v$pkgver.tar.gz" builddir="$srcdir/cli-v$pkgver" export CGO_ENABLED=0 export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}" export GOTMPDIR="${GOTMPDIR:-"$srcdir"}" export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}" build() { # date seems a little broken to override go build -ldflags " -X main.debugMode=false -X main.version=v$pkgver -X main.buildDate=$(date -u "+%Y-%m-%d" ${SOURCE_DATE_EPOCH:+-d @$SOURCE_DATE_EPOCH}) -extldflags \"$LDFLAGS\" " \ -o bin/glab \ ./cmd/glab/main.go # XXX: When glab is run in fakeroot it segfaults for some reason # on ppc64le. By generating the compilation files here we # workaround that but we need to investigate why it segfaults in # fakeroot eventually. bin/glab completion --shell bash > bash.comp bin/glab completion --shell zsh > zsh.comp bin/glab completion --shell fish > fish.comp } package() { install -Dm755 "$builddir"/bin/glab -t "$pkgdir"/usr/bin/ install -Dm644 bash.comp "$pkgdir"/usr/share/bash-completion/completions/glab.bash install -Dm644 zsh.comp "$pkgdir"/usr/share/zsh/site-functions/_glab install -Dm644 fish.comp "$pkgdir"/usr/share/fish/vendor_completions.d/glab.fish } sha512sums=" 210fd8a477d36efcf270cce0413dc118d46bfb3fe8fd4bb1cae13a9301205e5fcc6650ed8b19756942bbf7d338b8e478aea7503fa6d0e835557f618d5cbdd54f glab-1.31.0.tar.gz "