From 8fa024e917f0029d4b5653476053a8c679d79901 Mon Sep 17 00:00:00 2001 From: Kostadin Shishmanov Date: Fri, 3 May 2024 21:13:41 +0300 Subject: app-accessibility/flite: backport patch to fix lto Backport upstream patch that fixes lto-type-mismatch https://github.com/festvox/flite/pull/66 Signed-off-by: Kostadin Shishmanov Closes: https://github.com/gentoo/gentoo/pull/36541 Signed-off-by: Sam James --- .../flite/files/flite-2.2-backport-pr66.patch | 55 ++++++++ app-accessibility/flite/flite-2.2-r2.ebuild | 138 +++++++++++++++++++++ 2 files changed, 193 insertions(+) create mode 100644 app-accessibility/flite/files/flite-2.2-backport-pr66.patch create mode 100644 app-accessibility/flite/flite-2.2-r2.ebuild diff --git a/app-accessibility/flite/files/flite-2.2-backport-pr66.patch b/app-accessibility/flite/files/flite-2.2-backport-pr66.patch new file mode 100644 index 000000000000..f7f41ecb499d --- /dev/null +++ b/app-accessibility/flite/files/flite-2.2-backport-pr66.patch @@ -0,0 +1,55 @@ +https://github.com/festvox/flite/pull/66/commits/cad672713f3fc9702babf4e3a2cc685586aeb87e + +From cad672713f3fc9702babf4e3a2cc685586aeb87e Mon Sep 17 00:00:00 2001 +From: Dominik 'Rathann' Mierzejewski +Date: Wed, 6 Oct 2021 12:42:31 +0200 +Subject: [PATCH] make shared arrays size declarations consistent + +Fixes: +../../lang/cmulex/cmu_lex.c:49:27: warning: type of 'cmu_lex_phone_table' does not match original declaration [-Wlto-type-mismatch] + 49 | extern const char * const cmu_lex_phone_table[54]; + | ^ +../../lang/cmulex/cmu_lex_entries.c:14:20: note: array types have different bounds + 14 | const char * const cmu_lex_phone_table[57] = + | ^ +../../lang/cmulex/cmu_lex_entries.c:14:20: note: 'cmu_lex_phone_table' was previously declared here + +and +../../lang/cmu_grapheme_lex/cmu_grapheme_lex.h:47:27: warning: type of 'unicode_sampa_mapping' does not match original declaration [-Wlto-type-mismatch] + 47 | extern const char * const unicode_sampa_mapping[16663][5]; + | ^ +../../lang/cmu_grapheme_lex/grapheme_unitran_tables.c:9:20: note: array types have different bounds + 9 | const char * const unicode_sampa_mapping[16798][5] = + | ^ +../../lang/cmu_grapheme_lex/grapheme_unitran_tables.c:9:20: note: 'unicode_sampa_mapping' was previously declared here +--- + lang/cmu_grapheme_lex/cmu_grapheme_lex.h | 2 +- + lang/cmulex/cmu_lex.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lang/cmu_grapheme_lex/cmu_grapheme_lex.h b/lang/cmu_grapheme_lex/cmu_grapheme_lex.h +index 320d263..25386e7 100644 +--- a/lang/cmu_grapheme_lex/cmu_grapheme_lex.h ++++ b/lang/cmu_grapheme_lex/cmu_grapheme_lex.h +@@ -44,7 +44,7 @@ extern "C" { + cst_lexicon *cmu_grapheme_lex_init(void); + + extern const int num_unicode_sampa_mapping; +-extern const char * const unicode_sampa_mapping[16663][5]; ++extern const char * const unicode_sampa_mapping[16798][5]; + + #ifdef __cplusplus + } /* extern "C" */ +diff --git a/lang/cmulex/cmu_lex.c b/lang/cmulex/cmu_lex.c +index 7dfdfc1..e3f44cd 100644 +--- a/lang/cmulex/cmu_lex.c ++++ b/lang/cmulex/cmu_lex.c +@@ -46,7 +46,7 @@ extern const int cmu_lex_entry[]; + extern const unsigned char cmu_lex_data[]; + extern const int cmu_lex_num_entries; + extern const int cmu_lex_num_bytes; +-extern const char * const cmu_lex_phone_table[54]; ++extern const char * const cmu_lex_phone_table[57]; + extern const char * const cmu_lex_phones_huff_table[]; + extern const char * const cmu_lex_entries_huff_table[]; + diff --git a/app-accessibility/flite/flite-2.2-r2.ebuild b/app-accessibility/flite/flite-2.2-r2.ebuild new file mode 100644 index 000000000000..5e967534e978 --- /dev/null +++ b/app-accessibility/flite/flite-2.2-r2.ebuild @@ -0,0 +1,138 @@ +# Copyright 1999-2024 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 ~ia64 ~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 +) + +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 +} -- cgit v1.2.3-65-gdbad