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