# Template file for 'libgedit-gfls'
pkgname=libgedit-gfls
version=0.4.0
revision=1
build_style=meson
build_helper=gir
configure_args="$(vopt_bool gir gobject_introspection) $(vopt_bool gtk_doc gtk_doc)"
hostmakedepends="gettext glib-devel pkg-config $(vopt_if gtk_doc gtk-doc)"
makedepends="gtk+3-devel"
short_desc="Module dedicated to file loading and saving"
maintainer="chrysos349 <chrysostom349@gmail.com>"
license="GPL-3.0-or-later"
homepage="https://gitlab.gnome.org/World/gedit/libgedit-gfls"
changelog="https://gitlab.gnome.org/World/gedit/libgedit-gfls/-/raw/main/NEWS"
distfiles="https://gitlab.gnome.org/World/gedit/libgedit-gfls/-/archive/${version}/libgedit-gfls-${version}.tar.gz"
checksum=091952cb178430427b18ea62a4e4de5bde6335c00b7ab7eda58f31602ca33883

build_options="gir gtk_doc"
build_options_default="gir"

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

post_patch() {
	if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
		# Disable unsupported encoding tests on musl
		vsed -e '/test-iconv/d' -e '/test-encoding-convert/d' -i tests/unit-tests/meson.build
	fi
}

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