summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaleb Maclennan2022-10-30 10:41:32 +0300
committerSamuel Collins2022-10-30 09:51:06 +0000
commit66570f7fd87d6c7e3c5c3a5214b50569420dce87 (patch)
treec911e314899df62778541d6ce2186e9b5ff6cb16
parentf1f2fb89c5c8e15c6081eb072e5b58df14e12974 (diff)
downloadaur-66570f7fd87d6c7e3c5c3a5214b50569420dce87.tar.gz
Overhaul package to fix Go flags, reproducible builds, dependencies, and Arch package guidelines
Signed-off-by: Caleb Maclennan <caleb@alerque.com>
-rw-r--r--.SRCINFO9
-rw-r--r--PKGBUILD65
2 files changed, 34 insertions, 40 deletions
diff --git a/.SRCINFO b/.SRCINFO
index b22969622e15..0dbed66501c4 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,16 +1,17 @@
pkgbase = glab-git
pkgdesc = Cli tool to help work seamlessly with Gitlab from the command line
pkgver = 1.22.0.r168.g11a81099
- pkgrel = 1
+ pkgrel = 2
url = https://gitlab.com/gitlab-org/cli
arch = x86_64
license = MIT
+ makedepends = git
makedepends = go
depends = glibc
- provides = glab
+ provides = glab=1.22.0.r168.g11a81099
conflicts = glab
replaces = gitlab-glab-git
- source = git+https://gitlab.com/gitlab-org/cli.git
- md5sums = SKIP
+ source = glab-git::git+https://gitlab.com/gitlab-org/cli.git
+ sha256sums = SKIP
pkgname = glab-git
diff --git a/PKGBUILD b/PKGBUILD
index 864eb9889deb..6999206f9319 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,60 +1,53 @@
# Maintainer: Samuel Collins <samuel.collins@live.co.uk>
# Co-Maintainer: Bradley Garrod <bradleybredgarrod@gmail.com>
+# Contributor: Caleb Maclennan <caleb@alerque.com>
pkgname=glab-git
-_reponame=cli
pkgver=1.22.0.r168.g11a81099
-pkgrel=1
-epoch=
-pkgdesc="Cli tool to help work seamlessly with Gitlab from the command line"
+pkgrel=2
+pkgdesc='Cli tool to help work seamlessly with Gitlab from the command line'
arch=(x86_64)
url="https://gitlab.com/gitlab-org/cli"
-license=('MIT')
-groups=()
+license=(MIT)
depends=(glibc)
-makedepends=(go)
-checkdepends=()
-optdepends=()
-provides=(glab)
+makedepends=(git
+ go)
+provides=("glab=$pkgver")
conflicts=(glab)
replaces=(gitlab-glab-git)
-backup=()
-options=()
-install=
-changelog=
-source=(git+$url.git)
-noextract=()
-md5sums=(SKIP)
-validpgpkeys=()
+source=("$pkgname::git+$url.git")
+sha256sums=(SKIP)
pkgver() {
- cd "${_reponame}"
+ cd "$pkgname"
git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}
prepare(){
- cd "${_reponame}"
- mkdir -p build/
+ cd "$pkgname"
+ mkdir -p build
}
build() {
- export GOPATH="$srcdir"/gopath
- cd "${_reponame}"
- export CGO_CPPFLAGS="${CPPFLAGS}"
- export CGO_CFLAGS="${CFLAGS}"
- export CGO_CXXFLAGS="${CXXFLAGS}"
- export CGO_LDFLAGS="${LDFLAGS}"
- _builddate=$(date -u +%m/%d/%Y)
- go build -o build -trimpath -buildmode=pie -ldflags "-extldflags \"${LDFLAGS}\" -X main.version=v${pkgver} -X main.build=${_builddate} -X main.usageMode=prod -s -w" -modcacherw ./cmd/glab/main.go
+ cd "$pkgname"
+ export GOPATH="$srcdir"/gopath
+ local _date=$(date +'%Y/%m/%d' ${SOURCE_DATE_EPOCH:+-d @$SOURCE_DATE_EPOCH})
+ go build \
+ -trimpath \
+ -buildmode=pie \
+ -modcacherw \
+ -ldflags "-linkmode external -extldflags \"$LDFLAGS\" -X main.version=v$pkgver -X main.build=$_date -X main.usageMode=prod -s -w" \
+ -o build \
+ ./cmd/glab/main.go
}
package() {
- cd "${_reponame}"
- install -Dm755 build/main "$pkgdir"/usr/bin/glab
- install -Dm644 $srcdir/${_reponame}/LICENSE "$pkgdir/usr/share/licenses/${pkgname}/LICENSE"
+ cd "$pkgname"
+ install -Dm0755 build/main "$pkgdir/usr/bin/glab"
+ install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE
- # Shell completions
- build/main completion -s bash | install -Dm644 /dev/stdin "${pkgdir}/usr/share/bash-completion/completions/glab"
- build/main completion -s zsh | install -Dm644 /dev/stdin "${pkgdir}/usr/share/zsh/site-functions/_glab"
- build/main completion -s fish | install -Dm644 /dev/stdin "${pkgdir}/usr/share/fish/vendor_completions.d/glab.fish"
+ # Shell completions
+ build/main completion -s bash | install -Dm0644 /dev/stdin "$pkgdir/usr/share/bash-completion/completions/glab"
+ build/main completion -s zsh | install -Dm0644 /dev/stdin "$pkgdir/usr/share/zsh/site-functions/_glab"
+ build/main completion -s fish | install -Dm0644 /dev/stdin "$pkgdir/usr/share/fish/vendor_completions.d/glab.fish"
}