SUMMARY="An open source multimedia framework"
DESCRIPTION="A LGPL multimedia framework designed for TV broadcasting"
HOMEPAGE="https://www.mltframework.org/"
COPYRIGHT="2011-2019 by Meltytech, LLC."
LICENSE="GNU LGPL v2.1"
REVISION="1"
SOURCE_URI="https://github.com/mltframework/mlt/releases/download/v$portVersion/mlt-$portVersion.tar.gz"
CHECKSUM_SHA256="3b977c5632329fca7634d0034162df6d5b79cde3256bac43e7ba8353acced61e"
PATCHES="mlt-$portVersion.patchset"

ARCHITECTURES="all"
SECONDARY_ARCHITECTURES="x86"

libMltVersionCompat="$portVersion compat >= ${portVersion%%.*}"

PROVIDES="
	mlt$secondaryArchSuffix = $portVersion
	cmd:melt = $portVersion
	lib:libmlt$secondaryArchSuffix = $libMltVersionCompat
	lib:libmlt++$secondaryArchSuffix = $libMltVersionCompat
	"
REQUIRES="
	haiku$secondaryArchSuffix
#	ladspa_sdk$secondaryArchSuffix
	frei0r$secondaryArchSuffix
	lib:libatomic$secondaryArchSuffix
	lib:libavcodec$secondaryArchSuffix
	lib:libavdevice$secondaryArchSuffix
	lib:libavfilter$secondaryArchSuffix
	lib:libavformat$secondaryArchSuffix
	lib:libavutil$secondaryArchSuffix
	lib:libebur128$secondaryArchSuffix
	lib:libfftw3$secondaryArchSuffix
#	lib:libjack$secondaryArchSuffix
	lib:libSDL_1.2$secondaryArchSuffix
#	lib:libSDL_image_1.2$secondaryArchSuffix
	lib:libSDL2_2.0$secondaryArchSuffix
#	lib:libSDL2_image_2.0$secondaryArchSuffix
	lib:libsox$secondaryArchSuffix
	lib:libswscale$secondaryArchSuffix
	lib:libswresample$secondaryArchSuffix
	lib:libxml2$secondaryArchSuffix
	"


PROVIDES_devel="
	mlt${secondaryArchSuffix}_devel = $portVersion
	devel:libmlt$secondaryArchSuffix = $libMltVersionCompat
	devel:libmlt++$secondaryArchSuffix = $libMltVersionCompat
	"
REQUIRES_devel="
	mlt$secondaryArchSuffix == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
#	ladspa_sdk${secondaryArchSuffix}_devel
	frei0r${secondaryArchSuffix}_devel
	devel:libavcodec$secondaryArchSuffix
	devel:libavdevice$secondaryArchSuffix
	devel:libavfilter$secondaryArchSuffix
	devel:libavformat$secondaryArchSuffix
	devel:libavutil$secondaryArchSuffix
	devel:libebur128$secondaryArchSuffix
	devel:libfftw3$secondaryArchSuffix
#	devel:libjack$secondaryArchSuffix
	devel:libSDL_1.2$secondaryArchSuffix
#	devel:libSDL_image_1.2$secondaryArchSuffix
	devel:libSDL2_2.0$secondaryArchSuffix
#	devel:libSDL2_image_2.0$secondaryArchSuffix
	devel:libsox$secondaryArchSuffix
	devel:libswscale$secondaryArchSuffix
	devel:libswresample$secondaryArchSuffix
	devel:libxml2$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:awk
	cmd:find
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	"

BUILD()
{
	runConfigure ./configure
	make $jobsArgs
}

INSTALL()
{
	make install

	prepareInstalledDevelLibs libmlt libmlt++
	fixPkgconfig

	# devel package
	packageEntries devel \
		$developDir
}
