# Maintainer: André Klitzing <aklitzing@gmail.com>
pkgname=uncrustify
pkgver=0.81.0
pkgrel=0
pkgdesc="Source code beautifier"
url="https://github.com/uncrustify/uncrustify"
arch="all"
license="GPL-2.0-or-later"
makedepends="cmake python3 samurai"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/uncrustify/uncrustify/archive/uncrustify-$pkgver.tar.gz"
builddir="$srcdir/uncrustify-uncrustify-$pkgver"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_INSTALL_PREFIX=/usr
	cmake --build build
}

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

package() {
	DESTDIR="$pkgdir" cmake --install build

	install -Dm644 etc/*.cfg -t "$pkgdir"/usr/share/$pkgname
}

sha512sums="
464dfe5806dfb1eaa5070ae6917bb838d3f247255f4aea7e56dd6daf0d25fadaa887960d992a8d038187d629b5ecbb5b7ae0162de37a4fe5da928132aeda42d2  uncrustify-0.81.0.tar.gz
"
