# Template file for 'abiword'
pkgname=abiword
version=3.0.8
revision=1
build_style=gnu-configure
build_helper=gir
configure_args="--enable-plugins --enable-clipart --enable-templates
 --enable-introspection"
hostmakedepends="automake autoconf autoconf-archive libtool flex pkg-config gobject-introspection gettext-devel glib-devel"
makedepends="libjpeg-turbo-devel libpng-devel fribidi-devel libgsf-devel
 enchant2-devel librsvg-devel wv-devel boost-headers libxslt-devel
 libwmf-devel $(vopt_if champlain libchamplain-devel) redland-devel libical-devel
 libgcrypt-devel harfbuzz-devel $(vopt_if goffice goffice-devel)
 gtk+3-devel"
depends="hicolor-icon-theme desktop-file-utils"
short_desc="Free word processing program similar to Microsoft(R) Word"
maintainer="Orphaned <orphan@voidlinux.org>"
license="GPL-2.0-or-later"
homepage="https://gitlab.gnome.org/World/AbiWord"
distfiles="https://gitlab.gnome.org/World/AbiWord/-/archive/release-${version}/AbiWord-release-${version}.tar.gz"
checksum=7c490e46f0a6143f84d5c7e3fed246f34486ad70cd55f162c792827607cd7e9a
make_check=no # tests stuck in CI

build_options="goffice champlain"
build_options_default="goffice champlain"

CXXFLAGS="-std=c++11"

pre_configure() {
	./autogen-common.sh
	aclocal -I m4 --install
	autoreconf -fiv
}

libabiword_package() {
	short_desc+=" - Runtime library"
	pkg_install() {
		vmove "usr/lib/*.so*"
		vmove "usr/lib/girepository*"
	}
}
abiword-devel_package() {
	depends="fribidi-devel libgsf-devel wv-devel enchant2-devel gtk+3-devel
		librsvg-devel libabiword>=${version}_${revision}"
	short_desc+=" - development files"
	pkg_install() {
		vmove usr/include
		vmove usr/lib/pkgconfig
		vmove "usr/share/gir*"
	}
}
