Skip to content

Instantly share code, notes, and snippets.

@nathanfranke
Created November 3, 2021 09:03
Show Gist options
  • Save nathanfranke/7e6a5a1f7e38deadfad4e7d13ebeaa33 to your computer and use it in GitHub Desktop.
Save nathanfranke/7e6a5a1f7e38deadfad4e7d13ebeaa33 to your computer and use it in GitHub Desktop.
VCS PKGBUILD that doesn't change pkgver
_pkgver() {
(cd YOUR_GIT_REPOSITORY &>/dev/null && git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g') || echo latest
}
pkgname=YOUR_PACKAGE
pkgver=$(_pkgver)
pkgrel=1
...
source=('YOUR_GIT_REPOSITORY::git+https://github.com/example/example.git')
sha256sums=('SKIP')
prepare() {
pkgver=$(_pkgver)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment