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="2"
SOURCE_URI="$HOMEPAGE/archive/release-$portVersion.tar.gz"
CHECKSUM_SHA256="2562bb9bc3248e956a6ed1148eafe4d7d68759257133083c212d14faa8709d1e"
SOURCE_DIR="libebml-release-$portVersion"
PATCHES="libebml-$portVersion.patchset"

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

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

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

	rm -rf $developDir $libDir/cmake
}
