summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d9a76152b7034ff2007476041f3a4feaef26545e (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
47
48
49
50
# Maintainer: Otreblan <otreblain@gmail.com>

pkgname=tbsp-git
pkgver=r10.1702f95
pkgrel=1
epoch=
pkgdesc='tree-based source-processing language'
arch=('x86_64')
url="https://git.peppe.rs/languages/tbsp"
#license=()
groups=()
depends=('glibc' 'gcc-libs')
makedepends=('git' 'cargo')
checkdepends=()
optdepends=()
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
source=("$pkgname::git+$url")
sha256sums=('SKIP')

prepare() {
	cd "$srcdir/$pkgname"

	export RUSTUP_TOOLCHAIN=stable
	cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
}

pkgver() {
	cd "$srcdir/$pkgname"

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

build() {
	cd "$srcdir/$pkgname"

	export RUSTUP_TOOLCHAIN=stable
	export CARGO_TARGET_DIR=target
	cargo build --frozen --release --all-features
}

package() {
	cd "$srcdir/$pkgname"

	install -Dm0755 -t "$pkgdir/usr/bin/" "target/release/${pkgname%-git}"
}