SUMMARY="XML-FO to PDF formatter"
DESCRIPTION="A fast, free, high-quality, multi-platform XSL formatter that \
aims to excel at DocBook formatting and that integrates easily with other \
programs and with scripting languages."
HOMEPAGE="http://xmlroff.org"
COPYRIGHT="2001-2002 Sun Microsystems
	2007-2010 Meneith Consulting
	2011-2012 Mentea"
LICENSE="BSD (3-clause)"
REVISION="5"
SOURCE_URI="https://github.com/xmlroff/xmlroff/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="ef8386da3cd2fb12ac0d59899e3017b5ab2bebe8df23a94dbe95191724c3bc8f"
PATCHES="xmlroff-$portVersion.patchset"

ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"

PROVIDES="
	xmlroff$secondaryArchSuffix = $portVersion
	cmd:xmlroff$secondaryArchSuffix
	lib:libfo_0.6$secondaryArchSuffix = 0.603.0 compat >= 0
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libbz2$secondaryArchSuffix
	lib:libcairo$secondaryArchSuffix
	lib:libffi$secondaryArchSuffix
	lib:libfontconfig$secondaryArchSuffix
	lib:libfreetype$secondaryArchSuffix
	lib:libfribidi$secondaryArchSuffix
	lib:libgdk_pixbuf_2.0$secondaryArchSuffix
	lib:libglib_2.0$secondaryArchSuffix
	lib:libgobject_2.0$secondaryArchSuffix
	lib:libgthread_2.0$secondaryArchSuffix
	lib:libharfbuzz$secondaryArchSuffix
	lib:libiconv$secondaryArchSuffix
	lib:libintl$secondaryArchSuffix
	lib:libpango_1.0$secondaryArchSuffix
	lib:libpangoft2_1.0$secondaryArchSuffix
	lib:libpixman_1$secondaryArchSuffix
	lib:libpng16$secondaryArchSuffix
	lib:libxml2$secondaryArchSuffix
	lib:libxslt$secondaryArchSuffix
	lib:libz$secondaryArchSuffix
	"

PROVIDES_devel="
	xmlroff${secondaryArchSuffix}_devel = $portVersion
	devel:libfo_0.6$secondaryArchSuffix = 0.603.0 compat >= 0
	"
REQUIRES_devel="
	xmlroff$secondaryArchSuffix == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	docbook_xsl_stylesheets
	shared_mime_info$secondaryArchSuffix
	devel:libcairo$secondaryArchSuffix
	devel:libfreetype$secondaryArchSuffix
	devel:libfribidi$secondaryArchSuffix
	devel:libgdk_pixbuf_2.0$secondaryArchSuffix
	devel:libglib_2.0$secondaryArchSuffix
	devel:libpangoft2_1.0$secondaryArchSuffix
	devel:libxslt$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:autoconf
	cmd:automake
	cmd:gcc$secondaryArchSuffix
	cmd:libtool
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	"

BUILD()
{
	pushd xmlroff

	runConfigure autogen.sh
	make $jobArgs

	popd
}

INSTALL()
{
	pushd xmlroff
	make install
	popd

	rm $libDir/libfo*.la

	prepareInstalledDevelLib libfo-0.6
	fixPkgconfig

	packageEntries devel $developDir
}
