1 |
ssuominen |
1.1 |
# Copyright 1999-2009 Gentoo Foundation |
2 |
|
|
# Distributed under the terms of the GNU General Public License v2 |
3 |
|
|
# $Header: /var/cvsroot/gentoo-x86/media-sound/timidity++/timidity++-2.13.2-r9.ebuild,v 1.1 2009/05/12 16:00:46 ssuominen Exp $ |
4 |
|
|
|
5 |
|
|
inherit eutils elisp-common |
6 |
|
|
|
7 |
|
|
MY_PV=${PV/_/-} |
8 |
|
|
MY_P=TiMidity++-${MY_PV} |
9 |
|
|
S=${WORKDIR}/${MY_P} |
10 |
|
|
|
11 |
|
|
DESCRIPTION="A handy MIDI to WAV converter with OSS and ALSA output support" |
12 |
|
|
HOMEPAGE="http://timidity.sourceforge.net/" |
13 |
|
|
SRC_URI="mirror://sourceforge/timidity/${MY_P}.tar.bz2 mirror://gentoo/${P}-exiterror.patch" |
14 |
|
|
|
15 |
|
|
LICENSE="GPL-2" |
16 |
|
|
SLOT="0" |
17 |
|
|
KEYWORDS="~amd64 ~arm ~hppa ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd" |
18 |
|
|
IUSE="oss nas esd motif X gtk vorbis tk slang alsa arts jack emacs ao speex flac ncurses" |
19 |
|
|
|
20 |
|
|
DEPEND="ncurses? ( >=sys-libs/ncurses-5 ) |
21 |
|
|
emacs? ( virtual/emacs ) |
22 |
|
|
gtk? ( >=x11-libs/gtk+-2 ) |
23 |
|
|
tk? ( >=dev-lang/tk-8.1 ) |
24 |
|
|
motif? ( x11-libs/openmotif ) |
25 |
|
|
esd? ( >=media-sound/esound-0.2.22 ) |
26 |
|
|
nas? ( >=media-libs/nas-1.4 ) |
27 |
|
|
alsa? ( media-libs/alsa-lib ) |
28 |
|
|
slang? ( sys-libs/slang ) |
29 |
|
|
arts? ( kde-base/arts ) |
30 |
|
|
jack? ( media-sound/jack-audio-connection-kit ) |
31 |
|
|
vorbis? ( media-libs/libvorbis ) |
32 |
|
|
flac? ( media-libs/flac ) |
33 |
|
|
speex? ( media-libs/speex ) |
34 |
|
|
ao? ( >=media-libs/libao-0.8.5 )" |
35 |
|
|
RDEPEND="${DEPEND} |
36 |
|
|
alsa? ( media-sound/alsa-utils ) |
37 |
|
|
app-admin/eselect-timidity" |
38 |
|
|
|
39 |
|
|
PDEPEND="|| ( media-sound/timidity-eawpatches media-sound/timidity-shompatches media-sound/timidity-freepats )" |
40 |
|
|
|
41 |
|
|
SITEFILE=50${PN}-gentoo.el |
42 |
|
|
|
43 |
|
|
pkg_setup() { |
44 |
|
|
if use alsa && ! built_with_use --missing true media-libs/alsa-lib midi; then |
45 |
|
|
eerror "" |
46 |
|
|
eerror "To be able to build TiMidity++ with ALSA support you need" |
47 |
|
|
eerror "to have built media-libs/alsa-lib with midi USE flag." |
48 |
|
|
die "Missing midi USE flag on media-libs/alsa-lib" |
49 |
|
|
fi |
50 |
|
|
|
51 |
|
|
enewgroup audio 18 # Just make sure it exists |
52 |
|
|
enewuser timidity -1 -1 /var/lib/timidity audio |
53 |
|
|
} |
54 |
|
|
|
55 |
|
|
src_unpack() { |
56 |
|
|
unpack ${A} |
57 |
|
|
cd "${S}" |
58 |
|
|
epatch "${DISTDIR}"/${P}-exiterror.patch |
59 |
|
|
epatch "${FILESDIR}"/${P}-gtk26.patch |
60 |
|
|
epatch "${FILESDIR}"/${P}-gcc4.patch |
61 |
|
|
epatch "${FILESDIR}"/${P}-flac.patch |
62 |
|
|
epatch "${FILESDIR}"/${P}-flac113.patch |
63 |
|
|
epatch "${FILESDIR}"/${P}-protos.patch |
64 |
|
|
epatch "${FILESDIR}"/${P}-polling.patch |
65 |
|
|
|
66 |
|
|
# fix header location of speex |
67 |
|
|
sed -i -e "s:#include <speex:#include <speex/speex:g" configure* timidity/speex_a.c |
68 |
|
|
} |
69 |
|
|
|
70 |
|
|
src_compile() { |
71 |
|
|
local myconf |
72 |
|
|
local audios |
73 |
|
|
|
74 |
|
|
use flac && audios="${audios},flac" |
75 |
|
|
use speex && audios="${audios},speex" |
76 |
|
|
use vorbis && audios="${audios},vorbis" |
77 |
|
|
|
78 |
|
|
use oss && audios="${audios},oss" |
79 |
|
|
use esd && audios="${audios},esd" |
80 |
|
|
use arts && audios="${audios},arts" |
81 |
|
|
use jack && audios="${audios},jack" |
82 |
|
|
use ao && audios="${audios},ao" |
83 |
|
|
|
84 |
|
|
if use nas; then |
85 |
|
|
audios="${audios},nas" |
86 |
|
|
myconf="${myconf} --with-nas-library=/usr/$(get_libdir)/libaudio.so --with-x" |
87 |
|
|
use X || ewarn "Basic X11 support will be enabled because required by nas." |
88 |
|
|
fi |
89 |
|
|
|
90 |
|
|
if use alsa; then |
91 |
|
|
audios="${audios},alsa" |
92 |
|
|
myconf="${myconf} --with-default-output=alsa --enable-alsaseq" |
93 |
|
|
fi |
94 |
|
|
|
95 |
|
|
# We disable motif by default and then only enable it if it's requested. |
96 |
|
|
if use motif; then |
97 |
|
|
myconf="${myconf} --enable-motif --with-x" |
98 |
|
|
use X || ewarn "Basic X11 support will be enabled because required by motif." |
99 |
|
|
fi |
100 |
|
|
|
101 |
|
|
econf \ |
102 |
|
|
--localstatedir=/var/state/timidity++ \ |
103 |
|
|
--with-lispdir="${SITELISP}/${PN}" \ |
104 |
|
|
--with-elf \ |
105 |
|
|
--enable-audio=${audios} \ |
106 |
|
|
--enable-server \ |
107 |
|
|
--enable-network \ |
108 |
|
|
--enable-dynamic \ |
109 |
|
|
--enable-vt100 \ |
110 |
|
|
--enable-spline=cubic \ |
111 |
|
|
$(use_enable emacs) \ |
112 |
|
|
$(use_enable slang) \ |
113 |
|
|
$(use_enable ncurses) \ |
114 |
|
|
$(use_with X x) \ |
115 |
|
|
$(use_enable X spectrogram) \ |
116 |
|
|
$(use_enable X wrd) \ |
117 |
|
|
$(use_enable X xskin) \ |
118 |
|
|
$(use_enable X xaw) \ |
119 |
|
|
$(use_enable gtk) \ |
120 |
|
|
$(use_enable tk tcltk) \ |
121 |
|
|
--disable-motif \ |
122 |
|
|
${myconf} || die |
123 |
|
|
|
124 |
|
|
emake || die |
125 |
|
|
} |
126 |
|
|
|
127 |
|
|
src_install() { |
128 |
|
|
make DESTDIR="${D}" install || die |
129 |
|
|
|
130 |
|
|
dodoc AUTHORS ChangeLog* |
131 |
|
|
dodoc NEWS README* "${FILESDIR}/timidity.cfg-r1" |
132 |
|
|
|
133 |
|
|
# these are only for the ALSA sequencer mode |
134 |
|
|
if use alsa; then |
135 |
|
|
newconfd "${FILESDIR}/conf.d.timidity" timidity |
136 |
|
|
newinitd "${FILESDIR}/init.d.timidity.3" timidity |
137 |
|
|
fi |
138 |
|
|
|
139 |
|
|
insinto /etc |
140 |
|
|
newins "${FILESDIR}/timidity.cfg-r1" timidity.cfg |
141 |
|
|
|
142 |
|
|
dodir /usr/share/timidity |
143 |
|
|
dosym /etc/timidity.cfg /usr/share/timidity/timidity.cfg |
144 |
|
|
|
145 |
|
|
if use emacs ; then |
146 |
|
|
elisp-site-file-install "${FILESDIR}/${SITEFILE}" |
147 |
|
|
fi |
148 |
|
|
|
149 |
|
|
diropts -o timidity -g nobody -m 0700 |
150 |
|
|
keepdir /var/lib/timidity |
151 |
|
|
|
152 |
|
|
doicon "${FILESDIR}"/timidity.xpm |
153 |
|
|
domenu "${FILESDIR}"/timidity.desktop |
154 |
|
|
} |
155 |
|
|
|
156 |
|
|
pkg_postinst() { |
157 |
|
|
use emacs && elisp-site-regen |
158 |
|
|
|
159 |
|
|
elog "A timidity config file has been installed in /etc/timidity.cfg." |
160 |
|
|
elog "Do not edit this file as it will interfere with the eselect timidity tool." |
161 |
|
|
elog "The tool 'eselect timidity' can be used to switch between installed patchsets." |
162 |
|
|
|
163 |
|
|
if use alsa; then |
164 |
|
|
elog "An init script for the alsa timidity sequencer has been installed." |
165 |
|
|
elog "If you wish to use the timidity virtual sequencer, edit /etc/conf.d/timidity" |
166 |
|
|
elog "and run 'rc-update add timidity <runlevel> && /etc/init.d/timidity start'" |
167 |
|
|
fi |
168 |
|
|
|
169 |
|
|
if use sparc; then |
170 |
|
|
ewarn "sparc support is experimental. oss, alsa, and esd do not work." |
171 |
|
|
ewarn "-Ow (save to wave file) does..." |
172 |
|
|
fi |
173 |
|
|
} |
174 |
|
|
|
175 |
|
|
pkg_postrm() { |
176 |
|
|
use emacs && elisp-site-regen |
177 |
|
|
} |