SUMMARY="WebM File Parser"
DESCRIPTION="libwebm - WebM VP8 Codec SDK"
HOMEPAGE="https://www.webmproject.org/"
COPYRIGHT="2015 Google Inc."
LICENSE="BSD (3-clause)"
REVISION="1"
SOURCE_URI="https://github.com/webmproject/libwebm/archive/libwebm-$portVersion.tar.gz"
CHECKSUM_SHA256="1332f43742aeae215fd8df1be6e363e753b17abb37447190e789299fe3edec77"
SOURCE_DIR="libwebm-libwebm-$portVersion"

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

PROVIDES="
	libwebm$secondaryArchSuffix = $portVersion
	cmd:dumpvtt$secondaryArchSuffix = $portVersion
	cmd:vttdemux$secondaryArchSuffix = $portVersion
	lib:libwebm$secondaryArchSuffix = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	"

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

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

defineDebugInfoPackage libwebm$secondaryArchSuffix \
	"$binDir"/dumpvtt \
	"$binDir"/vttdemux \
	"$libDir"/libwebm.so

BUILD()
{
	make -f Makefile.unix all shared $jobArgs
}

INSTALL()
{
	install -m 0755 -d "$binDir" "$libDir" "$docDir"
	install -m 0755 -t "$binDir" dumpvtt vttdemux
	install -m 0644 -t "$libDir" libwebm.a libwebm.so
	install -m 0644 -t "$docDir" LICENSE.TXT

	prepareInstalledDevelLib libwebm

	packageEntries devel \
		"$developDir"
}
