Gentoo Archives: gentoo-commits

From: Aric Belsito <lluixhi@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/musl:master commit in: app-accessibility/speech-dispatcher/, app-accessibility/speech-dispatcher/files/
Date: Mon, 31 Oct 2016 23:07:50
Message-Id: 1477955205.31b4cc0a1fa2cca18e4fb46028b449333fe4cb86.lluixhi@gentoo
1 commit: 31b4cc0a1fa2cca18e4fb46028b449333fe4cb86
2 Author: Aric Belsito <lluixhi <AT> gmail <DOT> com>
3 AuthorDate: Mon Oct 31 23:06:45 2016 +0000
4 Commit: Aric Belsito <lluixhi <AT> gmail <DOT> com>
5 CommitDate: Mon Oct 31 23:06:45 2016 +0000
6 URL: https://gitweb.gentoo.org/proj/musl.git/commit/?id=31b4cc0a
7
8 app-accessibility/speech-dispatcher: Add stable.
9
10 Apparently @doughdemon made these patches, but I forget where I found them..
11
12 app-accessibility/speech-dispatcher/Manifest | 5 +
13 ...-Make-some-includes-consistent-with-POSIX.patch | 54 ++++++
14 ...lback-for-systems-without-TEMP_FAILURE_RE.patch | 182 +++++++++++++++++++++
15 app-accessibility/speech-dispatcher/metadata.xml | 19 +++
16 .../speech-dispatcher-0.8.1.ebuild | 116 +++++++++++++
17 5 files changed, 376 insertions(+)
18
19 diff --git a/app-accessibility/speech-dispatcher/Manifest b/app-accessibility/speech-dispatcher/Manifest
20 new file mode 100644
21 index 0000000..abe4cce
22 --- /dev/null
23 +++ b/app-accessibility/speech-dispatcher/Manifest
24 @@ -0,0 +1,5 @@
25 +AUX 0001-Make-some-includes-consistent-with-POSIX.patch 1413 SHA256 6a08763dd8d42283fb1cd0341ace5c948a3662e522137098a0043cb59308ebbb SHA512 76ad3f2e56a2e3ff85880da337dfae73b9c247b69a64584fbc045dc5055ef9f24a9f7788dae65b91d084b5a0f5c04336d40e6eaa7420abae58bc6d19f3121a9e WHIRLPOOL 7a751fd5e7fa6051b81fae15db6a60f5d66ba8ef9e03de5b811064ab05fd384596e0c407cd9053771d15cf07596c6daaf7c217bf3d969e7e8e5003eeaf7dd138
26 +AUX 0001-Provide-fallback-for-systems-without-TEMP_FAILURE_RE.patch 5153 SHA256 32d72cb4ba7a72cb7714e8f7226b34e21f3e57765a13c39cece38e966857e0c5 SHA512 ee5527670346c14c6453ac7aee320dca8360f963599bd95123ef5828d09d7a5c2907dddfd81b8477c198dcc8b1ca98c01fd9c73cd1b74d74083766904c7ea424 WHIRLPOOL a75572d10bd1beb6142964708769622a99f70037b00654ce31e895bf8e32d14d184dae22e4876c1927d2463c8f2b48b42b3beb2b3cd2b0234f2a8c9a53a133ca
27 +DIST speech-dispatcher-0.8.1.tar.gz 1309969 SHA256 d25727239bbee4ee7881dd5e23e4da64a184b2ff3c8c9830088a671fb23b7757 SHA512 35f1ae547001a45d7945406ae5672829ff9ab6ac3f0cccb9eb3670dd92888a63c7cc4270ee90b5a166e6788afe3b117b5c3ef62c41a9df9f9af94dc4e0948fe8 WHIRLPOOL 945ef7ab1d771dc1e3727f223cfadfd309db03813f11fe995c0f4caf3a6f24bc9abc18e1f2f342b072bcd5fd0d626dae315f1fd0228d4172e051a2aba1255092
28 +EBUILD speech-dispatcher-0.8.1.ebuild 2857 SHA256 7e0b44cbfcd9cbec8831408f5398c0edd6cff418096ccdcfd9a97f641f2ec487 SHA512 8317653382d1210ebbf45595a24d27665920c9e275c7c0625026973990bce6c3297e982429be8af7eb7e7ddb6785fd844b4ae4c20dac3599a761c4aa7a35a2c0 WHIRLPOOL ff1f61e92e7884a7cd51bc6b1de183290843f338b4b08586d2d45d5180c5f792187cd0f1760a9d1f2abdaf8918a8989eefd52c15dec6e8a868cb88a6a35fafa3
29 +MISC metadata.xml 632 SHA256 4ab0806f2fd7c313c2be2379d2f56ec03df12fa37a266bcd287a3dc5f0c11482 SHA512 db94cba99bd2c9bbfe98b1647ac53a3861cbd697df791bea025e2a713a5991ca6929f2bc82a985ba38eef4a2571515d96aac6558fe143b68e24713490c12dd0a WHIRLPOOL d3b4e5856cd9961bb4f030535f20b55595bf1a8264d228427f99d2b44d7b57892803a887a32f00e51bc77edc8d88f7ae4415dab6ac375c3f8f91a63ad34cfc55
30
31 diff --git a/app-accessibility/speech-dispatcher/files/0001-Make-some-includes-consistent-with-POSIX.patch b/app-accessibility/speech-dispatcher/files/0001-Make-some-includes-consistent-with-POSIX.patch
32 new file mode 100644
33 index 0000000..d7947b7
34 --- /dev/null
35 +++ b/app-accessibility/speech-dispatcher/files/0001-Make-some-includes-consistent-with-POSIX.patch
36 @@ -0,0 +1,54 @@
37 +From f2dda28648de4bd940be54e827878f081af22ebc Mon Sep 17 00:00:00 2001
38 +From: Felix Janda <felix.janda@××××××.de>
39 +Date: Mon, 23 Mar 2015 21:03:29 +0100
40 +Subject: [PATCH] Make some includes consistent with POSIX
41 +
42 +Reviewed-by: Luke Yelavich <themuso@×××××××.com>
43 +---
44 + src/modules/cicero.c | 2 +-
45 + src/modules/spd_audio.c | 2 +-
46 + src/server/module.c | 2 +-
47 + 3 files changed, 3 insertions(+), 3 deletions(-)
48 +
49 +diff --git a/src/modules/cicero.c b/src/modules/cicero.c
50 +index 62332a5..2c69b7e 100644
51 +--- a/src/modules/cicero.c
52 ++++ b/src/modules/cicero.c
53 +@@ -28,7 +28,7 @@
54 + #include <speechd_types.h>
55 + #include <safe_io.h>
56 + #include <errno.h>
57 +-#include <sys/poll.h>
58 ++#include <poll.h>
59 + #include <fcntl.h>
60 + #include <langinfo.h>
61 + #include <sys/stat.h>
62 +diff --git a/src/modules/spd_audio.c b/src/modules/spd_audio.c
63 +index 3b65bf7..c85e21d 100644
64 +--- a/src/modules/spd_audio.c
65 ++++ b/src/modules/spd_audio.c
66 +@@ -38,7 +38,7 @@
67 +
68 + #include <stdio.h>
69 + #include <string.h>
70 +-#include <sys/fcntl.h>
71 ++#include <fcntl.h>
72 + #include <sys/ioctl.h>
73 + #include <sys/time.h>
74 + #include <time.h>
75 +diff --git a/src/server/module.c b/src/server/module.c
76 +index 0681caf..51746a0 100644
77 +--- a/src/server/module.c
78 ++++ b/src/server/module.c
79 +@@ -29,7 +29,7 @@
80 + #include <sys/types.h>
81 + #include <sys/wait.h>
82 + #include <sys/stat.h>
83 +-#include <sys/unistd.h>
84 ++#include <unistd.h>
85 + #include <stdio.h>
86 + #include <dirent.h>
87 + #include <glib.h>
88 +--
89 +2.4.0
90 +
91
92 diff --git a/app-accessibility/speech-dispatcher/files/0001-Provide-fallback-for-systems-without-TEMP_FAILURE_RE.patch b/app-accessibility/speech-dispatcher/files/0001-Provide-fallback-for-systems-without-TEMP_FAILURE_RE.patch
93 new file mode 100644
94 index 0000000..c469902
95 --- /dev/null
96 +++ b/app-accessibility/speech-dispatcher/files/0001-Provide-fallback-for-systems-without-TEMP_FAILURE_RE.patch
97 @@ -0,0 +1,182 @@
98 +From 98504410b7f77cad7457bfdfcd593e2898c3b461 Mon Sep 17 00:00:00 2001
99 +From: Felix Janda <felix.janda@××××××.de>
100 +Date: Mon, 23 Mar 2015 21:03:12 +0100
101 +Subject: [PATCH] Provide fallback for systems without TEMP_FAILURE_RETRY
102 +
103 +Reviewed-by: Luke Yelavich <themuso@×××××××.com>
104 +---
105 + include/safe_io.h | 55 ++++++++++++++++++++++++++++++++++++++++++++++
106 + src/modules/cicero.c | 6 ++---
107 + src/server/output.c | 18 +--------------
108 + src/server/sem_functions.c | 5 +++--
109 + src/server/speaking.c | 5 ++---
110 + 5 files changed, 63 insertions(+), 26 deletions(-)
111 + create mode 100644 include/safe_io.h
112 +
113 +diff --git a/include/safe_io.h b/include/safe_io.h
114 +new file mode 100644
115 +index 0000000..37cfe7f
116 +--- /dev/null
117 ++++ b/include/safe_io.h
118 +@@ -0,0 +1,55 @@
119 ++/*
120 ++ * safe_io.h - Wrapper around read and write
121 ++ *
122 ++ * Copyright (C) 2001, 2002, 2003, 2007 Brailcom, o.p.s.
123 ++ *
124 ++ * This is free software; you can redistribute it and/or modify it
125 ++ * under the terms of the GNU General Public License as published by
126 ++ * the Free Software Foundation; either version 2, or (at your option)
127 ++ * any later version.
128 ++ *
129 ++ * This software is distributed in the hope that it will be useful,
130 ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
131 ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
132 ++ * General Public License for more details.
133 ++ *
134 ++ * You should have received a copy of the GNU General Public License
135 ++ * along with this package; see the file COPYING. If not, write to
136 ++ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
137 ++ * Boston, MA 02110-1301, USA.
138 ++ *
139 ++ */
140 ++
141 ++#ifdef HAVE_CONFIG_H
142 ++#include <config.h>
143 ++#endif
144 ++
145 ++#include <unistd.h>
146 ++#include <errno.h>
147 ++
148 ++#ifdef TEMP_FAILURE_RETRY /* GNU libc */
149 ++#define safe_read(fd, buf, count) TEMP_FAILURE_RETRY(read(fd, buf, count))
150 ++#define safe_write(fd, buf, count) TEMP_FAILURE_RETRY(write(fd, buf, count))
151 ++#else /* TEMP_FAILURE_RETRY */
152 ++#ifdef HAVE_UNISTD_H
153 ++#include <unistd.h>
154 ++#endif
155 ++static inline ssize_t
156 ++safe_read(int fd, void *buf, size_t count) {
157 ++ do {
158 ++ ssize_t w = read(fd, buf, count);
159 ++
160 ++ if (w == -1 && errno == EINTR) continue;
161 ++ return w;
162 ++ } while (1);
163 ++}
164 ++static inline ssize_t
165 ++safe_write(int fd, const void *buf, size_t count) {
166 ++ do {
167 ++ ssize_t w = write(fd, buf, count);
168 ++
169 ++ if (w == -1 && errno == EINTR) continue;
170 ++ return w;
171 ++ } while (1);
172 ++}
173 ++#endif /* TEMP_FAILURE_RETRY */
174 +diff --git a/src/modules/cicero.c b/src/modules/cicero.c
175 +index 237796e..62332a5 100644
176 +--- a/src/modules/cicero.c
177 ++++ b/src/modules/cicero.c
178 +@@ -26,6 +26,7 @@
179 + #endif
180 +
181 + #include <speechd_types.h>
182 ++#include <safe_io.h>
183 + #include <errno.h>
184 + #include <sys/poll.h>
185 + #include <fcntl.h>
186 +@@ -376,10 +377,7 @@ void *_cicero_speak(void *nothing)
187 + cicero_speaking = 0;
188 + break;
189 + }
190 +- if (ret > 0)
191 +- TEMP_FAILURE_RETRY(read
192 +- (fd1[0], b,
193 +- 2));
194 ++ if (ret > 0) safe_read(fd1[0], b, 2);
195 + if (cicero_stop) {
196 + cicero_speaking = 0;
197 + module_report_event_stop();
198 +diff --git a/src/server/output.c b/src/server/output.c
199 +index 40b7e8c..ef98a45 100644
200 +--- a/src/server/output.c
201 ++++ b/src/server/output.c
202 +@@ -26,27 +26,11 @@
203 + #endif
204 +
205 + #include <fdsetconv.h>
206 ++#include <safe_io.h>
207 + #include <spd_utils.h>
208 + #include "output.h"
209 + #include "parse.h"
210 +
211 +-#ifdef TEMP_FAILURE_RETRY /* GNU libc */
212 +-#define safe_write(fd, buf, count) TEMP_FAILURE_RETRY(write(fd, buf, count))
213 +-#else /* TEMP_FAILURE_RETRY */
214 +-#ifdef HAVE_UNISTD_H
215 +-#include <unistd.h>
216 +-#endif
217 +-static inline ssize_t
218 +-safe_write(int fd, const void *buf, size_t count) {
219 +- do {
220 +- ssize_t w = write(fd, buf, count);
221 +-
222 +- if (w == -1 && errno == EINTR) continue;
223 +- return w;
224 +- } while (1);
225 +-}
226 +-#endif /* TEMP_FAILURE_RETRY */
227 +-
228 + #if !(defined(__GLIBC__) && defined(_GNU_SOURCE))
229 + /* Added by Willie Walker - strndup is a gcc-ism
230 + */
231 +diff --git a/src/server/sem_functions.c b/src/server/sem_functions.c
232 +index 0a86f56..430e74c 100644
233 +--- a/src/server/sem_functions.c
234 ++++ b/src/server/sem_functions.c
235 +@@ -26,6 +26,8 @@
236 + #include <config.h>
237 + #endif
238 +
239 ++#include <safe_io.h>
240 ++
241 + #include "speechd.h"
242 + #include "sem_functions.h"
243 +
244 +@@ -33,8 +35,7 @@ void speaking_semaphore_post(void)
245 + {
246 + char buf[1];
247 + buf[0] = 42;
248 +- const ssize_t wr_bytes =
249 +- TEMP_FAILURE_RETRY(write(speaking_pipe[1], buf, 1));
250 ++ const ssize_t wr_bytes = safe_write(speaking_pipe[1], buf, 1);
251 + if (wr_bytes != 1)
252 + FATAL("write to polled fd: could not write 1 byte");
253 + }
254 +diff --git a/src/server/speaking.c b/src/server/speaking.c
255 +index bd27008..f2dc289 100644
256 +--- a/src/server/speaking.c
257 ++++ b/src/server/speaking.c
258 +@@ -29,6 +29,7 @@
259 + #include <glib.h>
260 + #include <poll.h>
261 + #include <unistd.h>
262 ++#include <safe_io.h>
263 + #include "speechd.h"
264 + #include "server.h"
265 + #include "index_marking.h"
266 +@@ -88,9 +89,7 @@ void *speak(void *data)
267 + MSG(5,
268 + "wait_for_poll: activity in Speech Dispatcher");
269 + const ssize_t rd_bytes =
270 +- TEMP_FAILURE_RETRY(read
271 +- (poll_fds[0].fd, buf,
272 +- 1));
273 ++ safe_read(poll_fds[0].fd, buf, 1);
274 + if (rd_bytes != 1)
275 + FATAL
276 + ("read from polled fd: could not read 1 byte");
277 +--
278 +2.4.0
279 +
280
281 diff --git a/app-accessibility/speech-dispatcher/metadata.xml b/app-accessibility/speech-dispatcher/metadata.xml
282 new file mode 100644
283 index 0000000..3b8394d
284 --- /dev/null
285 +++ b/app-accessibility/speech-dispatcher/metadata.xml
286 @@ -0,0 +1,19 @@
287 +<?xml version="1.0" encoding="UTF-8"?>
288 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
289 +<pkgmetadata>
290 + <maintainer type="person">
291 + <email>williamh@g.o</email>
292 + </maintainer>
293 + <maintainer type="project">
294 + <email>accessibility@g.o</email>
295 + <name>Gentoo Accessibility Project</name>
296 + </maintainer>
297 + <maintainer type="project">
298 + <email>sound@g.o</email>
299 + <name>Gentoo Sound project</name>
300 + </maintainer>
301 + <use>
302 + <flag name="espeak">Adds support for espeak speech engine</flag>
303 + <flag name="flite">Adds support for flite speech engine</flag>
304 + </use>
305 +</pkgmetadata>
306
307 diff --git a/app-accessibility/speech-dispatcher/speech-dispatcher-0.8.1.ebuild b/app-accessibility/speech-dispatcher/speech-dispatcher-0.8.1.ebuild
308 new file mode 100644
309 index 0000000..f7d0b8e
310 --- /dev/null
311 +++ b/app-accessibility/speech-dispatcher/speech-dispatcher-0.8.1.ebuild
312 @@ -0,0 +1,116 @@
313 +# Copyright 1999-2015 Gentoo Foundation
314 +# Distributed under the terms of the GNU General Public License v2
315 +# $Id$
316 +
317 +EAPI=5
318 +
319 +PYTHON_COMPAT=( python3_3 python3_4 python3_5 )
320 +PYTHON_REQ_USE="threads(+)"
321 +
322 +inherit eutils python-r1
323 +
324 +DESCRIPTION="Speech synthesis interface"
325 +HOMEPAGE="http://www.freebsoft.org/speechd"
326 +SRC_URI="http://www.freebsoft.org/pub/projects/speechd/${P}.tar.gz"
327 +
328 +LICENSE="GPL-2"
329 +SLOT="0"
330 +KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ppc ppc64 sparc x86 ~amd64-linux ~x86-linux"
331 +IUSE="alsa ao +espeak flite nas pulseaudio python static-libs"
332 +
333 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
334 +
335 +COMMON_DEPEND="python? ( ${PYTHON_DEPS} )
336 + >=dev-libs/dotconf-1.3
337 + >=dev-libs/glib-2.28:2
338 + >=media-libs/libsndfile-1.0.2
339 + alsa? ( media-libs/alsa-lib )
340 + ao? ( media-libs/libao )
341 + espeak? ( app-accessibility/espeak )
342 + flite? ( app-accessibility/flite )
343 + nas? ( media-libs/nas )
344 + pulseaudio? ( media-sound/pulseaudio )"
345 +DEPEND="${COMMON_DEPEND}
346 + >=dev-util/intltool-0.40.0
347 + virtual/pkgconfig"
348 + RDEPEND="${COMMON_DEPEND}
349 + dev-python/pyxdg"
350 +
351 +src_prepare() {
352 + # Fix for MUSL
353 + epatch "${FILESDIR}"/0001-Make-some-includes-consistent-with-POSIX.patch
354 + epatch "${FILESDIR}"/0001-Provide-fallback-for-systems-without-TEMP_FAILURE_RE.patch
355 +}
356 +
357 +src_configure() {
358 + local myeconfargs=(
359 + --disable-python
360 + $(use_enable static-libs static)
361 + $(use_with alsa)
362 + $(use_with ao libao)
363 + $(use_with espeak)
364 + $(use_with flite)
365 + $(use_with pulseaudio pulse)
366 + $(use_with nas)
367 + )
368 + econf ${myeconfargs[@]}
369 +}
370 +
371 +src_compile() {
372 + use python && python_copy_sources
373 +
374 + emake
375 +
376 + if use python; then
377 + building() {
378 + cd src/api/python || die
379 + emake \
380 + pyexecdir="$(python_get_sitedir)" \
381 + pythondir="$(python_get_sitedir)"
382 + }
383 + python_foreach_impl run_in_build_dir building
384 + fi
385 +}
386 +
387 +src_install() {
388 + emake DESTDIR="${D}" install
389 + dodoc ANNOUNCE AUTHORS BUGS ChangeLog FAQ NEWS README*
390 +
391 + prune_libtool_files --all
392 +
393 + if use python; then
394 + installation() {
395 + cd src/api/python || die
396 + emake \
397 + DESTDIR="${D}" \
398 + pyexecdir="$(python_get_sitedir)" \
399 + pythondir="$(python_get_sitedir)" \
400 + install
401 + }
402 + python_foreach_impl run_in_build_dir installation
403 + python_replicate_script "${ED}"/usr/bin/spd-conf
404 + fi
405 +}
406 +
407 +pkg_postinst() {
408 + local editconfig="n"
409 + if ! use espeak; then
410 + ewarn "You have disabled espeak, which is speech-dispatcher's"
411 + ewarn "default speech synthesizer."
412 + ewarn
413 + editconfig="y"
414 + fi
415 + if ! use pulseaudio; then
416 + ewarn "You have disabled pulseaudio support."
417 + ewarn "pulseaudio is speech-dispatcher's default audio subsystem."
418 + ewarn
419 + editconfig="y"
420 + fi
421 + if [[ "${editconfig}" == "y" ]]; then
422 + ewarn "You must edit ${EROOT}etc/speech-dispatcher/speechd.conf"
423 + ewarn "and make sure the settings there match your system."
424 + ewarn
425 + fi
426 + elog "For festival support, you need to"
427 + elog "install app-accessibility/festival-freebsoft-utils."
428 +}