SUMMARY="Language tags identification library"
DESCRIPTION="liblangtag is an interface library to access/deal with tags for \
identifying languages, which is described in RFC 5646."
HOMEPAGE="http://tagoh.bitbucket.org/liblangtag"
COPYRIGHT="Akira Tagoh"
LICENSE="
	GNU LGPL v3
	MPL v2.0
	"
REVISION="1"
SOURCE_URI="https://bitbucket.org/tagoh/liblangtag/downloads/liblangtag-$portVersion.tar.bz2"
CHECKSUM_SHA256="1f12a20a02ec3a8d22e54dedb8b683a43c9c160bda1ba337bf1060607ae733bd"

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

PROVIDES="
	liblangtag$secondaryArchSuffix = $portVersion
	lib:liblangtag$secondaryArchSuffix = 1.4.1 compat >= 1
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libxml2$secondaryArchSuffix
	lib:libz$secondaryArchSuffix
	"

PROVIDES_devel="
	liblangtag${secondaryArchSuffix}_devel = $portVersion
	devel:liblangtag$secondaryArchSuffix = 1.4.1 compat >= 1
	"
REQUIRES_devel="
	liblangtag$secondaryArchSuffix == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libxml2$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:awk
	cmd:g++$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	"

PATCH()
{
	sed -i 's/HAVE_INTROSPECTION/ENABLE_GOBJECT/' liblangtag-gobject/Makefile.am
}

BUILD()
{
	runConfigure ./configure --enable-introspection=no --disable-modules
	make $jobArgs
}

INSTALL()
{
	make install

	rm $libDir/liblangtag.la

	prepareInstalledDevelLibs liblangtag
	fixPkgconfig

	packageEntries devel $developDir
}

TEST()
{
	make check
}
