1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit eutils multilib toolchain-funcs
10 SRC_URI="mirror://sourceforge/${PN}/${MY_P}.zip"
11 DESCRIPTION="Speech synthesizer for English and other languages"
12 HOMEPAGE="http://espeak.sourceforge.net/"
15 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux"
16 IUSE="portaudio pulseaudio"
18 COMMON_DEPEND=" portaudio? ( >=media-libs/portaudio-19_pre20071207 )
19 pulseaudio? ( media-sound/pulseaudio )"
21 DEPEND="${COMMON_DEPEND}
24 RDEPEND="${COMMON_DEPEND}
27 S=${WORKDIR}/${MY_P}/src
30 if use portaudio && use pulseaudio; then
32 elif use portaudio; then
34 elif use pulseaudio; then
42 # gentoo uses portaudio 19.
43 mv -f portaudio19.h portaudio.h
48 PREFIX="${EPREFIX}/usr" \
52 CXXFLAGS="${CXXFLAGS}" \
54 AUDIO="$(get_audio)" \
57 einfo "Fixing byte order of phoneme data files"
58 pushd ../platforms/big_endian > /dev/null
62 ./espeak-phoneme-data \
65 ../../espeak-data/phondata-manifest
66 cp -f phondata phonindex phontab "../../espeak-data"
71 PREFIX="${EPREFIX}/usr" \
72 LIBDIR="\$(PREFIX)/$(get_libdir)" \
74 AUDIO="$(get_audio)" \
78 insinto /usr/share/espeak-data
80 dodoc ChangeLog.txt ReadMe
85 local voicedir="${ROOT}/usr/share/${PN}-data/voices/en"
86 if [ -d "${voicedir}" ]; then
92 if ! use portaudio && ! use pulseaudio; then
93 ewarn "Since portaudio and pulseaudio are not in your use flags,"
94 ewarn "espeak will only be able to create wav files."
95 ewarn "If this is not what you want, please reemerge ${CATEGORY}/${PN}"
96 ewarn "with either portaudio or pulseaudio USE flag enabled."