Use https by default
[gentoo.git] / app-accessibility / speech-tools / speech-tools-2.1-r3.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI="5"
6
7 inherit eutils flag-o-matic multilib toolchain-funcs
8
9 MY_P=${P/speech-/speech_}
10 PATCHSET="r3"
11
12 DESCRIPTION="Speech tools for Festival Text to Speech engine"
13 HOMEPAGE="http://www.cstr.ed.ac.uk/projects/speech_tools/"
14 SRC_URI="http://www.festvox.org/packed/festival/${PV}/${MY_P}-release.tar.gz
15                  https://dev.gentoo.org/~neurogeek/${PN}/${MY_P}-${PATCHSET}-patches.tar.gz"
16
17 LICENSE="FESTIVAL HPND BSD rc regexp-UofT"
18 SLOT="0"
19 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
20 IUSE="nas X"
21
22 RDEPEND="
23         nas? ( media-libs/nas )
24         X? ( x11-libs/libX11
25                 x11-libs/libXt )
26         >=media-libs/alsa-lib-1.0.20-r1
27         !<app-accessibility/festival-1.96_beta
28         !sys-power/powerman
29         >=sys-libs/ncurses-5.6-r2
30 "
31 DEPEND="${RDEPEND}
32         virtual/pkgconfig
33 "
34
35 S="${WORKDIR}/speech_tools"
36
37 src_prepare() {
38         EPATCH_SUFFIX="patch"
39         epatch
40
41         sed -i -e 's,{{HORRIBLELIBARCHKLUDGE}},"/usr/$(get_libdir)",' \
42                 main/siod_main.cc || die
43
44         #WRT bug #309983
45         sed -i -e "s:\(GCC_SYSTEM_OPTIONS =\).*:\1:" \
46                 "${S}"/config/systems/sparc_SunOS5.mak || die
47
48         # Fix underlinking, bug #493204
49         epatch "${FILESDIR}"/${PN}-2.1-underlinking.patch
50 }
51
52 src_configure() {
53         local CONFIG=config/config.in
54         sed -i -e 's/@COMPILERTYPE@/gcc42/' ${CONFIG} || die
55         if use nas; then
56                 sed -i -e "s/#.*\(INCLUDE_MODULES += NAS_AUDIO\)/\1/" \
57                         ${CONFIG} || die
58         fi
59         if ! use X; then
60                 sed -i -e "s/-lX11 -lXt//" config/modules/esd_audio.mak || die
61         fi
62         econf
63 }
64
65 src_compile() {
66         emake -j1 CC="$(tc-getCC)" CXX="$(tc-getCXX)" CXX_OTHER_FLAGS="${CXXFLAGS}" CC_OTHER_FLAGS="${CFLAGS}" \
67                 LDFLAGS="${LDFLAGS}"
68 }
69
70 src_install() {
71         dolib.so lib/libest*.so*
72
73         dodoc "${S}"/README
74         dodoc "${S}"/lib/cstrutt.dtd
75
76         insinto /usr/share/doc/${PF}
77         doins -r lib/example_data
78
79         insinto /usr/share/speech-tools
80         doins -r config base_class
81
82         insinto /usr/share/speech-tools/lib
83         doins -r lib/siod
84
85         cd include || die
86         insinto /usr/include/speech-tools
87         doins -r *
88         dosym /usr/include/speech-tools /usr/share/speech-tools/include
89
90         cd ../bin || die
91         for file in *; do
92                 [ "${file}" = "Makefile" ] && continue
93                 dobin ${file}
94                 dstfile="${D}/usr/bin/${file}"
95                 sed -i -e "s:${S}/testsuite/data:/usr/share/speech-tools/testsuite:g" \
96                         ${dstfile} || die
97                 sed -i -e "s:${S}/bin:/usr/$(get_libdir)/speech-tools:g" \
98                         ${dstfile} || die
99                 sed -i -e "s:${S}/main:/usr/$(get_libdir)/speech-tools:g" \
100                         ${dstfile} || die
101
102                 # This just changes LD_LIBRARY_PATH
103                 sed -i -e "s:${S}/lib:/usr/$(get_libdir):g" ${dstfile} || die
104         done
105
106         cd "${S}" || die
107         exeinto /usr/$(get_libdir)/speech-tools
108         for file in `find main -perm /111 -type f`; do
109                 doexe ${file}
110         done
111
112         #Remove /usr/bin/resynth as it is broken. See bug #253556
113         rm "${D}/usr/bin/resynth" || die
114
115         # Remove bcat (only useful for testing on windows, see bug #418301).
116         rm "${D}/usr/bin/bcat" || die
117         rm "${D}/usr/$(get_libdir)/speech-tools/bcat" || die
118 }