# Maintainer: Brett Cornwall <ainola@archlinux.org>

pkgname=csound-plugins
pkgver=r32.e2c9cf5
pkgrel=1
pkgdesc="Extra opcodes for Csound"
arch=(x86_64)
url="https://github.com/csound/plugins"
license=('GPL')
groups=('pro-audio')
depends=(
	'csound'
	'python'
)
makedepends=(
	'cmake'
	'faust'
	'fltk'
	'git'
	'libpng'
)
optdepends=(
	'faust: for libfaustcsound plugin'
	'fltk: for libvirtual and libwidgets plugins'
	'libpng: for libimage plugin'
)
source=('git+https://github.com/csound/plugins.git#tag=e2c9cf5deded1e57ffbfe5d12e27489ba2b9b9c3')
sha256sums=('SKIP')

pkgver() {
	cd plugins
	printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
	mkdir build
	# libchua is already built by csound for now.
	cmake -B build -S plugins \
		-DCMAKE_BUILD_TYPE='None' \
		-DCMAKE_INSTALL_PREFIX='/usr' \
		-DBUILD_CHUA_OPCODES='OFF' \
		-Wno-dev
	make -C build
}

package() {
	make -C build DESTDIR="$pkgdir/" install
}
