# Template file for 'abiword'
pkgname=abiword
version=3.0.4
revision=1
build_style=gnu-configure
configure_args="--enable-plugins --enable-clipart --enable-templates
 $(vopt_if gtk3 '--with-gtk3' '--with-gtk2')
 $(vopt_enable goffice)"
hostmakedepends="automake libtool flex pkg-config"
makedepends="libjpeg-turbo-devel libpng-devel fribidi-devel libgsf-devel
 enchant-devel librsvg-devel wv-devel boost-devel libxslt-devel
 libwmf-devel libchamplain-devel redland-devel libical-devel
 libgcrypt-devel harfbuzz-devel $(vopt_if goffice goffice-devel)
 $(vopt_if gtk3 'gtk+3-devel' 'gtk+-devel')"
depends="hicolor-icon-theme desktop-file-utils liberation-fonts-ttf"
short_desc="Free word processing program similar to Microsoft(R) Word"
maintainer="Orphaned <orphan@voidlinux.org>"
license="GPL-2.0-or-later"
homepage="http://www.abisource.com/"
distfiles="${homepage}/downloads/${pkgname}/${version}/source/${pkgname}-${version}.tar.gz"
checksum=e93096cb192e5bc19d62e180fc5eda643206465315a710113ae5036bc2a1a5d7
build_options="gtk3 goffice"
build_options_default="gtk3 goffice"

CXXFLAGS="-std=c++11"

pre_configure() {
	# To remove Google search plugin.
	# We have a "remove-google.patch" patch file to remove Google from the build.
	# This is just to be extra sure.
	rm -rf plugins/google
}

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