# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=black-hole-solver
pkgver=1.12.0
pkgrel=2
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() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

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

sha512sums="
54aea7d86717e6dd24eb809afe972691e644497eeb240859194eca6193506af9f5d739949ebc9f0776b7409b5f934a2e9ab3f4507dc827f90fd0c3de945818d1  black-hole-solver-1.12.0.tar.xz
"
