# Maintainer: David Runge <dave@sleepmap.de>

_name=BSlizr
pkgname=bslizr
pkgver=0.4
pkgrel=1
pkgdesc="LV2 audio effect plugin for sequenced slicing of stereo audio input signals"
arch=('x86_64')
url="https://github.com/sjaehn/bslizr"
license=('GPL3')
groups=('lv2-plugins' 'pro-audio')
depends=('cairo')
makedepends=('lv2')
source=("$pkgname-$pkgver.tar.gz::https://github.com/sjaehn/${pkgname}/archive/v${pkgver}.tar.gz")
sha512sums=('5c2db7ab5e601c010282bd15fd5b46ce826eb34e5bfd0b0415863a69ba001abc6ddbbf7dd371cd36fa3b9826bcf274eb2d885e9b19f792b4d2fd3b33278ee1a8')

prepare() {
  mv -v "${_name}-${pkgver}" "$pkgname-$pkgver"
  cd "$pkgname-$pkgver"
  # achieve full RELRO: https://github.com/sjaehn/BSlizr/issues/6
  sed -e "/CC)/ s/$/${LDFLAGS}/g" -i makefile
}

build() {
  cd "$pkgname-$pkgver"
  make
}

package() {
  cd "$pkgname-$pkgver"
  # Makefile doesn't honor DESTDIR: https://github.com/sjaehn/BSlizr/issues/5
  make INSTALL_DIR="$pkgdir/usr/lib/lv2" install
  # remove useless license file
  find "${pkgdir}/usr/lib/" -type f -iname "*LICENSE*" -delete
}
