]> Pileus Git - ~andy/sunrise/blob - media-sound/tapestrea/tapestrea-0.1.0.3.ebuild
media-sound/tapestrea: filter-flags march and clean
[~andy/sunrise] / media-sound / tapestrea / tapestrea-0.1.0.3.ebuild
1 # Copyright 1999-2006 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 inherit eutils toolchain-funcs flag-o-matic
6
7 DESCRIPTION="Techniques And Paradigms for Expressive Synthesis, Transformation, and Rendering of Environmental Audio"
8 HOMEPAGE="http://taps.cs.princeton.edu/"
9 SRC_URI="http://taps.cs.princeton.edu/release/files/${P}.tgz"
10
11 LICENSE="GPL-2"
12 SLOT="0"
13 KEYWORDS="~x86"
14 IUSE="oss jack alsa doc"
15
16 RDEPEND="jack? ( media-sound/jack-audio-connection-kit )
17         alsa? ( >=media-libs/alsa-lib-0.9 )
18         media-libs/libsndfile
19         virtual/glut
20         virtual/opengl
21         virtual/glu
22         >=x11-libs/gtk+-2"
23 DEPEND="${RDEPEND}
24         sys-devel/bison
25         sys-devel/flex"
26
27 src_unpack() {
28         unpack ${A}
29         cd "${S}"
30         epatch "${FILESDIR}/${P}-makefile.patch"
31 }
32
33 pkg_setup() {
34         local cnt=0
35         use jack && cnt="$((${cnt} + 1))"
36         use alsa && cnt="$((${cnt} + 1))"
37         use oss && cnt="$((${cnt} + 1))"
38         if [[ "${cnt}" -eq 0 ]] ; then
39                 eerror "One of the following USE flags is needed: jack, alsa or oss"
40                 die "Please set one audio engine type"
41         elif [[ "${cnt}" -ne 1 ]] ; then
42                 ewarn "You have set ${P} to use multiple audio engine."
43         fi
44 }
45
46 src_compile() {
47         local backend
48         if use jack; then
49                 backend="jack"
50         elif use alsa; then
51                 backend="alsa"
52         elif use oss; then
53                 backend="oss"
54         fi
55         einfo "Compiling against ${backend}"
56
57         filter-flags "-march=*"
58
59         cd "${S}/scripting/chuck-1.2.0.6/src"
60         emake -f "makefile.${backend}" CC=$(tc-getCC) CXX=$(tc-getCXX) || die "emake failed"
61
62         cd "${S}/src"
63         emake -f "makefile.${backend}" CC=$(tc-getCC) CXX=$(tc-getCXX) || die "emake failed"
64 }
65
66 src_install() {
67         dobin src/taps
68
69         dodoc AUTHORS BUGS DEVELOPER PROGRAMMER QUICKSTART README THANKS TODO VERSIONS
70         if use doc; then
71                 for dir in `find examples/* -type d -maxdepth 0`; do
72                         docinto $dir
73                         dodoc `find $dir/* -type f -maxdepth 0`
74                         for dir2 in `find $dir/* -type d -maxdepth 0`; do
75                                 docinto $dir2
76                                 dodoc `find $dir2/* -type f -maxdepth 0`
77                         done
78                 done
79                 docinto doc
80                 dodoc doc/*
81         fi
82 }