# Maintainer:
pkgname=zam-plugins
pkgver=4.2
_dpf=63dfb7610bc37dee69f4a303f3e3362529d95f24
_pugl=2e98e220b5b860c1c8cd5809fad61baf27380a37
pkgrel=0
pkgdesc="Collection of LADSPA/LV2/VST/JACK audio plugins for high-quality processing"
url="https://github.com/zamaudio/zam-plugins"
arch="all"
license="GPL-2.0-or-later"
options="!check" # no testsuite
install="$pkgname.post-upgrade"
makedepends="
	bash
	fftw-dev
	jack-dev
	ladspa-dev
	liblo-dev
	libsamplerate-dev
	lv2-dev
	mesa-dev
	zita-convolver-dev
	"
subpackages="
	$pkgname-clap
	$pkgname-ladspa
	$pkgname-lv2
	$pkgname-vst2
	$pkgname-vst3
	"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/zamaudio/zam-plugins/archive/refs/tags/$pkgver.tar.gz
	dpf-$_dpf.tar.gz::https://github.com/DISTRHO/DPF/archive/$_dpf.tar.gz
	pugl-$_pugl.tar.gz::https://github.com/DISTRHO/pugl/archive/$_pugl.tar.gz
	"

prepare() {
	default_prepare

	# overwrite folders
	rmdir dpf
	ln -sfv "$srcdir"/DPF-$_dpf dpf

	rmdir dpf/dgl/src/pugl-upstream
	ln -sfv "$srcdir"/pugl-$_pugl dpf/dgl/src/pugl-upstream
}

build() {
	make PREFIX=/usr
}

package() {
	make DESTDIR="$pkgdir" PREFIX=/usr install
}

clap() {
	pkgdesc="$pkgdesc (clap integration)"

	amove usr/lib/clap
}

ladspa() {
	pkgdesc="$pkgdesc (ladspa integration)"

	amove usr/lib/ladspa
}

lv2() {
	pkgdesc="$pkgdesc (lv2 plugins)"

	amove usr/lib/lv2
}

vst2() {
	pkgdesc="$pkgdesc (vst2 plugins)"

	amove usr/lib/vst
}

vst3() {
	pkgdesc="$pkgdesc (vst3 plugins)"

	amove usr/lib/vst3
}

sha512sums="
84aff169f7992ea6f99efe7fb44f9923f19cab233bc2757aa0799575d4dce9140b9a6aec07782dfba3b951b6765ade7a0381c2c64c56aa23a635318f56ed84fd  zam-plugins-4.2.tar.gz
d80d5e0bf70f9c441f72b433817ab0183a80ad74496e6a5f1e5ff7870c8869a2dfc3fcd70057025ff7b3622dd7417d0567b23e2cc7cd7ef29e716080d2abd813  dpf-63dfb7610bc37dee69f4a303f3e3362529d95f24.tar.gz
8fda46853a03c83c9c090826cb89822793647e9ead540c41c229fa69c60f41ab61fc4a405d4bef7ed22ca9c73172202f26f632bd8eff386963c35286720c6412  pugl-2e98e220b5b860c1c8cd5809fad61baf27380a37.tar.gz
"
