# Mantainer: William Díaz <wdiaz [at] archlinux [dot] us>

pkgname=snack
pkgver=2.2.10
pkgrel=10
pkgdesc="The Snack Sound Toolkit (Tcl)"
url="http://www.speech.kth.se/snack/"
arch=('i686' 'x86_64')
license=('GPL')
depends=('tk' 'alsa-lib' 'libxft' 'libxss')
source=(http://www.speech.kth.se/snack/dist/${pkgname}${pkgver}.tar.gz configure.patch alsa.patch)
md5sums=('98da0dc73599b3a039cba1b7ff169399'
         'd0e95891bbaa44f555314ca91c9688f6'
	 '3cf709c217aa0c33e12e785db71c5583')

build() {
  cd ${srcdir}/${pkgname}${pkgver}/unix

  # bug from glib - error from /usr/include/bits/mathcalls.h:310
  sed -i -e 's|^\(#define roundf(.*\)|//\1|' ../generic/jkFormatMP3.c

  patch < ../../configure.patch || return 1
  patch < ../../alsa.patch || return 1

  ./configure --prefix=/usr \
              --with-tcl=/usr/lib \
	      --with-tk=/usr/lib \
	      --enable-alsa
  make || return 1
  make DESTDIR=${pkgdir} install
}

