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-2019 Matroska"
LICENSE="GNU LGPL v2.1"
REVISION="1"
SOURCE_URI="$HOMEPAGE/archive/release-$portVersion.tar.gz"
CHECKSUM_SHA256="66486742fd4f443553ad1917505208404c8c4240c0ab26cedaf41d9476efc665"
SOURCE_DIR="libebml-release-$portVersion"

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

PROVIDES="
	libebml$secondaryArchSuffix = $portVersion
	lib:libebml$secondaryArchSuffix = 5.0.0 compat >= 5
	"
REQUIRES="
	haiku${secondaryArchSuffix}
	"

PROVIDES_devel="
	libebml${secondaryArchSuffix}_devel = $portVersion
	devel:libebml$secondaryArchSuffix = 5.0.0 compat >= 5
	"
REQUIRES_devel="
	libebml$secondaryArchSuffix == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	"
BUILD_PREREQUIRES="
	cmd:cmake
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:make
	"

BUILD()
{
	mkdir -p build && cd build
	cmake .. $cmakeDirArgs -DBUILD_SHARED_LIBS=TRUE \
		-DCMAKE_BUILD_TYPE=Release
	make $jobArgs
}

INSTALL()
{
	make -C build install

	prepareInstalledDevelLibs libebml
	fixPkgconfig

	packageEntries devel $developDir $libDir/cmake
}
