# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=rinutils
pkgver=0.10.3
pkgrel=0
pkgdesc="C11 / gnu11 utilities C library"
url="https://www.shlomifish.org/open-source/projects/"
arch="noarch"
license="MIT"
makedepends="
	cmake
	cmocka-dev
	perl
	samurai
	"
checkdepends="
	perl-dev
	perl-env-path
	perl-inline
	perl-inline-c
	perl-parse-recdescent
	perl-path-tiny
	perl-string-shellquote
	perl-test-differences
	perl-utils
	"
subpackages="$pkgname-dev"
source="https://github.com/shlomif/rinutils/releases/download/$pkgver/rinutils-$pkgver.tar.xz"
options="!check" # Requires unavailable perl modules Test::TrainlingSpace module

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

check() {
	cd build
	ctest
}

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

sha512sums="
fe9e774c597012bb0d86b867bb05d27d00234edcca89a61f715f96464e06d5985286328b2cb8960f1582ea25fb5b04eb37b6384b3d178b8dca959f4e3d86a0ff  rinutils-0.10.3.tar.xz
"
