Skip to content

Instantly share code, notes, and snippets.

@lmartinez-mirror
Created August 19, 2022 03:04
Show Gist options
  • Save lmartinez-mirror/3e4290cc99663100ff11733edd433335 to your computer and use it in GitHub Desktop.
Save lmartinez-mirror/3e4290cc99663100ff11733edd433335 to your computer and use it in GitHub Desktop.
Patch for bday-git
diff --git a/PKGBUILD b/PKGBUILD
index d9cb33e..5ac9566 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,31 +1,43 @@
# Maintainer: rv178
+# Contributor: Luis Martinez <luis dot martinez at disroot dot org>
-_pkgname=bday
-pkgname="${_pkgname}-git"
-pkgver=0.1.0.15.g9c82d4a
+pkgname=bday-git
+_pkgname="${pkgname%-git}"
+pkgver=r16.9290c50
pkgrel=1
-pkgdesc="CLI birthday tracker."
-arch=("x86_64")
-url="https://github.com/rv178/bday"
-license=("MIT")
-makedepends=("rustup" "git")
-source=("${_pkgname}::git+${url}.git")
-sha256sums=("SKIP")
+epoch=1
+pkgdesc='CLI birthday tracker'
+arch=('x86_64')
+url='https://github.com/rv178/bday'
+license=('MIT')
+depends=('gcc-libs')
+makedepends=('cargo' 'git')
+provides=("$_pkgname")
+conflicts=("$_pkgname")
+source=("$_pkgname::git+$url")
+sha256sums=('SKIP')
pkgver() {
- cd $_pkgname
- echo "$(grep "^version =" Cargo.toml|head -n1|cut -d\" -f2|cut -d\- -f1).$(git rev-list --count HEAD).g$(git rev-parse --short HEAD)"
+ cd "$_pkgname"
+ ( set -o pipefail
+ git describe --long --tags 2>/dev/null | sed 's/\([^-]*\)-g.*/r\1/;s/-/./g' ||
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)")
+}
+
+prepare() {
+ cd "$_pkgname"
+ cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}
build() {
+ RUSTUP_TOOLCHAIN=stable
+ CARGO_TARGET_DIR=target
cd "$_pkgname"
- rustup install stable
- rustup default stable
- cargo build --release
+ cargo build --frozen --release --all-features
}
package() {
cd "$_pkgname"
- install -Dm 755 ./target/release/bday "$pkgdir/usr/bin/bday"
+ install -D "target/release/$_pkgname" -t "$pkgdir/usr/bin/"
+ install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
}
-
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment