summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 5f24249aa9ac3c5311b122bc8d3eb426960f310f (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
# Maintainer: Alexandre Bouvier <contact@amb.tf>
_pkgname=oaknut
pkgname=$_pkgname-git
pkgver=2.0.2.r0.g6b1d57e
pkgrel=1
pkgdesc="A C++20 assembler for AArch64 (ARMv8.0 to ARMv8.2)"
arch=('any')
url="https://github.com/merryhime/oaknut"
license=('MIT')
makedepends=('cmake' 'git')
checkdepends=('catch2>=3')
provides=("$_pkgname=$pkgver")
conflicts=("$_pkgname")
source=("$_pkgname::git+$url.git")
b2sums=('SKIP')

pkgver() {
	cd $_pkgname
	git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
	cmake -S $_pkgname -B build \
		-DBUILD_TESTING="$CHECKFUNC" \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-Wno-dev
	cmake --build build
}

check() {
	ctest --test-dir build
}

package() {
	# shellcheck disable=SC2154
	DESTDIR="$pkgdir" cmake --install build
	install -Dm644 -t "$pkgdir"/usr/share/licenses/$pkgname $_pkgname/LICENSE
}