summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 83ce57cbce2f85036f7b8bf8af58e7ab1f710316 (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
34
35
36
37
38
39
40
41
42
43
44
45
46
# Maintainer: Emma Tebibyte <emma@tebibyte.media>

_repo=harakit
_pkgname=$_repo
pkgname=$_pkgname-git
pkgver=r292.4b3333d
pkgrel=2
pkgdesc="New utilities for a new era."
arch=('any')
url="https://git.tebibyte.media/bonsai/$_repo"
license=('AGPL')
depends=()
makedepends=('rust' 'rust-bindgen')
replaces=('bonsai-coreutils-git')
source=("git+https://git.tebibyte.media/bonsai/$_repo.git" "bonsai.sh")
md5sums=(
	SKIP
	ae17ace590d882d9c9701ba4cecbeefe
)

pkgver() {
  cd "$_repo"
  ( set -o pipefail
    git describe --long --abbrev=7 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
  )
}

build() {
	cd "$_repo"
	make all
}

check() {
	cd "$_pkgname"
	make test
}

package() {
	profile_d="$pkgdir/etc/profile.d"
	mkdir -p "$profile_d"
	cp bonsai.sh "$profile_d"

	cd "$_repo"
	make install PREFIX="$pkgdir/opt/bonsai"
}