SUMMARY="Simple, fast, open source XML parser for C++"
DESCRIPTION="irrXML is a simple and fast open source xml parser for C++. \
Why another xml parser? The strenghts of irrXML are its speed and its simplicity. \
It ideally fits into realtime projects which need to read xml data without overhead, \
like games. irrXML was originally written as part of the Irrlicht Engine \
but after it has become quite mature it now has become a separate project."
HOMEPAGE="https://www.ambiera.com/irrxml"
COPYRIGHT="2002-2007 Nikolaus Gebhardt"
LICENSE="irrXML"
REVISION="1"
SOURCE_URI="http://prdownloads.sourceforge.net/irrlicht/irrxml-$portVersion.zip"
CHECKSUM_SHA256="9b4f80639b2dee3caddbf75862389de684747df27bea7d25f96c7330606d7079"
ADDITIONAL_FILES="
	configure.ac
	irrxml.pc.in
	Makefile.am
	"

ARCHITECTURES="all ?arm ?ppc ?sparc"
SECONDARY_ARCHITECTURES="x86"

libVersion="0.0.0"
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"

PROVIDES="
	irrxml$secondaryArchSuffix = $portVersion
	lib:libirrxml$secondaryArchSuffix = $libVersionCompat
	"
REQUIRES="
	haiku$secondaryArchSuffix
	"

PROVIDES_devel="
	irrxml${secondaryArchSuffix}_devel = $portVersion
	devel:libirrxml$secondaryArchSuffix = $libVersionCompat
	"
REQUIRES_devel="
	irrxml$secondaryArchSuffix == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoreconf
	cmd:awk
	cmd:gcc$secondaryArchSuffix
	cmd:libtoolize$secondaryArchSuffix
	cmd:make
	"

BUILD()
{
	cp "$portDir"/additional-files/*.* .

	mkdir -p m4
	autoreconf -vfi
	runConfigure configure

	make $jobArgs
}

INSTALL()
{
	make install

	rm $libDir/libirrxml.la

	prepareInstalledDevelLib libirrxml
	fixPkgconfig

	# devel package
	packageEntries devel $developDir
}

TEST()
{
	export LIBRARY_PATH=$LIBRARY_PATH:$sourceDir

	make check
}
