Gentoo Archives: gentoo-commits

From: Alfredo Tupone <tupone@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-tcltk/snack/files/, dev-tcltk/snack/
Date: Sun, 02 Dec 2018 21:05:53
Message-Id: 1543784734.d2e5f66588d1af0d0c6624bfb724cb8551268523.tupone@gentoo
1 commit: d2e5f66588d1af0d0c6624bfb724cb8551268523
2 Author: Tupone Alfredo <tupone <AT> gentoo <DOT> org>
3 AuthorDate: Sun Dec 2 21:05:34 2018 +0000
4 Commit: Alfredo Tupone <tupone <AT> gentoo <DOT> org>
5 CommitDate: Sun Dec 2 21:05:34 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d2e5f665
7
8 dev-tcltk/snack: Stabilize and fix tests
9
10 Signed-off-by: Alfredo Tupone <tupone <AT> gentoo.org>
11 Package-Manager: Portage-2.3.51, Repoman-2.3.11
12
13 .../snack/files/snack-2.2.10-debian-args.patch | 154 +++++++++++++++++++++
14 dev-tcltk/snack/files/snack-2.2.10-test.patch | 22 +++
15 dev-tcltk/snack/snack-2.2.10-r8.ebuild | 100 +++++++++++++
16 3 files changed, 276 insertions(+)
17
18 diff --git a/dev-tcltk/snack/files/snack-2.2.10-debian-args.patch b/dev-tcltk/snack/files/snack-2.2.10-debian-args.patch
19 new file mode 100644
20 index 00000000000..1f306d61266
21 --- /dev/null
22 +++ b/dev-tcltk/snack/files/snack-2.2.10-debian-args.patch
23 @@ -0,0 +1,154 @@
24 +Patch by Sergei Golovan fixes several cases of access beyond array boundaries.
25 +
26 +--- a/generic/jkFilterIIR.c
27 ++++ b/generic/jkFilterIIR.c
28 +@@ -125,6 +125,12 @@
29 + return TCL_ERROR;
30 + }
31 +
32 ++ if (arg + 1 == objc) {
33 ++ Tcl_AppendResult(interp, "No argument given for ",
34 ++ optionStrings[index], " option", (char *) NULL);
35 ++ return TCL_ERROR;
36 ++ }
37 ++
38 + switch ((enum options) index) {
39 + /* size of triangular dithering on output */
40 + case DITHER:
41 +--- a/generic/jkPitchCmd.c
42 ++++ b/generic/jkPitchCmd.c
43 +@@ -850,7 +850,7 @@
44 +
45 + for (arg = 2; arg < objc; arg += 2) {
46 + char *opt = Tcl_GetStringFromObj(objv[arg], NULL);
47 +- char *val = Tcl_GetStringFromObj(objv[arg+1], NULL);
48 ++ char *val = (arg + 1 == objc) ? "" : Tcl_GetStringFromObj(objv[arg+1], NULL);
49 +
50 + if ((strcmp("-method", opt) == 0) && (strcasecmp("esps", val) == 0)) {
51 + Get_f0(s, interp, objc, objv);
52 +--- a/generic/jkSoundEdit.c
53 ++++ b/generic/jkSoundEdit.c
54 +@@ -291,6 +291,12 @@
55 + string = Tcl_GetStringFromObj(objv[arg], &len);
56 +
57 + if (strncmp(string, "-units", len) == 0) {
58 ++ if (arg + 1 == objc) {
59 ++ Tcl_AppendResult(interp, "No argument given for ",
60 ++ string, " option", (char *) NULL);
61 ++ return TCL_ERROR;
62 ++ }
63 ++
64 + string = Tcl_GetStringFromObj(objv[arg+1], &len);
65 + if (strncasecmp(string, "seconds", len) == 0) type = 1;
66 + if (strncasecmp(string, "samples", len) == 0) type = 0;
67 +@@ -1152,6 +1158,12 @@
68 + return TCL_ERROR;
69 + }
70 +
71 ++ if (arg + 1 == objc) {
72 ++ Tcl_AppendResult(interp, "No argument given for ",
73 ++ subOptionStrings[index], " option", (char *) NULL);
74 ++ return TCL_ERROR;
75 ++ }
76 ++
77 + switch ((enum subOptions) index) {
78 + case RATE:
79 + case FREQUENCY:
80 +--- a/generic/shape.c
81 ++++ b/generic/shape.c
82 +@@ -103,6 +103,12 @@
83 + "option", 0, &index) != TCL_OK) {
84 + return TCL_ERROR;
85 + }
86 ++ if (arg + 1 == objc) {
87 ++ Tcl_AppendResult(interp, "No argument given for ",
88 ++ subOptionStrings[index], " option", (char *) NULL);
89 ++ return TCL_ERROR;
90 ++ }
91 ++
92 + switch ((enum subOptions) index) {
93 + case START:
94 + {
95 +@@ -155,6 +161,12 @@
96 + "option", 0, &index) != TCL_OK) {
97 + return TCL_ERROR;
98 + }
99 ++ if (arg + 1 == objc) {
100 ++ Tcl_AppendResult(interp, "No argument given for ",
101 ++ subOptionStrings[index], " option", (char *) NULL);
102 ++ return TCL_ERROR;
103 ++ }
104 ++
105 + switch ((enum subOptions) index) {
106 + case START:
107 + {
108 +@@ -384,6 +396,12 @@
109 + "option", 0, &index) != TCL_OK) {
110 + return TCL_ERROR;
111 + }
112 ++ if (arg + 1 == objc) {
113 ++ Tcl_AppendResult(interp, "No argument given for ",
114 ++ subOptionStrings[index], " option", (char *) NULL);
115 ++ return TCL_ERROR;
116 ++ }
117 ++
118 + switch ((enum subOptions) index) {
119 + case START:
120 + {
121 +--- /dev/null
122 ++++ b/tests/zargs.test
123 +@@ -0,0 +1,54 @@
124 ++# Tests cover lack of command arguments
125 ++
126 ++package require -exact snack 2.2
127 ++
128 ++if {[lsearch [namespace children] ::tcltest] == -1} {
129 ++ package require tcltest
130 ++ namespace import ::tcltest::*
131 ++}
132 ++
133 ++test zargs-1.1 {pitch command, with missing argument for -start option} {
134 ++ set s [snack::sound snd -load ex1.wav]
135 ++ catch {$s pitch -start} msg
136 ++ $s destroy
137 ++ set msg
138 ++} {No argument given for -start option}
139 ++
140 ++test zargs-1.2 {length command, with missing argument for -units option} {
141 ++ set s [snack::sound snd -load ex1.wav]
142 ++ catch {$s length 10 10 -units} msg
143 ++ $s destroy
144 ++ set msg
145 ++} {No argument given for -units option}
146 ++
147 ++test zargs-1.3 {convert command, with missing argument for -rate option} {
148 ++ set s [snack::sound snd -load ex1.wav]
149 ++ catch {$s convert -rate 1 -rate} msg
150 ++ $s destroy
151 ++ set msg
152 ++} {No argument given for -rate option}
153 ++
154 ++test zargs-1.4 {iir filter, with missing argument for -denominator option} {
155 ++ set s [snack::sound snd -load ex1.wav]
156 ++ catch {snack::filter iir -denominator} msg
157 ++ $s destroy
158 ++ set msg
159 ++} {No argument given for -denominator option}
160 ++
161 ++test zargs-1.5 {shape command, with missing argument for -start option} {
162 ++ set s [snack::sound snd -load ex1.wav]
163 ++ catch {$s shape -start 0 -start} msg
164 ++ $s destroy
165 ++ set msg
166 ++} {No argument given for -start option}
167 ++
168 ++test zargs-1.6 {datasamples command, with missing argument for -start option} {
169 ++ set s [snack::sound snd -load ex1.wav]
170 ++ catch {$s datasamples -start 0 -start} msg
171 ++ $s destroy
172 ++ set msg
173 ++} {No argument given for -start option}
174 ++
175 ++# cleanup
176 ++::tcltest::cleanupTests
177 ++return
178
179 diff --git a/dev-tcltk/snack/files/snack-2.2.10-test.patch b/dev-tcltk/snack/files/snack-2.2.10-test.patch
180 new file mode 100644
181 index 00000000000..724ccd686fc
182 --- /dev/null
183 +++ b/dev-tcltk/snack/files/snack-2.2.10-test.patch
184 @@ -0,0 +1,22 @@
185 +--- a/tests/pitch.test 2018-12-02 21:56:08.315195566 +0100
186 ++++ b/tests/pitch.test 2018-12-02 21:54:19.853964344 +0100
187 +@@ -28,7 +28,7 @@
188 + set res [$s pitch -method ESPS]
189 + $s destroy
190 + set res
191 +-} {{0.0 0.0 0.0 0.7046} {0.0 0.0 773.75 0.65552} {0.0 0.0 818.19 0.24061} {0.0 0.0 813.11 0.56787} {0.0 0.0 808.38 0.51307} {0.0 0.0 826.19 0.49327} {0.0 0.0 856.39 0.9469} {0.0 0.0 851.94 0.0} {0.0 0.0 869.07 0.48861} {0.0 0.0 842.5 0.39768} {0.0 0.0 839.18 0.4009} {0.0 0.0 820.35 0.81465} {0.0 0.0 833.41 0.95806} {0.0 0.0 855.43 0.89539} {0.0 0.0 853.1 0.28335} {0.0 0.0 889.35 0.59169} {0.0 0.0 1070.4 0.68884} {0.0 0.0 878.07 0.5143} {0.0 0.0 893.05 0.3997} {0.0 0.0 873.35 0.68623} {0.0 0.0 965.28 0.57252} {0.0 0.0 882.13 0.49351} {0.0 0.0 1196.0 0.70511} {209.81 1.0 3310.1 0.88756} {162.78 1.0 3659.8 0.99115} {161.92 1.0 3512.8 0.99646} {158.92 1.0 3547.8 0.99354} {155.91 1.0 3468.3 0.98505} {149.48 1.0 3284.6 0.99364} {143.31 1.0 3007.4 0.98736} {133.77 1.0 2823.2 0.94805} {126.48 1.0 2640.0 0.98759} {119.94 1.0 2332.5 0.9852} {112.98 1.0 2040.0 0.95218} {109.81 1.0 2122.5 0.9571} {107.68 1.0 2418.8 0.92161} {106.6 1.0 2507.1 0.95998} {105.57 1.0 2478.7 0.95695} {105.43 1.0 267
192 1.9 0.96458} {106.74 1.0 2706.4 0.98918} {109.0 1.0 2755.5 0.99448} {111.84 1.0 2716.9 0.97564} {115.73 1.0 2274.5 0.87201} {99.183 1.0 920.17 0.60726} {120.34 1.0 860.54 0.84981} {150.88 1.0 2140.9 0.93803} {136.25 1.0 2838.7 0.98336} {141.73 1.0 2877.0 0.99704} {145.06 1.0 2894.6 0.98906} {146.54 1.0 2748.1 0.98797} {149.82 1.0 2700.2 0.94096} {149.23 1.0 2838.5 0.98879} {146.53 1.0 2629.4 0.95378} {141.86 1.0 2179.6 0.97326} {133.37 1.0 1887.6 0.85003} {124.99 1.0 1659.4 0.94212} {117.97 1.0 1442.7 0.96375} {109.74 1.0 1090.7 0.96917} {103.63 1.0 915.58 0.92499} {111.49 1.0 852.97 0.69573} {107.37 1.0 786.45 0.86455} {93.37 1.0 815.31 0.81332} {123.3 1.0 804.19 0.61468} {84.033 1.0 762.64 0.74945} {121.1 1.0 725.97 0.5574} {114.08 1.0 700.18 0.82347} {101.78 1.0 704.91 0.57994} {103.43 1.0 695.82 0.75774} {101.42 1.0 699.76 0.79472} {105.86 1.0 714.6 0.70127} {0.0 0.0 745.64 0.828} {0.0 0.0 736.29 0.64289} {0.0 0.0 696.31 0.40449} {0.0 0.0 684.55 0.44551} {0.0 0.0 639.39 0.38997}
193 {0.0 0.0 561.58 0.0} {0.0 0.0 628.03 0.34976} {0.0 0.0 717.81 0.38937} {0.0 0.0 748.32 0.41932} {0.0 0.0 750.33 0.86962} {0.0 0.0 783.32 0.82826} {0.0 0.0 761.07 0.20038} {0.0 0.0 809.66 0.35076} {0.0 0.0 831.98 0.7714} {0.0 0.0 872.36 0.67117} {0.0 0.0 826.35 0.6413} {0.0 0.0 717.04 0.0} {0.0 0.0 723.39 0.54415} {0.0 0.0 751.84 0.33728} {0.0 0.0 818.29 0.31209} {0.0 0.0 837.27 0.4341} {0.0 0.0 849.58 0.3289} {0.0 0.0 862.31 0.28854} {0.0 0.0 845.67 0.68362} {0.0 0.0 868.24 0.74526}}
194 ++} {{0.0 0.0 0.0 0.7046} {0.0 0.0 773.7 0.65552} {0.0 0.0 818.08 0.24061} {0.0 0.0 813.13 0.56787} {0.0 0.0 808.39 0.51307} {0.0 0.0 826.01 0.49327} {0.0 0.0 856.56 0.9469} {0.0 0.0 851.72 0.0} {0.0 0.0 869.15 0.48861} {0.0 0.0 842.57 0.39768} {0.0 0.0 839.14 0.4009} {0.0 0.0 820.39 0.81465} {0.0 0.0 833.47 0.95806} {0.0 0.0 855.33 0.89539} {0.0 0.0 852.97 0.28335} {0.0 0.0 889.07 0.59169} {0.0 0.0 1070.5 0.68884} {0.0 0.0 878.41 0.5143} {0.0 0.0 892.74 0.3997} {0.0 0.0 873.53 0.68623} {0.0 0.0 965.13 0.57252} {0.0 0.0 882.69 0.49351} {0.0 0.0 1193.0 0.70511} {209.81 1.0 3304.3 0.88756} {162.78 1.0 3660.9 0.99115} {161.92 1.0 3512.7 0.99646} {158.92 1.0 3547.9 0.99354} {155.91 1.0 3468.7 0.98505} {149.48 1.0 3285.3 0.99364} {143.31 1.0 3008.2 0.98736} {133.77 1.0 2823.7 0.94805} {126.48 1.0 2640.8 0.98759} {119.94 1.0 2333.7 0.9852} {112.98 1.0 2040.5 0.95218} {109.81 1.0 2121.6 0.9571} {107.68 1.0 2418.1 0.92161} {106.6 1.0 2507.3 0.95998} {105.57 1.0 2478.0 0.95695} {105.43 1.0 26
195 71.9 0.96458} {106.74 1.0 2706.6 0.98918} {109.0 1.0 2755.4 0.99448} {111.84 1.0 2717.5 0.97564} {115.73 1.0 2277.5 0.87201} {99.183 1.0 924.36 0.60726} {120.34 1.0 859.79 0.84981} {150.88 1.0 2136.3 0.93803} {136.25 1.0 2838.1 0.98336} {141.73 1.0 2877.0 0.99704} {145.06 1.0 2894.6 0.98906} {146.54 1.0 2749.1 0.98797} {149.82 1.0 2699.5 0.94096} {149.23 1.0 2838.4 0.98879} {146.53 1.0 2630.6 0.95378} {141.86 1.0 2181.0 0.97326} {133.37 1.0 1888.3 0.85003} {124.99 1.0 1660.0 0.94212} {117.97 1.0 1443.6 0.96375} {109.74 1.0 1091.7 0.96917} {103.63 1.0 915.75 0.92499} {111.49 1.0 853.13 0.69573} {107.37 1.0 786.42 0.86455} {93.37 1.0 815.44 0.81332} {123.3 1.0 804.05 0.61468} {84.033 1.0 762.98 0.74945} {121.1 1.0 725.91 0.5574} {114.08 1.0 700.22 0.82347} {101.78 1.0 704.95 0.57994} {103.43 1.0 695.87 0.75774} {101.42 1.0 699.81 0.79472} {105.86 1.0 714.47 0.70127} {0.0 0.0 745.7 0.828} {0.0 0.0 736.31 0.64289} {0.0 0.0 696.35 0.40449} {0.0 0.0 684.65 0.44551} {0.0 0.0 639.58 0.38997
196 } {0.0 0.0 561.77 0.0} {0.0 0.0 627.65 0.34976} {0.0 0.0 717.62 0.38937} {0.0 0.0 748.27 0.41932} {0.0 0.0 750.33 0.86962} {0.0 0.0 783.3 0.82826} {0.0 0.0 761.05 0.20038} {0.0 0.0 809.51 0.35076} {0.0 0.0 831.97 0.7714} {0.0 0.0 872.22 0.67117} {0.0 0.0 826.62 0.6413} {0.0 0.0 717.3 0.0} {0.0 0.0 723.3 0.54415} {0.0 0.0 751.75 0.33728} {0.0 0.0 818.03 0.31209} {0.0 0.0 837.29 0.4341} {0.0 0.0 849.53 0.3289} {0.0 0.0 862.33 0.28854} {0.0 0.0 845.65 0.68362} {0.0 0.0 868.25 0.74526}}
197 +
198 + test pitch-2.1 {pitch command, with missing argument for -start option} {
199 + set s [snack::sound snd -load ex1.wav]
200 +--- a/tests/power.test 2018-12-02 21:58:19.319057755 +0100
201 ++++ b/tests/power.test 2018-12-02 21:56:48.303543173 +0100
202 +@@ -14,7 +14,7 @@
203 + set res [$s power]
204 + $s destroy
205 + set res
206 +-} {57.668 58.916 57.992 58.647 58.462 58.415 58.353 58.948 58.897 59.02 58.761 58.745 58.248 58.595 59.158 58.846 58.467 61.37 59.153 59.315 58.301 60.035 59.451 58.963 71.281 71.387 71.13 71.213 71.01 70.635 69.845 68.822 68.986 68.525 67.103 66.664 67.365 67.627 66.72 67.337 67.657 68.365 68.854 68.204 58.26 58.141 66.927 69.789 69.122 69.601 69.076 68.909 69.337 68.621 67.11 65.266 64.678 64.223 61.751 60.287 59.447 57.811 58.444 58.209 57.645 57.279 56.377 56.572 56.467 56.796 57.045 57.735 57.858 57.081 56.943 56.421 54.929 56.202 57.349 57.643 57.477 58.207 57.706 58.385 58.601 59.228 58.694 57.176 57.423 57.733 58.599 58.614 58.771 59.005 58.651 59.077 59.001 58.113 58.374}
207 ++} {57.668 58.916 57.992 58.647 58.463 58.415 58.353 58.948 58.897 59.02 58.761 58.745 58.248 58.595 59.158 58.846 58.467 61.37 59.153 59.315 58.301 60.035 59.451 58.963 71.281 71.387 71.13 71.213 71.01 70.635 69.845 68.822 68.986 68.525 67.103 66.664 67.365 67.627 66.72 67.337 67.657 68.365 68.854 68.204 58.26 58.141 66.927 69.789 69.122 69.601 69.076 68.909 69.337 68.621 67.11 65.266 64.678 64.223 61.751 60.287 59.447 57.811 58.444 58.209 57.645 57.279 56.377 56.572 56.467 56.796 57.045 57.735 57.858 57.081 56.943 56.421 54.929 56.202 57.349 57.643 57.477 58.207 57.706 58.385 58.601 59.228 58.694 57.176 57.423 57.733 58.599 58.614 58.771 59.005 58.651 59.077 59.001 58.113 58.374}
208 +
209 + test power-1.2 {power command} {
210 + set s [snack::sound snd -load ex1.wav]
211
212 diff --git a/dev-tcltk/snack/snack-2.2.10-r8.ebuild b/dev-tcltk/snack/snack-2.2.10-r8.ebuild
213 new file mode 100644
214 index 00000000000..773eb22926a
215 --- /dev/null
216 +++ b/dev-tcltk/snack/snack-2.2.10-r8.ebuild
217 @@ -0,0 +1,100 @@
218 +# Copyright 1999-2018 Gentoo Authors
219 +# Distributed under the terms of the GNU General Public License v2
220 +
221 +EAPI=6
222 +
223 +PYTHON_COMPAT=( python2_7 pypy )
224 +
225 +inherit autotools distutils-r1 multilib virtualx
226 +
227 +DESCRIPTION="The Snack Sound Toolkit (Tcl)"
228 +HOMEPAGE="http://www.speech.kth.se/snack/"
229 +SRC_URI="http://www.speech.kth.se/snack/dist/${PN}${PV}.tar.gz"
230 +
231 +LICENSE="GPL-2"
232 +KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
233 +SLOT="0"
234 +IUSE="alsa examples python vorbis"
235 +
236 +DEPEND="
237 + dev-lang/tcl:0=
238 + dev-lang/tk:0=
239 + alsa? ( media-libs/alsa-lib )
240 + python? ( ${PYTHON_DEPS} )
241 + vorbis? ( media-libs/libvorbis )"
242 +RDEPEND="${DEPEND}"
243 +
244 +S="${WORKDIR}/${PN}${PV}/unix"
245 +
246 +PATCHES=(
247 + "${FILESDIR}"/alsa-undef-sym.patch
248 + "${FILESDIR}"/${P}-CVE-2012-6303-fix.patch
249 + "${FILESDIR}"/${P}-debian-args.patch
250 + "${FILESDIR}"/${P}-test.patch
251 +)
252 +
253 +HTML_DOCS="${WORKDIR}/${PN}${PV}/doc/*"
254 +
255 +src_prepare() {
256 + # adds -install_name (soname on Darwin)
257 + [[ ${CHOST} == *-darwin* ]] && PATCHES+=( "${FILESDIR}"/${P}-darwin.patch )
258 +
259 + sed \
260 + -e "s:ar cr:$(tc-getAR) cr:g" \
261 + -e "s:-O:${CFLAGS}:g" \
262 + -i Makefile.in || die
263 +
264 + cd ..
265 +
266 + default
267 +
268 + sed \
269 + -e 's|^\(#define roundf(.*\)|//\1|' \
270 + -i generic/jkFormatMP3.c || die
271 + rm tests/{play,record}.test || die
272 +}
273 +
274 +src_configure() {
275 + local myconf=""
276 +
277 + use alsa && myconf+=" --enable-alsa"
278 +
279 + if use vorbis; then
280 + myconf+=" --with-ogg-include="${EPREFIX}"/usr/include"
281 + myconf+=" --with-ogg-lib="${EPREFIX}"/usr/$(get_libdir)"
282 + fi
283 +
284 + econf \
285 + --libdir="${EPREFIX}"/usr/$(get_libdir) \
286 + --includedir="${EPREFIX}"/usr/include \
287 + --with-tcl="${EPREFIX}"/usr/$(get_libdir) \
288 + --with-tk="${EPREFIX}"/usr/$(get_libdir) \
289 + $myconf
290 +}
291 +
292 +src_compile() {
293 + default
294 +}
295 +
296 +src_test() {
297 + TCLLIBPATH=${S} virtx default | grep FAILED && die
298 +}
299 +
300 +src_install() {
301 + default
302 +
303 + if use python ; then
304 + cd "${S}"/../python || die
305 + distutils-r1_src_install
306 + fi
307 +
308 + cd "${S}"/.. || die
309 +
310 + if use examples ; then
311 + docinto examples
312 + sed -i -e 's/wish[0-9.]+/wish/g' demos/tcl/* || die
313 + dodoc -r demos/tcl
314 +
315 + use python && dodoc -r demos/python
316 + fi
317 +}