# Template file for 'libspelling'
pkgname=libspelling
version=0.4.5
revision=1
build_style=meson
build_helper="gir"
configure_args="-Dsysprof=false"
hostmakedepends="pkg-config gi-docgen gettext glib-devel vala"
makedepends="gtk4-devel libadwaita-devel gtksourceview5-devel enchant2-devel"
checkdepends="hunspell-en"
short_desc="Spellcheck library for GTK 4"
maintainer="oreo639 <oreo6391@gmail.com>"
license="LGPL-3.0-or-later"
homepage="https://gitlab.gnome.org/GNOME/libspelling"
changelog="https://gitlab.gnome.org/GNOME/libspelling/-/raw/main/NEWS"
distfiles="${GNOME_SITE}/libspelling/${version%.*}/libspelling-${version}.tar.xz"
checksum=ec0372d83f42b65aee3734248ef8e2ffbfba4ea91268419c98ea44a00ef3e83f

pre_build() {
	# help gi-docgen find gi files on cross
	if [ -n "$CROSS_BUILD" ]; then
		export XDG_DATA_DIRS=/usr/$XBPS_CROSS_TRIPLET/usr/share/
	fi
}

libspelling-devel_package() {
	depends="gtk4-devel libadwaita-devel gtksourceview5-devel ${sourcepkg}>=${version}_${revision}"
	short_desc+=" - development files"
	pkg_install() {
		vmove usr/share/doc
		vmove usr/include
		vmove usr/lib/pkgconfig
		vmove "usr/lib/*.so"
		vmove usr/share/gir-1.0
		vmove usr/share/vala
	}
}
