# Maintainer:
pkgname=libtracefs
pkgver=1.8.1
pkgrel=1
pkgdesc="Linux kernel trace file system library"
url="https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/about/"
arch="all"
license="LGPL-2.1-or-later"
makedepends="
	asciidoc
	bison
	docbook-xsl-nons
	flex
	libtraceevent-dev
	meson
	source-highlight
	xmlto
	"
checkdepends="cunit-dev"
subpackages="$pkgname-dev $pkgname-doc $pkgname-utils"
source="https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/snapshot/libtracefs-$pkgver.tar.gz"
options="!check" # fail to start, but exit 0

build() {
	abuild-meson \
		--default-library=shared \
		-Db_lto=true \
		. output
	meson compile -C output
	meson compile -C output docs
}

check() {
	meson test --no-rebuild --print-errorlogs -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

utils() {
	pkgdesc="$pkgdesc (utils)"

	amove usr/bin
}

sha512sums="
1d8775cf511982a99e2dd17afcf48da272ff8ec189710a27420befe8765155ed21fd62db8fb2b75a0965e0a52ef810459c826f9b4989093c6a64d0cb7894cfca  libtracefs-1.8.1.tar.gz
"
