summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0f9e92cbef2a37419f75691ec830b5eb242cca4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Maintainer: Raafat Turki <raafat.turki@pm.me>

pkgname=genxrdb-git
pkgver=r14.9deed3d
pkgrel=1
pkgdesc='a tool that generates xresources from toml'
arch=(x86_64)
url='https://github.com/RaafatTurki/genxrdb'
license=(unknown)
makedepends=(git cargo)
provides=(genxrdb)
conflicts=(genxrdb)
source=("git+$url")
sha256sums=('SKIP')

pkgver() {
  cd "${pkgname%-git}"

  if git describe --long --tags &>/dev/null; then
    git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
  else
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
  fi
}

build() {
  cd "${pkgname%-git}"
  cargo build --release
}

package() {
  install -Dm755 "$srcdir/${pkgname%-git}/target/release/${pkgname%-git}" "$pkgdir/usr/bin/${pkgname%-git}"
}