SUMMARY="Recurrent neural network for audio noise reduction"
DESCRIPTION="RNNoise is a noise suppression library based on a recurrent neural network."
HOMEPAGE="https://gitlab.xiph.org/xiph/rnnoise/"
COPYRIGHT="Jean-Marc Valin"
LICENSE="MPL v2.0"
REVISION="1"
srcGitRev="1cbdbcf1283499bbb2230a6b0f126eb9b236defd"
SOURCE_URI="https://github.com/xiph/rnnoise/archive/$srcGitRev.tar.gz"
CHECKSUM_SHA256="68c7ab4e408426088603e19955e746bb2a412d84bb121b6f39834c60fc8068b7"
SOURCE_DIR="rnnoise-$srcGitRev"

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

PROVIDES="
	rnnoise$secondaryArchSuffix = $portVersion
	lib:librnnoise$secondaryArchSuffix = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	"

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

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoconf
	cmd:automake
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:libtoolize$secondaryArchSuffix
	cmd:make
	"

BUILD()
{
	autogen.sh
	runConfigure ./configure
	make $jobArgs
}

INSTALL()
{
	make install

	rm $libDir/*.la

	prepareInstalledDevelLibs librnnoise
	fixPkgconfig

	# devel package
	packageEntries devel \
		$developDir
}
