# Template file for 'portaudio'
pkgname=portaudio
version=190600.20161030
revision=1
wrksrc=portaudio
build_style=gnu-configure
configure_args="--enable-cxx --with-jack"
hostmakedepends="automake libtool pkg-config"
makedepends="alsa-lib-devel jack-devel"
homepage="http://www.portaudio.com"
license="MIT"
short_desc="Portable cross-platform audio I/O library"
maintainer="Juan RP <xtraeme@voidlinux.eu>"
distfiles="http://www.${pkgname}.com/archives/pa_stable_v${version%.*}_${version#*.}.tgz"
checksum=f5a21d7dcd6ee84397446fa1fa1a0675bb2e8a4a6dceb4305a8404698d8d1513

disable_parallel_build=yes

pre_configure() {
	# depcomp is required when building the bindings/cpp extension
	# but will be removed by autoreconf + libtool >= 2.4.6
	# Protect it from removal
	mv depcomp{,~}

	autoreconf -fi

	# Restore depcomp
	mv depcomp{~,}
}

post_install() {
	vlicense LICENSE.txt
}

portaudio-devel_package() {
	depends="portaudio>=${version}_${revision}"
	short_desc+=" - development files"
	pkg_install() {
		vmove "usr/include/*.h"
		vmove usr/lib/libportaudio.a
		vmove usr/lib/libportaudio.so
		vmove usr/lib/pkgconfig/portaudio-2.0.pc
	}
}
portaudio-cpp_package() {
	short_desc+=" - C++ Bindings"
	pkg_install() {
		vmove "usr/lib/libportaudiocpp.so.*"
	}
}
portaudio-cpp-devel_package() {
	depends="portaudio-cpp>=${version}_${revision} portaudio-devel>=${version}_${revision}"
	short_desc+=" - C++ bindings development files"
	pkg_install() {
		vmove usr/include/portaudiocpp
		vmove usr/lib/pkgconfig/portaudiocpp.pc
		vmove usr/lib/libportaudiocpp.a
		vmove usr/lib/libportaudiocpp.so
	}
}
