summaryrefslogtreecommitdiff
path: root/app-accessibility/flite
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2025-04-11 08:43:59 +0100
committerV3n3RiX <venerix@koprulu.sector>2025-04-11 08:43:59 +0100
commitbb59556b3302a941db4630613c604644d5f7a617 (patch)
tree42e60b7ae227b0fe3af52dfac08d59653066a2db /app-accessibility/flite
parent3cd09a18bad26aad2645241b868755cfdf41b6ae (diff)
gentoo auto-resync : 11:04:2025 - 08:43:58HEADmaster
Diffstat (limited to 'app-accessibility/flite')
-rw-r--r--app-accessibility/flite/Manifest2
-rw-r--r--app-accessibility/flite/files/flite-2.2-remove-const-cast.patch83
-rw-r--r--app-accessibility/flite/flite-2.2-r3.ebuild139
3 files changed, 224 insertions, 0 deletions
diff --git a/app-accessibility/flite/Manifest b/app-accessibility/flite/Manifest
index c8d10d1d90ae..5a2ad24a6cd9 100644
--- a/app-accessibility/flite/Manifest
+++ b/app-accessibility/flite/Manifest
@@ -2,6 +2,7 @@ AUX flite-1.4-audio-interface.patch 452 BLAKE2B c4d2a9f1368ee93802e004a1573ada68
AUX flite-2.2-backport-pr30.patch 3504 BLAKE2B 71a9441d6465dbc6dc903a6b83a8224c7c7a91f21c5f5040d46beba56e812ff1de7e6b5427b7b0ebc6d9f8a3f077bf9457c7c99b9982435dd1c057287d2d4921 SHA512 5e4eb2cd57ed71bf46fd1b3a8e41dabb3ddb2accd28556bbcea945c0e8e3a31e6ac60005cc6121bc92ce02268b5057cc24529d5b6476e195c75dd67425f2cdb8
AUX flite-2.2-backport-pr66.patch 2589 BLAKE2B e0a462e49cfb00cb208e7bca95d43b2d3c1b692799cf8649557a8ef583c8d3c168cd291869b5e3224bd73043b3d61cae901639f47fe37357d87daea328e3913d SHA512 9fee4800f5bdff334ca79ebad9f9fce60eb64d1a58d8b48fcdb49cf6c10f51d472e0533eafdf2ba7e9743da163b53620a8bbb536f8ebdc111af6113d4e205f88
AUX flite-2.2-make-4.4.patch 2273 BLAKE2B f27c86987f481dca05f9838a571fc5a2992dd5a476adb68bd0cde33bd295d3e0f4a0c8140548f53de4f5fb6069149b29268a277e38962a915723d5eefd5972d8 SHA512 24da5c352ee3ab98e3bcdc803d35b6ab22fc51ccb69be53cea79d72a9e496be6136dea098d7ac6aa5a08f0e3754c3cfaca56873a6970fbf2543ffdbf8a45f465
+AUX flite-2.2-remove-const-cast.patch 4168 BLAKE2B 67e086a0c84cec86427efe2ff4d15c3ecc96ccf05c6025689bfda5f50dcdeb5c3537d11056a37fe25df189e51c4357405466d7d522e6f4e5cacb25719d1df822 SHA512 e0ec84736f12140028311098e1b17d4a5db39679392874f166ef2b150aef26fc2cd4b1a9f30c07993fc5a38f46de576bce65682f80fe92f25af4fb0ff777b6cc
DIST cmu_indic_ben_rm.flitevox 8868578 BLAKE2B 2c916a142809999ed69a0cc6bf94ee11380f5a6d5362f347fac5c83ddd25861b7b42d2c4071c1646a26cb5bfef86552ed51d0f708b998c7e3d02fc2815df9445 SHA512 26b6bb62cd00a2c2f51abd04fc8917a2b44472abf99b09b156218fa90499056c96652a984ee9fac4820db513cd2fdba396c1ceb5d26a67e312505b73d1d2b3d1
DIST cmu_indic_guj_ad.flitevox 11368818 BLAKE2B 972e01ab3e06d830435645eadc34bcefde9c3fdd4c302271847e2f66d5e179c88456ce80164ee1a8e2145b123af634a70929e6d9340e59189ea7e03e405c1a3e SHA512 e309cabdc2f8bd049c7b43e48a55898d1adeefbfedf2dc28785c57d9606030fd9c00769f88955d514e537f5ecdac49fd4297fb2cde5a575f2927a98b38b92829
DIST cmu_indic_guj_dp.flitevox 10235186 BLAKE2B e609657306b1f8a99850b9d69ee6ad7d037f60537a7b5e63c8e9962001cf0c4b87771574f29570f8a58c7684d8b7293e54aba35e931c54c5a825ad59b8c6d595 SHA512 8ad73d24ebf6026daae701549b783441c522bbb0e2db958b139553446a8b488f068dc14c6136e3e98f564f27a4a62b086aa45d8dfb3cadd440d08db9e9faef3b
@@ -36,4 +37,5 @@ DIST cmu_us_slt.flitevox 11156032 BLAKE2B 909d4d2adf94d5b40aee4b85aefaf1e8383718
DIST flite-2.2.tar.gz 20233792 BLAKE2B c395c34d2739da523c4794da3a795f2febb7e9a26336c7688215f648c4aee03855c8ac7c9d3817efe3e3a41380a5e325aa8236d1b64af21f8100da3dbba2db23 SHA512 1ca2f4145651490ef8405fdb830a3b42e885020a7603d965f6a5581b01bed41047d396b38c2ceab138fc0b28d28078db17acd2b5a84c6444cb99d65c581afa72
EBUILD flite-2.2-r1.ebuild 4543 BLAKE2B dba4178237fc2ba442da5b713840727c996fe31d92550c7dc3842726b16e041ce519326aa4cc850dc1406886ee2cc68241adefb70dd887e926dae95e53fc3572 SHA512 649b6ef5052bd497d053dc864c186ff811b2fe64c85ac541d652037767bb331efe4f273ee9b556fada1ccb121800bee35eda3e244a83641c9ac7670cb147a607
EBUILD flite-2.2-r2.ebuild 4489 BLAKE2B f529ddcbe1df1a7d4433905e6f5e84f79e4e8ae778153c9af592dc0de384052e124041cc4d42d8ad2b28d7e43260156d1eaa50f8b07f702b72e9549dd2335ca3 SHA512 57ceaedd6e68ae54cf6af39c184aa164c2987f4d9c72ed825d6b7ee2d5411509f72f2000f6538c879b0e6e75e973ce86852c20be7716c3f3daae0cec960f274b
+EBUILD flite-2.2-r3.ebuild 4544 BLAKE2B acb15023852da0ad708ac0c03270bef09ef489d08a2807834ea7e57f91aba7fbb10ea6fdf1b79d7ec677c0a5081979101ea07d1d5a6b27aa76d2b150b6153c86 SHA512 0918f77716b69419fb7d66a5bf088fb698687116188496663321a6f26f30c07b5cd70f8bdc52480932d114e88395e235e027b1a3562cc062c4e857957e19a27b
MISC metadata.xml 517 BLAKE2B e91b1a0a5e78284d318a97b13637c13666520a280afa818bb7bacabd73d0f8406a6da66899ea4607d1ef3c13f858242e2239eb176dfe24e859c391d16ebed018 SHA512 e9fcd43288f59205389fa9cd35be1da34f014bdbf078891b1f1c51154262562e6ff986a6367035d9ddbfa856c198ba96ed2240b085cdb12ecb746d6b67ad271f
diff --git a/app-accessibility/flite/files/flite-2.2-remove-const-cast.patch b/app-accessibility/flite/files/flite-2.2-remove-const-cast.patch
new file mode 100644
index 000000000000..c49aef91220e
--- /dev/null
+++ b/app-accessibility/flite/files/flite-2.2-remove-const-cast.patch
@@ -0,0 +1,83 @@
+https://github.com/festvox/flite/pull/112
+
+From 4fcb01e726b867440fc918e820a8d27bd09f3bd4 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 2 Jul 2024 21:41:24 -0700
+Subject: [PATCH] Remove defining 'const' as nothing
+
+This is a hack to override constness of struct members
+however, with modern compiler like clang with fortified
+glibc ( 2.40+ ) headers this runs into compiler errors
+
+| /mnt/b/yoe/master/build/tmp/work/riscv64-yoe-linux/flite/2.2/recipe-sysroot/usr/include/bits/stdlib.h:38:54: error: pass_object_size attribute only applies to constant pointer arguments
+| 38 | __fortify_clang_overload_arg (char *, __restrict, __resolved)))
+| | ^
+| /mnt/b/yoe/master/build/tmp/work/riscv64-yoe-linux/flite/2.2/recipe-sysroot/usr/include/bits/stdlib.h:73:43: error: pass_object_size attribute only applies to constant pointer arguments
+| 73 | __fortify_clang_overload_arg (char *, ,__buf),
+| | ^
+| /mnt/b/yoe/master/build/tmp/work/riscv64-yoe-linux/flite/2.2/recipe-sysroot/usr/include/bits/stdlib.h:91:55: error: pass_object_size attribute only applies to constant pointer arguments
+| 91 | __NTH (wctomb (__fortify_clang_overload_arg (char *, ,__s), wchar_t __wchar))
+| | ^
+| /mnt/b/yoe/master/build/tmp/work/riscv64-yoe-linux/flite/2.2/recipe-sysroot/usr/include/bits/stdlib.h:129:71: error: pass_object_size attribute only applies to constant pointer arguments
+| 129 | __NTH (mbstowcs (__fortify_clang_overload_arg (wchar_t *, __restrict, __dst),
+| | ^
+| /mnt/b/yoe/master/build/tmp/work/riscv64-yoe-linux/flite/2.2/recipe-sysroot/usr/include/bits/stdlib.h:159:68: error: pass_object_size attribute only applies to constant pointer arguments
+| 159 | __NTH (wcstombs (__fortify_clang_overload_arg (char *, __restrict, __dst),
+| | ^
+| 5 errors generated.
+|
+
+Therefore take this out, instead cast away the 'const' qualifier where needed ( equilly dangerous )
+however limited to just this file instead of apply to all headers including system headers
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ tools/find_sts_main.c | 11 ++++-------
+ 1 file changed, 4 insertions(+), 7 deletions(-)
+
+diff --git a/tools/find_sts_main.c b/tools/find_sts_main.c
+index 3c94449..a5bf8ef 100644
+--- a/tools/find_sts_main.c
++++ b/tools/find_sts_main.c
+@@ -41,9 +41,6 @@
+ #include <math.h>
+ #include <string.h>
+
+-/* To allow some normally const fields to manipulated during building */
+-#define const
+-
+ #include "cst_args.h"
+ #include "cst_wave.h"
+ #include "cst_track.h"
+@@ -132,16 +129,16 @@ cst_sts *find_sts(cst_wave *sig, cst_track *lpc)
+ lpc->frames[i],lpc->num_channels,
+ resd,
+ size);
+- sts[i].size = size;
++ *(int *)(&sts[i].size) = size;
+ sts[i].frame = cst_alloc(unsigned short,lpc->num_channels-1);
+ for (j=1; j < lpc->num_channels; j++)
+- sts[i].frame[j-1] = (unsigned short)
++ *(unsigned short *)(&sts[i].frame[j-1]) = (unsigned short)
+ (((lpc->frames[i][j]-lpc_min)/lpc_range)*65535);
+ if (cst_streq(residual_codec,"ulaw"))
+ {
+ sts[i].residual = cst_alloc(unsigned char,size);
+ for (j=0; j < size; j++)
+- sts[i].residual[j] = cst_short_to_ulaw((short)resd[j]);
++ *(unsigned char *)(&sts[i].residual[j]) = cst_short_to_ulaw((short)resd[j]);
+ }
+ else if (cst_streq(residual_codec,"g721"))
+ {
+@@ -189,7 +186,7 @@ cst_sts *find_sts(cst_wave *sig, cst_track *lpc)
+ {
+ sts[i].residual = cst_alloc(unsigned char,size);
+ for (j=0; j < size; j++)
+- sts[i].residual[j] = cst_short_to_ulaw((short)resd[j]);
++ *(unsigned char *)(&sts[i].residual[j]) = cst_short_to_ulaw((short)resd[j]);
+ }
+ else /* Unvoiced frame */
+ {
+--
+2.45.2
+
diff --git a/app-accessibility/flite/flite-2.2-r3.ebuild b/app-accessibility/flite/flite-2.2-r3.ebuild
new file mode 100644
index 000000000000..58431bfaa790
--- /dev/null
+++ b/app-accessibility/flite/flite-2.2-r3.ebuild
@@ -0,0 +1,139 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools multilib-minimal toolchain-funcs
+
+DESCRIPTION="Flite text to speech engine"
+HOMEPAGE="http://www.festvox.org/flite/ https://github.com/festvox/flite"
+SRC_URI="https://github.com/festvox/flite/archive/v${PV}.tar.gz -> ${P}.tar.gz
+ voices? (
+ http://www.festvox.org/${PN}/packed/${P}/voices/cmu_indic_ben_rm.flitevox
+ http://www.festvox.org/${PN}/packed/${P}/voices/cmu_indic_guj_ad.flitevox
+ http://www.festvox.org/${PN}/packed/${P}/voices/cmu_indic_guj_dp.flitevox
+ http://www.festvox.org/${PN}/packed/${P}/voices/cmu_indic_guj_kt.flitevox
+ http://www.festvox.org/${PN}/packed/${P}/voices/cmu_indic_hin_ab.flitevox
+ http://www.festvox.org/${PN}/packed/${P}/voices/cmu_indic_kan_plv.flitevox
+ http://www.festvox.org/${PN}/packed/${P}/voices/cmu_indic_mar_aup.flitevox
+ http://www.festvox.org/${PN}/packed/${P}/voices/cmu_indic_mar_slp.flitevox
+ http://www.festvox.org/${PN}/packed/${P}/voices/cmu_indic_pan_amp.flitevox
+ http://www.festvox.org/${PN}/packed/${P}/voices/cmu_indic_tam_sdr.flitevox
+ http://www.festvox.org/${PN}/packed/${P}/voices/cmu_indic_tel_kpn.flitevox
+ http://www.festvox.org/${PN}/packed/${P}/voices/cmu_indic_tel_sk.flitevox
+ http://www.festvox.org/${PN}/packed/${P}/voices/cmu_indic_tel_ss.flitevox
+ http://www.festvox.org/${PN}/packed/${P}/voices/cmu_us_aew.flitevox
+ http://www.festvox.org/${PN}/packed/${P}/voices/cmu_us_ahw.flitevox
+ http://www.festvox.org/${PN}/packed/${P}/voices/cmu_us_aup.flitevox
+ http://www.festvox.org/${PN}/packed/${P}/voices/cmu_us_awb.flitevox
+ http://www.festvox.org/${PN}/packed/${P}/voices/cmu_us_axb.flitevox
+ http://www.festvox.org/${PN}/packed/${P}/voices/cmu_us_bdl.flitevox
+ http://www.festvox.org/${PN}/packed/${P}/voices/cmu_us_clb.flitevox
+ http://www.festvox.org/${PN}/packed/${P}/voices/cmu_us_eey.flitevox
+ http://www.festvox.org/${PN}/packed/${P}/voices/cmu_us_fem.flitevox
+ http://www.festvox.org/${PN}/packed/${P}/voices/cmu_us_gka.flitevox
+ http://www.festvox.org/${PN}/packed/${P}/voices/cmu_us_jmk.flitevox
+ http://www.festvox.org/${PN}/packed/${P}/voices/cmu_us_ksp.flitevox
+ http://www.festvox.org/${PN}/packed/${P}/voices/cmu_us_ljm.flitevox
+ http://www.festvox.org/${PN}/packed/${P}/voices/cmu_us_lnh.flitevox
+ http://www.festvox.org/${PN}/packed/${P}/voices/cmu_us_rms.flitevox
+ http://www.festvox.org/${PN}/packed/${P}/voices/cmu_us_rxr.flitevox
+ http://www.festvox.org/${PN}/packed/${P}/voices/cmu_us_slp.flitevox
+ http://www.festvox.org/${PN}/packed/${P}/voices/cmu_us_slt.flitevox
+ )"
+
+LICENSE="BSD freetts public-domain regexp-UofT BSD-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86"
+IUSE="alsa oss pulseaudio test voices"
+REQUIRED_USE="test? ( alsa )"
+RESTRICT="!test? ( test )"
+
+DEPEND="
+ pulseaudio? ( media-libs/libpulse[${MULTILIB_USEDEP}] )
+ !pulseaudio? ( alsa? ( >=media-libs/alsa-lib-1.0.27.2[${MULTILIB_USEDEP}] ) )
+"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.4-audio-interface.patch
+ "${FILESDIR}"/${PN}-2.2-backport-pr30.patch
+ "${FILESDIR}"/${PN}-2.2-make-4.4.patch
+ "${FILESDIR}"/${PN}-2.2-backport-pr66.patch
+ "${FILESDIR}"/${PN}-2.2-remove-const-cast.patch
+)
+
+get_audio() {
+ if use pulseaudio; then
+ echo pulseaudio
+ elif use alsa; then
+ echo alsa
+ elif use oss; then
+ echo oss
+ else
+ echo none
+ fi
+}
+
+pkg_pretend() {
+ [[ ${MERGE_TYPE} != binary ]] && use test && tc-check-openmp
+}
+
+pkg_setup() {
+ [[ ${MERGE_TYPE} != binary ]] && use test && tc-check-openmp
+}
+
+src_unpack() {
+ for file in ${A}; do
+ case "${file}" in
+ *.flitevox)
+ cp -av "${DISTDIR}/${file}" "${WORKDIR}/" || die "Unable to copy ${file}"
+ ;;
+ *)
+ unpack "${file}"
+ ;;
+ esac
+ done
+}
+
+src_prepare() {
+ default
+ sed -i main/Makefile \
+ -e '/-rpath/s|$(LIBDIR)|$(INSTALLLIBDIR)|g' \
+ || die
+ mv configure.{in,ac} || die
+ eautoreconf
+
+ # custom makefiles
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --enable-shared
+ --with-audio=$(get_audio)
+ )
+ econf "${myconf[@]}"
+}
+
+multilib_src_compile() {
+ emake -j1 CC="$(tc-getCC)" CFLAGS="${CFLAGS}"
+}
+
+multilib_src_install_all() {
+ dodoc ACKNOWLEDGEMENTS README.md
+
+ rm -rf "${D}"/usr/lib*/*.a
+
+ if use voices; then
+ insinto /usr/share/flite
+ doins "${WORKDIR}"/*.flitevox
+ fi
+}
+
+pkg_postinst() {
+ if [[ "$(get_audio)" = "none" ]]; then
+ ewarn "flite is built without audio support. Enable the"
+ ewarn "alsa, oss, or pulseaudio USE flags for audio support."
+ fi
+}