SUMMARY="A simple C++ XML parser"
DESCRIPTION="
TinyXML-2 is a simple, small, efficient, C++ XML parser that can be \
easily integrated into other programs.
"
HOMEPAGE="http://www.grinninglizard.com/tinyxml2/"
LICENSE="Zlib"
COPYRIGHT="2011-2013 Lee Thomason"
SRC_URI="git+https://github.com/leethomason/tinyxml2.git#343a5ff3bdd7336644db4080f001759e062c359e"
REVISION="1"
ARCHITECTURES="!x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="x86"


PROVIDES="
	tinyxml2$secondaryArchSuffix = $portVersion
	lib:libtinyxml2$secondaryArchSuffix = $portVersion
	"

REQUIRES="
	haiku$secondaryArchSuffix >= $haikuVersion
	"
BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel >= $haikuVersion
	"
BUILD_PREREQUIRES="
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:make
	"

BUILD()
{
	g++ -fpic -c tinyxml2.cpp
	g++ -shared -Wl,-soname,libtinyxml2.so -o libtinyxml2.so tinyxml2.o
}

INSTALL()
{
	mkdir -p $libDir
	# also install shared lib
	cp -a libtinyxml2.so $libDir

	# move headers
	mkdir -p $includeDir
	mv tinyxml2.h $includeDir
	
	# prepare development lib links
	prepareInstalledDevelLib libtinyxml2
	
	# devel package
	packageEntries devel $developDir
}

TEST()
{
	make test
}

# ----- devel package -------------------------------------------------------

PROVIDES_devel="
	tinyxml2${secondaryArchSuffix}_devel = $portVersion
	devel:libtinyxml2$secondaryArchSuffix = $portVersion
	"
REQUIRES_devel="
	tinyxml2$secondaryArchSuffix == $portVersion base
	"
