# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: Fixes send to ps@twin.jikos.cz $

EAPI=2

inherit eutils wxwidgets

WX_GTK_VER=2.8

DESCRIPTION="Development System for Auditory Modelling"
HOMEPAGE="http://www.pdn.cam.ac.uk/groups/dsam"
SRC_URI="http://prdownloads.sourceforge.net/dsam/dsam-2.8.30.tar.gz"

LICENSE="GPL-3"
SLOT="0"
KEYWORDS="x86"
IUSE="+wxwidgets portaudio"

DEPEND="sci-libs/fftw
	media-libs/libsndfile
	wxwidgets? ( x11-libs/wxGTK )
	portaudio? ( media-libs/portaudio )"
RDEPEND="${DEPEND}"

src_configure() {
	need-wxwidgets gtk2
	epatch "${FILESDIR}"/dsam.patch || die 
	./autogen.sh
	#for some weird reason first pass returns errors which are fixed in the second pass
	econf
	econf
}

src_install() {
	emake DESTDIR="${D}" install || die "emake install failed"
}