# Maintainer: David Runge <dave@sleepmap.de>
pkgname=eq10q
pkgver=2.2
pkgrel=3
pkgdesc="Audio plugin bundle over the LV2 standard for Linux"
arch=('x86_64')
url="http://eq10q.sourceforge.net/"
license=('GPL3')
groups=('lv2-plugins' 'pro-audio')
depends=('fftw' 'gtkmm')
makedepends=('cmake' 'lv2')
source=("https://sourceforge.net/projects/${pkgname}/files/${pkgname}-${pkgver}.tar.gz")
sha512sums=('4c6a79e9f1faeb431abd4e94b6bfa153b1ff5f55b3c2734d35a865ba23e3a7786ee45ee122cdcc26c9a8de915f1c4e2ec588a4c219ad6daf0ccf4a2b474b1e24')

prepare() {
  cd "$pkgname-$pkgver"
  # replacing use of deprecated pow10 with standardized exp10:
  # https://sourceforge.net/p/eq10q/bugs/13/
  sed -e 's/pow10/exp10/g' -i gui/widgets/{bandctl,bodeplot}.cpp
  # fix install location: https://sourceforge.net/p/eq10q/bugs/20/
  sed -e '/CMAKE_INSTALL_PREFIX/d' \
      -e 's|sapista|lib/lv2/sapista|g' -i CMakeLists.txt
  mkdir -v build
}

build() {
  cd "$pkgname-$pkgver/build"
  cmake .. \
        -DCMAKE_INSTALL_PREFIX=/usr
}

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