summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorRyan O'Beirne2023-12-24 12:17:39 -0500
committerRyan O'Beirne2023-12-24 12:17:39 -0500
commit311ca3d33a74a0c9f9aff143b948e715ac4a2f04 (patch)
tree4a02cb68430a467c000675dfa2c10b9722ff1722 /PKGBUILD
parenta0d4b9186315cc5a5903e92dd882f02d0fbf0e05 (diff)
downloadaur-pretty-git-prompt-git.tar.gz
Create git package
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD23
1 files changed, 16 insertions, 7 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 3be1dc3967ac..60ca5eee01a1 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,9 @@
# Maintainer: Alexander Rundberg <alexanderrundberg [at] fastmail [dot] jp>
# Maintainer: Ryan O'Beirne <ryanobeirne [at] ryanobeirne [dot] com>
-pkgname=pretty-git-prompt
-pkgver=0.2.1
+__pkgname=pretty-git-prompt
+pkgname="$__pkgname-git"
+conflicts=("$__pkgname")
+pkgver=0.2.1_63967bc
pkgrel=1
pkgdesc="Pretty git status for your shell prompt"
arch=('any')
@@ -9,15 +11,22 @@ url="https://github.com/TomasTomecek/pretty-git-prompt"
license=('MIT')
depends=('git')
makedepends=('rust' 'cmake')
-source=("https://github.com/TomasTomecek/pretty-git-prompt/archive/$pkgver.tar.gz")
-sha256sums=('56e1228209aa1e7d632ad98ca5d044dbf4d7c04d7b2cdea9132c3c3f759df93c')
+source=("git+https://github.com/TomasTomecek/pretty-git-prompt.git")
+sha256sums=(SKIP)
+
+pkgver() {
+ cd "$srcdir/$__pkgname"
+ local cargo_version="$(sed -En '/version/s/^.*=.*"(.*)".*$/\1/p' Cargo.toml | head -n1)"
+ local git_hash="$(git rev-parse --short HEAD)"
+ printf '%s_%s' "$cargo_version" "$git_hash"
+}
build() {
- cd "$srcdir"/"$pkgname"-"$pkgver"
+ cd "$srcdir/$__pkgname"
make exec-stable-build
}
package() {
- cd "$srcdir"/"$pkgname"-"$pkgver"
- install -Dm755 target/release/pretty-git-prompt "$pkgdir"/usr/bin/pretty-git-prompt
+ cd "$srcdir/$__pkgname"
+ install -Dm755 "target/release/pretty-git-prompt" "$pkgdir/usr/bin/pretty-git-prompt"
}