diff --git a/audio/espeak-ng/Makefile b/audio/espeak-ng/Makefile index 46597c996dfd..27b3fd73af93 100644 --- a/audio/espeak-ng/Makefile +++ b/audio/espeak-ng/Makefile @@ -1,40 +1,41 @@ PORTNAME= espeak-ng PORTVERSION= 1.52.0 +PORTREVISION= 1 CATEGORIES= audio #MASTER_SITES= https://github.com/espeak-ng/${PORTNAME}/releases/download/${PORTVERSION}/ MAINTAINER= se@FreeBSD.org COMMENT= Software speech synthesizer WWW= https://github.com/espeak-ng/espeak-ng/ LICENSE= GPLv3 BUILD_DEPENDS= ronn:textproc/rubygem-ronn LIB_DEPENDS= libpcaudio.so:audio/pcaudiolib USES= autoreconf gmake libtool localbase USE_GITHUB= yes USE_LDCONFIG= yes GNU_CONFIGURE= yes GNU_CONFIGURE_MANPREFIX=${PREFIX}/share CONFIGURE_ARGS= --with-pcaudiolib CONFLICTS_INSTALL= espeak speak OPTIONS_DEFINE= DOCS pre-build: @${REINPLACE_CMD} -e 's|%%DATADIR%%|${DATADIR}|' \ ${WRKSRC}/Makefile.am ${WRKSRC}/src/libespeak-ng/speech.h post-install: ${MKDIR} ${STAGEDIR}${DOCSDIR} cd ${WRKSRC}/docs && ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR} ${RLN} ${STAGEDIR}${PREFIX}/share/man/man1/espeak-ng.1 \ ${STAGEDIR}${PREFIX}/share/man/man1/espeak.1 ${LN} -sf libespeak-ng.so ${STAGEDIR}${PREFIX}/lib/libespeak.so ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${PORTNAME} ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libespeak-ng.so* .include diff --git a/audio/espeak-ng/files/patch-src_include_espeak-ng_speak__lib.h b/audio/espeak-ng/files/patch-src_include_espeak-ng_speak__lib.h new file mode 100644 index 000000000000..df152b5b6eb9 --- /dev/null +++ b/audio/espeak-ng/files/patch-src_include_espeak-ng_speak__lib.h @@ -0,0 +1,15 @@ +--- src/include/espeak-ng/speak_lib.h.orig 2024-12-12 13:28:01 UTC ++++ src/include/espeak-ng/speak_lib.h +@@ -544,6 +544,12 @@ extern "C" + #ifdef __cplusplus + extern "C" + #endif ++ESPEAK_API const char *espeak_TextToPhonemesWithTerminator(const void **textptr, int textmode, int phonememode, int *terminator); ++/* Version of espeak_TextToPhonemes that also returns the clause terminator (e.g., CLAUSE_INTONATION_FULL_STOP) */ ++ ++#ifdef __cplusplus ++extern "C" ++#endif + ESPEAK_API void espeak_CompileDictionary(const char *path, FILE *log, int flags); + /* Compile pronunciation dictionary for a language which corresponds to the currently + selected voice. The required voice should be selected before calling this function. diff --git a/audio/espeak-ng/files/patch-src_libespeak-ng_speech.c b/audio/espeak-ng/files/patch-src_libespeak-ng_speech.c new file mode 100644 index 000000000000..36ea86f6e328 --- /dev/null +++ b/audio/espeak-ng/files/patch-src_libespeak-ng_speech.c @@ -0,0 +1,28 @@ +--- src/libespeak-ng/speech.c.orig 2024-12-12 13:28:01 UTC ++++ src/libespeak-ng/speech.c +@@ -850,7 +850,7 @@ ESPEAK_API void espeak_SetPhonemeTrace(int phonememode + f_trans = stderr; + } + +-ESPEAK_API const char *espeak_TextToPhonemes(const void **textptr, int textmode, int phonememode) ++ESPEAK_API const char* espeak_TextToPhonemesWithTerminator(const void** textptr, int textmode, int phonememode, int* terminator) + { + /* phoneme_mode + bit 1: 0=eSpeak's ascii phoneme names, 1= International Phonetic Alphabet (as UTF-8 characters). +@@ -864,10 +864,15 @@ ESPEAK_API const char *espeak_TextToPhonemes(const voi + if (text_decoder_decode_string_multibyte(p_decoder, *textptr, translator->encoding, textmode) != ENS_OK) + return NULL; + +- TranslateClause(translator, NULL, NULL); ++ TranslateClauseWithTerminator(translator, NULL, NULL, terminator); + *textptr = text_decoder_get_buffer(p_decoder); + + return GetTranslatedPhonemeString(phonememode); ++} ++ ++ESPEAK_API const char *espeak_TextToPhonemes(const void **textptr, int textmode, int phonememode) ++{ ++ return espeak_TextToPhonemesWithTerminator(textptr, textmode, phonememode, NULL); + } + + ESPEAK_NG_API espeak_ng_STATUS espeak_ng_Cancel(void)