# Template file for 'cutechess-gui'
pkgname=cutechess-gui
version=1.3.1
revision=1
build_style=cmake
makedepends="qt5-devel qt5-svg-devel"
short_desc="GUI for playing chess"
maintainer="Imran Khan <imran@khan.ovh>"
license="GPL-3.0-or-later, MIT"
homepage="https://github.com/cutechess/cutechess"
changelog="https://github.com/cutechess/cutechess/raw/master/CHANGELOG.md"
distfiles="https://github.com/cutechess/cutechess/archive/refs/tags/v${version}.tar.gz"
checksum=b6b76f11a53b89ba38e2d21ed180a51ce95e963e1ae2054a352563cad075e2f8

if [ "$CROSS_BUILD" ]; then
	hostmakedepends="qt5-qmake qt5-host-tools"
fi

do_install() {
	vbin build/cutechess
	vinstall dist/linux/cutechess.desktop 644 usr/share/applications
	sed -n '2,23s:^[ ]*::p' projects/gui/components/pgnhighlighter/src/pgnhighlighter.h > COPYING.gui
	vlicense COPYING.gui
}

cutechess-cli_package() {
	short_desc="CLI tool to automate chess engine tournaments"
	pkg_install() {
		vbin build/cutechess-cli
		vman docs/cutechess-cli.6
	}
}
