accessibility/*speech-dispatcher: Upate to 0.12.0

Introduce a rudimentary automated testing mechanism.

Improve Makefile readability and decruft. On this line, remove VOXIN
option that was added almost 4 years ago and marked BROKEN from the very
start. libvoxin seems like an abandoned project, anyways, with no
activity in the last 2.5 years.

https://github.com/brailcom/speechd/releases/tag/0.12.0
This commit is contained in:
Jason E. Hale 2025-02-27 08:20:09 -05:00
parent 102d735455
commit d3186fa355
8 changed files with 123 additions and 87 deletions

View file

@ -3,8 +3,6 @@ PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
COMMENT= Python bindings for Speech Dispatcher
SPEECH_SLAVE= yes
MASTERDIR= ${.CURDIR:H}/speech-dispatcher
BUILD_WRKSRC= ${WRKSRC}/src/api/python
@ -12,4 +10,6 @@ INSTALL_WRKSRC= ${BUILD_WRKSRC}
PLIST= ${.CURDIR}/pkg-plist
_SD_PYTHON= yes
.include "${MASTERDIR}/Makefile"

View file

@ -1,23 +1,23 @@
bin/spd-conf
%%PYTHON_SITELIBDIR%%/speechd/__init__.py
%%PYTHON_SITELIBDIR%%/speechd/__pycache__/__init__.cpython-%%PYTHON_SUFFIX%%.pyc
%%PYTHON_SITELIBDIR%%/speechd/__pycache__/__init__.cpython-%%PYTHON_SUFFIX%%.opt-1.pyc
%%PYTHON_SITELIBDIR%%/speechd/__pycache__/_test.cpython-%%PYTHON_SUFFIX%%.pyc
%%PYTHON_SITELIBDIR%%/speechd/__pycache__/_test.cpython-%%PYTHON_SUFFIX%%.opt-1.pyc
%%PYTHON_SITELIBDIR%%/speechd/__pycache__/client.cpython-%%PYTHON_SUFFIX%%.pyc
%%PYTHON_SITELIBDIR%%/speechd/__pycache__/client.cpython-%%PYTHON_SUFFIX%%.opt-1.pyc
%%PYTHON_SITELIBDIR%%/speechd/__pycache__/paths.cpython-%%PYTHON_SUFFIX%%.pyc
%%PYTHON_SITELIBDIR%%/speechd/__pycache__/paths.cpython-%%PYTHON_SUFFIX%%.opt-1.pyc
%%PYTHON_SITELIBDIR%%/speechd/__pycache__/__init__%%PYTHON_EXT_SUFFIX%%.opt-1.pyc
%%PYTHON_SITELIBDIR%%/speechd/__pycache__/__init__%%PYTHON_EXT_SUFFIX%%.pyc
%%PYTHON_SITELIBDIR%%/speechd/__pycache__/_test%%PYTHON_EXT_SUFFIX%%.opt-1.pyc
%%PYTHON_SITELIBDIR%%/speechd/__pycache__/_test%%PYTHON_EXT_SUFFIX%%.pyc
%%PYTHON_SITELIBDIR%%/speechd/__pycache__/client%%PYTHON_EXT_SUFFIX%%.opt-1.pyc
%%PYTHON_SITELIBDIR%%/speechd/__pycache__/client%%PYTHON_EXT_SUFFIX%%.pyc
%%PYTHON_SITELIBDIR%%/speechd/__pycache__/paths%%PYTHON_EXT_SUFFIX%%.opt-1.pyc
%%PYTHON_SITELIBDIR%%/speechd/__pycache__/paths%%PYTHON_EXT_SUFFIX%%.pyc
%%PYTHON_SITELIBDIR%%/speechd/_test.py
%%PYTHON_SITELIBDIR%%/speechd/client.py
%%PYTHON_SITELIBDIR%%/speechd/paths.py
%%PYTHON_SITELIBDIR%%/speechd_config/__init__.py
%%PYTHON_SITELIBDIR%%/speechd_config/__pycache__/__init__.cpython-%%PYTHON_SUFFIX%%.pyc
%%PYTHON_SITELIBDIR%%/speechd_config/__pycache__/__init__.cpython-%%PYTHON_SUFFIX%%.opt-1.pyc
%%PYTHON_SITELIBDIR%%/speechd_config/__pycache__/buildconfig.cpython-%%PYTHON_SUFFIX%%.pyc
%%PYTHON_SITELIBDIR%%/speechd_config/__pycache__/buildconfig.cpython-%%PYTHON_SUFFIX%%.opt-1.pyc
%%PYTHON_SITELIBDIR%%/speechd_config/__pycache__/config.cpython-%%PYTHON_SUFFIX%%.pyc
%%PYTHON_SITELIBDIR%%/speechd_config/__pycache__/config.cpython-%%PYTHON_SUFFIX%%.opt-1.pyc
%%PYTHON_SITELIBDIR%%/speechd_config/__pycache__/__init__%%PYTHON_EXT_SUFFIX%%.opt-1.pyc
%%PYTHON_SITELIBDIR%%/speechd_config/__pycache__/__init__%%PYTHON_EXT_SUFFIX%%.pyc
%%PYTHON_SITELIBDIR%%/speechd_config/__pycache__/buildconfig%%PYTHON_EXT_SUFFIX%%.opt-1.pyc
%%PYTHON_SITELIBDIR%%/speechd_config/__pycache__/buildconfig%%PYTHON_EXT_SUFFIX%%.pyc
%%PYTHON_SITELIBDIR%%/speechd_config/__pycache__/config%%PYTHON_EXT_SUFFIX%%.opt-1.pyc
%%PYTHON_SITELIBDIR%%/speechd_config/__pycache__/config%%PYTHON_EXT_SUFFIX%%.pyc
%%PYTHON_SITELIBDIR%%/speechd_config/buildconfig.py
%%PYTHON_SITELIBDIR%%/speechd_config/config.py
share/man/man1/spd-conf.1.gz

View file

@ -1,6 +1,5 @@
PORTNAME= speech-dispatcher
DISTVERSION= 0.11.5
PORTREVISION= 1
DISTVERSION= 0.12.0
CATEGORIES?= accessibility audio
MASTER_SITES= https://github.com/brailcom/speechd/releases/download/${PORTVERSION}/
@ -13,39 +12,35 @@ LICENSE_COMB= multi
BUILD_DEPENDS= help2man:misc/help2man
LIB_DEPENDS= libdotconf.so:devel/dotconf \
libltdl.so:devel/libltdl \
libsndfile.so:audio/libsndfile
USES= alias gettext gmake gnome libtool makeinfo pathfix pkgconfig
USES= gettext gmake gnome libtool localbase makeinfo pathfix \
pkgconfig
USE_GNOME= glib20 intltool
USE_LDCONFIG= yes
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --with-espeak-ng=no \
CONFIGURE_ARGS= --disable-ltdl \
--with-espeak-ng=no \
--with-baratinoo=no \
--with-kali=no \
--with-ibmtts=no \
--with-oss \
--with-voxin=no \
--without-systemdsystemunitdir
CFLAGS+= -fcommon -I${LOCALBASE}/include
LDFLAGS+= -L${LOCALBASE}/lib
USE_LDCONFIG= yes
INSTALL_TARGET= install-strip
.if !defined(SPEECH_SLAVE)
.if !defined(_SD_PYTHON)
CONFIGURE_ARGS+= --disable-python
ETCFILES= clients/emacs.conf modules/cicero.conf modules/dtk-generic.conf \
modules/epos-generic.conf modules/espeak-mbrola-generic.conf \
modules/espeak-ng-mbrola-generic.conf modules/espeak-ng-mbrola.conf \
modules/espeak-ng.conf modules/espeak.conf modules/festival.conf \
modules/flite.conf modules/llia_phon-generic.conf modules/mary-generic.conf \
modules/mimic3-generic.conf modules/swift-generic.conf speechd.conf
PORTDOCS= ANNOUNCE AUTHORS FAQ NEWS README* TODO
CONFIGURE_ARGS+=--disable-python
TEST_TARGET= check
TEST_WRKSRC= ${WRKSRC}/src/tests
INFO= spd-say speech-dispatcher speech-dispatcher-cs ssip
PORTDOCS= ANNOUNCE AUTHORS FAQ NEWS README* TODO
OPTIONS_DEFINE= ALSA AO DOCS ESPEAK FESTIVAL FLITE NAS PULSEAUDIO VOXIN
OPTIONS_DEFINE= ALSA AO DOCS ESPEAK FESTIVAL FLITE NAS PIPEWIRE \
PULSEAUDIO
OPTIONS_DEFAULT= ESPEAK PULSEAUDIO
OPTIONS_SUB= yes
@ -67,54 +62,85 @@ FLITE_LIB_DEPENDS= libflite.so:audio/flite
FLITE_CONFIGURE_WITH= flite
NAS_LIB_DEPENDS= libaudio.so:audio/nas
NAS_USES= xorg
NAS_USE= XORG=xau
NAS_CONFIGURE_WITH= nas
PIPEWIRE_LIB_DEPENDS= libpipewire-0.3.so:multimedia/pipewire
PIPEWIRE_CONFIGURE_WITH= pipewire
PULSEAUDIO_LIB_DEPENDS= libpulse.so:audio/pulseaudio
PULSEAUDIO_CONFIGURE_WITH= pulse
VOXIN_BROKEN= libvoxin not yet ported
VOXIN_DESC= Voxin speech synthesis engine support (not yet ported)
#VOXIN_LIB_DEPENDS= libvoxin.so:accessibility/libvoxin
VOXIN_CONFIGURE_WITH= voxin
_SD_ETCFILES= clients/emacs.conf \
modules/cicero.conf \
modules/dtk-generic.conf \
modules/epos-generic.conf \
modules/espeak-mbrola-generic.conf \
modules/espeak-ng-mbrola-generic.conf \
modules/espeak-ng-mbrola.conf \
modules/espeak-ng.conf \
modules/espeak.conf \
modules/festival.conf \
modules/flite.conf \
modules/llia_phon-generic.conf \
modules/mary-generic.conf \
modules/mimic3-generic.conf \
modules/openjtalk.conf \
modules/swift-generic.conf \
speechd.conf
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MVOXIN}
ETCFILES+= modules/voxin.conf
.endif
. include <bsd.port.options.mk>
post-patch:
# ibmtts.c is omitted, because it is disabled by default
.for f in espeak.c ivona.c pico.c
${REINPLACE_CMD} -e 's,/usr/share,${LOCALBASE}/share,g' \
. for f in espeak.c generic.c ivona.c openjtalk.c pico.c
${REINPLACE_CMD} -e 's|/usr/share|${LOCALBASE}/share|g' \
${WRKSRC}/src/modules/${f}
.endfor
${REINPLACE_CMD} -e 's,/etc,${LOCALBASE}/etc,g ;\
s,/usr/bin,${LOCALBASE}/bin,g ;\
s,/usr/share,${LOCALBASE}/share,g' \
. endfor
${REINPLACE_CMD} -e 's|/etc|${LOCALBASE}/etc|g ; \
s|/usr/bin|${LOCALBASE}/bin|g ; \
s|/usr/share|${LOCALBASE}/share|g' \
${WRKSRC}/config/modules/*.conf
post-install:
.for f in ${ETCFILES}
. for f in ${_SD_ETCFILES}
@${MV} ${STAGEDIR}${ETCDIR}/${f} ${STAGEDIR}${ETCDIR}/${f}.sample
.endfor
. endfor
@${RM} -r ${STAGEDIR}${DATADIR}/conf
@${RMDIR} ${STAGEDIR}${DATADIR} || ${TRUE}
${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${PORTDOCS:S,^,${WRKSRC}/,} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR}
# The 'test' target only builds the tests. The speech-dispatcher tests, in
# whole, are not easily automated. This is only intended to provide a minimal
# baseline. If you don't hear some robotic voices coming out of your speakers
# after running the 'test' target, something is definitely wrong.
post-test:
@if [ "`${LOCALBASE}/bin/speech-dispatcher -v | head -1`" != "${PORTNAME} ${DISTVERSION}" ]; then \
${ECHO_CMD} "===> Tests require a local installation of ${PKGNAME} to"; \
${ECHO_CMD} " proceed. Try reinstalling ${PKGNAME} and running the"; \
${ECHO_CMD} " 'test' target again."; \
exit 1; \
else \
${ECHO_CMD} "===> Testing with locally installed `${LOCALBASE}/bin/speech-dispatcher -v | head -1`" ; \
${LOCALBASE}/bin/speech-dispatcher && ${TEST_WRKSRC}/run_test ${TEST_WRKSRC}/basic.test; \
fi
.else
PORTSCOUT= ignore:1
NO_ARCH= yes
USES+= python shebangfix
SHEBANG_FILES= src/api/python/speechd_config/spd-conf
USE_PYTHON= flavors
BUILD_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}xdg>0:devel/py-xdg@${PY_FLAVOR}
LIB_DEPENDS+= libspeechd.so:accessibility/speech-dispatcher
RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}xdg>0:devel/py-xdg@${PY_FLAVOR}
USES+= python shebangfix
USE_PYTHON= flavors
SHEBANG_FILES= src/api/python/speechd_config/spd-conf
NO_ARCH= yes
PORTSCOUT= ignore:1
.endif
.include <bsd.port.mk>

View file

@ -1,3 +1,3 @@
TIMESTAMP = 1694513565
SHA256 (speech-dispatcher-0.11.5.tar.gz) = 1ce4759ffabbaf1aeb433a5ec0739be0676e9bdfbae9444a7b3be1b2af3ec12b
SIZE (speech-dispatcher-0.11.5.tar.gz) = 7230756
TIMESTAMP = 1740452962
SHA256 (speech-dispatcher-0.12.0.tar.gz) = e1dd0bfa24b8338545e165451330adf51c4c0dca862b1b67e76fba5142dbbb74
SIZE (speech-dispatcher-0.12.0.tar.gz) = 7481967

View file

@ -0,0 +1,17 @@
Fix staging violations. We currently only account for one level of Python
bytecode optimization in the ports tree.
=>> Error: Filesystem touched during stage (files must install to ${STAGEDIR}):
extra: usr/local/lib/python3.11/site-packages/_distutils_hack/__pycache__/__init__.cpython-311.opt-2.pyc
--- py-compile.orig 2025-02-23 21:19:45 UTC
+++ py-compile
@@ -210,7 +210,7 @@ case $python_major.$python_minor in
# Then byte compile w/more optimization.
# Only do this for Python 3.5+, see https://bugs.gnu.org/38043 for background.
case $python_major.$python_minor in
-2.*|3.[0-4])
+2.*|3.*)
;;
*)
$PYTHON -OO -c "

View file

@ -1,10 +0,0 @@
--- src/clients/spdsend/server.c.orig 2015-05-07 23:19:02 UTC
+++ src/clients/spdsend/server.c
@@ -33,6 +33,7 @@
#include <errno.h>
#include <netdb.h>
+#include <sys/types.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#if USE_THREADS

View file

@ -1,11 +0,0 @@
--- src/server/speechd.h.orig 2015-06-04 01:52:14 UTC
+++ src/server/speechd.h
@@ -56,7 +56,7 @@
/* TODO: This fixes compilation for Mac OS X but might not be a correct
solution for other platforms. A better check is needed, possibly including
_POSIX_C_SOURCE and friends*/
-#if (defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)) || defined(__APPLE__)
+#if (defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)) || defined(__APPLE__) || defined(__FreeBSD__)
/* union semun is defined by including <sys/sem.h> */
#else
/* according to X/OPEN we have to define it ourselves */

View file

@ -15,18 +15,23 @@ bin/speech-dispatcher
@sample %%ETCDIR%%/modules/llia_phon-generic.conf.sample
@sample %%ETCDIR%%/modules/mary-generic.conf.sample
@sample %%ETCDIR%%/modules/mimic3-generic.conf.sample
@sample %%ETCDIR%%/modules/openjtalk.conf.sample
@sample %%ETCDIR%%/modules/swift-generic.conf.sample
%%VOXIN%%@sample %%ETCDIR%%/modules/voxin.conf.sample
@sample %%ETCDIR%%/speechd.conf.sample
include/speech-dispatcher/libspeechd.h
include/speech-dispatcher/libspeechd_version.h
include/speech-dispatcher/spd_audio_plugin.h
include/speech-dispatcher/spd_module_main.h
include/speech-dispatcher/speechd_defines.h
include/speech-dispatcher/speechd_types.h
lib/libspeechd.a
lib/libspeechd.so
lib/libspeechd.so.2
lib/libspeechd.so.2.6.0
lib/libspeechd_module.a
lib/libspeechd_module.so
lib/libspeechd_module.so.0
lib/libspeechd_module.so.0.0.0
%%ALSA%%lib/speech-dispatcher/spd_alsa.a
%%ALSA%%lib/speech-dispatcher/spd_alsa.so
%%AO%%lib/speech-dispatcher/spd_libao.a
@ -35,6 +40,8 @@ lib/libspeechd.so.2.6.0
%%NAS%%lib/speech-dispatcher/spd_nas.so
lib/speech-dispatcher/spd_oss.a
lib/speech-dispatcher/spd_oss.so
%%PIPEWIRE%%lib/speech-dispatcher/spd_pipewire.a
%%PIPEWIRE%%lib/speech-dispatcher/spd_pipewire.so
%%PULSEAUDIO%%lib/speech-dispatcher/spd_pulse.a
%%PULSEAUDIO%%lib/speech-dispatcher/spd_pulse.so
libdata/pkgconfig/speech-dispatcher.pc
@ -44,16 +51,19 @@ libexec/speech-dispatcher-modules/sd_dummy
libexec/speech-dispatcher-modules/sd_festival
%%FLITE%%libexec/speech-dispatcher-modules/sd_flite
libexec/speech-dispatcher-modules/sd_generic
%%VOXIN%%libexec/speech-dispatcher-modules/sd_voxin
libexec/speech-dispatcher-modules/sd_openjtalk
share/locale/cs/LC_MESSAGES/speech-dispatcher.mo
share/locale/de/LC_MESSAGES/speech-dispatcher.mo
share/locale/eo/LC_MESSAGES/speech-dispatcher.mo
share/locale/fr/LC_MESSAGES/speech-dispatcher.mo
share/locale/hu/LC_MESSAGES/speech-dispatcher.mo
share/locale/ka/LC_MESSAGES/speech-dispatcher.mo
share/locale/nb_NO/LC_MESSAGES/speech-dispatcher.mo
share/locale/pt/LC_MESSAGES/speech-dispatcher.mo
share/locale/pt_BR/LC_MESSAGES/speech-dispatcher.mo
share/locale/ru/LC_MESSAGES/speech-dispatcher.mo
share/locale/sv/LC_MESSAGES/speech-dispatcher.mo
share/locale/tr/LC_MESSAGES/speech-dispatcher.mo
share/man/man1/spd-say.1.gz
share/man/man1/speech-dispatcher.1.gz
share/sounds/speech-dispatcher/dummy-message.wav
@ -75,10 +85,11 @@ share/sounds/speech-dispatcher/dummy-message.wav
%%DATADIR%%/locale/base/font-variants.dic
%%DATADIR%%/locale/base/orca-chars.dic
%%DATADIR%%/locale/base/orca.dic
%%DATADIR%%/locale/base/symbols.dic
%%DATADIR%%/locale/base/symbols-fallback.dic
%%DATADIR%%/locale/be/emojis.dic
%%DATADIR%%/locale/be/orca-chars.dic
%%DATADIR%%/locale/be/orca.dic
%%DATADIR%%/locale/bew/emojis.dic
%%DATADIR%%/locale/bg/emojis.dic
%%DATADIR%%/locale/bg/orca-chars.dic
%%DATADIR%%/locale/bg/orca.dic
@ -109,6 +120,7 @@ share/sounds/speech-dispatcher/dummy-message.wav
%%DATADIR%%/locale/cs/orca-chars.dic
%%DATADIR%%/locale/cs/orca.dic
%%DATADIR%%/locale/cs/symbols.dic
%%DATADIR%%/locale/cv/emojis.dic
%%DATADIR%%/locale/cy/emojis.dic
%%DATADIR%%/locale/da/emojis.dic
%%DATADIR%%/locale/da/orca-chars.dic
@ -308,6 +320,7 @@ share/sounds/speech-dispatcher/dummy-message.wav
%%DATADIR%%/locale/pt_PT/symbols.dic
%%DATADIR%%/locale/qu/emojis.dic
%%DATADIR%%/locale/quc/emojis.dic
%%DATADIR%%/locale/rhg/emojis.dic
%%DATADIR%%/locale/rm/emojis.dic
%%DATADIR%%/locale/ro/emojis.dic
%%DATADIR%%/locale/ro/orca-chars.dic
@ -351,6 +364,7 @@ share/sounds/speech-dispatcher/dummy-message.wav
%%DATADIR%%/locale/sw_KE/emojis.dic
%%DATADIR%%/locale/ta/emojis.dic
%%DATADIR%%/locale/ta/orca-chars.dic
%%DATADIR%%/locale/ta/orca.dic
%%DATADIR%%/locale/ta/symbols.dic
%%DATADIR%%/locale/te/emojis.dic
%%DATADIR%%/locale/te/orca-chars.dic