commit:     608191e30730b3bf41ddce46054df7119d43ea60
Author:     Matoro Mahri <matoro <AT> users <DOT> noreply <DOT> github <DOT> 
com>
AuthorDate: Wed Mar  8 22:20:37 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Mar  9 01:08:01 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=608191e3

app-accessibility/flite: wire up tests

See https://github.com/festvox/flite/pull/90

Bug: https://bugs.gentoo.org/896106
Signed-off-by: Matoro Mahri <matoro <AT> users.noreply.github.com>
Closes: https://github.com/gentoo/gentoo/pull/30006
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../flite/files/flite-2.2-backport-pr30.patch      | 91 ++++++++++++++++++++++
 app-accessibility/flite/flite-2.2.ebuild           |  7 +-
 2 files changed, 96 insertions(+), 2 deletions(-)

diff --git a/app-accessibility/flite/files/flite-2.2-backport-pr30.patch 
b/app-accessibility/flite/files/flite-2.2-backport-pr30.patch
new file mode 100644
index 000000000000..7c859a5bb03e
--- /dev/null
+++ b/app-accessibility/flite/files/flite-2.2-backport-pr30.patch
@@ -0,0 +1,91 @@
+https://bugs.gentoo.org/896106
+https://github.com/festvox/flite/pull/90
+
+From 56ef01e5a7cd8d8606b4ccd13b4366039269f9d7 Mon Sep 17 00:00:00 2001
+From: matoro <mat...@users.noreply.github.com>
+Date: Fri, 24 Feb 2023 14:25:16 -0500
+Subject: [PATCH] Expose automated tests under "make check"
+
+The following unit tests can be run automatically without specifying any
+user-provided arguments:
+hrg_test lex_test multi_thread nums_test regex_test token_test
+
+Fix up the Makefiles to expose the ability to run these tests via "make
+check" or "make test", since it is currently broken (exposed at the top
+level, but missing the "test" target in testsuite/).
+---
+ Makefile           |  2 +-
+ testsuite/Makefile | 22 ++++++++++++----------
+ 2 files changed, 13 insertions(+), 11 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 511f8cf..1b627b2 100644
+--- a/Makefile
++++ b/Makefile
+@@ -129,6 +129,6 @@ voices: ./bin/flite_cmu_us_awb ./bin/flite_cmu_us_rms 
./bin/flite_cmu_us_rms
+       ./bin/flite_cmu_us_rms -voicedump voices/cmu_us_rms.flitevox
+       ./bin/flite_cmu_us_slt -voicedump voices/cmu_us_slt.flitevox
+ 
+-test:
++check test:
+       @ $(MAKE) --no-print-directory -C testsuite test
+ 
+diff --git a/testsuite/Makefile b/testsuite/Makefile
+index b60e98a..275a3e8 100644
+--- a/testsuite/Makefile
++++ b/testsuite/Makefile
+@@ -49,15 +49,17 @@ SRCS = token_test_main.c hrg_test_main.c \
+        bin2ascii_main.c record_in_noise_main.c \
+        compare_wave_main.c rfc_main.c lpc_resynth_main.c \
+        by_word_main.c flite_test_main.c \
+-       dcoffset_wave_main.c tris1_main.c
++       dcoffset_wave_main.c tris1_main.c \
++       multi_thread_main.c
+ FC = us.flitecheck indic_hin.flitecheck indic_tam.flitecheck
+-OTHERS = kal_test_main.c multi_thread_main.c 
++OTHERS = kal_test_main.c
+ 
+ FILES = Makefile $(SRCS) $(DATAFILES) $(OTHERS) $(FC)
+ 
+ LOCAL_INCLUDES = -I$(TOP)/lang/usenglish
+ 
+ MAIN_EXECS = $(SRCS:_main.c=$(EXEEXT))
++AUTO_EXECS = hrg_test lex_test multi_thread nums_test regex_test token_test
+ lex_test_LIBS = -lflite_cmulex
+ nums_test_LIBS = -lflite_usenglish
+ utt_test_LIBS = -lflite_cmulex
+@@ -65,6 +67,7 @@ lex_lookup_LIBS = -lflite_cmulex
+ ldom_time_LIBS = -L/home/awb/data/ldom/time_flite/flite/lib -lcmu_time_awb 
-lflite_usenglish -lflite_cmulex
+ flite_test_LIBS = -lflite_usenglish -lflite_cmulex
+ by_word_LIBS = -lflite_cmu_us_kal -lflite_usenglish -lflite_cmulex
++multi_thread_LIBS = -lflite_cmu_us_slt -lflite_cmulex -lflite_usenglish 
-lflite -lm -lasound -lgomp
+ #kal_test_LIBS = -lflite_cmu_us_kal -lflite_usenglish -lflite_cmulex \
+ #               /home/awb/src/malloc/gmalloc.o
+ 
+@@ -73,19 +76,18 @@ LOCAL_CLEAN = $(MAIN_EXECS)
+ 
+ include $(TOP)/config/common_make_rules
+ 
++multi_thread : CFLAGS += -fopenmp
++
+ MAIN_O = $(SRCS:%=%_main.o)
+ $(MAIN_O) : %_main.o : %_main.c
+       $(CC) $(CFLAGS) -o $@ $< 
+ $(MAIN_EXECS) : %$(EXEEXT) : %_main.o $(FLITELIBS)
+       $(CC) $(CFLAGS) -o $@ $@_main.o $($(@:=_LIBS)) $(FLITELIBFLAGS) 
$(LDFLAGS)
+ 
+-multi_thread: multi_thread_main.c
+-      gcc -fopenmp -o multi_thread multi_thread_main.c \
+-              $(CFLAGS) -I$(TOP)/include $(FLITELIBFLAGS) $(LDFLAGS) \
+-              -l flite_cmu_us_slt -lflite_cmulex -lflite_usenglish \
+-              -lflite -lm -lasound -lgomp
+-do_thread_test: multi_thread
+-#     This shouldn't segfault
+-      export OMP_NUM_THREADS=100 && ./multi_thread
++check test: $(patsubst %, run_%, $(AUTO_EXECS))
+ 
++run_%: %
++      ./$<
+ 
++run_multi_thread: multi_thread
++      OMP_NUM_THREADS=100 ./$<

diff --git a/app-accessibility/flite/flite-2.2.ebuild 
b/app-accessibility/flite/flite-2.2.ebuild
index 0b4c34e70ff8..5833e0487797 100644
--- a/app-accessibility/flite/flite-2.2.ebuild
+++ b/app-accessibility/flite/flite-2.2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -44,7 +44,9 @@ 
SRC_URI="https://github.com/festvox/flite/archive/v${PV}.tar.gz -> ${P}.tar.gz
 LICENSE="BSD freetts public-domain regexp-UofT BSD-2"
 SLOT="0"
 KEYWORDS="~alpha amd64 arm arm64 ~ia64 ~loong ppc ppc64 ~riscv sparc x86"
-IUSE="alsa oss pulseaudio voices"
+IUSE="alsa oss pulseaudio test voices"
+RESTRICT="!test? ( test )"
+REQUIRED_USE="test? ( alsa )"
 
 DEPEND="
        pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
@@ -54,6 +56,7 @@ RDEPEND="${DEPEND}"
 
 PATCHES=(
        "${FILESDIR}"/${PN}-1.4-audio-interface.patch
+       "${FILESDIR}"/${PN}-2.2-backport-pr30.patch
 )
 
 get_audio() {

Reply via email to