aboutsummaryrefslogtreecommitdiffstats
path: root/community/github-cli/APKBUILD
blob: c7bb09c926b0ff2105d9e7d6dfe2be96a920693a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Contributor: Leo <thinkabit.ukim@gmail.com>
# Contributor Andrei Jiroh Eugenio Halili <ajhalili2006@gmail.com>
# Maintainer: Andrei Jiroh Eugenio Halili <ajhalili2006@gmail.com>
pkgname=github-cli
pkgver=2.0.0
pkgrel=2
pkgdesc="CLI for dealing with GitHub"
options="net chmod-clean" # Need to fetch modules and clean them up
url="https://cli.github.com"
arch="all"
license="MIT"
depends="git"
makedepends="go"
subpackages="
	$pkgname-doc
	$pkgname-bash-completion
	$pkgname-zsh-completion
	"
source="https://github.com/cli/cli/archive/v$pkgver/github-cli-$pkgver-$pkgver.tar.gz
	"
builddir="$srcdir/cli-$pkgver"

prepare() {
	default_prepare

	# TODO: These tests invoke the TTY and our container *really* does not like that
	# Copied from https://github.com/archlinux/svntogit-community/blob/packages/github-cli/trunk/PKGBUILD
	rm pkg/cmd/auth/login/login_test.go
}

build() {
	CGO_CPPFLAGS="$CPPFLAGS" \
	CGO_CFLAGS="$CFLAGS" \
	CGO_CXXFLAGS="$CXXFLAGS" \
	CGO_LDFLAGS="$LDFLAGS" \
	\
	make GH_VERSION="v$pkgver" bin/gh manpages
	bin/gh completion -s bash | install -Dm0644 /dev/stdin \
		share/bash-completion/completions/gh
	bin/gh completion -s zsh | install -Dm0644 /dev/stdin \
		share/zsh/site-functions/_gh
}

check() {
	go test -v ./...
}

package() {
	install -Dm755 bin/gh "$pkgdir"/usr/bin/gh

	mkdir -p "$pkgdir"/usr
	cp -r share "$pkgdir"/usr
}

sha512sums="
3b0008894690a9a097259410e144e0031dee7c876e0b862e5219009d82a2f50d00ad22e3d92a16c369e9b1f0f51668e868c08d9eeb718dfe8a0337aa00233435  github-cli-2.0.0-2.0.0.tar.gz
"