| 1 | # Contributor: Leo <[email protected]> |
| 2 | # Contributor: Celeste <[email protected]> |
| 3 | # Contributor: dabao1955 <[email protected]> |
| 4 | # Contributor: Andrei Jiroh Eugenio Halili <[email protected]> |
| 5 | maintainer="Alex Ungur <[email protected]>" |
| 6 | pkgname=github-cli |
| 7 | pkgver=2.102.0 |
| 8 | pkgrel=0 |
| 9 | pkgdesc="CLI for dealing with GitHub" |
| 10 | options="net" # Need to fetch modules |
| 11 | url="https://cli.github.com" |
| 12 | arch="all" |
| 13 | license="MIT" |
| 14 | depends="git" |
| 15 | makedepends="go" |
| 16 | checkdepends="openssh-keygen openssh-client" |
| 17 | subpackages=" |
| 18 | $pkgname-doc |
| 19 | $pkgname-bash-completion |
| 20 | $pkgname-fish-completion |
| 21 | $pkgname-zsh-completion |
| 22 | " |
| 23 | source="https://github.com/cli/cli/archive/v$pkgver/github-cli-$pkgver.tar.gz |
| 24 | no-ignore-goflags.patch |
| 25 | skip-flaky-test.patch |
| 26 | " |
| 27 | builddir="$srcdir/cli-$pkgver" |
| 28 | |
| 29 | prepare() { |
| 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 | |
| 37 | build() { |
| 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 | |
| 45 | check() { |
| 46 | export TZ=Europe/London |
| 47 | # skip tests that fail in official CI |
| 48 | export GITHUB_ACTIONS=true |
| 49 | go test ./... |
| 50 | } |
| 51 | |
| 52 | package() { |
| 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 | } |
| 60 | sha512sums=" |
| 61 | d3821de17759debac0672b5d65d2b061db7b7c5f9391685fbac0636f0ae05e6a28e160197316f40646c4c87ed34d4c0e3cb30b6d4bcd640abade6bf611be8de0 github-cli-2.102.0.tar.gz |
| 62 | 57be81e57c0bb5c36e07b6ff2aab661f1a9cd0bbab3ef159c24d59098451858c44fce09d2f5eb86380044568a6acc46ed65b56a87f5a3dc4057d5579e8f420aa no-ignore-goflags.patch |
| 63 | 21f0693d26b6e7c4aff5845441d96069941f23392f585b18dfec6aab058c72441a5766eedecfa327cc1c2658098538ece2d7efa74af4be1bb5d0f36c5847a127 skip-flaky-test.patch |
| 64 | " |