# Maintainer: David Runge <dvzrv@archlinux.org>

pkgname=noise-repellent
pkgver=0.1.5
pkgrel=3
pkgdesc="An lv2 plug-in for broadband noise reduction"
arch=('x86_64')
url="https://github.com/lucianodato/noise-repellent"
license=('LGPL3')
groups=('lv2-plugins' 'pro-audio')
depends=('fftw' 'glibc' 'lv2-host')
makedepends=('lv2' 'meson')
checkdepends=('lv2lint')
source=("$pkgname-$pkgver.tar.gz::https://github.com/lucianodato/${pkgname}/archive/${pkgver}.tar.gz")
sha512sums=('85fcafdaead400efa3ba9e87f2ecf96c02a41334f933902d456a2d5e714e72ef4124e68534f87b60421ef7139bea4e5e768a89d5ed13e6fcf95a9923cc89e383')
b2sums=('b840df30a5b374be7df2797f970e115083aa97e1ba4219466a659d29ff5791f34c8d7f7352cfb615ea8d109b92a27b47b29ca1dd6b77031a6f7fd3f15e2ddf5f')

build() {
  cd "$pkgname-$pkgver"
  # install_folder is broken:
  # https://github.com/lucianodato/noise-repellent/issues/68
  arch-meson --prefix=/usr/lib/lv2 build
  ninja -C build
}

check() {
  cd "$pkgname-$pkgver"
  cp -av lv2ttl/*.ttl build/
  lv2lint -Mpack -I build "https://github.com/lucianodato/noise-repellent" || printf "Known to fail: https://github.com/lucianodato/noise-repellent/issues/79\n"
}

package() {
  cd "$pkgname-$pkgver"
  DESTDIR="${pkgdir}" meson install -C build
  install -vDm 644 README.md -t "${pkgdir}/usr/share/doc/${pkgname}/"
}
