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

pkgname=avldrums.lv2
pkgver=0.4.2
pkgrel=3
pkgdesc="A simple Drum Sample Player Plugin, dedicated to the AVLinux Drumkits"
arch=('x86_64')
url="https://x42-plugins.com/x42/x42-avldrums"
license=('GPL2')
groups=('pro-audio' 'lv2-plugins')
depends=('cairo' 'glibc' 'libglvnd' 'libx11' 'lv2-host')
makedepends=('fluidsynth' 'git' 'glib2' 'glu' 'lv2' 'pango')
source=("git+https://github.com/x42/${pkgname}.git#tag=v${pkgver}"
        "git+https://github.com/x42/robtk"
        "${pkgname}-0.4.2-use-system-fluidsynth.patch")
sha512sums=('SKIP'
            'SKIP'
            'a47ac0c731e843000bd0b05e58ed2f1159df596ac2303583ebecd3010cb381506cd704fcd7c187ba45961cffb0c5b73ea01b19fc4c75a2bf376e6d7596d17d33')
b2sums=('SKIP'
        'SKIP'
        'aeff7bd322e9e1fa36c36096cdbfc8f3db9a0a726eda27f9f38375c6b887acddaca4ab907ccf59c633d8813c4d992ffdc23524e5beb4209f851cacef9750c577')

prepare() {
  cd "${pkgname}"
  git submodule init
  git config submodule.robtk.url "${srcdir}/robtk"
  git submodule update
  # build against system fluidsynth
  patch -Np1 -i "../${pkgname}-0.4.2-use-system-fluidsynth.patch"
}

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

package() {
  depends+=('libfluidsynth.so' 'libgobject-2.0.so' 'libpango-1.0.so' 'libpangocairo-1.0.so')
  cd "${pkgname}"
  make DESTDIR="$pkgdir/" PREFIX='/usr' install
}
