maintainer="Bart Ribbers <bribbers@disroot.org>"
pkgname=black-hole-solver
pkgver=1.14.0
pkgrel=0
pkgdesc="Solvers and statistics for 'Golf' solitaire, 'Black Hole' solitaire, 'All in a Row' solitaire and related card patience games"
url="https://www.shlomifish.org/open-source/projects/black-hole-solitaire-solver"
arch="all"
license="MIT"
depends="
	perl
	perl-env-path
	perl-path-tiny
	"
makedepends="
	cmake
	perl-utils
	python3
	rinutils-dev
	samurai
	"
checkdepends="
	perl-file-which
	perl-test-differences
	"
subpackages="$pkgname-dev $pkgname-doc"
source="https://fc-solve.shlomifish.org/downloads/fc-solve/black-hole-solver-$pkgver.tar.xz"
options="!check" # Requires not yet packaged perl modules

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

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

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

sha512sums="
53bf292e4c78916a95645c2821fe6fce0305873268356eb4c3c3ee0e18c0df650bca79fb7a71ab30ab206c0da07b846a47b45745391d7c43ba8cbc849d041053  black-hole-solver-1.14.0.tar.xz
"
