From 5eed5243b76b1565be2ad55a6e3a18bed7a43890 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Tue, 18 Mar 2014 11:13:49 +0100 Subject: [PATCH] new package: add package 'espeak' (initial) Signed-off-by: Stephan Raue --- packages/audio/espeak/package.mk | 53 +++++++++++++++++++ .../patches/espeak-1.47-ftbs-ld-libm.patch | 23 ++++++++ .../patches/espeak-1.47-wav-close.patch | 23 ++++++++ packages/mediacenter/xbmc/package.mk | 5 ++ projects/ATV/options | 3 ++ projects/Cuboxi/options | 3 ++ projects/Generic/options | 3 ++ projects/RPi/options | 3 ++ projects/Virtual/options | 3 ++ 9 files changed, 119 insertions(+) create mode 100644 packages/audio/espeak/package.mk create mode 100644 packages/audio/espeak/patches/espeak-1.47-ftbs-ld-libm.patch create mode 100644 packages/audio/espeak/patches/espeak-1.47-wav-close.patch diff --git a/packages/audio/espeak/package.mk b/packages/audio/espeak/package.mk new file mode 100644 index 0000000000..090662af6e --- /dev/null +++ b/packages/audio/espeak/package.mk @@ -0,0 +1,53 @@ +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2014 Stephan Raue (stephan@openelec.tv) +# +# OpenELEC is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# OpenELEC is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with OpenELEC. If not, see . +################################################################################ + +PKG_NAME="espeak" +PKG_VERSION="1.48.04-source" +PKG_REV="1" +PKG_ARCH="any" +PKG_LICENSE="GPL" +PKG_SITE="http://espeak.sourceforge.net/" +PKG_URL="http://downloads.sourceforge.net/$PKG_NAME/$PKG_NAME-$PKG_VERSION.zip" +PKG_SOURCE_DIR="$PKG_NAME/$PKG_NAME-$PKG_VERSION" +PKG_DEPENDS_TARGET="toolchain" +PKG_PRIORITY="optional" +PKG_SECTION="audio" +PKG_SHORTDESC="Text to Speech engine for English, with support for other languages" +PKG_LONGDESC="Text to Speech engine for English, with support for other languages" + +PKG_IS_ADDON="no" +PKG_AUTORECONF="no" + +pre_make_target() { + cp src/portaudio19.h src/portaudio.h +} + +make_target() { + make -C src \ + CXXFLAGS="$CXXFLAGS" \ + LDFLAGS="$LDFLAGS" \ + AUDIO="" +} + +makeinstall_target() { + make -C src \ + CXXFLAGS="$CXXFLAGS" \ + LDFLAGS="$LDFLAGS" \ + AUDIO="" \ + DESTDIR=$INSTALL install +} diff --git a/packages/audio/espeak/patches/espeak-1.47-ftbs-ld-libm.patch b/packages/audio/espeak/patches/espeak-1.47-ftbs-ld-libm.patch new file mode 100644 index 0000000000..446493fb40 --- /dev/null +++ b/packages/audio/espeak/patches/espeak-1.47-ftbs-ld-libm.patch @@ -0,0 +1,23 @@ +diff --git a/src/Makefile b/src/Makefile +index f04b4c4..b8d4b19 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -83,15 +83,15 @@ libespeak_SOURCES = speak_lib.cpp compiledict.cpp dictionary.cpp intonation.cpp + + SRCS1=$(speak_SOURCES) + OBJS1=$(patsubst %.cpp,%.o,$(SRCS1)) +-LIBS1=-lstdc++ $(LIB_AUDIO) -lpthread $(EXTRA_LIBS) ++LIBS1=-lstdc++ -lm $(LIB_AUDIO) -lpthread $(EXTRA_LIBS) + + SRCS2=$(libespeak_SOURCES) + OBJS2=$(patsubst %.cpp,x_%.o,$(SRCS2)) +-LIBS2=-lstdc++ $(LIB_AUDIO) -lpthread ++LIBS2=-lstdc++ -lm $(LIB_AUDIO) -lpthread + + SRCS3 = espeak.cpp + OBJS3=$(patsubst %.cpp,%.o,$(SRCS3)) +-LIBS3=-lstdc++ -L . -lespeak ++LIBS3=-lstdc++ -lm -L . -lespeak + + CXXFLAGS=-O2 + diff --git a/packages/audio/espeak/patches/espeak-1.47-wav-close.patch b/packages/audio/espeak/patches/espeak-1.47-wav-close.patch new file mode 100644 index 0000000000..d0550d9458 --- /dev/null +++ b/packages/audio/espeak/patches/espeak-1.47-wav-close.patch @@ -0,0 +1,23 @@ +diff --git a/src/espeak.cpp b/src/espeak.cpp +index 00f93c1..4ad42e8 100644 +--- a/src/espeak.cpp ++++ b/src/espeak.cpp +@@ -281,10 +281,7 @@ static int SynthCallback(short *wav, int numsamples, espeak_EVENT *events) + if(quiet) return(0); // -q quiet mode + + if(wav == NULL) +- { +- CloseWavFile(); + return(0); +- } + + while(events->type != 0) + { +@@ -805,5 +802,7 @@ int main (int argc, char **argv) + + if(f_phonemes_out != stdout) + fclose(f_phonemes_out); // needed for WinCE ++ CloseWavFile(); ++ espeak_Terminate(); + return(0); + } diff --git a/packages/mediacenter/xbmc/package.mk b/packages/mediacenter/xbmc/package.mk index d74a694d28..e914a86922 100644 --- a/packages/mediacenter/xbmc/package.mk +++ b/packages/mediacenter/xbmc/package.mk @@ -88,6 +88,11 @@ else XBMC_PULSEAUDIO="--disable-pulse" fi +if [ "$ESPEAK_SUPPORT" = yes ]; then +# for espeak support + PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET espeak" +fi + if [ "$CEC_SUPPORT" = yes ]; then # for CEC support PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET libcec" diff --git a/projects/ATV/options b/projects/ATV/options index 5d45716620..fd13c776f8 100644 --- a/projects/ATV/options +++ b/projects/ATV/options @@ -152,6 +152,9 @@ # build and install PulseAudio support (yes / no) PULSEAUDIO_SUPPORT="no" +# build and install espeak support (yes / no) + ESPEAK_SUPPORT="yes" + # build and install with non-free support # (RAR compression support in XBMC) (yes / no) NONFREE_SUPPORT="yes" diff --git a/projects/Cuboxi/options b/projects/Cuboxi/options index d646fba06f..0d6da8e00d 100644 --- a/projects/Cuboxi/options +++ b/projects/Cuboxi/options @@ -153,6 +153,9 @@ # build and install PulseAudio support (yes / no) PULSEAUDIO_SUPPORT="no" +# build and install espeak support (yes / no) + ESPEAK_SUPPORT="yes" + # build and install with non-free support # (RAR compression support in XBMC) (yes / no) NONFREE_SUPPORT="yes" diff --git a/projects/Generic/options b/projects/Generic/options index 466f3c8336..0816c724e1 100644 --- a/projects/Generic/options +++ b/projects/Generic/options @@ -152,6 +152,9 @@ # build and install PulseAudio support (yes / no) PULSEAUDIO_SUPPORT="no" +# build and install espeak support (yes / no) + ESPEAK_SUPPORT="yes" + # build and install with non-free support # (RAR compression support in XBMC) (yes / no) NONFREE_SUPPORT="yes" diff --git a/projects/RPi/options b/projects/RPi/options index 6d8be840fa..33a299bbe4 100644 --- a/projects/RPi/options +++ b/projects/RPi/options @@ -153,6 +153,9 @@ # build and install PulseAudio support (yes / no) PULSEAUDIO_SUPPORT="no" +# build and install espeak support (yes / no) + ESPEAK_SUPPORT="yes" + # build and install with non-free support # (RAR compression support in XBMC) (yes / no) NONFREE_SUPPORT="yes" diff --git a/projects/Virtual/options b/projects/Virtual/options index 4be9c8451b..740db5f194 100644 --- a/projects/Virtual/options +++ b/projects/Virtual/options @@ -147,6 +147,9 @@ # build and install PulseAudio support (yes / no) PULSEAUDIO_SUPPORT="no" +# build and install espeak support (yes / no) + ESPEAK_SUPPORT="yes" + # build and install with non-free support # (RAR compression support in XBMC) (yes / no) NONFREE_SUPPORT="yes"