# Template file for 'gspell'
pkgname=gspell
version=1.14.2
revision=1
build_style=meson
build_helper="gir"
configure_args="$(vopt_bool gir gobject_introspection)
 $(vopt_bool vala vapi) $(vopt_bool gtk_doc gtk_doc)"
hostmakedepends="pkg-config glib-devel gettext
 $(vopt_if vala vala) $(vopt_if gtk_doc gtk-doc)"
makedepends="glib-devel enchant2-devel gtk+3-devel icu-devel"
checkdepends="xvfb-run cantarell-fonts hunspell-en enchant2-hunspell"
short_desc="Flexible API to add spell checking to a GTK+ application"
maintainer="Enno Boland <gottox@voidlinux.org>"
license="LGPL-2.1-or-later"
homepage="https://gitlab.gnome.org/GNOME/gspell"
changelog="https://gitlab.gnome.org/GNOME/gspell/-/raw/master/NEWS"
distfiles="${GNOME_SITE}/gspell/${version%.*}/gspell-${version}.tar.xz"
checksum=4ec7e5accc9013281bacd6bbc00006be733818b81ba3fe332c1e876c7e1e1477
make_check_pre="xvfb-run"

# Package build options
build_options="gir vala gtk_doc"
build_options_default="gir vala"

if [ -z "$CROSS_BUILD" ]; then
	build_options_default+=" gtk_doc"
fi

gspell-devel_package() {
	depends="libglib-devel enchant2-devel gtk+3-devel icu-devel
	 ${sourcepkg}>=${version}_${revision}"
	short_desc+=" - development files"
	pkg_install() {
		vmove usr/include
		vmove usr/lib/pkgconfig
		vmove "usr/lib/*.so"
		if [ "$build_option_gir" ]; then
			vmove usr/share/gir-1.0
		fi
		if [ "$build_option_vala" ]; then
			vmove usr/share/vala
		fi
		if [ "$build_option_gtk_doc" ]; then
			vmove usr/share/gtk-doc
		fi
	}
}
