aboutsummaryrefslogtreecommitdiff
path: root/accessibility
diff options
context:
space:
mode:
authorAlberto Villa <avilla@FreeBSD.org>2010-02-18 16:31:55 +0000
committerAlberto Villa <avilla@FreeBSD.org>2010-02-18 16:31:55 +0000
commitccee07e3e8c45db24caddffdc6c29c2e7550bc52 (patch)
treeff0bd124e9c749e5928883f0acb3bcb442b4a3bb /accessibility
parentf8e68e60508c0eb2cbacbc95384d46a83cb4a1ac (diff)
downloadports-ccee07e3e8c45db24caddffdc6c29c2e7550bc52.tar.gz
ports-ccee07e3e8c45db24caddffdc6c29c2e7550bc52.zip
Notes
Diffstat (limited to 'accessibility')
-rw-r--r--accessibility/speech-dispatcher/Makefile30
-rw-r--r--accessibility/speech-dispatcher/files/extrapatch-src-c-api-Makefile.in2
-rw-r--r--accessibility/speech-dispatcher/files/extrapatch-src-c-clients-say-Makefile.in2
-rw-r--r--accessibility/speech-dispatcher/files/extrapatch-src-c-clients-spdsend-Makefile.in2
-rw-r--r--accessibility/speech-dispatcher/files/extrapatch-src-modules-Makefile.in16
-rw-r--r--accessibility/speech-dispatcher/files/extrapatch-src-server-Makefile.in2
-rw-r--r--accessibility/speech-dispatcher/files/getline.c8
-rw-r--r--accessibility/speech-dispatcher/files/getline_strndup.c184
-rw-r--r--accessibility/speech-dispatcher/files/pkg-message.in12
-rw-r--r--accessibility/speech-dispatcher/files/speechd.in4
10 files changed, 231 insertions, 31 deletions
diff --git a/accessibility/speech-dispatcher/Makefile b/accessibility/speech-dispatcher/Makefile
index b465ac25f115..e87ac0b17ca0 100644
--- a/accessibility/speech-dispatcher/Makefile
+++ b/accessibility/speech-dispatcher/Makefile
@@ -6,6 +6,7 @@
PORTNAME= speech-dispatcher
PORTVERSION= 0.6.7
+PORTREVISION= 1
CATEGORIES= accessibility audio
MASTER_SITES= http://www.freebsoft.org/pub/projects/speechd/
@@ -14,6 +15,8 @@ COMMENT= Common interface to speech synthesis
LIB_DEPENDS= dotconf.0:${PORTSDIR}/devel/dotconf
+SUB_FILES= pkg-message
+
USE_RC_SUBR= speechd
USE_GNOME= glib20 pkgconfig
MAKE_JOBS_SAFE= yes
@@ -84,24 +87,29 @@ CONFIGURE_ARGS+= --with-pulseaudio
CONFIGURE_ARGS+= --without-pulseaudio
.endif
-.if ${OSVERSION} < 800000
-EXTRA_PATCHES= ${FILESDIR}/extrapatch-*
+.if ${OSVERSION} < 800067
+.if ${ARCH} == "amd64"
+CFLAGS+= -fPIC
.endif
-
-.if ${OSVERSION} < 700000
-BROKEN= does not compile on 6.X
-.endif
-
-.if ${OSVERSION} >= 700000 && ${OSVERSION} < 800000 && ${ARCH} == "amd64"
-BROKEN= does not compile on amd64/7
+EXTRA_PATCHES= ${FILESDIR}/extrapatch-*
.endif
post-extract:
-.if ${OSVERSION} < 800000
- ${CP} ${FILESDIR}/getline.* ${WRKSRC}/src
+.if ${OSVERSION} < 800067
+ ${CP} ${FILESDIR}/getline.h ${WRKSRC}/src
+.if ${OSVERSION} < 701101
+ ${CP} ${FILESDIR}/getline_strndup.c ${WRKSRC}/src/freebsd.c
+.else
+ ${CP} ${FILESDIR}/getline.c ${WRKSRC}/src/freebsd.c
+.endif
.endif
post-patch:
+.if ${OSVERSION} < 700042
+ @${REINPLACE_CMD} -E -e 's/^(LDFLAGS =.+)/\1 ${PTHREAD_LIBS}/' \
+ ${WRKSRC}/src/c/clients/say/Makefile.in \
+ ${WRKSRC}/src/tests/Makefile.in
+.endif
@${REINPLACE_CMD} -e 's/-pthread/${PTHREAD_LIBS}/g' \
${WRKSRC}/ltmain.sh
@${REINPLACE_CMD} -e 's/-lpthread/${PTHREAD_LIBS}/g' \
diff --git a/accessibility/speech-dispatcher/files/extrapatch-src-c-api-Makefile.in b/accessibility/speech-dispatcher/files/extrapatch-src-c-api-Makefile.in
index 8e2c746da1e8..c2552fe0ef0c 100644
--- a/accessibility/speech-dispatcher/files/extrapatch-src-c-api-Makefile.in
+++ b/accessibility/speech-dispatcher/files/extrapatch-src-c-api-Makefile.in
@@ -5,7 +5,7 @@
LTLIBRARIES = $(lib_LTLIBRARIES)
libspeechd_la_DEPENDENCIES =
-am_libspeechd_la_OBJECTS = libspeechd.lo
-+am_libspeechd_la_OBJECTS = libspeechd.lo ../../getline.$(OBJEXT)
++am_libspeechd_la_OBJECTS = libspeechd.lo ../../freebsd.$(OBJEXT)
libspeechd_la_OBJECTS = $(am_libspeechd_la_OBJECTS)
libspeechd_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
diff --git a/accessibility/speech-dispatcher/files/extrapatch-src-c-clients-say-Makefile.in b/accessibility/speech-dispatcher/files/extrapatch-src-c-clients-say-Makefile.in
index c6f47f19e91b..40f586bba2e8 100644
--- a/accessibility/speech-dispatcher/files/extrapatch-src-c-clients-say-Makefile.in
+++ b/accessibility/speech-dispatcher/files/extrapatch-src-c-clients-say-Makefile.in
@@ -5,7 +5,7 @@
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
PROGRAMS = $(bin_PROGRAMS)
-am_spd_say_OBJECTS = say.$(OBJEXT) options.$(OBJEXT)
-+am_spd_say_OBJECTS = say.$(OBJEXT) options.$(OBJEXT) ../../../getline.$(OBJEXT)
++am_spd_say_OBJECTS = say.$(OBJEXT) options.$(OBJEXT) ../../../freebsd.$(OBJEXT)
spd_say_OBJECTS = $(am_spd_say_OBJECTS)
spd_say_DEPENDENCIES = $(c_api)/libspeechd.la
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
diff --git a/accessibility/speech-dispatcher/files/extrapatch-src-c-clients-spdsend-Makefile.in b/accessibility/speech-dispatcher/files/extrapatch-src-c-clients-spdsend-Makefile.in
index d341bef54366..bb90cb46bfa0 100644
--- a/accessibility/speech-dispatcher/files/extrapatch-src-c-clients-spdsend-Makefile.in
+++ b/accessibility/speech-dispatcher/files/extrapatch-src-c-clients-spdsend-Makefile.in
@@ -5,7 +5,7 @@
PROGRAMS = $(bin_PROGRAMS)
am_spdsend_OBJECTS = spdsend.$(OBJEXT) server.$(OBJEXT) \
- client.$(OBJEXT) common.$(OBJEXT)
-+ client.$(OBJEXT) common.$(OBJEXT) ../../../getline.$(OBJEXT)
++ client.$(OBJEXT) common.$(OBJEXT) ../../../freebsd.$(OBJEXT)
spdsend_OBJECTS = $(am_spdsend_OBJECTS)
spdsend_DEPENDENCIES =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
diff --git a/accessibility/speech-dispatcher/files/extrapatch-src-modules-Makefile.in b/accessibility/speech-dispatcher/files/extrapatch-src-modules-Makefile.in
index 244e2c80f004..8d23bb06697c 100644
--- a/accessibility/speech-dispatcher/files/extrapatch-src-modules-Makefile.in
+++ b/accessibility/speech-dispatcher/files/extrapatch-src-modules-Makefile.in
@@ -5,32 +5,32 @@
modulebinPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
PROGRAMS = $(modulebin_PROGRAMS)
-am_sd_cicero_OBJECTS = cicero.$(OBJEXT) module_utils.$(OBJEXT)
-+am_sd_cicero_OBJECTS = cicero.$(OBJEXT) module_utils.$(OBJEXT) ../getline.$(OBJEXT)
++am_sd_cicero_OBJECTS = cicero.$(OBJEXT) module_utils.$(OBJEXT) ../freebsd.$(OBJEXT)
sd_cicero_OBJECTS = $(am_sd_cicero_OBJECTS)
sd_cicero_DEPENDENCIES =
-am_sd_dummy_OBJECTS = dummy.$(OBJEXT) module_utils.$(OBJEXT)
-+am_sd_dummy_OBJECTS = dummy.$(OBJEXT) module_utils.$(OBJEXT) ../getline.$(OBJEXT)
++am_sd_dummy_OBJECTS = dummy.$(OBJEXT) module_utils.$(OBJEXT) ../freebsd.$(OBJEXT)
sd_dummy_OBJECTS = $(am_sd_dummy_OBJECTS)
sd_dummy_DEPENDENCIES =
sd_dummy_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(sd_dummy_LDFLAGS) \
$(LDFLAGS) -o $@
-am_sd_espeak_OBJECTS = espeak.$(OBJEXT) module_utils.$(OBJEXT)
-+am_sd_espeak_OBJECTS = espeak.$(OBJEXT) module_utils.$(OBJEXT) ../getline.$(OBJEXT)
++am_sd_espeak_OBJECTS = espeak.$(OBJEXT) module_utils.$(OBJEXT) ../freebsd.$(OBJEXT)
sd_espeak_OBJECTS = $(am_sd_espeak_OBJECTS)
sd_espeak_DEPENDENCIES =
sd_espeak_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(sd_espeak_LDFLAGS) $(LDFLAGS) -o $@
-am_sd_festival_OBJECTS = festival.$(OBJEXT) module_utils.$(OBJEXT)
-+am_sd_festival_OBJECTS = festival.$(OBJEXT) module_utils.$(OBJEXT) ../getline.$(OBJEXT)
++am_sd_festival_OBJECTS = festival.$(OBJEXT) module_utils.$(OBJEXT) ../freebsd.$(OBJEXT)
sd_festival_OBJECTS = $(am_sd_festival_OBJECTS)
sd_festival_DEPENDENCIES =
sd_festival_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(sd_festival_LDFLAGS) $(LDFLAGS) -o $@
-am_sd_flite_OBJECTS = flite.$(OBJEXT) module_utils.$(OBJEXT)
-+am_sd_flite_OBJECTS = flite.$(OBJEXT) module_utils.$(OBJEXT) ../getline.$(OBJEXT)
++am_sd_flite_OBJECTS = flite.$(OBJEXT) module_utils.$(OBJEXT) ../freebsd.$(OBJEXT)
sd_flite_OBJECTS = $(am_sd_flite_OBJECTS)
am__DEPENDENCIES_1 =
sd_flite_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
@@ -38,18 +38,18 @@
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(sd_flite_LDFLAGS) \
$(LDFLAGS) -o $@
-am_sd_generic_OBJECTS = generic.$(OBJEXT) module_utils.$(OBJEXT)
-+am_sd_generic_OBJECTS = generic.$(OBJEXT) module_utils.$(OBJEXT) ../getline.$(OBJEXT)
++am_sd_generic_OBJECTS = generic.$(OBJEXT) module_utils.$(OBJEXT) ../freebsd.$(OBJEXT)
sd_generic_OBJECTS = $(am_sd_generic_OBJECTS)
sd_generic_DEPENDENCIES =
-am_sd_ibmtts_OBJECTS = ibmtts.$(OBJEXT) module_utils.$(OBJEXT)
-+am_sd_ibmtts_OBJECTS = ibmtts.$(OBJEXT) module_utils.$(OBJEXT) ../getline.$(OBJEXT)
++am_sd_ibmtts_OBJECTS = ibmtts.$(OBJEXT) module_utils.$(OBJEXT) ../freebsd.$(OBJEXT)
sd_ibmtts_OBJECTS = $(am_sd_ibmtts_OBJECTS)
sd_ibmtts_DEPENDENCIES =
sd_ibmtts_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(sd_ibmtts_LDFLAGS) $(LDFLAGS) -o $@
-am_sd_ivona_OBJECTS = ivona.$(OBJEXT) module_utils.$(OBJEXT)
-+am_sd_ivona_OBJECTS = ivona.$(OBJEXT) module_utils.$(OBJEXT) ../getline.$(OBJEXT)
++am_sd_ivona_OBJECTS = ivona.$(OBJEXT) module_utils.$(OBJEXT) ../freebsd.$(OBJEXT)
sd_ivona_OBJECTS = $(am_sd_ivona_OBJECTS)
sd_ivona_DEPENDENCIES =
sd_ivona_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
diff --git a/accessibility/speech-dispatcher/files/extrapatch-src-server-Makefile.in b/accessibility/speech-dispatcher/files/extrapatch-src-server-Makefile.in
index dab5b4e2c802..07ea4b5896cd 100644
--- a/accessibility/speech-dispatcher/files/extrapatch-src-server-Makefile.in
+++ b/accessibility/speech-dispatcher/files/extrapatch-src-server-Makefile.in
@@ -5,7 +5,7 @@
compare.$(OBJEXT) speaking.$(OBJEXT) options.$(OBJEXT) \
output.$(OBJEXT) sem_functions.$(OBJEXT) \
- index_marking.$(OBJEXT)
-+ index_marking.$(OBJEXT) ../getline.$(OBJEXT)
++ index_marking.$(OBJEXT) ../freebsd.$(OBJEXT)
speech_dispatcher_OBJECTS = $(am_speech_dispatcher_OBJECTS)
speech_dispatcher_DEPENDENCIES =
speech_dispatcher_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
diff --git a/accessibility/speech-dispatcher/files/getline.c b/accessibility/speech-dispatcher/files/getline.c
index 8a38b2e9df7a..e8781da699dd 100644
--- a/accessibility/speech-dispatcher/files/getline.c
+++ b/accessibility/speech-dispatcher/files/getline.c
@@ -1,6 +1,4 @@
-/* getline.c -- Replacement for GNU C library function getline
-
-Copyright (C) 1993 Free Software Foundation, Inc.
+/* Copyright (C) 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@ -12,8 +10,6 @@ WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details. */
-/* Written by Jan Brittenson, bson@gnu.ai.mit.edu. */
-
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -33,7 +29,7 @@ General Public License for more details. */
read no more than LIMIT chars.
*LINEPTR is a pointer returned from malloc (or NULL), pointing to
- *N characters of space. It is realloc'd as necessary.
+ *N characters of space. It is realloc'd as necessary.
Return the number of characters read (not including the null
terminator), or -1 on error or EOF. On a -1 return, the caller
diff --git a/accessibility/speech-dispatcher/files/getline_strndup.c b/accessibility/speech-dispatcher/files/getline_strndup.c
new file mode 100644
index 000000000000..2ee51b571409
--- /dev/null
+++ b/accessibility/speech-dispatcher/files/getline_strndup.c
@@ -0,0 +1,184 @@
+/* Copyright (C) 1993 Free Software Foundation, Inc.
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details. */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <sys/types.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <errno.h>
+#include "getline.h"
+
+/* Always add at least this many bytes when extending the buffer. */
+#define MIN_CHUNK 64
+
+/* Read up to (and including) a TERMINATOR from STREAM into *LINEPTR
+ + OFFSET (and null-terminate it). If LIMIT is non-negative, then
+ read no more than LIMIT chars.
+
+ *LINEPTR is a pointer returned from malloc (or NULL), pointing to
+ *N characters of space. It is realloc'd as necessary.
+
+ Return the number of characters read (not including the null
+ terminator), or -1 on error or EOF. On a -1 return, the caller
+ should check feof(), if not then errno has been set to indicate the
+ error. */
+
+int
+getstr (lineptr, n, stream, terminator, offset, limit)
+ char **lineptr;
+ size_t *n;
+ FILE *stream;
+ int terminator;
+ int offset;
+ int limit;
+{
+ int nchars_avail; /* Allocated but unused chars in *LINEPTR. */
+ char *read_pos; /* Where we're reading into *LINEPTR. */
+ int ret;
+
+ if (!lineptr || !n || !stream)
+ {
+ errno = EINVAL;
+ return -1;
+ }
+
+ if (!*lineptr)
+ {
+ *n = MIN_CHUNK;
+ *lineptr = malloc (*n);
+ if (!*lineptr)
+ {
+ errno = ENOMEM;
+ return -1;
+ }
+ *lineptr[0] = '\0';
+ }
+
+ nchars_avail = *n - offset;
+ read_pos = *lineptr + offset;
+
+ for (;;)
+ {
+ int save_errno;
+ register int c;
+
+ if (limit == 0)
+ break;
+ else
+ {
+ c = getc (stream);
+
+ /* If limit is negative, then we shouldn't pay attention to
+ it, so decrement only if positive. */
+ if (limit > 0)
+ limit--;
+ }
+
+ save_errno = errno;
+
+ /* We always want at least one char left in the buffer, since we
+ always (unless we get an error while reading the first char)
+ NUL-terminate the line buffer. */
+
+ assert((*lineptr + *n) == (read_pos + nchars_avail));
+ if (nchars_avail < 2)
+ {
+ if (*n > MIN_CHUNK)
+ *n *= 2;
+ else
+ *n += MIN_CHUNK;
+
+ nchars_avail = *n + *lineptr - read_pos;
+ *lineptr = realloc (*lineptr, *n);
+ if (!*lineptr)
+ {
+ errno = ENOMEM;
+ return -1;
+ }
+ read_pos = *n - nchars_avail + *lineptr;
+ assert((*lineptr + *n) == (read_pos + nchars_avail));
+ }
+
+ if (ferror (stream))
+ {
+ /* Might like to return partial line, but there is no
+ place for us to store errno. And we don't want to just
+ lose errno. */
+ errno = save_errno;
+ return -1;
+ }
+
+ if (c == EOF)
+ {
+ /* Return partial line, if any. */
+ if (read_pos == *lineptr)
+ return -1;
+ else
+ break;
+ }
+
+ *read_pos++ = c;
+ nchars_avail--;
+
+ if (c == terminator)
+ /* Return the line. */
+ break;
+ }
+
+ /* Done - NUL terminate and return the number of chars read. */
+ *read_pos = '\0';
+
+ ret = read_pos - (*lineptr + offset);
+ return ret;
+}
+
+int
+getline (lineptr, n, stream)
+ char **lineptr;
+ size_t *n;
+ FILE *stream;
+{
+ return getstr (lineptr, n, stream, '\n', 0, GETLINE_NO_LIMIT);
+}
+
+int
+getline_safe (lineptr, n, stream, limit)
+ char **lineptr;
+ size_t *n;
+ FILE *stream;
+ int limit;
+{
+ return getstr (lineptr, n, stream, '\n', 0, limit);
+}
+
+char *
+strndup (str, n)
+ const char *str;
+ size_t n;
+{
+ size_t len;
+ char *copy;
+
+ len = strlen(str);
+ if (n < len)
+ len = n;
+ copy = malloc(len + 1);
+ if (copy == NULL)
+ return NULL;
+ memcpy(copy, str, len);
+ copy[len] = '\0';
+ return copy;
+}
diff --git a/accessibility/speech-dispatcher/files/pkg-message.in b/accessibility/speech-dispatcher/files/pkg-message.in
new file mode 100644
index 000000000000..25934073d746
--- /dev/null
+++ b/accessibility/speech-dispatcher/files/pkg-message.in
@@ -0,0 +1,12 @@
+======================================================================
+
+To start speech-dispatcher daemon locally, instead of using the rc.d
+script, you have to export SPEECHD_PORT to a number between 1024 and
+65535 (it must be a free port). The following example works on
+/bin/sh:
+
+$ export SPEECHD_PORT=1138
+$ speech-dispatcher --config-dir %%ETCDIR%% \
+> --port $SPEECHD_PORT
+
+======================================================================
diff --git a/accessibility/speech-dispatcher/files/speechd.in b/accessibility/speech-dispatcher/files/speechd.in
index 5f34ae46c62b..b56e378d724e 100644
--- a/accessibility/speech-dispatcher/files/speechd.in
+++ b/accessibility/speech-dispatcher/files/speechd.in
@@ -17,7 +17,7 @@ rcvar=`set_rcvar`
real_name="speech-dispatcher"
command="%%PREFIX%%/bin/${real_name}"
-command_args="-C %%ETCDIR%%"
+command_args="--config-dir %%ETCDIR%%"
pidfile="/var/run/${real_name}.pid"
start_precmd="${name}_prestart"
@@ -30,7 +30,7 @@ speechd_prestart()
speechd_poststop()
{
- rm -f $pifile
+ rm -f $pidfile
}
load_rc_config $name