summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e2716dfaedcde9a89b508005ebd7a8b3c6cca1a7 (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
# Maintainer: only_vip <onlyme_vip@protonmail.com>
pkgname=cbonsai-git
_gitpkg=cbonsai
pkgver=1.3.1.2.gb3ee97a1212021.08.17
pkgrel=1
pkgdesc='A bonsai tree generator, written in C using ncurses (git version)'
arch=('aarch64' 'arm' 'armv6h' 'armv7h' 'i686' 'pentium4' 'x86_64')
url="https://gitlab.com/jallbrit/cbonsai"
license=('GPL3')
depends=('libncursesw5-dev')
makedepends=('scdoc')
provides=('cbonsai')
conflicts=('cbonsai')
source=('git+https://gitlab.com/jallbrit/cbonsai.git')
md5sums=(SKIP)

pkgver() {
    cd "${srcdir}/${_gitpkg}"
    _tag=$(git describe --tags | sed -e 's:-:.:g' -e 's:v::') # tag is mobile, and switches between numbers and letters, can't use it for versioning
    _commits=$(git rev-list --count HEAD | sed 's:-:.:g') # total commits is the most sane way of getting incremental pkgver
    _date=$(git log -1 --date=short --pretty=format:%cd)
    printf "%s%s%s\n" "${_tag}" "${_commits}" "${_date}" | sed -e 's:-:.:g'  -e 's:_:.:g'
}

package() {
  cd "${srcdir}"/"${_gitpkg}"
  make DESTDIR="${pkgdir}" PREFIX="/usr" install
}