SUMMARY="Plugin pack is a set of extra plugins for Qmmp"
DESCRIPTION="Plugin List:
 * FFap - enhanced Monkey's Audio (APE) decoder (24-bit samples and embedded cue support)
 * XMP - module player with use of the libxmp library
 * Sample Rate Converter - resampler based on libsamplerate library
 * Goom - audio visualization based on goom project
 * FFVideo - video playback engine based on FFmpeg library"
HOMEPAGE="http://qmmp.ylsoftware.com/"
COPYRIGHT="2006-2021 Qmmp Development Team"
LICENSE="GNU GPL v2"
REVISION="1"
SOURCE_URI="https://qmmp.ylsoftware.com/files/qmmp-plugin-pack/2.0/qmmp-plugin-pack-$portVersion.tar.bz2"
CHECKSUM_SHA256="73f0d5c62b518eb1843546c8440f528a5de6795f1f4c3740f28b8ed0d4c3dbca"
SOURCE_DIR="qmmp-plugin-pack-$portVersion"

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

PROVIDES="
	qmmp_plugin_pack$secondaryArchSuffix = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libavcodec$secondaryArchSuffix
	lib:libavformat$secondaryArchSuffix
	lib:libavutil$secondaryArchSuffix
	lib:libqmmp$secondaryArchSuffix
	lib:libqmmpui$secondaryArchSuffix
	lib:libQt6Core$secondaryArchSuffix
	lib:libQt6Gui$secondaryArchSuffix
	lib:libQt6Widgets$secondaryArchSuffix
	lib:libsamplerate$secondaryArchSuffix
	lib:libtag$secondaryArchSuffix
	lib:libxmp$secondaryArchSuffix
	lib:libz$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	qt6_tools${secondaryArchSuffix}_devel
	devel:libavcodec$secondaryArchSuffix
	devel:libavformat$secondaryArchSuffix
	devel:libqmmp$secondaryArchSuffix
	devel:libQt6Core$secondaryArchSuffix
	devel:libQt6Gui$secondaryArchSuffix
	devel:libQt6Widgets$secondaryArchSuffix
	devel:libsamplerate$secondaryArchSuffix
	devel:libtag$secondaryArchSuffix
	devel:libxmp$secondaryArchSuffix
	devel:libz$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:cmake
	cmd:find
	cmd:flex
	cmd:gcc$secondaryArchSuffix
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	cmd:xargs
	cmd:yacc
	cmd:yasm
	"

BUILD()
{
	mkdir -p build
	cd build

	cmake .. $cmakeDirArgs \
		-DCMAKE_INSTALL_PREFIX=$appsDir/Qmmp \
		-DCMAKE_INSTALL_BINDIR=$appsDir/Qmmp \
		-DPLUGIN_DIR=$appsDir/Qmmp/plugins \
		-DCMAKE_BUILD_TYPE=RELEASE \
		-DUSE_FFVIDEO=OFF

	make $jobArgs
}

INSTALL()
{
	cd build
	make install
}
