summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorVlad Petrov2021-05-18 16:25:36 +0300
committerVlad Petrov2021-05-18 16:25:36 +0300
commit850edacbb6fd81be8cb1384132366493456c15e0 (patch)
tree6d415aa5416868a5103903d2cae535d89b7ceda5 /PKGBUILD
parent02c97d7e0906428606ca190b84a4311e48f9e016 (diff)
downloadaur-go-jira.tar.gz
go-jira: build go-jira from source
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD55
1 files changed, 46 insertions, 9 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 418caeaaa4a4..6ee30a190d36 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,15 +1,52 @@
-# Maintainer: Stas Rudakou <stas at garage22 dot net>
-
pkgname=go-jira
-pkgver=1.0.26
+_pkgname=jira
+pkgver=1.0.27
pkgrel=1
-pkgdesc="Simple command line client for Atlassian's Jira service written in Go"
-url="https://github.com/Netflix-Skunkworks/go-jira"
+pkgdesc='simple jira command line client in Go'
arch=('x86_64')
-license=('APACHE')
-source=("jira-$pkgver::https://github.com/Netflix-Skunkworks/go-jira/releases/download/v$pkgver/jira-linux-amd64")
-sha256sums=('27a1bb92e763ebdb4ba4204a1d7874d3d5e9094f6d6b15299c6e41f6a3546e83')
+url="https://github.com/go-jira/jira"
+license=('Apache')
+makedepends=('go')
+optdepends=('bash-completion: support auto completion for bash')
+source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/refs/tags/v${pkgver}.tar.gz"
+ "jira"
+ "_jira")
+sha256sums=('c5bcf7b61300b67a8f4e42ab60e462204130c352050e8551b1c23ab2ecafefc7'
+ '737b5bcf05a0121bf5db7baec080446a3c85c9bcdeaf53867d2cba3b86049e48'
+ '0ddd0422eb74510bd71b8d370ef8e6b698126fd66abebbb18a00ede45cc9facf')
+
+prepare(){
+ cd "${_pkgname}-${pkgver}"
+ mkdir -p build/
+}
+
+build() {
+ cd "${_pkgname}-${pkgver}"
+ export CGO_CPPFLAGS="${CPPFLAGS}"
+ export CGO_CFLAGS="${CFLAGS}"
+ export CGO_CXXFLAGS="${CXXFLAGS}"
+ export CGO_LDFLAGS="${LDFLAGS}"
+ export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
+ go build -o build ./cmd/...
+}
package() {
- install -Dm755 jira-$pkgver "$pkgdir/usr/bin/jira"
+ cd "$_pkgname-$pkgver"
+ install -Dm755 build/$_pkgname "$pkgdir"/usr/bin/$_pkgname
+ install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+
+ install -dm 755 "${pkgdir}/etc/bash_completion.d/" \
+ "${pkgdir}/usr/share/zsh/site-functions/"
+
+ # Autocomplete generated by the binary are quite outdated due to old version of kingpin
+ # For some reason go-jira returns non-zero exit code for completions
+ # https://github.com/go-jira/jira/issues/326
+ #
+ # "${pkgdir}/usr/bin/${_pkgname}" --completion-script-bash > "${pkgdir}/etc/bash_completion.d/${_pkgname}" || true
+ # "${pkgdir}/usr/bin/${_pkgname}" --completion-script-zsh > "${pkgdir}/usr/share/zsh/site-functions/_${_pkgname}" || true
+
+ # Our modified autocomplete
+ cd ..
+ install -Dm644 ${_pkgname} "${pkgdir}/etc/bash_completion.d/${_pkgname}"
+ install -Dm644 _${_pkgname} "${pkgdir}/usr/share/zsh/site-functions/_${_pkgname}"
}