SUMMARY="LibAV based gstreamer plugin"
DESCRIPTION="GStreamer LibAV plug-in contains one plugin with a set of elements using the \
LibAV library code. It contains most popular decoders as well as very fast colorspace \
conversion elements."
HOMEPAGE="https://gstreamer.freedesktop.org/"
COPYRIGHT="Erik Walthinsen"
LICENSE="GNU LGPL v2
	GNU GPL v2"
REVISION="1"
SOURCE_URI="https://gstreamer.freedesktop.org/src/gst-libav/gst-libav-$portVersion.tar.xz"
CHECKSUM_SHA256="822e008a910e9dd13aedbdd8dc63fedef4040c0ee2e927bab3112e9de693a548"
SOURCE_DIR="gst-libav-$portVersion"

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

libVersion="0.1805.0"

PROVIDES="
	gst_libav$secondaryArchSuffix = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libavcodec$secondaryArchSuffix
	lib:libavformat$secondaryArchSuffix
	lib:libavutil$secondaryArchSuffix
	lib:libbz2$secondaryArchSuffix
	lib:libglib_2.0$secondaryArchSuffix
	lib:libgstapp_1.0$secondaryArchSuffix
	lib:libgstaudio_1.0$secondaryArchSuffix
	lib:libgstreamer_1.0$secondaryArchSuffix
	lib:libgstvideo_1.0$secondaryArchSuffix
	lib:libiconv$secondaryArchSuffix
	lib:libintl$secondaryArchSuffix
	lib:liborc_0.4$secondaryArchSuffix
	lib:libxml2$secondaryArchSuffix
	lib:libz$secondaryArchSuffix
	"
SUPPLEMENTS="
	gstreamer$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libavcodec$secondaryArchSuffix
	devel:libavformat$secondaryArchSuffix
	devel:libavutil$secondaryArchSuffix
	devel:libbz2$secondaryArchSuffix
	devel:libglib_2.0$secondaryArchSuffix
	devel:libgstapp_1.0$secondaryArchSuffix >= $libVersion
	devel:libgstaudio_1.0$secondaryArchSuffix >= $libVersion
	devel:libgstreamer_1.0$secondaryArchSuffix >= $libVersion
	devel:libgstvideo_1.0$secondaryArchSuffix >= $libVersion
	devel:libiconv$secondaryArchSuffix
	devel:libintl$secondaryArchSuffix
	devel:liborc_0.4$secondaryArchSuffix
	devel:libxml2$secondaryArchSuffix
	devel:libz$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:bison
	cmd:cmake
	cmd:flex
	cmd:gcc$secondaryArchSuffix
	cmd:grep
	cmd:ld$secondaryArchSuffix
	cmd:make
	cmd:meson
	cmd:ninja
	cmd:orcc$secondaryArchSuffix
	cmd:pkg_config$secondaryArchSuffix
	cmd:python
	cmd:python3
	cmd:which
	"

BUILD()
{
	export CFLAGS="-lnetwork"

	meson build \
		--buildtype=release \
		--prefix=$prefix \
		--bindir=$binDir \
		--libdir=$libDir \
		--libexecdir=$libDir \
		--datadir=$dataDir \
		--mandir=$manDir \
		--includedir=$includeDir \
		-D doc=disabled \
		-D examples=disabled \
		-D test=disabled \
		-D nls=disabled \
		-D orc=enabled

	ninja -C build $jobArgs
}

INSTALL()
{
	ninja -C build install
}
