maintainer="fossdd <fossdd@pwned.life>"
pkgname=sd-tools
pkgver=0.99.0
pkgrel=1
pkgdesc="Standalone, cleaned up utilities from systemd"
url="https://github.com/chimera-linux/sd-tools"
arch="all"
license="LGPL-2.1-or-later"
makedepends="
	acl-dev
	clang
	libcap-dev
	meson
	"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/chimera-linux/sd-tools/archive/refs/tags/v$pkgver.tar.gz
	drop-bash-dep.patch
	32bit.patch
	"

export CC=clang

build() {
	abuild-meson . output
	meson compile -C output
}

check() {
	meson test -C output
}

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

	install -Dm644 README.md -t "$pkgdir"/usr/share/doc/$pkgname
	install -Dm644 LICENSE.LGPL2.1 -t "$pkgdir"/usr/share/doc/$pkgname
}

sha512sums="
f82471a33f204766977c24a56c78ad41a295cb7b7c8190bdad4d40c45db67677c3bb2f71222fc02ca1c42653bc60b2cf742b0114b5bfc2d9efdfc238c866c52f  sd-tools-0.99.0.tar.gz
f64e1cc6b7f9ddcb97d13080e0e1b12841426247b1f27eee62bfda122e77c0673f669904c513bbebb94232b8f4c055fdbaa1b75c83294b1279ef7503fa9464ee  drop-bash-dep.patch
7562ed1a10fc730c4befd0df834ca4f348a7cdc5c9ba6dd5ebfdcfabbef9c094fc5d42373b0f214969e04f2a43e50eebeb4417a3b37b2e99cbeaffa06af72e46  32bit.patch
"
