SUMMARY="A C++ library to parse EBML content (read/write)"
DESCRIPTION="libebml is a C++ library to parse EBML content (read/write)."
HOMEPAGE="https://github.com/Matroska-Org/libebml/"
COPYRIGHT="2005-2017 Matroska"
LICENSE="GNU LGPL v2.1"
REVISION="1"
SOURCE_URI="$HOMEPAGE/archive/release-$portVersion.tar.gz"
CHECKSUM_SHA256="efe9851797db47bc78486b6c518d822cfca435afe3d9c9d0812d8e3825cd71e6"
SOURCE_DIR="libebml-release-$portVersion"
PATCHES="libebml-$portVersion.patchset"

ARCHITECTURES="all"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"

PROVIDES="
	libebml$secondaryArchSuffix = $portVersion
	lib:libebml$secondaryArchSuffix = 4.0.0 compat >= 4
	"
REQUIRES="
	haiku${secondaryArchSuffix}
	"

PROVIDES_devel="
	libebml${secondaryArchSuffix}_devel = $portVersion
	devel:libebml$secondaryArchSuffix = 4.0.0 compat >= 4
	"
REQUIRES_devel="
	libebml$secondaryArchSuffix == $portVersion base
	"
if [ "$effectiveTargetArchitecture" != x86_gcc2 ]; then
	REQUIRES_devel="$REQUIRES_devel
		gcc$secondaryArchSuffix
		"
fi

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoconf
	cmd:automake
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:pkg_config$secondaryArchSuffix
	cmd:libtoolize$secondaryArchSuffix
	cmd:make
	"

BUILD()
{
	autoreconf -f -i
	runConfigure ./configure
	make $jobArgs
}

INSTALL()
{
	make install

	rm -f $libDir/libebml.la

	prepareInstalledDevelLibs libebml
	fixPkgconfig

	packageEntries devel $developDir
}

TEST()
{
	make check
}
