# Maintainer (arch): David Runge <dave@archlinux.org>
# Contributor: Ray Rashif <schiv@archlinux.org>
# Contributor: Eric Belanger <eric@archlinux.org>
# Contributor: Tom Newsom <Jeepster@gmx.co.uk>
# Contributor: André Silva <emulatorman@hyperbola.info>
# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>

pkgname=ecasound
pkgver=2.9.3
pkgrel=1
pkgrel+=.parabola1
pkgdesc="Command-line multitrack audio processor"
pkgdesc+=", without nonfree faac recommendation"
arch=('x86_64')
arch+=('i686' 'armv7h')
url="https://ecasound.seul.org/ecasound/"
license=('GPL2' 'LGPL2.1')
groups=('pro-audio')
depends=('alsa-lib' 'gcc-libs' 'glibc' 'libjack.so' 'libaudiofile.so'
'liblo.so' 'liblilv-0.so' 'libreadline.so' 'libsndfile.so' 'libncursesw.so')
makedepends=('lv2' 'ruby' 'python' 'libmikmod.so')
optdepends=('bash: for libecasoundc-config and libecasound-config'
            'lame: MP3 encoding'
            'libfaad2: for .aac/.m4a/.mp4 file support'
            'libmikmod.so: for tracker module'
            'mpg123: MP3 decoding'
            'python: for ecamonitor'
            'ruby: ECI API'
            'timidity++: for .mid file support'
            'vorbis-tools: for .ogg file support')
replaces=("${pkgname}-libre" "${pkgname}-parabola")
conflicts=("${pkgname}-libre" "${pkgname}-parabola")
source=("https://ecasound.seul.org/download/$pkgname-$pkgver.tar.gz")
sha512sums=('4f70e6f54cd05194a4ffe80905e7488d16d32d684c87736dfdac7b3aebf3d20cbf417964d75e00e781f6f0614b8b699061c69fcbf7e1761d66ce1abfcd5f1140')

prepare() {
  cd "$pkgname-$pkgver"
  # lv2core is deprecated in favor of lv2:
  # https://sourceforge.net/p/ecasound/bugs/52/
  sed -e 's/lv2core/lv2/g' -i configure.ac
  # install ruby integration to vendor_ruby
  sed -e 's/sitedir/vendordir/' -i configure.ac
  autoreconf -vfi
}
build() {
  cd "$pkgname-$pkgver"
  ./configure --prefix=/usr
  make
}

package() {
  cd "$pkgname-$pkgver"
  make DESTDIR="$pkgdir/" install
  # docs
  install -vDm 644 {AUTHORS,BUGS,NEWS,README,RELNOTES,TODO} \
    -t "${pkgdir}/usr/share/doc/${pkgname}/"
}
# vim:set ts=2 sw=2 et:
