Gentoo Archives: gentoo-commits

From: David Seifert <soap@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-sound/cvoicecontrol/files/, media-sound/cvoicecontrol/
Date: Sat, 08 Aug 2020 16:55:48
Message-Id: 1596905622.61e8a007fd7e45537965ba515faca3611806bb94.soap@gentoo
1 commit: 61e8a007fd7e45537965ba515faca3611806bb94
2 Author: David Seifert <soap <AT> gentoo <DOT> org>
3 AuthorDate: Sat Aug 8 16:53:42 2020 +0000
4 Commit: David Seifert <soap <AT> gentoo <DOT> org>
5 CommitDate: Sat Aug 8 16:53:42 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=61e8a007
7
8 media-sound/cvoicecontrol: Fix building under -fno-common
9
10 Closes: https://bugs.gentoo.org/706970
11 Package-Manager: Portage-3.0.1, Repoman-2.3.23
12 Signed-off-by: David Seifert <soap <AT> gentoo.org>
13
14 .../cvoicecontrol-0.9_alpha-r1.ebuild | 19 +--
15 .../files/cvoicecontrol-0.9_alpha-automake.patch | 33 ++++
16 .../files/cvoicecontrol-0.9_alpha-gentoo-2.patch | 180 +++++++++++++++++++--
17 3 files changed, 210 insertions(+), 22 deletions(-)
18
19 diff --git a/media-sound/cvoicecontrol/cvoicecontrol-0.9_alpha-r1.ebuild b/media-sound/cvoicecontrol/cvoicecontrol-0.9_alpha-r1.ebuild
20 index 0b0363c94bc..a1d1238c92c 100644
21 --- a/media-sound/cvoicecontrol/cvoicecontrol-0.9_alpha-r1.ebuild
22 +++ b/media-sound/cvoicecontrol/cvoicecontrol-0.9_alpha-r1.ebuild
23 @@ -14,27 +14,20 @@ SRC_URI="http://www.kiecza.net/daniel/linux/${MY_P}.tar.bz2"
24 LICENSE="GPL-2"
25 SLOT="0"
26 KEYWORDS="amd64 ppc sparc x86"
27 -IUSE=""
28
29 S="${WORKDIR}/${MY_P}"
30
31 PATCHES=(
32 - "${FILESDIR}/${P}-gentoo-2.patch"
33 - "${FILESDIR}/${P}-tinfo.patch" #647166
34 + "${FILESDIR}"/${P}-gentoo-2.patch
35 + "${FILESDIR}"/${P}-tinfo.patch #64716
36 + # Handle documentation with HTML_DOCS instead
37 + "${FILESDIR}"/${P}-automake.patch
38 )
39
40 src_prepare() {
41 default
42 - # Handle documentation with dohtml instead.
43 - sed \
44 - -e "s:SUBDIRS = docs:#SUBDIRS = docs:" \
45 - -i cvoicecontrol/Makefile.am || die
46 -
47 - eautoreconf #647166
48 -
49 - sed \
50 - -e "s/install-data-am: install-data-local/install-data-am:/" \
51 - -i Makefile.in || die
52 + mv configure.{in,ac} || die
53 + eautoreconf
54 }
55
56 src_install() {
57
58 diff --git a/media-sound/cvoicecontrol/files/cvoicecontrol-0.9_alpha-automake.patch b/media-sound/cvoicecontrol/files/cvoicecontrol-0.9_alpha-automake.patch
59 new file mode 100644
60 index 00000000000..e2d73cbc984
61 --- /dev/null
62 +++ b/media-sound/cvoicecontrol/files/cvoicecontrol-0.9_alpha-automake.patch
63 @@ -0,0 +1,33 @@
64 +--- a/cvoicecontrol/Makefile.am
65 ++++ b/cvoicecontrol/Makefile.am
66 +@@ -11,7 +11,7 @@
67 + model_editor_SOURCES = audio.c configuration.c keypressed.c mixer.c model.c ncurses_tools.c preprocess.c realfftf.c model_editor.c
68 + model_editor_LDADD = -lm ${LIBNCURSES}
69 +
70 +-SUBDIRS = docs
71 ++#SUBDIRS = docs
72 +
73 + EXTRA_DIST = audio.c audio.h bb_queue.c bb_queue.h configuration.c configuration.h keypressed.c keypressed.h microphone_config.c microphone_config.h mixer.c mixer.h model.c model.h model_editor.c model_editor.h ncurses_tools.c ncurses_tools.h preprocess.c preprocess.h queue.h realfftf.c realfftf.h score.c score.h semaphore.c semaphore.h cvoicecontrol.c cvoicecontrol.h
74 +
75 +--- a/Makefile.am
76 ++++ b/Makefile.am
77 +@@ -8,19 +8,3 @@
78 +
79 + ####### kdevelop will overwrite this part!!! (end)############
80 + AUTOMAKE_OPTIONS = foreign
81 +-
82 +-install-data-local:
83 +- $(mkinstalldirs) $(prefix)/share/doc/cvoicecontrol
84 +- $(INSTALL_DATA) AUTHORS $(prefix)/share/doc/cvoicecontrol/AUTHORS
85 +- $(INSTALL_DATA) FAQ $(prefix)/share/doc/cvoicecontrol/FAQ
86 +- $(INSTALL_DATA) BUGS $(prefix)/share/doc/cvoicecontrol/BUGS
87 +- $(INSTALL_DATA) README $(prefix)/share/doc/cvoicecontrol/README
88 +- $(INSTALL_DATA) COPYING $(prefix)/share/doc/cvoicecontrol/COPYING
89 +-
90 +-uninstall-local:
91 +- -rm -f $(prefix)/share/doc/cvoicecontrol/AUTHORS
92 +- -rm -f $(prefix)/share/doc/cvoicecontrol/FAQ
93 +- -rm -f $(prefix)/share/doc/cvoicecontrol/BUGS
94 +- -rm -f $(prefix)/share/doc/cvoicecontrol/README
95 +- -rm -f $(prefix)/share/doc/cvoicecontrol/COPYING
96 +- rmdir $(prefix)/share/doc/cvoicecontrol
97
98 diff --git a/media-sound/cvoicecontrol/files/cvoicecontrol-0.9_alpha-gentoo-2.patch b/media-sound/cvoicecontrol/files/cvoicecontrol-0.9_alpha-gentoo-2.patch
99 index 7e1ae985b18..2316e92ba96 100644
100 --- a/media-sound/cvoicecontrol/files/cvoicecontrol-0.9_alpha-gentoo-2.patch
101 +++ b/media-sound/cvoicecontrol/files/cvoicecontrol-0.9_alpha-gentoo-2.patch
102 @@ -1,6 +1,40 @@
103 -diff -ur cvoicecontrol-0.9alpha.orig/cvoicecontrol/cvoicecontrol.c cvoicecontrol-0.9alpha/cvoicecontrol/cvoicecontrol.c
104 ---- cvoicecontrol-0.9alpha.orig/cvoicecontrol/cvoicecontrol.c 2002-09-05 19:09:06.000000000 +0300
105 -+++ cvoicecontrol-0.9alpha/cvoicecontrol/cvoicecontrol.c 2007-07-29 23:35:33.000000000 +0300
106 +--- a/cvoicecontrol/audio.c
107 ++++ b/cvoicecontrol/audio.c
108 +@@ -32,6 +32,10 @@
109 +
110 + int is_open = 0;
111 +
112 ++int fd_audio;
113 ++char *dev_audio;
114 ++signed short rec_level, stop_level, silence_level;
115 ++
116 + /********************************************************************************
117 + * set name of audio device
118 + ********************************************************************************/
119 +--- a/cvoicecontrol/audio.h
120 ++++ b/cvoicecontrol/audio.h
121 +@@ -31,8 +31,8 @@
122 + #define CONSECUTIVE_SPEECH_BLOCKS_THRESHOLD 3
123 + #define CONSECUTIVE_NONSPEECH_BLOCKS_THRESHOLD 5
124 +
125 +-int fd_audio;
126 +-char *dev_audio;
127 ++extern int fd_audio;
128 ++extern char *dev_audio;
129 +
130 + /********************************************************************************
131 + * For now, microphone input level is used to start and stop recording
132 +@@ -43,7 +43,7 @@
133 + * silence_level average micro level of silence
134 + ********************************************************************************/
135 +
136 +-signed short rec_level, stop_level, silence_level;
137 ++extern signed short rec_level, stop_level, silence_level;
138 +
139 + typedef struct
140 + {
141 +--- a/cvoicecontrol/cvoicecontrol.c
142 ++++ b/cvoicecontrol/cvoicecontrol.c
143 @@ -38,6 +38,8 @@
144 #include<sys/select.h>
145 #endif
146 @@ -10,9 +44,62 @@ diff -ur cvoicecontrol-0.9alpha.orig/cvoicecontrol/cvoicecontrol.c cvoicecontrol
147 #include "cvoicecontrol.h"
148
149 #include "model.h"
150 -diff -ur cvoicecontrol-0.9alpha.orig/cvoicecontrol/microphone_config.c cvoicecontrol-0.9alpha/cvoicecontrol/microphone_config.c
151 ---- cvoicecontrol-0.9alpha.orig/cvoicecontrol/microphone_config.c 2000-02-19 14:08:47.000000000 +0200
152 -+++ cvoicecontrol-0.9alpha/cvoicecontrol/microphone_config.c 2007-07-29 23:36:08.000000000 +0300
153 +@@ -53,6 +55,10 @@
154 + #include "mixer.h"
155 + #include "preprocess.h"
156 +
157 ++int adjust_window_width;
158 ++int sloppy_corner;
159 ++float float_max;
160 ++
161 + Model *model; /***** speaker model */
162 +
163 + Queue queue1; /***** thread-safe queue used to hand data from 'recording' to 'preprocessing' */
164 +@@ -341,7 +347,7 @@
165 + * calculate euklidian distance of two feature vectors
166 + ********************************************************************************/
167 +
168 +-inline float euklid_distance(float *a, float *b)
169 ++float euklid_distance(float *a, float *b)
170 + {
171 + float result = 0; /***** resulting distance */
172 + int i;
173 +--- a/cvoicecontrol/cvoicecontrol.h
174 ++++ b/cvoicecontrol/cvoicecontrol.h
175 +@@ -66,7 +66,7 @@
176 + *
177 + * Legend: w = adjust_window_width
178 + */
179 +-int adjust_window_width;
180 ++extern int adjust_window_width;
181 +
182 + /*
183 + * strictly speaking, time-alignment in the DTW matrix starts
184 +@@ -87,19 +87,19 @@
185 + *
186 + * Legend: x = distance value, o = (infinity)
187 + */
188 +-int sloppy_corner;
189 ++extern int sloppy_corner;
190 +
191 + /*****
192 + time alignment scores must stay below this value
193 + otherwise the according samples are ignored in
194 + the further evaluation process
195 + *****/
196 +-float score_threshold;
197 ++extern float score_threshold;
198 +
199 + /*****
200 + a (very high) float value that is considered "infinity"
201 + *****/
202 +-float float_max;
203 ++extern float float_max;
204 +
205 + /***** these macros are used in the DTW warping function
206 + to calculate the maximum/minimum of two or three
207 +--- a/cvoicecontrol/microphone_config.c
208 ++++ b/cvoicecontrol/microphone_config.c
209 @@ -1099,8 +1099,6 @@
210 free(command);
211 }
212 @@ -22,9 +109,84 @@ diff -ur cvoicecontrol-0.9alpha.orig/cvoicecontrol/microphone_config.c cvoicecon
213 }
214 else /***** couldn't retrieve home directory -> store results in /tmp/ */
215 {
216 -diff -ur cvoicecontrol-0.9alpha.orig/cvoicecontrol/semaphore.c cvoicecontrol-0.9alpha/cvoicecontrol/semaphore.c
217 ---- cvoicecontrol-0.9alpha.orig/cvoicecontrol/semaphore.c 2000-02-12 18:05:24.000000000 +0200
218 -+++ cvoicecontrol-0.9alpha/cvoicecontrol/semaphore.c 2007-07-29 23:34:38.000000000 +0300
219 +--- a/cvoicecontrol/mixer.c
220 ++++ b/cvoicecontrol/mixer.c
221 +@@ -30,6 +30,9 @@
222 +
223 + char *dev_mixer = NULL;
224 +
225 ++int mic_level;
226 ++int igain_level;
227 ++
228 + /********************************************************************************
229 + * set mixer device name
230 + ********************************************************************************/
231 +--- a/cvoicecontrol/mixer.h
232 ++++ b/cvoicecontrol/mixer.h
233 +@@ -37,7 +37,7 @@
234 + #define MIXER_ERR -1
235 + #define MIXER_OK 1
236 +
237 +-int mic_level;
238 +-int igain_level;
239 ++extern int mic_level;
240 ++extern int igain_level;
241 +
242 + #endif
243 +--- a/cvoicecontrol/preprocess.c
244 ++++ b/cvoicecontrol/preprocess.c
245 +@@ -23,6 +23,13 @@
246 +
247 + int i,j; /***** counter variables */
248 +
249 ++int filter_banks[17];
250 ++float power_spec[POWER_SPEC_SIZE];
251 ++float hamming_window[HAMMING_SIZE];
252 ++int do_mean_sub;
253 ++float channel_mean[FEAT_VEC_SIZE];
254 ++float score_threshold;
255 ++
256 + /********************************************************************************
257 + * initialize preprocessing s tuff
258 + ********************************************************************************/
259 +--- a/cvoicecontrol/preprocess.h
260 ++++ b/cvoicecontrol/preprocess.h
261 +@@ -51,12 +51,12 @@
262 + /*****
263 + used for reduction of short-time spectrum to mel scale coefficients
264 + *****/
265 +-int filter_banks[17];
266 ++extern int filter_banks[17];
267 +
268 + /*****
269 + contains the power spectrum
270 + *****/
271 +-float power_spec[POWER_SPEC_SIZE];
272 ++extern float power_spec[POWER_SPEC_SIZE];
273 +
274 + /********************************************************************************
275 + * Hamming window width = 16ms ! (256 Frames)
276 +@@ -68,15 +68,15 @@
277 + * to reduce the number of artefacts in the power spectrum
278 + ********************************************************************************/
279 +
280 +-float hamming_window[HAMMING_SIZE];
281 ++extern float hamming_window[HAMMING_SIZE];
282 +
283 + /*****
284 + The characteristics of the recording channel
285 + This is substracted from each feature vector to reduce
286 + channel effects
287 + *****/
288 +-int do_mean_sub;
289 +-float channel_mean[FEAT_VEC_SIZE];
290 ++extern int do_mean_sub;
291 ++extern float channel_mean[FEAT_VEC_SIZE];
292 +
293 +
294 + int initPreprocess();
295 +--- a/cvoicecontrol/semaphore.c
296 ++++ b/cvoicecontrol/semaphore.c
297 @@ -26,6 +26,7 @@
298 ****************************************************************************/