SUMMARY="A frameserver controlled by scripting"
DESCRIPTION="A powerful nonlinear scripting language for media. Includes a set \
of core filters for editing, pre-production and post-production, and the \
ability to extend its capabilities through the use of external plugins."
HOMEPAGE="https://avs-plus.net"
COPYRIGHT="2000-2015 Ben Rudiak-Gould, et al.
	2013-2021 AviSynth+ Project"
LICENSE="GNU GPL v2"
REVISION="1"
SOURCE_URI="https://github.com/AviSynth/AviSynthPlus/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="96c5043512ecf8dca7a6257b8a54a28dcb8fea454d0dc5a9fd6f61cceda6bbef"
SOURCE_FILENAME="avisynthplus-$portVersion.tar.gz"
SOURCE_DIR="AviSynthPlus-$portVersion"

ARCHITECTURES="all !x86_gcc2 ?arm ?arm64 ?ppc ?riscv64 ?sparc"
SECONDARY_ARCHITECTURES="x86"

libVersion="9"
libVersionCompat="$libVersion compat >= 9"

PROVIDES="
	avisynthplus$secondaryArchSuffix = $portVersion
	lib:libavisynth$secondaryArchSuffix = $libVersionCompat
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libIL$secondaryArchSuffix
	"

PROVIDES_devel="
	avisynthplus${secondaryArchSuffix}_devel = $portVersion
	devel:libavisynth$secondaryArchSuffix = $libVersionCompat
	"
REQUIRES_devel="
	avisynthplus$secondaryArchSuffix == $portVersion base
	"

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

BUILD()
{
	mkdir -p avisynth-build
	cd avisynth-build
	cmake ../ $cmakeDirArgs -DCMAKE_CXX_FLAGS="-DRELEASE_TARBALL" -DCMAKE_BUILD_TYPE=Release
	make $jobArgs
}

INSTALL()
{
	make -C avisynth-build install

	fixPkgconfig

	packageEntries devel \
		$developDir
}
