- Update to 0.8.

- STAGEify.
- Use OPTIONS helpers.
This commit is contained in:
Alberto Villa 2013-11-16 16:50:55 +00:00
parent 0dec236d38
commit 94db08640e
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=334013
17 changed files with 208 additions and 210 deletions

View File

@ -1,10 +1,9 @@
# $FreeBSD$
PORTNAME= speech-dispatcher
PORTVERSION= 0.7.1
PORTREVISION= 3
PORTVERSION= 0.8
CATEGORIES= accessibility audio
MASTER_SITES= http://www.freebsoft.org/pub/projects/speechd/
MASTER_SITES= http://devel.freebsoft.org/pub/projects/speechd/
MAINTAINER= avilla@FreeBSD.org
COMMENT= Common interface to speech synthesis
@ -12,17 +11,17 @@ COMMENT= Common interface to speech synthesis
LICENSE= GPLv2 LGPL21
LICENSE_COMB= multi
LIB_DEPENDS= dotconf:${PORTSDIR}/devel/dotconf \
sndfile:${PORTSDIR}/audio/libsndfile
LIB_DEPENDS= libdotconf.so:${PORTSDIR}/devel/dotconf \
libsndfile.so:${PORTSDIR}/audio/libsndfile
NO_STAGE= yes
# gnomehier is required because of share/sounds directory.
USES= gmake pkgconfig
USE_GNOME= glib20 gnomehier
USE_AUTOTOOLS= libltdl
USE_GNOME= glib20 gnomehier intltool
USES= gettext gmake pathfix pkgconfig
GNU_CONFIGURE= yes
CFLAGS+= -I${LOCALBASE}/include
LDFLAGS+= -L${LOCALBASE}/lib
USE_LDCONFIG= ${PREFIX}/lib ${PREFIX}/lib/${PORTNAME}
USE_LDCONFIG= yes
ETCFILES= clients/emacs.conf clients/gnome-speech.conf \
modules/cicero.conf modules/dtk-generic.conf \
@ -34,108 +33,54 @@ ETCFILES= clients/emacs.conf clients/gnome-speech.conf \
PLIST_SUB+= ETCFILES="${ETCFILES}"
PORTDOCS= AUTHORS ChangeLog INSTALL NEWS README TODO
PORTDOCS= AUTHORS ChangeLog FAQ INSTALL NEWS README TODO
INFO= spd-say speech-dispatcher ssip
OPTIONS_DEFINE= ALSA AO ESPEAK FESTIVAL FLITE NAS PULSEAUDIO PYTHON
OPTIONS_DEFINE= ALSA AO DOCS ESPEAK FESTIVAL FLITE NAS PULSEAUDIO #PYTHON
OPTIONS_DEFAULT=ESPEAK
OPTIONS_SUB= yes
ESPEAK_DESC= eSpeak output module
FESTIVAL_DESC= Festival output module
FLITE_DESC= Festival Lite output module
ALSA_LIB_DEPENDS= libasound.so:${PORTSDIR}/audio/alsa-lib
ALSA_CONFIGURE_WITH= alsa
.include <bsd.port.options.mk>
AO_LIB_DEPENDS= libao.so:${PORTSDIR}/audio/libao
AO_CONFIGURE_WITH= libao
.if ${OSVERSION} < 800067 && ${ARCH} == "amd64"
CFLAGS+= -fPIC
.endif
ESPEAK_DESC= eSpeak speech synthesizer support
ESPEAK_LIB_DEPENDS= libespeak.so:${PORTSDIR}/audio/espeak
ESPEAK_CONFIGURE_WITH= espeak
.if ${PORT_OPTIONS:MALSA}
LIB_DEPENDS+= asound:${PORTSDIR}/audio/alsa-lib
CONFIGURE_ARGS+=--with-alsa
.else
CONFIGURE_ARGS+=--without-alsa
.endif
FESTIVAL_DESC= Festival Speech Synthesis System support
FESTIVAL_RUN_DEPENDS= festival:${PORTSDIR}/audio/festival \
${LOCALBASE}/share/festival/lib/${PORTNAME}.scm:${PORTSDIR}/audio/festival-freebsoft-utils
.if ${PORT_OPTIONS:MAO}
LIB_DEPENDS+= ao:${PORTSDIR}/audio/libao
CONFIGURE_ARGS+=--with-libao
.else
CONFIGURE_ARGS+=--without-libao
.endif
FLITE_DESC= Flite speech synthesis engine support
FLITE_LIB_DEPENDS= libflite.so:${PORTSDIR}/audio/flite
FLITE_CONFIGURE_WITH= flite
.if ${PORT_OPTIONS:MESPEAK}
LIB_DEPENDS+= espeak:${PORTSDIR}/audio/espeak
CONFIGURE_ARGS+=--with-espeak
PLIST_SUB+= ESPEAK=""
.else
CONFIGURE_ARGS+=--without-espeak
PLIST_SUB+= ESPEAK="@comment "
.endif
NAS_LIB_DEPENDS= libaudio.so:${PORTSDIR}/audio/nas
NAS_CONFIGURE_WITH= nas
.if ${PORT_OPTIONS:MFESTIVAL}
RUN_DEPENDS+= festival:${PORTSDIR}/audio/festival \
${LOCALBASE}/share/festival/lib/${PORTNAME}.scm:${PORTSDIR}/audio/festival-freebsoft-utils
.endif
PULSEAUDIO_LIB_DEPENDS= libpulse.so:${PORTSDIR}/audio/pulseaudio
PULSEAUDIO_CONFIGURE_WITH=pulse
.if ${PORT_OPTIONS:MFLITE}
BUILD_DEPENDS+= flite:${PORTSDIR}/audio/flite
RUN_DEPENDS+= flite:${PORTSDIR}/audio/flite
CONFIGURE_ARGS+=--with-flite
PLIST_SUB+= FLITE=""
.else
CONFIGURE_ARGS+=--without-flite
PLIST_SUB+= FLITE="@comment "
.endif
.if ${PORT_OPTIONS:MNAS}
LIB_DEPENDS+= audio:${PORTSDIR}/audio/nas
CONFIGURE_ARGS+=--with-nas
.else
CONFIGURE_ARGS+=--without-nas
.endif
.if ${PORT_OPTIONS:MPULSEAUDIO}
LIB_DEPENDS+= pulse:${PORTSDIR}/audio/pulseaudio
CONFIGURE_ARGS+=--with-pulse
.else
CONFIGURE_ARGS+=--without-pulse
.endif
.if ${PORT_OPTIONS:MPYTHON}
USE_PYTHON= -2.7
CONFIGURE_ARGS+=--enable-python
PLIST_SUB+= PYTHON=""
.else
CONFIGURE_ARGS+=--disable-python
PLIST_SUB+= PYTHON="@comment "
.endif
# devel/py-xdg doesn't support Python 3.
CONFIGURE_ARGS+= --disable-python
PLIST_SUB+= PYTHON="@comment "
#PYTHON_RUN_DEPENDS= ${PYTHON_SITELIBDIR}/xdg/__init__.py:${PORTSDIR}/devel/py-xdg
#PYTHON_USE= PYTHON=3
#PYTHON_CONFIGURE_ENABLE=python
post-patch:
${REINPLACE_CMD} -e 's/-pthread/${PTHREAD_LIBS}/g' \
${WRKSRC}/ltmain.sh
${REINPLACE_CMD} -e 's/-lpthread/${PTHREAD_LIBS}/g' \
${WRKSRC}/configure \
${WRKSRC}/src/audio/Makefile.in \
${WRKSRC}/src/c/api/Makefile.in \
${WRKSRC}/src/c/clients/spdsend/Makefile.in \
${WRKSRC}/src/modules/Makefile.in \
${WRKSRC}/src/server/Makefile.in
${REINPLACE_CMD} -e '/SUBDIRS/ s/tests//' \
@${REINPLACE_CMD} -e '/SUBDIRS/ s/tests//' \
${WRKSRC}/src/Makefile.in
post-install:
.for f in ${ETCFILES}
@if [ ! -f ${ETCDIR}/${f} ]; then \
${CP} -p ${ETCDIR}/${f}.sample ${ETCDIR}/${f}; \
fi
@${MV} ${STAGEDIR}${ETCDIR}/${f} ${STAGEDIR}${ETCDIR}/${f}.sample
.endfor
.if ${PORT_OPTIONS:MDOCS}
${MKDIR} ${DOCSDIR}
.for f in ${PORTDOCS}
${INSTALL_MAN} ${WRKSRC}/${f} ${DOCSDIR}
.endfor
.endif
${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${PORTDOCS:S,^,${WRKSRC}/,} ${STAGEDIR}${DOCSDIR}
.include <bsd.port.mk>

View File

@ -1,2 +1,2 @@
SHA256 (speech-dispatcher-0.7.1.tar.gz) = a8a9cf299447df4645d36c649977e007a3050ccaecb7f77e2165001ec5794a51
SIZE (speech-dispatcher-0.7.1.tar.gz) = 1144818
SHA256 (speech-dispatcher-0.8.tar.gz) = 0a6ce544cfbac8592a8ea08e3ab24c389153904ea51c6fd68756cea52de9efa2
SIZE (speech-dispatcher-0.8.tar.gz) = 1229312

View File

@ -1,17 +0,0 @@
--- config/Makefile.in.orig 2010-08-25 01:32:29.007194513 +0200
+++ config/Makefile.in 2010-08-25 01:58:14.194467567 +0200
@@ -304,11 +304,9 @@
@list='$(spdconf_DATA)'; test -n "$(spdconfdir)" || list=; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; \
- done | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(spdconfdir)'"; \
- $(INSTALL_DATA) $$files "$(DESTDIR)$(spdconfdir)" || exit $$?; \
+ $(am__strip_dir) \
+ echo " $(INSTALL_DATA) $$d$$p '$(DESTDIR)$(spdconfdir)/$$f'"; \
+ $(INSTALL_DATA) $$d$$p "$(DESTDIR)$(spdconfdir)/$$f.sample" || exit $$?; \
done
uninstall-spdconfDATA:

View File

@ -1,17 +0,0 @@
--- config/clients/Makefile.in.orig 2010-08-25 02:00:47.363039128 +0200
+++ config/clients/Makefile.in 2010-08-25 02:02:07.456297674 +0200
@@ -262,11 +262,9 @@
@list='$(dist_clientconf_DATA)'; test -n "$(clientconfdir)" || list=; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; \
- done | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(clientconfdir)'"; \
- $(INSTALL_DATA) $$files "$(DESTDIR)$(clientconfdir)" || exit $$?; \
+ $(am__strip_dir) \
+ echo " $(INSTALL_DATA) $$d$$p '$(DESTDIR)$(clientconfdir)/$$f'"; \
+ $(INSTALL_DATA) $$d$$p "$(DESTDIR)$(clientconfdir)/$$f.sample" || exit $$?; \
done
uninstall-dist_clientconfDATA:

View File

@ -1,17 +0,0 @@
--- config/modules/Makefile.in.orig 2010-08-25 02:02:45.920937579 +0200
+++ config/modules/Makefile.in 2010-08-25 02:04:07.949176894 +0200
@@ -262,11 +262,9 @@
@list='$(dist_moduleconf_DATA)'; test -n "$(moduleconfdir)" || list=; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; \
- done | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(moduleconfdir)'"; \
- $(INSTALL_DATA) $$files "$(DESTDIR)$(moduleconfdir)" || exit $$?; \
+ $(am__strip_dir) \
+ echo " $(INSTALL_DATA) $$d$$p '$(DESTDIR)$(moduleconfdir)/$$f'"; \
+ $(INSTALL_DATA) $$d$$p "$(DESTDIR)$(moduleconfdir)/$$f.sample" || exit $$?; \
done
uninstall-dist_moduleconfDATA:

View File

@ -1,44 +0,0 @@
--- configure.orig 2010-08-25 02:22:44.937559878 +0200
+++ configure 2010-08-25 02:23:12.962288324 +0200
@@ -10761,41 +10761,6 @@
echo "*** Required math library missing! See INSTALL .";exit 1
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -ldl" >&5
-$as_echo_n "checking for main in -ldl... " >&6; }
-if test "${ac_cv_lib_dl_main+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-
-int
-main ()
-{
-return main ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_dl_main=yes
-else
- ac_cv_lib_dl_main=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_main" >&5
-$as_echo "$ac_cv_lib_dl_main" >&6; }
-if test "x$ac_cv_lib_dl_main" = x""yes; then :
- echo ""
-else
- echo "*** Required dl library missing! See INSTALL .";exit 1
-fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -ldotconf" >&5
$as_echo_n "checking for main in -ldotconf... " >&6; }

View File

@ -0,0 +1,11 @@
--- ./include/spd_utils.h.orig 2012-07-11 11:05:05.000000000 +0200
+++ ./include/spd_utils.h 2013-11-15 08:46:53.865350816 +0100
@@ -27,4 +27,8 @@
#include <sys/types.h>
ssize_t spd_getline(char **lineptr, size_t * n, FILE * f);
+
+ssize_t safe_read(int fd, void *buf, size_t count);
+ssize_t safe_write(int fd, const void *buf, size_t count);
+
#endif /* SPD_UTILS_H */

View File

@ -1,10 +0,0 @@
--- src/c/clients/spdsend/server.c.orig 2009-12-08 20:16:01.708882022 +0000
+++ src/c/clients/spdsend/server.c 2009-12-08 20:24:49.894019326 +0000
@@ -30,6 +30,7 @@
#include <errno.h>
#include <netdb.h>
+#include <sys/types.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#if USE_THREADS

View File

@ -0,0 +1,10 @@
--- ./src/clients/spdsend/server.c.orig 2012-07-11 11:05:05.000000000 +0200
+++ ./src/clients/spdsend/server.c 2013-11-15 08:44:05.105354858 +0100
@@ -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

@ -0,0 +1,34 @@
--- ./src/common/spd_getline.c.orig 2012-07-11 11:05:05.000000000 +0200
+++ ./src/common/spd_getline.c 2013-11-15 11:25:07.125139008 +0100
@@ -26,6 +26,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <unistd.h>
#include <errno.h>
#include <limits.h>
#include <glib.h>
@@ -122,3 +123,23 @@
}
return buf_pos;
}
+
+ssize_t
+safe_read(int fd, void *buf, size_t count)
+{
+ ssize_t r;
+ do {
+ r = read(fd, buf, count);
+ } while (r == -1 && errno == EINTR);
+ return r;
+}
+
+ssize_t
+safe_write(int fd, const void *buf, size_t count)
+{
+ ssize_t w;
+ do {
+ w = write(fd, buf, count);
+ } while (w == -1 && errno == EINTR);
+ return w;
+}

View File

@ -0,0 +1,21 @@
--- ./src/modules/cicero.c.orig 2012-07-11 11:05:05.000000000 +0200
+++ ./src/modules/cicero.c 2013-11-15 08:51:41.687674164 +0100
@@ -32,6 +32,7 @@
#include <langinfo.h>
#include <sys/stat.h>
#include <semaphore.h>
+#include <spd_utils.h>
#include "module_utils.h"
@@ -377,9 +378,7 @@
break;
}
if (ret > 0)
- TEMP_FAILURE_RETRY(read
- (fd1[0], b,
- 2));
+ safe_read(fd1[0], b, 2);
if (cicero_stop) {
cicero_speaking = 0;
module_report_event_stop();

View File

@ -0,0 +1,25 @@
--- ./src/server/output.c.orig 2012-07-11 11:05:06.000000000 +0200
+++ ./src/server/output.c 2013-11-15 11:18:27.066817985 +0100
@@ -30,22 +30,9 @@
#include "output.h"
#include "parse.h"
-#ifdef TEMP_FAILURE_RETRY /* GNU libc */
-#define safe_write(fd, buf, count) TEMP_FAILURE_RETRY(write(fd, buf, count))
-#else /* TEMP_FAILURE_RETRY */
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-static inline ssize_t
-safe_write(int fd, const void *buf, size_t count) {
- do {
- ssize_t w = write(fd, buf, count);
-
- if (w == -1 && errno == EINTR) continue;
- return w;
- } while (1);
-}
-#endif /* TEMP_FAILURE_RETRY */
#if !(defined(__GLIBC__) && defined(_GNU_SOURCE))
/* Added by Willie Walker - strndup is a gcc-ism

View File

@ -0,0 +1,18 @@
--- ./src/server/sem_functions.c.orig 2012-07-11 11:05:06.000000000 +0200
+++ ./src/server/sem_functions.c 2013-11-15 11:19:15.965146025 +0100
@@ -28,13 +28,13 @@
#include "speechd.h"
#include "sem_functions.h"
+#include <spd_utils.h>
void speaking_semaphore_post(void)
{
char buf[1];
buf[0] = 42;
- const ssize_t wr_bytes =
- TEMP_FAILURE_RETRY(write(speaking_pipe[1], buf, 1));
+ const ssize_t wr_bytes = safe_write(speaking_pipe[1], buf, 1);
if (wr_bytes != 1)
FATAL("write to polled fd: could not write 1 byte");
}

View File

@ -0,0 +1,22 @@
--- ./src/server/speaking.c.orig 2012-07-11 11:05:06.000000000 +0200
+++ ./src/server/speaking.c 2013-11-15 11:20:31.405951238 +0100
@@ -39,6 +39,7 @@
#include "output.h"
#include "speaking.h"
#include "sem_functions.h"
+#include <spd_utils.h>
TSpeechDMessage *current_message = NULL;
static SPDPriority highest_priority = 0;
@@ -87,10 +88,7 @@
char buf[1];
MSG(5,
"wait_for_poll: activity in Speech Dispatcher");
- const ssize_t rd_bytes =
- TEMP_FAILURE_RETRY(read
- (poll_fds[0].fd, buf,
- 1));
+ const ssize_t rd_bytes = safe_read(poll_fds[0].fd, buf, 1);
if (rd_bytes != 1)
FATAL
("read from polled fd: could not read 1 byte");

View File

@ -1,11 +1,11 @@
--- src/server/speechd.h.orig 2010-08-25 03:20:44.157056094 +0200
+++ src/server/speechd.h 2010-08-25 03:21:00.004912354 +0200
--- ./src/server/speechd.h.orig 2012-07-11 11:05:06.000000000 +0200
+++ ./src/server/speechd.h 2013-11-15 08:44:05.115355454 +0100
@@ -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 1
+#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

@ -5,4 +5,4 @@ necessary to solve in speech enabled applications. What is a very high
level GUI library to graphics, Speech Dispatcher is to speech
synthesis.
WWW: http://www.freebsoft.org/speechd
WWW: http://devel.freebsoft.org/speechd

View File

@ -19,11 +19,13 @@ bin/speech-dispatcher
%%ETCDIR%%/modules/swift-generic.conf.sample
%%ETCDIR%%/speechd.conf.sample
@exec for f in %%ETCFILES%%; do [ -f %D/%%ETCDIR%%/$f ] || cp -p %D/%%ETCDIR%%/$f.sample %D/%%ETCDIR%%/$f; done
include/libspeechd.h
include/speech-dispatcher/libspeechd.h
include/speech-dispatcher/spd_audio_plugin.h
include/speech-dispatcher/speechd_types.h
lib/libspeechd.a
lib/libspeechd.la
lib/libspeechd.so
lib/libspeechd.so.5
lib/libspeechd.so.6
%%PYTHON%%%%PYTHON_SITELIBDIR%%/speechd/__init__.py
%%PYTHON%%%%PYTHON_SITELIBDIR%%/speechd/__init__.pyc
%%PYTHON%%%%PYTHON_SITELIBDIR%%/speechd/__init__.pyo
@ -51,10 +53,24 @@ lib/speech-dispatcher-modules/sd_dummy
lib/speech-dispatcher-modules/sd_festival
%%FLITE%%lib/speech-dispatcher-modules/sd_flite
lib/speech-dispatcher-modules/sd_generic
lib/speech-dispatcher/libsdaudio.a
lib/speech-dispatcher/libsdaudio.la
lib/speech-dispatcher/libsdaudio.so
lib/speech-dispatcher/libsdaudio.so.2
%%ALSA%%lib/speech-dispatcher/spd_alsa.a
%%ALSA%%lib/speech-dispatcher/spd_alsa.la
%%ALSA%%lib/speech-dispatcher/spd_alsa.so
%%AO%%lib/speech-dispatcher/spd_libao.a
%%AO%%lib/speech-dispatcher/spd_libao.la
%%AO%%lib/speech-dispatcher/spd_libao.so
%%NAS%%lib/speech-dispatcher/spd_nas.a
%%NAS%%lib/speech-dispatcher/spd_nas.la
%%NAS%%lib/speech-dispatcher/spd_nas.so
lib/speech-dispatcher/spd_oss.a
lib/speech-dispatcher/spd_oss.la
lib/speech-dispatcher/spd_oss.so
%%PULSEAUDIO%%lib/speech-dispatcher/spd_pulse.a
%%PULSEAUDIO%%lib/speech-dispatcher/spd_pulse.la
%%PULSEAUDIO%%lib/speech-dispatcher/spd_pulse.so
libdata/pkgconfig/speech-dispatcher.pc
share/locale/cs/LC_MESSAGES/speech-dispatcher.mo
share/locale/hu/LC_MESSAGES/speech-dispatcher.mo
share/sounds/speech-dispatcher/dummy-message.wav
%%PYTHON%%share/sounds/speech-dispatcher/test.wav
%%DATADIR%%/conf/clients/emacs.conf
@ -83,6 +99,7 @@ share/sounds/speech-dispatcher/dummy-message.wav
%%PYTHON%%@dirrm %%PYTHON_SITELIBDIR%%/speechd
%%PYTHON%%@dirrmtry %%PYTHON_SITELIBDIR%%
%%PYTHON%%@dirrmtry %%PYTHON_LIBDIR%%
@dirrm include/speech-dispatcher
@dirrmtry %%ETCDIR%%/modules
@dirrmtry %%ETCDIR%%/clients
@dirrmtry %%ETCDIR%%