# Maintainer:
pkgname=libtracefs
pkgver=1.8.1
pkgrel=0
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
	flex
	libtraceevent-dev
	meson
	xmlto
	"
checkdepends="cunit-dev"
subpackages="$pkgname-dev $pkgname-utils"
source="https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/snapshot/libtracefs-$pkgver.tar.gz
	makefile.patch
	"
options="!check" # fail to start, but exit 0

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

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
575cde93b1118afc72ba4fe0df976ba7238033c9bb2b365bf295da7c057bf7e1fa72dd02be55963697db92bb0e96ffc8ed4f5b127ffa84468a6c0b4f478390f3  makefile.patch
"
