projects/aports·blob master · refs

64 lines · 2.0 KiB

1# Contributor: Leo <[email protected]>
2# Contributor: Celeste <[email protected]>
3# Contributor: dabao1955 <[email protected]>
4# Contributor: Andrei Jiroh Eugenio Halili <[email protected]>
5maintainer="Alex Ungur <[email protected]>"
6pkgname=github-cli
7pkgver=2.102.0
8pkgrel=0
9pkgdesc="CLI for dealing with GitHub"
10options="net" # Need to fetch modules
11url="https://cli.github.com"
12arch="all"
13license="MIT"
14depends="git"
15makedepends="go"
16checkdepends="openssh-keygen openssh-client"
17subpackages="
18 $pkgname-doc
19 $pkgname-bash-completion
20 $pkgname-fish-completion
21 $pkgname-zsh-completion
22 "
23source="https://github.com/cli/cli/archive/v$pkgver/github-cli-$pkgver.tar.gz
24 no-ignore-goflags.patch
25 skip-flaky-test.patch
26 "
27builddir="$srcdir/cli-$pkgver"
28
29prepare() {
30 default_prepare
31
32 # TODO: These tests invoke the TTY and our container *really* does not like that
33 # Copied from https://github.com/archlinux/svntogit-community/blob/packages/github-cli/trunk/PKGBUILD
34 rm pkg/cmd/auth/login/login_test.go
35}
36
37build() {
38 CGO_CPPFLAGS="$CPPFLAGS" \
39 CGO_CFLAGS="$CFLAGS" \
40 CGO_CXXFLAGS="$CXXFLAGS" \
41 CGO_LDFLAGS="$LDFLAGS" \
42 make GH_VERSION="v$pkgver" bin/gh manpages completions
43}
44
45check() {
46 export TZ=Europe/London
47 # skip tests that fail in official CI
48 export GITHUB_ACTIONS=true
49 go test ./...
50}
51
52package() {
53 install -Dm755 bin/gh "$pkgdir"/usr/bin/gh
54 install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/"$pkgname"
55
56 rm -fr share/zsh/vendor-completions
57 mkdir -p "$pkgdir"/usr
58 cp -r share "$pkgdir"/usr
59}
60sha512sums="
61d3821de17759debac0672b5d65d2b061db7b7c5f9391685fbac0636f0ae05e6a28e160197316f40646c4c87ed34d4c0e3cb30b6d4bcd640abade6bf611be8de0 github-cli-2.102.0.tar.gz
6257be81e57c0bb5c36e07b6ff2aab661f1a9cd0bbab3ef159c24d59098451858c44fce09d2f5eb86380044568a6acc46ed65b56a87f5a3dc4057d5579e8f420aa no-ignore-goflags.patch
6321f0693d26b6e7c4aff5845441d96069941f23392f585b18dfec6aab058c72441a5766eedecfa327cc1c2658098538ece2d7efa74af4be1bb5d0f36c5847a127 skip-flaky-test.patch
64"