# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>

pkgname=gnome-chess
pkgver=40.1
pkgrel=1
pkgdesc="Play the classic two-player boardgame of chess"
url="https://wiki.gnome.org/Apps/Chess"
arch=(x86_64)
license=(GPL)
depends=(gtk4 librsvg)
makedepends=(gobject-introspection yelp-tools vala git meson) 
optdepends=('gnuchess: Play against computer')
groups=(gnome-extra)
_commit=31167cdadaf81b68db9d865f36b700772fb9f26b  # tags/40.1^0
source=("git+https://gitlab.gnome.org/GNOME/gnome-chess.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd $pkgname
}

build() {
  arch-meson $pkgname build
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

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