SUMMARY="Audio file library"
DESCRIPTION="library for reading and writing audio files in many common formats.

The Audio File Library provides a uniform API which abstracts away details of \
file formats and data formats. The same calls for opening a file, accessing \
and manipulating audio metadata (e.g. sample rate, sample format, textual \
information, MIDI parameters), and reading and writing sample data will work \
with any supported audio file format. The Audio File Library lets you work \
with audio data in whatever format is most convenient for you.

Supported file formats:
* AIFF/AIFF-C (.aiff, .aifc)
* WAVE (.wav)
* NeXT .snd/Sun .au (.snd, .au)
* Berkeley/IRCAM/CARL Sound File (.sf)
* Audio Visual Research (.avr)
* Amiga IFF/8SVX (.iff)
* Sample Vision (.smp)
* Creative Voice File (.voc)
* NIST SPHERE (.wav)
* Core Audio Format (.caf)
* FLAC (.flac)

Supported compression formats:
* G.711 mu-law and A-law
* IMA ADPCM
* Microsoft ADPCM
* FLAC
* ALAC (Apple Lossless Audio Codec)"
HOMEPAGE="https://audiofile.68k.org/"
COPYRIGHT="1998-2013 Michael Pruett, Chris Pirazzi, Scott Porter, Doug Scott"
LICENSE="GNU LGPL v2.1"
REVISION="6"
SOURCE_URI="https://audiofile.68k.org/audiofile-$portVersion.tar.gz"
CHECKSUM_SHA256="cdc60df19ab08bfe55344395739bb08f50fc15c92da3962fac334d3bff116965"
PATCHES="audiofile-$portVersion.patch"

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

PROVIDES="
	audiofile$secondaryArchSuffix = $portVersion
	cmd:sfconvert$secondaryArchSuffix
	cmd:sfinfo$secondaryArchSuffix
	lib:libaudiofile$secondaryArchSuffix = 1.0.0 compat >= 1
	"
REQUIRES="
	haiku$secondaryArchSuffix
	"

PROVIDES_devel="
	audiofile${secondaryArchSuffix}_devel = $portVersion
	devel:libaudiofile$secondaryArchSuffix
	"
REQUIRES_devel="
	audiofile$secondaryArchSuffix == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	"
BUILD_PREREQUIRES="
	cmd:awk
	cmd:g++$secondaryArchSuffix
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	"

defineDebugInfoPackage audiofile$secondaryArchSuffix \
	"$libDir"/libaudiofile.so.1.0.0

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

INSTALL()
{
	make install
	rm $libDir/*.la
	prepareInstalledDevelLib libaudiofile
	fixPkgconfig
	packageEntries devel $developDir
}
