summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Heiko Becker <heirecka@exherbo.org> 2017-01-31 18:32:10 +0100
committerAvatar Heiko Becker <heirecka@exherbo.org> 2017-09-02 12:44:41 +0200
commitc6c056158f54d0bbbd5fb1783f858d761eb1c5bf (patch)
tree4d31f96d43edcbc46679a5f2aa9a75a72c8260a7
parent90e6a138122441d7b7351ad37ac02eb932b04c14 (diff)
downloadmedia-c6c056158f54d0bbbd5fb1783f858d761eb1c5bf.tar.gz
media-c6c056158f54d0bbbd5fb1783f858d761eb1c5bf.tar.xz
flite: Initial exheres
-rw-r--r--packages/app-speech/flite/files/flite-CVE-2014-0027_unsafe_temporary_file.patch51
-rw-r--r--packages/app-speech/flite/files/flite-ldflags.patch39
-rw-r--r--packages/app-speech/flite/flite-2.0.0.exheres-012
-rw-r--r--packages/app-speech/flite/flite.exlib53
4 files changed, 155 insertions, 0 deletions
diff --git a/packages/app-speech/flite/files/flite-CVE-2014-0027_unsafe_temporary_file.patch b/packages/app-speech/flite/files/flite-CVE-2014-0027_unsafe_temporary_file.patch
new file mode 100644
index 0000000..0b43e75
--- /dev/null
+++ b/packages/app-speech/flite/files/flite-CVE-2014-0027_unsafe_temporary_file.patch
@@ -0,0 +1,51 @@
+Upstream: unknown
+Source: Debian, https://anonscm.debian.org/cgit/pkg-a11y/flite.git/tree/debian/patches/CVE-2014-0027_unsafe_temporary_file.patch
+Reason: CVE-2014-0027
+
+Description: Only write audio data to a file in debug builds
+ This isn't useful in regular builds and is actually a security
+ concern.
+From: Rui Matos <tiagomatos@gmail.com>
+Date: Mon, 6 Jan 2014 13:45:00 +0000
+Bug-Debian: http://bugs.debian.org/734746
+Bug-Redhat: https://bugzilla.redhat.com/show_bug.cgi?id=1048678
+Source: https://bugzilla.redhat.com/attachment.cgi?id=846118
+
+---
+ src/audio/auserver.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/src/audio/auserver.c
++++ b/src/audio/auserver.c
+@@ -62,9 +62,11 @@
+ 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) ?
+@@ -111,7 +113,9 @@
+ 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);
+@@ -120,7 +124,9 @@
+ }
+ }
+ audio_close(audio_device);
++#ifdef DEBUG
+ cst_fclose(fff);
++#endif
+
+ return CST_OK_FORMAT;
+
diff --git a/packages/app-speech/flite/files/flite-ldflags.patch b/packages/app-speech/flite/files/flite-ldflags.patch
new file mode 100644
index 0000000..b6fa630
--- /dev/null
+++ b/packages/app-speech/flite/files/flite-ldflags.patch
@@ -0,0 +1,39 @@
+Upstream: unknown
+Source: https://github.com/gentoo/gentoo/blob/master/app-accessibility/flite/files/flite-1.4-ldflags.patch
+Reason Respect LDFLAGS amongst other things
+
+diff -Naur flite-1.4-release/config/common_make_rules flite-1.4-release.new/config/common_make_rules
+--- flite-1.4-release/config/common_make_rules 2009-07-30 14:52:56.000000000 +0000
++++ flite-1.4-release.new/config/common_make_rules 2011-03-26 20:22:59.000000000 +0000
+@@ -68,7 +68,7 @@
+
+ FLITELIBS = $(BUILDDIR)/lib/libflite.a
+ FLITELIBFLAGS = -L$(BUILDDIR)/lib -lflite
+-LDFLAGS += -lm $(AUDIOLIBS) $(OTHERLIBS)
++LDLIBS += -lm $(AUDIOLIBS) $(OTHERLIBS)
+
+ FULLOBJS = $(OBJS:%=$(OBJDIR)/%)
+ ifdef SHFLAGS
+@@ -123,7 +123,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,`basename $@`.${PROJECT_SHLIB_VERSION} -o ../$@.${PROJECT_VERSION} *.os)
++ @ (cd shared_os && $(CC) ${LDFLAGS} -shared -Wl,-soname,`basename $@`.${PROJECT_SHLIB_VERSION} -o ../$@.${PROJECT_VERSION} *.os $(LDLIBS))
+ @ (cd $(LIBDIR) && ln -s `basename $@.${PROJECT_VERSION}` `basename $@.${PROJECT_SHLIB_VERSION}` )
+ @ (cd $(LIBDIR) && ln -s `basename $@.${PROJECT_SHLIB_VERSION}` `basename $@` )
+ @ rm -rf shared_os
+--- flite-1.4-release/tools/Makefile~ 2009-08-22 20:19:01.000000000 +0100
++++ flite-1.4-release.new/tools/Makefile 2013-01-20 20:06:34.259527220 +0000
+@@ -62,9 +62,9 @@
+ LOCAL_CLEAN = $(BINDIR)/find_sts $(BINDIR)/flite_sort
+
+ $(BINDIR)/find_sts: find_sts_main.o $(FLITELIBS)
+- $(CC) $(CFLAGS) -o $@ find_sts_main.o $(FLITELIBFLAGS) $(LDFLAGS)
++ $(CC) $(CFLAGS) ${LDFLAGS} -o $@ find_sts_main.o $(FLITELIBFLAGS) $(LDLIBS)
+ $(BINDIR)/flite_sort: flite_sort_main.o $(FLITELIBS)
+- $(CC) $(CFLAGS) -o $@ flite_sort_main.o $(FLITELIBFLAGS) $(LDFLAGS)
++ $(CC) $(CFLAGS) ${LDFLAGS} -o $@ flite_sort_main.o $(FLITELIBFLAGS) $(LDLIBS)
+ makescripts:
+ @ cp -p $(SCRIPTS) $(TOP)/bin
+
diff --git a/packages/app-speech/flite/flite-2.0.0.exheres-0 b/packages/app-speech/flite/flite-2.0.0.exheres-0
new file mode 100644
index 0000000..788634c
--- /dev/null
+++ b/packages/app-speech/flite/flite-2.0.0.exheres-0
@@ -0,0 +1,12 @@
+# Copyright 2017 Heiko Becker <heirecka@exherbo.org>
+# Distributed under the terms of the GNU General Public License v2
+
+require flite
+
+PLATFORMS="~amd64"
+
+DEFAULT_SRC_PREPARE_PATCHES+=(
+ "${FILES}"/${PN}-ldflags.patch
+ "${FILES}"/${PN}-CVE-2014-0027_unsafe_temporary_file.patch
+)
+
diff --git a/packages/app-speech/flite/flite.exlib b/packages/app-speech/flite/flite.exlib
new file mode 100644
index 0000000..d785c33
--- /dev/null
+++ b/packages/app-speech/flite/flite.exlib
@@ -0,0 +1,53 @@
+# Copyright 2017 Heiko Becker <heirecka@exherbo.org>
+# Distributed under the terms of the GNU General Public License v2
+
+MY_PNV="${PNV}-release"
+
+export_exlib_phases src_prepare
+
+SUMMARY="A small, fast run-time speech synthesis engine"
+DESCRIPTION="
+It's primarily designed for small embedded machines and/or large servers.
+Flite is designed as an alternative synthesis engine to Festival for voices
+built using the FestVox suite of voice building tools.
+"
+
+HOMEPAGE="http://www.festvox.org/flite/"
+
+DOWNLOADS="${HOMEPAGE}packed/${PN}-$(ever range -2)/${MY_PNV}.tar.bz2"
+
+LICENCES="
+ BSD-3 [[ note = [ src/cg/cst_*, see COPYING ] ]]
+ BSD-4
+"
+SLOT="0"
+MYOPTIONS="
+ alsa pulseaudio
+
+ ( alsa pulseaudio ) [[ number-selected = exactly-one ]]
+"
+
+DEPENDENCIES="
+ build+run:
+ alsa? ( sys-sound/alsa-lib )
+ pulseaudio? ( media-sound/pulseaudio )
+"
+
+BUGS_TO="heirecka@exherbo.org"
+
+WORK=${WORKBASE}/${MY_PNV}
+
+DEFAULT_SRC_CONFIGURE_OPTIONS+=(
+ 'alsa --with-audio=alsa'
+ 'pulseaudio --with-audio=pulseaudio'
+)
+DEFAULT_SRC_CONFIGURE_PARAMS+=(
+ --enable-shared
+)
+
+flite_src_prepare() {
+ default
+
+ edo sed -e 's: ar : $(AR) :' -i config/common_make_rules
+}
+