From a840820212aa9741b61b9224cc4d510e6c49efa4 Mon Sep 17 00:00:00 2001 From: Christopher Brannon Date: Wed, 12 Feb 2014 21:21:11 +0000 Subject: Bugfixes. For flite 1.2, 1.3, and 1.4, add a patch to prevent the use of a temporary file. (bug #498020). For flite 1.3, respect LDFLAGS (bug #476810). For flite 1.3, fix build failure (bug #456986). For flite 1.3, allow static flite to be built. USE=static has been broken for a long time. No bug was ever opened, and I just found the problem today. (Portage version: 2.2.7/cvs/Linux x86_64, signed Manifest commit with key 0x6521e06d) --- app-accessibility/flite/ChangeLog | 21 +++++- .../flite/files/flite-1.2-tempfile.patch | 50 ++++++++++++++ .../flite/files/flite-1.3-fix-static.patch | 29 ++++++++ app-accessibility/flite/files/flite-1.3-libm.patch | 11 +++ .../flite/files/flite-1.3-respect-ldflags.patch | 24 +++++++ .../flite/files/flite-1.3-tempfile.patch | 50 ++++++++++++++ .../flite/files/flite-1.4-tempfile.patch | 50 ++++++++++++++ app-accessibility/flite/flite-1.2-r2.ebuild | 78 ++++++++++++++++++++++ app-accessibility/flite/flite-1.3-r1.ebuild | 73 ++++++++++++++++++++ app-accessibility/flite/flite-1.4-r2.ebuild | 70 ------------------- app-accessibility/flite/flite-1.4-r3.ebuild | 71 ++++++++++++++++++++ 11 files changed, 455 insertions(+), 72 deletions(-) create mode 100644 app-accessibility/flite/files/flite-1.2-tempfile.patch create mode 100644 app-accessibility/flite/files/flite-1.3-fix-static.patch create mode 100644 app-accessibility/flite/files/flite-1.3-libm.patch create mode 100644 app-accessibility/flite/files/flite-1.3-respect-ldflags.patch create mode 100644 app-accessibility/flite/files/flite-1.3-tempfile.patch create mode 100644 app-accessibility/flite/files/flite-1.4-tempfile.patch create mode 100644 app-accessibility/flite/flite-1.2-r2.ebuild create mode 100644 app-accessibility/flite/flite-1.3-r1.ebuild delete mode 100644 app-accessibility/flite/flite-1.4-r2.ebuild create mode 100644 app-accessibility/flite/flite-1.4-r3.ebuild (limited to 'app-accessibility/flite') diff --git a/app-accessibility/flite/ChangeLog b/app-accessibility/flite/ChangeLog index 6f3ef8993fb5..e04a63a681bd 100644 --- a/app-accessibility/flite/ChangeLog +++ b/app-accessibility/flite/ChangeLog @@ -1,6 +1,23 @@ # ChangeLog for app-accessibility/flite -# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-accessibility/flite/ChangeLog,v 1.47 2013/08/25 14:42:09 jer Exp $ +# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/app-accessibility/flite/ChangeLog,v 1.48 2014/02/12 21:21:11 teiresias Exp $ + +*flite-1.4-r3 (12 Feb 2014) +*flite-1.3-r1 (12 Feb 2014) +*flite-1.2-r2 (12 Feb 2014) + + 12 Feb 2014; Christopher Brannon +flite-1.2-r2.ebuild, + +files/flite-1.2-tempfile.patch, +flite-1.3-r1.ebuild, + +files/flite-1.3-fix-static.patch, +files/flite-1.3-libm.patch, + +files/flite-1.3-respect-ldflags.patch, +files/flite-1.3-tempfile.patch, + -flite-1.4-r2.ebuild, +flite-1.4-r3.ebuild, +files/flite-1.4-tempfile.patch: + For flite 1.2, 1.3, and 1.4, add a patch to prevent + the use of a temporary file. (bug #498020). + For flite 1.3, respect LDFLAGS (bug #476810). + For flite 1.3, fix build failure (bug #456986). + For flite 1.3, allow static flite to be built. USE=static has been + broken for a long time. No bug was ever opened, and I just found the + problem today. 25 Aug 2013; Jeroen Roovers flite-1.2-r1.ebuild, flite-1.3.ebuild, flite-1.4-r2.ebuild: diff --git a/app-accessibility/flite/files/flite-1.2-tempfile.patch b/app-accessibility/flite/files/flite-1.2-tempfile.patch new file mode 100644 index 000000000000..09b54f64ea2e --- /dev/null +++ b/app-accessibility/flite/files/flite-1.2-tempfile.patch @@ -0,0 +1,50 @@ +From a85193f122b7ec0d377e0a39ac58c64f12c51085 Mon Sep 17 00:00:00 2001 +From: Rui Matos +Date: Mon, 6 Jan 2014 13:45:00 +0000 +Subject: [PATCH] auserver.c: Only write audio data to a file in debug builds + +This isn't useful in regular builds and is actually a security +concern. +--- + src/audio/auserver.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/src/audio/auserver.c b/src/audio/auserver.c +index 29716d3..3e838d0 100644 +--- a/src/audio/auserver.c ++++ b/src/audio/auserver.c +@@ -58,9 +58,11 @@ static int play_wave_from_socket(snd_header *header,int audiostream) + int q,i,n,r; + unsigned char bytes[CST_AUDIOBUFFSIZE]; + short shorts[CST_AUDIOBUFFSIZE]; ++#ifdef DEBUG + cst_file fff; + + fff = cst_fopen("/tmp/awb.wav",CST_OPEN_WRITE|CST_OPEN_BINARY); ++#endif + + if ((audio_device = audio_open(header->sample_rate,1, + (header->encoding == CST_SND_SHORT) ? +@@ -107,7 +109,9 @@ static int play_wave_from_socket(snd_header *header,int audiostream) + for (q=r; q > 0; q-=n) + { + n = audio_write(audio_device,shorts,q); ++#ifdef DEBUG + cst_fwrite(fff,shorts,2,q); ++#endif + if (n <= 0) + { + audio_close(audio_device); +@@ -116,7 +120,9 @@ static int play_wave_from_socket(snd_header *header,int audiostream) + } + } + audio_close(audio_device); ++#ifdef DEBUG + cst_fclose(fff); ++#endif + + return CST_OK_FORMAT; + +-- +1.8.3.1 + diff --git a/app-accessibility/flite/files/flite-1.3-fix-static.patch b/app-accessibility/flite/files/flite-1.3-fix-static.patch new file mode 100644 index 000000000000..156f145aa236 --- /dev/null +++ b/app-accessibility/flite/files/flite-1.3-fix-static.patch @@ -0,0 +1,29 @@ +diff -Naur flite-1.3-release/main/Makefile flite-1.3-release.new/main/Makefile +--- flite-1.3-release/main/Makefile 2014-02-12 12:08:32.222776141 -0800 ++++ flite-1.3-release.new/main/Makefile 2014-02-12 12:29:32.308048276 -0800 +@@ -48,15 +48,23 @@ + ALL = $(BINDIR)/flite$(EXEEXT) $(BINDIR)/flite_time$(EXEEXT) \ + $(BINDIR)/t2p$(EXEEXT) + ++include $(TOP)/config/common_make_rules ++ + flite_LIBS = flite_$(FL_VOX) flite_$(FL_LANG) flite_$(FL_LEX) + flite_LIBS_flags = -L$(LIBDIR) $(flite_LIBS:%=-l%) ++ifdef SHFLAGS + flite_LIBS_deps = $(flite_LIBS:%=$(LIBDIR)/lib%.so) ++else ++flite_LIBS_deps = $(flite_LIBS:%=$(LIBDIR)/lib%.a) ++endif + + flite_time_LIBS = flite_cmu_time_awb flite_$(FL_LANG) flite_$(FL_LEX) + flite_time_LIBS_flags = -L$(LIBDIR) $(flite_time_LIBS:%=-l%) ++ifdef SHFLAGS + flite_time_LIBS_deps = $(flite_time_LIBS:%=$(LIBDIR)/lib%.so) +- +-include $(TOP)/config/common_make_rules ++else ++flite_time_LIBS_deps = $(flite_time_LIBS:%=$(LIBDIR)/lib%.a) ++endif + + $(BINDIR)/flite$(EXEEXT): flite_main.o $(FLITELIBS) $(flite_LIBS_deps) + $(CC) $(CFLAGS) -o $@ flite_main.o $(flite_LIBS_flags) $(LDFLAGS) diff --git a/app-accessibility/flite/files/flite-1.3-libm.patch b/app-accessibility/flite/files/flite-1.3-libm.patch new file mode 100644 index 000000000000..90eba91a3d6c --- /dev/null +++ b/app-accessibility/flite/files/flite-1.3-libm.patch @@ -0,0 +1,11 @@ +--- flite-1.3-release/config/common_make_rules 2013-04-03 15:28:04.004893371 +0100 ++++ flite-1.3-release/config/common_make_rules 2013-04-03 15:27:50.574992901 +0100 +@@ -69,7 +69,7 @@ + + ifdef SHFLAGS + FLITELIBS = $(LIBDIR)/libflite.so +-LDFLAGS += -L$(LIBDIR) -lflite $(OTHERLIBS) ++LDFLAGS += -L$(LIBDIR) -lflite -lm $(OTHERLIBS) + else + FLITELIBS = $(LIBDIR)/libflite.a + LDFLAGS += -L$(LIBDIR) -lflite -lm $(AUDIOLIBS) $(OTHERLIBS) diff --git a/app-accessibility/flite/files/flite-1.3-respect-ldflags.patch b/app-accessibility/flite/files/flite-1.3-respect-ldflags.patch new file mode 100644 index 000000000000..a8a8cb6fb445 --- /dev/null +++ b/app-accessibility/flite/files/flite-1.3-respect-ldflags.patch @@ -0,0 +1,24 @@ +diff -Naur flite-1.3-release/config/common_make_rules flite-1.3-release.new/config/common_make_rules +--- flite-1.3-release/config/common_make_rules 2014-02-12 09:56:23.058678651 -0800 ++++ flite-1.3-release.new/config/common_make_rules 2014-02-12 11:27:18.039561163 -0800 +@@ -67,6 +67,11 @@ + + BUILDDIRS=$(OBJDIR) $(BINDIR) $(LIBDIR) + ++ifndef SO_LDFLAGS ++SO_LDFLAGS := $(LDFLAGS) ++endif ++export SO_LDFLAGS ++ + ifdef SHFLAGS + FLITELIBS = $(LIBDIR)/libflite.so + LDFLAGS += -L$(LIBDIR) -lflite -lm $(OTHERLIBS) +@@ -130,7 +135,7 @@ + @ rm -rf shared_os && mkdir shared_os + @ rm -f $@ $@.${PROJECT_VERSION} $@.${PROJECT_SHLIB_VERSION} + @ (cd shared_os && ar x ../$<) +- @ (cd shared_os && $(CC) -shared -Wl,-soname,$@.${PROJECT_SHLIB_VERSION} -o ../$@.${PROJECT_VERSION} *.os -L../ $($(@:%.so=%_LDLIBS))) ++ @ (cd shared_os && $(CC) -shared -Wl,-soname,$@.${PROJECT_SHLIB_VERSION} $(SO_LDFLAGS) -o ../$@.${PROJECT_VERSION} *.os -L../ $($(@:%.so=%_LDLIBS))) + @ ln -s $@.${PROJECT_VERSION} $@.${PROJECT_SHLIB_VERSION} + @ ln -s $@.${PROJECT_SHLIB_VERSION} $@ + @ rm -rf shared_os diff --git a/app-accessibility/flite/files/flite-1.3-tempfile.patch b/app-accessibility/flite/files/flite-1.3-tempfile.patch new file mode 100644 index 000000000000..09b54f64ea2e --- /dev/null +++ b/app-accessibility/flite/files/flite-1.3-tempfile.patch @@ -0,0 +1,50 @@ +From a85193f122b7ec0d377e0a39ac58c64f12c51085 Mon Sep 17 00:00:00 2001 +From: Rui Matos +Date: Mon, 6 Jan 2014 13:45:00 +0000 +Subject: [PATCH] auserver.c: Only write audio data to a file in debug builds + +This isn't useful in regular builds and is actually a security +concern. +--- + src/audio/auserver.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/src/audio/auserver.c b/src/audio/auserver.c +index 29716d3..3e838d0 100644 +--- a/src/audio/auserver.c ++++ b/src/audio/auserver.c +@@ -58,9 +58,11 @@ static int play_wave_from_socket(snd_header *header,int audiostream) + int q,i,n,r; + unsigned char bytes[CST_AUDIOBUFFSIZE]; + short shorts[CST_AUDIOBUFFSIZE]; ++#ifdef DEBUG + cst_file fff; + + fff = cst_fopen("/tmp/awb.wav",CST_OPEN_WRITE|CST_OPEN_BINARY); ++#endif + + if ((audio_device = audio_open(header->sample_rate,1, + (header->encoding == CST_SND_SHORT) ? +@@ -107,7 +109,9 @@ static int play_wave_from_socket(snd_header *header,int audiostream) + for (q=r; q > 0; q-=n) + { + n = audio_write(audio_device,shorts,q); ++#ifdef DEBUG + cst_fwrite(fff,shorts,2,q); ++#endif + if (n <= 0) + { + audio_close(audio_device); +@@ -116,7 +120,9 @@ static int play_wave_from_socket(snd_header *header,int audiostream) + } + } + audio_close(audio_device); ++#ifdef DEBUG + cst_fclose(fff); ++#endif + + return CST_OK_FORMAT; + +-- +1.8.3.1 + diff --git a/app-accessibility/flite/files/flite-1.4-tempfile.patch b/app-accessibility/flite/files/flite-1.4-tempfile.patch new file mode 100644 index 000000000000..09b54f64ea2e --- /dev/null +++ b/app-accessibility/flite/files/flite-1.4-tempfile.patch @@ -0,0 +1,50 @@ +From a85193f122b7ec0d377e0a39ac58c64f12c51085 Mon Sep 17 00:00:00 2001 +From: Rui Matos +Date: Mon, 6 Jan 2014 13:45:00 +0000 +Subject: [PATCH] auserver.c: Only write audio data to a file in debug builds + +This isn't useful in regular builds and is actually a security +concern. +--- + src/audio/auserver.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/src/audio/auserver.c b/src/audio/auserver.c +index 29716d3..3e838d0 100644 +--- a/src/audio/auserver.c ++++ b/src/audio/auserver.c +@@ -58,9 +58,11 @@ static int play_wave_from_socket(snd_header *header,int audiostream) + int q,i,n,r; + unsigned char bytes[CST_AUDIOBUFFSIZE]; + short shorts[CST_AUDIOBUFFSIZE]; ++#ifdef DEBUG + cst_file fff; + + fff = cst_fopen("/tmp/awb.wav",CST_OPEN_WRITE|CST_OPEN_BINARY); ++#endif + + if ((audio_device = audio_open(header->sample_rate,1, + (header->encoding == CST_SND_SHORT) ? +@@ -107,7 +109,9 @@ static int play_wave_from_socket(snd_header *header,int audiostream) + for (q=r; q > 0; q-=n) + { + n = audio_write(audio_device,shorts,q); ++#ifdef DEBUG + cst_fwrite(fff,shorts,2,q); ++#endif + if (n <= 0) + { + audio_close(audio_device); +@@ -116,7 +120,9 @@ static int play_wave_from_socket(snd_header *header,int audiostream) + } + } + audio_close(audio_device); ++#ifdef DEBUG + cst_fclose(fff); ++#endif + + return CST_OK_FORMAT; + +-- +1.8.3.1 + diff --git a/app-accessibility/flite/flite-1.2-r2.ebuild b/app-accessibility/flite/flite-1.2-r2.ebuild new file mode 100644 index 000000000000..3d48142a52c4 --- /dev/null +++ b/app-accessibility/flite/flite-1.2-r2.ebuild @@ -0,0 +1,78 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-accessibility/flite/flite-1.2-r2.ebuild,v 1.1 2014/02/12 21:21:11 teiresias Exp $ + +EAPI=5 +inherit eutils + +DESCRIPTION="Flite text to speech engine" +HOMEPAGE="http://www.speech.cs.cmu.edu/flite/index.html" +SRC_URI="http://www.speech.cs.cmu.edu/flite/packed/${P}/${P}-release.tar.bz2 + http://www.speech.cs.cmu.edu/flite/packed/${P}/${PN}_lexfix.tar.gz" + +LICENSE="BSD freetts public-domain regexp-UofT BSD-2" +SLOT="0" +KEYWORDS=" ~alpha ~amd64 ~ppc ~sparc ~x86" +IUSE="static" + +S=${WORKDIR}/${P}-release + +src_unpack() { + unpack ${P}-release.tar.bz2 + unpack ${PN}_lexfix.tar.gz + + # Move the update into ${S} + cd ${PN} + tar -cf - . | (cd "${S}"; tar -xf -) +} + +src_prepare() { + epatch "${FILESDIR}"/const.patch + epatch "${FILESDIR}"/${P}-tempfile.patch +} + +src_configure() { + local myconf + if ! use static ; then + myconf="${myconf} --enable-shared" + fi + myconf="${myconf} --with-vox=cmu_us_kal16" + + econf ${myconf} + # -j2 borks when we make the shared libs +} + +src_compile() { + emake -j1 +} + +src_install() { + dobin bin/* + dodoc ACKNOWLEDGEMENTS README + + if use static ; then + dolib.a lib/*.a + else + for lib in lib/*.so*; do + if [ -f ${lib} ]; then + dolib.so ${lib} + lib=`basename ${lib}` + majlib=`echo ${lib} | sed 's:\(\.so\.[0-9]\)\(\.[0-9]*\)*$:\1:'` + noverlib=`echo ${lib} | sed 's:\(\.so\)\(\.[0-9]*\)*$:\1:'` + + dosym ${lib} /usr/lib/${majlib} + dosym ${lib} /usr/lib/${noverlib} + fi + done + fi + + insinto /usr/include/flite + cd "${S}"/include + for file in *.h; do + doins ${file} + sed -i -e 's:#include "\(.*\)":#include :g' \ + "${D}"/usr/include/flite/${file} || die "sed failed" + done + + dosym flite/flite.h /usr/include/flite.h +} diff --git a/app-accessibility/flite/flite-1.3-r1.ebuild b/app-accessibility/flite/flite-1.3-r1.ebuild new file mode 100644 index 000000000000..633d902112c2 --- /dev/null +++ b/app-accessibility/flite/flite-1.3-r1.ebuild @@ -0,0 +1,73 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-accessibility/flite/flite-1.3-r1.ebuild,v 1.1 2014/02/12 21:21:11 teiresias Exp $ + +EAPI=5 +inherit eutils + +DESCRIPTION="Flite text to speech engine" +HOMEPAGE="http://www.speech.cs.cmu.edu/flite/index.html" +SRC_URI="http://www.speech.cs.cmu.edu/flite/packed/${P}/${P}-release.tar.gz" + +LICENSE="BSD freetts public-domain regexp-UofT BSD-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~ppc ~ppc64 ~sparc ~x86" +IUSE="alsa static" + +S=${WORKDIR}/${P}-release + +src_prepare() { + epatch "${FILESDIR}"/${P}-tempfile.patch + if use alsa; then + epatch "${FILESDIR}"/${P}-alsa-support.patch + fi + epatch "${FILESDIR}"/${P}-shared-libs.patch + epatch "${FILESDIR}"/${P}-fix-static.patch + epatch "${FILESDIR}"/${P}-respect-ldflags.patch + epatch "${FILESDIR}"/${P}-libm.patch +} + +src_configure() { + local myconf + if ! use static ; then + myconf="--enable-shared" + fi + myconf="${myconf} --with-vox=cmu_us_kal16" + + econf ${myconf} +} + +src_compile() { + emake -j1 +} + +src_install() { + dobin bin/* + dodoc ACKNOWLEDGEMENTS README + + if use static ; then + dolib.a lib/*.a + else + for lib in lib/*.so*; do + if [ -f ${lib} ]; then + dolib.so ${lib} + lib=`basename ${lib}` + majlib=`echo ${lib} | sed 's:\(\.so\.[0-9]\)\(\.[0-9]*\)*$:\1:'` + noverlib=`echo ${lib} | sed 's:\(\.so\)\(\.[0-9]*\)*$:\1:'` + + dosym ${lib} /usr/lib/${majlib} + dosym ${lib} /usr/lib/${noverlib} + fi + done + fi + + insinto /usr/include/flite + cd "${S}"/include + for file in *.h; do + doins ${file} + sed -i -e 's:#include "\(.*\)":#include :g' \ + "${D}"/usr/include/flite/${file} || die "sed failed" + done + + dosym flite/flite.h /usr/include/flite.h +} diff --git a/app-accessibility/flite/flite-1.4-r2.ebuild b/app-accessibility/flite/flite-1.4-r2.ebuild deleted file mode 100644 index 0fd9d2fc63d4..000000000000 --- a/app-accessibility/flite/flite-1.4-r2.ebuild +++ /dev/null @@ -1,70 +0,0 @@ -# Copyright 1999-2013 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-accessibility/flite/flite-1.4-r2.ebuild,v 1.3 2013/08/25 14:42:09 jer Exp $ - -EAPI=4 -inherit autotools eutils - -DESCRIPTION="Flite text to speech engine" -HOMEPAGE="http://www.speech.cs.cmu.edu/flite/index.html" -SRC_URI=" http://www.speech.cs.cmu.edu/${PN}/packed/${P}/${P}-release.tar.bz2" - -LICENSE="BSD freetts public-domain regexp-UofT BSD-2" -SLOT="0" -KEYWORDS=" ~alpha ~amd64 ~arm ~ppc ~ppc64 ~sparc ~x86" -IUSE="alsa oss static-libs" - -DEPEND="alsa? ( >=media-libs/alsa-lib-1.0.24.1 )" -RDEPEND="${DEPEND}" - -S=${WORKDIR}/${P}-release - -get_audio() { - if use alsa; then - echo alsa - elif use oss; then - echo oss - else - echo none - fi -} - -src_prepare() { - epatch "${FILESDIR}"/${P}-fix-parallel-builds.patch - epatch "${FILESDIR}"/${P}-respect-destdir.patch - epatch "${FILESDIR}"/${P}-ldflags.patch - epatch "${FILESDIR}"/${P}-audio-interface.patch - sed -i main/Makefile \ - -e '/-rpath/s|$(LIBDIR)|$(INSTALLLIBDIR)|g' \ - || die - eautoreconf -} - -src_configure() { - local myconf - if ! use static-libs; then - myconf=--enable-shared - fi - myconf="${myconf} --with-audio=$(get_audio)" - econf ${myconf} -} - -src_compile() { - emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" -} - -src_install() { - emake DESTDIR="${D}" install - dodoc ACKNOWLEDGEMENTS README - if ! use static-libs; then - rm -rf "${D}"/usr/lib*/*.a - fi -} - -pkg_postinst() { - if [ "$(get_audio)" = "none" ]; then - ewarn "you have built flite without audio support." - ewarn "If you want audio support, re-emerge" - ewarn "flite with alsa or oss in your use flags." - fi -} diff --git a/app-accessibility/flite/flite-1.4-r3.ebuild b/app-accessibility/flite/flite-1.4-r3.ebuild new file mode 100644 index 000000000000..5e526bd98c47 --- /dev/null +++ b/app-accessibility/flite/flite-1.4-r3.ebuild @@ -0,0 +1,71 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-accessibility/flite/flite-1.4-r3.ebuild,v 1.1 2014/02/12 21:21:11 teiresias Exp $ + +EAPI=4 +inherit autotools eutils + +DESCRIPTION="Flite text to speech engine" +HOMEPAGE="http://www.speech.cs.cmu.edu/flite/index.html" +SRC_URI=" http://www.speech.cs.cmu.edu/${PN}/packed/${P}/${P}-release.tar.bz2" + +LICENSE="BSD freetts public-domain regexp-UofT BSD-2" +SLOT="0" +KEYWORDS=" ~alpha ~amd64 ~arm ~ppc ~ppc64 ~sparc ~x86" +IUSE="alsa oss static-libs" + +DEPEND="alsa? ( >=media-libs/alsa-lib-1.0.24.1 )" +RDEPEND="${DEPEND}" + +S=${WORKDIR}/${P}-release + +get_audio() { + if use alsa; then + echo alsa + elif use oss; then + echo oss + else + echo none + fi +} + +src_prepare() { + epatch "${FILESDIR}"/${P}-tempfile.patch + epatch "${FILESDIR}"/${P}-fix-parallel-builds.patch + epatch "${FILESDIR}"/${P}-respect-destdir.patch + epatch "${FILESDIR}"/${P}-ldflags.patch + epatch "${FILESDIR}"/${P}-audio-interface.patch + sed -i main/Makefile \ + -e '/-rpath/s|$(LIBDIR)|$(INSTALLLIBDIR)|g' \ + || die + eautoreconf +} + +src_configure() { + local myconf + if ! use static-libs; then + myconf=--enable-shared + fi + myconf="${myconf} --with-audio=$(get_audio)" + econf ${myconf} +} + +src_compile() { + emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" +} + +src_install() { + emake DESTDIR="${D}" install + dodoc ACKNOWLEDGEMENTS README + if ! use static-libs; then + rm -rf "${D}"/usr/lib*/*.a + fi +} + +pkg_postinst() { + if [ "$(get_audio)" = "none" ]; then + ewarn "you have built flite without audio support." + ewarn "If you want audio support, re-emerge" + ewarn "flite with alsa or oss in your use flags." + fi +} -- cgit v1.2.3-65-gdbad