diff options
author | Carlo Landmeter <clandmeter@gmail.com> | 2015-05-09 19:50:04 +0200 |
---|---|---|
committer | Carlo Landmeter <clandmeter@gmail.com> | 2015-05-09 19:50:04 +0200 |
commit | 32d61d1abe06d14b749e0dc8202d7e2c141b34c7 (patch) | |
tree | ea81ea8adf1e0da468238102087c8942db0c4242 /testing/speech-dispatcher | |
parent | d48d53a499c423beb2f4818f46573405a889d41f (diff) | |
download | aports-32d61d1abe06d14b749e0dc8202d7e2c141b34c7.tar.bz2 aports-32d61d1abe06d14b749e0dc8202d7e2c141b34c7.tar.xz |
testing/speech-dispatcher: new aport
Diffstat (limited to 'testing/speech-dispatcher')
3 files changed, 296 insertions, 0 deletions
diff --git a/testing/speech-dispatcher/0001-Make-some-includes-consistent-with-POSIX.patch b/testing/speech-dispatcher/0001-Make-some-includes-consistent-with-POSIX.patch new file mode 100644 index 0000000000..d7947b7751 --- /dev/null +++ b/testing/speech-dispatcher/0001-Make-some-includes-consistent-with-POSIX.patch @@ -0,0 +1,54 @@ +From f2dda28648de4bd940be54e827878f081af22ebc Mon Sep 17 00:00:00 2001 +From: Felix Janda <felix.janda@posteo.de> +Date: Mon, 23 Mar 2015 21:03:29 +0100 +Subject: [PATCH] Make some includes consistent with POSIX + +Reviewed-by: Luke Yelavich <themuso@themuso.com> +--- + src/modules/cicero.c | 2 +- + src/modules/spd_audio.c | 2 +- + src/server/module.c | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/modules/cicero.c b/src/modules/cicero.c +index 62332a5..2c69b7e 100644 +--- a/src/modules/cicero.c ++++ b/src/modules/cicero.c +@@ -28,7 +28,7 @@ + #include <speechd_types.h> + #include <safe_io.h> + #include <errno.h> +-#include <sys/poll.h> ++#include <poll.h> + #include <fcntl.h> + #include <langinfo.h> + #include <sys/stat.h> +diff --git a/src/modules/spd_audio.c b/src/modules/spd_audio.c +index 3b65bf7..c85e21d 100644 +--- a/src/modules/spd_audio.c ++++ b/src/modules/spd_audio.c +@@ -38,7 +38,7 @@ + + #include <stdio.h> + #include <string.h> +-#include <sys/fcntl.h> ++#include <fcntl.h> + #include <sys/ioctl.h> + #include <sys/time.h> + #include <time.h> +diff --git a/src/server/module.c b/src/server/module.c +index 0681caf..51746a0 100644 +--- a/src/server/module.c ++++ b/src/server/module.c +@@ -29,7 +29,7 @@ + #include <sys/types.h> + #include <sys/wait.h> + #include <sys/stat.h> +-#include <sys/unistd.h> ++#include <unistd.h> + #include <stdio.h> + #include <dirent.h> + #include <glib.h> +-- +2.4.0 + diff --git a/testing/speech-dispatcher/0001-Provide-fallback-for-systems-without-TEMP_FAILURE_RE.patch b/testing/speech-dispatcher/0001-Provide-fallback-for-systems-without-TEMP_FAILURE_RE.patch new file mode 100644 index 0000000000..c469902448 --- /dev/null +++ b/testing/speech-dispatcher/0001-Provide-fallback-for-systems-without-TEMP_FAILURE_RE.patch @@ -0,0 +1,182 @@ +From 98504410b7f77cad7457bfdfcd593e2898c3b461 Mon Sep 17 00:00:00 2001 +From: Felix Janda <felix.janda@posteo.de> +Date: Mon, 23 Mar 2015 21:03:12 +0100 +Subject: [PATCH] Provide fallback for systems without TEMP_FAILURE_RETRY + +Reviewed-by: Luke Yelavich <themuso@themuso.com> +--- + include/safe_io.h | 55 ++++++++++++++++++++++++++++++++++++++++++++++ + src/modules/cicero.c | 6 ++--- + src/server/output.c | 18 +-------------- + src/server/sem_functions.c | 5 +++-- + src/server/speaking.c | 5 ++--- + 5 files changed, 63 insertions(+), 26 deletions(-) + create mode 100644 include/safe_io.h + +diff --git a/include/safe_io.h b/include/safe_io.h +new file mode 100644 +index 0000000..37cfe7f +--- /dev/null ++++ b/include/safe_io.h +@@ -0,0 +1,55 @@ ++/* ++ * safe_io.h - Wrapper around read and write ++ * ++ * Copyright (C) 2001, 2002, 2003, 2007 Brailcom, o.p.s. ++ * ++ * This 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, or (at your option) ++ * any later version. ++ * ++ * This software 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. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this package; see the file COPYING. If not, write to ++ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ * Boston, MA 02110-1301, USA. ++ * ++ */ ++ ++#ifdef HAVE_CONFIG_H ++#include <config.h> ++#endif ++ ++#include <unistd.h> ++#include <errno.h> ++ ++#ifdef TEMP_FAILURE_RETRY /* GNU libc */ ++#define safe_read(fd, buf, count) TEMP_FAILURE_RETRY(read(fd, buf, count)) ++#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_read(int fd, void *buf, size_t count) { ++ do { ++ ssize_t w = read(fd, buf, count); ++ ++ if (w == -1 && errno == EINTR) continue; ++ return w; ++ } while (1); ++} ++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 */ +diff --git a/src/modules/cicero.c b/src/modules/cicero.c +index 237796e..62332a5 100644 +--- a/src/modules/cicero.c ++++ b/src/modules/cicero.c +@@ -26,6 +26,7 @@ + #endif + + #include <speechd_types.h> ++#include <safe_io.h> + #include <errno.h> + #include <sys/poll.h> + #include <fcntl.h> +@@ -376,10 +377,7 @@ void *_cicero_speak(void *nothing) + cicero_speaking = 0; + break; + } +- if (ret > 0) +- TEMP_FAILURE_RETRY(read +- (fd1[0], b, +- 2)); ++ if (ret > 0) safe_read(fd1[0], b, 2); + if (cicero_stop) { + cicero_speaking = 0; + module_report_event_stop(); +diff --git a/src/server/output.c b/src/server/output.c +index 40b7e8c..ef98a45 100644 +--- a/src/server/output.c ++++ b/src/server/output.c +@@ -26,27 +26,11 @@ + #endif + + #include <fdsetconv.h> ++#include <safe_io.h> + #include <spd_utils.h> + #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 + */ +diff --git a/src/server/sem_functions.c b/src/server/sem_functions.c +index 0a86f56..430e74c 100644 +--- a/src/server/sem_functions.c ++++ b/src/server/sem_functions.c +@@ -26,6 +26,8 @@ + #include <config.h> + #endif + ++#include <safe_io.h> ++ + #include "speechd.h" + #include "sem_functions.h" + +@@ -33,8 +35,7 @@ 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"); + } +diff --git a/src/server/speaking.c b/src/server/speaking.c +index bd27008..f2dc289 100644 +--- a/src/server/speaking.c ++++ b/src/server/speaking.c +@@ -29,6 +29,7 @@ + #include <glib.h> + #include <poll.h> + #include <unistd.h> ++#include <safe_io.h> + #include "speechd.h" + #include "server.h" + #include "index_marking.h" +@@ -88,9 +89,7 @@ void *speak(void *data) + MSG(5, + "wait_for_poll: activity in Speech Dispatcher"); + const ssize_t rd_bytes = +- TEMP_FAILURE_RETRY(read +- (poll_fds[0].fd, buf, +- 1)); ++ safe_read(poll_fds[0].fd, buf, 1); + if (rd_bytes != 1) + FATAL + ("read from polled fd: could not read 1 byte"); +-- +2.4.0 + diff --git a/testing/speech-dispatcher/APKBUILD b/testing/speech-dispatcher/APKBUILD new file mode 100644 index 0000000000..43b3476160 --- /dev/null +++ b/testing/speech-dispatcher/APKBUILD @@ -0,0 +1,60 @@ +# Contributor: Carlo Landmeter <clandmeter@gmail.com> +# Maintainer: +pkgname=speech-dispatcher +pkgver=0.8.2 +pkgrel=0 +pkgdesc="High-level device independent layer for speech synthesis interface" +url="http://www.freebsoft.org/speechd" +arch="all" +license="GPL2" +depends="" +depends_dev="glib-dev dotconf-dev" +makedepends="$depends_dev intltool libtool" +install="" +subpackages="$pkgname-dev $pkgname-doc $pkgname-lang" +source="http://devel.freebsoft.org/pub/projects/speechd/speech-dispatcher-$pkgver.tar.gz + 0001-Make-some-includes-consistent-with-POSIX.patch + 0001-Provide-fallback-for-systems-without-TEMP_FAILURE_RE.patch" + +_builddir="$srcdir"/speech-dispatcher-$pkgver +prepare() { + local i + cd "$_builddir" + for i in $source; do + case $i in + *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; + esac + done +} + +build() { + cd "$_builddir" + ./configure \ + --build=$CBUILD \ + --host=$CHOST \ + --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + --localstatedir=/var \ + --without-flite \ + --without-pulse \ + || return 1 + make || return 1 +} + +package() { + cd "$_builddir" + make DESTDIR="$pkgdir" install || return 1 + rm -f "$pkgdir"/usr/lib/*.la +} + +md5sums="6beee9a1e4792508bf6d638c750229cc speech-dispatcher-0.8.2.tar.gz +a5982a0f81d8463923f286f15dcb141a 0001-Make-some-includes-consistent-with-POSIX.patch +f8f4bbfcd064a1fb35888f85d34e6984 0001-Provide-fallback-for-systems-without-TEMP_FAILURE_RE.patch" +sha256sums="475c109e70670a02aa8bece9b6358d977f16d4ee6c9fc22cfa043cb2d9ddb55f speech-dispatcher-0.8.2.tar.gz +6a08763dd8d42283fb1cd0341ace5c948a3662e522137098a0043cb59308ebbb 0001-Make-some-includes-consistent-with-POSIX.patch +32d72cb4ba7a72cb7714e8f7226b34e21f3e57765a13c39cece38e966857e0c5 0001-Provide-fallback-for-systems-without-TEMP_FAILURE_RE.patch" +sha512sums="2fd2656055cb266fa0cbec87f025c2bca0ab9bc114c0f894f4cfd9f38d480fe1dab27969a17162de24f278269f8cb24a8b4567e114a27271fefba41615c35977 speech-dispatcher-0.8.2.tar.gz +76ad3f2e56a2e3ff85880da337dfae73b9c247b69a64584fbc045dc5055ef9f24a9f7788dae65b91d084b5a0f5c04336d40e6eaa7420abae58bc6d19f3121a9e 0001-Make-some-includes-consistent-with-POSIX.patch +ee5527670346c14c6453ac7aee320dca8360f963599bd95123ef5828d09d7a5c2907dddfd81b8477c198dcc8b1ca98c01fd9c73cd1b74d74083766904c7ea424 0001-Provide-fallback-for-systems-without-TEMP_FAILURE_RE.patch" |