]> Pileus Git - ~andy/sunrise/blob - media-sound/chuck/chuck-1.2.0.5.ebuild
273374712ac68157e4365096cdb6ec836709b267
[~andy/sunrise] / media-sound / chuck / chuck-1.2.0.5.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
6
7 DESCRIPTION="ChuCK - On-the-fly Audio Programming"
8 HOMEPAGE="http://chuck.cs.princeton.edu/release/"
9 SRC_URI="http://chuck.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 DEPEND="jack? ( media-sound/jack-audio-connection-kit )
17         alsa? ( >=media-libs/alsa-lib-0.9 )
18         media-libs/libsndfile
19         sys-devel/bison
20         sys-devel/flex"
21
22 src_unpack() {
23         unpack ${A}
24         cd "${S}"
25         epatch "${FILESDIR}/${P}-makefile.patch"
26 }
27
28 pkg_setup() {
29         local cnt=0
30         use jack && cnt="$((${cnt} + 1))"
31         use alsa && cnt="$((${cnt} + 1))"
32         use oss && cnt="$((${cnt} + 1))"
33         if [[ "${cnt}" -ne 1 ]] ; then
34                 eerror "You have set ${P} to use multiple audio engine."
35                 eerror "I don't know which to use!"
36                 eerror "You can use /etc/portage/package.use to set per-package USE flags"
37                 eerror "Set it so only one audio engine type jack, alsa, oss"
38                 die "Please set only one audio engine type"
39         fi
40 }
41
42 src_compile() {
43         cd "${S}/src"
44
45         local backend
46         if use jack ; then
47                 backend="jack"
48         elif use alsa ; then
49                 backend="alsa"
50         elif use oss ; then
51                 backend="oss"
52         else
53                 local msg="One of the following USE flags is needed: jack, alsa or oss"
54                 eerror "${msg}"
55                 die "${msg}"
56         fi
57         einfo "Compiling against ${backend}"
58         emake -j1 "linux-${backend}" || die "emake failed"
59 }
60
61 src_install() {
62         dobin src/chuck
63
64         dodoc AUTHORS DEVELOPER PROGRAMMER QUICKSTART README THANKS TODO VERSIONS
65         if use doc; then
66                 docinto examples
67                 dodoc `find examples -type f`
68                 for dir in `find examples/* -type d`; do
69                         docinto $dir
70                         dodoc $dir/*
71                 done
72                 docinto doc
73                 dodoc doc/*
74         fi
75 }