# Template file for 'libpeas2'
pkgname=libpeas2
version=2.2.1
revision=1
build_style=meson
build_helper="gir"
configure_args="-Dgtk_doc=true -Dvapi=true"
hostmakedepends="pkg-config gettext glib-devel python3 lua51 lua51-lgi
 gi-docgen vala"
makedepends="vala-devel python3-gobject-devel lua51-devel gjs-devel
 mozjs140-devel"
depends="python3-gobject hicolor-icon-theme"
checkdepends="xvfb-run"
short_desc="Gobject-based plugins engine"
maintainer="Enno Boland <gottox@voidlinux.org>"
license="LGPL-2.1-or-later"
homepage="https://wiki.gnome.org/Projects/Libpeas"
changelog="https://gitlab.gnome.org/GNOME/libpeas/-/raw/main/NEWS"
distfiles="${GNOME_SITE}/libpeas/${version%.*}/libpeas-${version}.tar.xz"
checksum=589eca89b437006edf3755478df037c740a2a84cfa5d202dbad6095e828e2488
make_check_pre="xvfb-run"

post_patch() {
	# libpeas2 checks for lua51.pc or lua-5.1.pc but Void uses lua5.1.pc
	vsed -e "s/dependency('lua51'/dependency('lua5.1'/" -i meson.build
}

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