# $Id: PKGBUILD 115633 2014-07-12 20:45:12Z speps $
# Maintainer : speps <speps at aur dot archlinux dot org>

pkgname=ams
pkgver=2.1.1
pkgrel=1
pkgdesc="A realtime modular synthesizer and effect processor"
arch=('i686' 'x86_64')
url="http://alsamodular.sourceforge.net/"
license=('GPL')
depends=('qt4' 'fftw' 'jack' 'ladspa' 'liblo' 'zita-alsa-pcmi')
optdepends=('amb-plugins: ambisonic plugins'
            'mcp-plugins: phaser, chorus and moog vcf plugins'
            'rev-plugins: zita-rev1 based reverb plugins'
            'swh-plugins: Steve Harris plugins'
            'vco-plugins: oscillator plugins'
            'fil-plugins: equaliser plugins'
            'tap-plugins: toms audio plugins'
            'wah-plugins: wah audio plugins'
            'g2reverb: greverb based plugins'
            'cmt: Computer Music Toolkit plugins'
            'blop: bandlimited oscillator plugins'
            'pvoc: phase-vocoding plugins'
            'caps: the C* audio plugins')
install="$pkgname.install"
source=("http://downloads.sourceforge.net/project/alsamodular/alsamodular/$pkgver/$pkgname-$pkgver.tar.bz2"
        "$pkgname.desktop" "$pkgname.png")
md5sums=('3255bce2d3c1a7e0aad07496001b7cc9'
         'ffa277cffd52254f0297cbc2f200767e'
         '0349171d5431f1c6e56085f080eb8c68')

prepare() {
  cd $pkgname-$pkgver

  # strip unwanted optimization flags
  sed -i '/AMS_OPT_CXXFLAGS=/d' configure
}

build() {
  cd $pkgname-$pkgver
  ./configure --prefix=/usr
  make
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir/" install

  # desktop file
  install -Dm644 ../$pkgname.desktop \
    "$pkgdir/usr/share/applications/$pkgname.desktop"

  # icon
  install -Dm644 ../$pkgname.png \
    "$pkgdir/usr/share/pixmaps/$pkgname.png"
}
