Gentoo Archives: gentoo-commits

From: Fabian Groffen <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-text/vilistextum/, app-text/vilistextum/files/
Date: Sat, 31 Oct 2020 12:36:44
Message-Id: 1604147783.377ba1b3198a4b260e30600a4479a3e48e3693e5.grobian@gentoo
1 commit: 377ba1b3198a4b260e30600a4479a3e48e3693e5
2 Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
3 AuthorDate: Sat Oct 31 12:36:23 2020 +0000
4 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
5 CommitDate: Sat Oct 31 12:36:23 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=377ba1b3
7
8 app-text/vilistextum-2.8.0.20200411: version bump for -fno-common
9
10 Bug: https://bugs.gentoo.org/707644
11 Package-Manager: Portage-3.0.8, Repoman-3.0.2
12 Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
13
14 app-text/vilistextum/Manifest | 1 +
15 .../vilistextum-2.8.0.20200411-blockquote.patch | 120 +++++++++++++++++++++
16 ...vilistextum-2.8.0.20200411-list-alignment.patch | 43 ++++++++
17 .../vilistextum/vilistextum-2.8.0.20200411.ebuild | 80 ++++++++++++++
18 4 files changed, 244 insertions(+)
19
20 diff --git a/app-text/vilistextum/Manifest b/app-text/vilistextum/Manifest
21 index a8d25bac9f5..73b4114bac3 100644
22 --- a/app-text/vilistextum/Manifest
23 +++ b/app-text/vilistextum/Manifest
24 @@ -1,2 +1,3 @@
25 DIST vilistextum-2.6.9.tar.bz2 147743 BLAKE2B 1cf6f187cb277271ddd9946984afb4d59336ea0cd446e62df3593070ccc63b3510a107e2b7e7b8dc757c63e4f5caf3790c7d998b6be325f4d22d2a6b9fea3432 SHA512 ce76a4061b766e4544d1a86986333314a3b6959439ba6995a2977c10b01b0142c524d4b215c3272a1dcfcc4f5b6fda03210de95d65cedecfc6a1c940cedf487d
26 DIST vilistextum-2.8.0.20191023.tar.gz 219395 BLAKE2B 5e3962b4b18b9e6e3896f26e04a63394b3ed58473862f264a3255641b5d13474e12529acadcff3d2f71eb5a41ec7b11a1367f3da15e473551e87e554472f6727 SHA512 99023b4801159047e1433dc5a887e6164192f7aa25bdc79594e717f047f83177612e5120d55cbbc22f3ad4e225bc229a0b186f7fc337c6081ff27ac781422f4e
27 +DIST vilistextum-2.8.0.20200411.tar.gz 219791 BLAKE2B 95b86d17e8dbf29b520aa48c88eb8c9e8abb01a234848ed55bdad0a63a7c0ec8ca9ae7c437fe7f84bbf7f4dad74fc8437a9e3b53493552e9e01b8029b10ef18a SHA512 40a219ebe7bebd61548a3bad794690cf091b67b70e8e6c44548a0c1b9f61077b141a035335e7128b191a8501103707f5324b00326a407e29ec0fee383c4d0917
28
29 diff --git a/app-text/vilistextum/files/vilistextum-2.8.0.20200411-blockquote.patch b/app-text/vilistextum/files/vilistextum-2.8.0.20200411-blockquote.patch
30 new file mode 100644
31 index 00000000000..c8a7da2c212
32 --- /dev/null
33 +++ b/app-text/vilistextum/files/vilistextum-2.8.0.20200411-blockquote.patch
34 @@ -0,0 +1,120 @@
35 +Many clients seem to use blockquote tags to flag quotes these days, so
36 +write them out as quotes, so they remain readable.
37 +
38 +--- a/src/html_tags.c 2019-10-23 16:25:27.000000000 +0200
39 ++++ b/src/html_tags.c 2020-02-05 20:11:57.308596941 +0100
40 +@@ -261,6 +261,7 @@
41 + line_break();
42 + } else {
43 + start_p();
44 ++ quote++;
45 + }
46 + } /* html_pre */
47 +
48 +@@ -271,6 +272,7 @@
49 + line_break();
50 + } else {
51 + paragraphen_ende();
52 ++ quote -= quote != 0;
53 + }
54 + } /* html_pre_end */
55 +
56 +--- a/src/multibyte.h 2020-02-05 20:08:43.863715764 +0100
57 ++++ b/src/multibyte.h 2020-02-05 20:12:34.401382354 +0100
58 +@@ -18,6 +18,7 @@
59 + #define ATOI(n) wcstoi(n)
60 +
61 + #define ONESPACE L" "
62 ++ #define QUOTE L">"
63 + #define WORT_PLUS_STRING(str) wort_plus_string(L##str)
64 +
65 + #define STRSTR(haystack, needle) wcsstr(haystack, L##needle)
66 +@@ -43,6 +44,7 @@
67 + #define ATOI(n) atoi(n)
68 +
69 + #define ONESPACE " "
70 ++ #define QUOTE ">"
71 + #define WORT_PLUS_STRING(str) wort_plus_string(str)
72 +
73 + #define STRSTR(haystack, needle) strstr(haystack, needle)
74 +--- a/src/text.c 2019-10-23 16:25:27.000000000 +0200
75 ++++ b/src/text.c 2020-02-05 20:16:04.852164539 +0100
76 +@@ -28,6 +28,7 @@
77 + int breite=76,
78 + hr_breite=76,
79 + paragraph=0,
80 ++ quote=0,
81 +
82 + tab=4, /* tabulator */
83 + spaces=0, /* spaces at beginning of line */
84 +@@ -378,6 +379,12 @@
85 + printf(" z0: zeilen_pos: %d\n",zeilen_pos);
86 + #endif
87 + print_zeile();
88 ++ if (quote > 0)
89 ++ {
90 ++ i=0;
91 ++ while (i<quote) { zeile_plus_wort(QUOTE,1,1); i++; }
92 ++ zeile_plus_wort(ONESPACE,1,1);
93 ++ }
94 + i=0;
95 + while (i<spaces) { zeile_plus_wort(ONESPACE,1,1); i++; }
96 + if (orderedlist>0) { zeile_plus_wort(ONESPACE,1,1); }
97 +@@ -398,6 +405,12 @@
98 + printf(" z2: zeilen_len: %d\n",zeilen_len);
99 + printf(" z2: zeilen_pos: %d\n",zeilen_pos);
100 + #endif
101 ++ if (quote > 0)
102 ++ {
103 ++ i=0;
104 ++ while (i<quote) { zeile_plus_wort(QUOTE,1,1); i++; }
105 ++ zeile_plus_wort(ONESPACE,1,1);
106 ++ }
107 + i=0;
108 + while (i<spaces) { zeile_plus_wort(ONESPACE,1,1); i++; }
109 + if (orderedlist>0) { zeile_plus_wort(ONESPACE,1,1); }
110 +--- a/src/text.h 2019-10-23 16:25:27.000000000 +0200
111 ++++ b/src/text.h 2020-02-05 20:18:40.792261818 +0100
112 +@@ -26,6 +26,7 @@
113 +
114 + extern int tab;
115 + extern int spaces;
116 ++extern int quote;
117 +
118 + void print_zeile();
119 + int is_zeile_empty();
120 +--- a/tests/test_functions
121 ++++ b/tests/test_functions
122 +@@ -12,6 +12,9 @@
123 + rm -f testcases/$prefix.output.test
124 + ../src/vilistextum 2>/dev/null $args testcases/$prefix.html testcases/$output_prefix.output.test
125 +
126 ++ # remove (block)quotes
127 ++ sed -i -e 's/^>\+ //' testcases/$output_prefix.output.test
128 ++
129 + diff >/dev/null testcases/$output_prefix.output testcases/$output_prefix.output.test
130 + retval=$?
131 + if [ $retval -ne 0 ]; then
132 +--- a/tests/testcases/utf-8-sampler.output
133 ++++ b/tests/testcases/utf-8-sampler.output.test
134 +@@ -100,8 +100,8 @@
135 + ვეპხის ტყაოსანი შოთა რუსთაველი
136 +
137 + ღმერთსი შემვედრე, ნუთუ კვლა დამხსნას სოფლისა შრომასა, ცეცხლს, წყალსა და
138 +-მიწასა, ჰაერთა თანა მრომასა; მომცნეს ფრთენი და აღვფრინდე, მივჰხვდე მას ჩემსა
139 +-ნდომასა, დღისით და ღამით ვჰხედვიდე მზისა ელვათა კრთომაასა.
140 ++მიწასა, ჰაერთა თანა მრომასა; მომცნეს ფრთენი და აღვფრინდე, მივჰხვდე მას
141 ++ჩემსა ნდომასა, დღისით და ღამით ვჰხედვიდე მზისა ელვათა კრთომაასა.
142 +
143 + Tamil poetry of Cupiramaniya Paarathiyar: சுப்ரமணிய பாரதியார் (1882-1921)
144 +
145 +@@ -446,7 +446,8 @@
146 + д, п, and/or т:
147 +
148 + Bulgarian:   [ бгдпт ]   [ бгдпт ]   Мога да ям стъкло и не ме боли.
149 +- Russian: [ бгдпт ]   [ бгдпт ]   Я могу есть стекло, это мне не вредит.
150 ++ Russian: [ бгдпт ]   [ бгдпт ]   Я могу есть стекло, это мне не
151 ++вредит.
152 + Serbian: [ бгдпт ]   [ бгдпт ]   Могу јести стакло а да ми не шкоди.
153 +
154 + ------------------------------------------------------------------------
155
156 diff --git a/app-text/vilistextum/files/vilistextum-2.8.0.20200411-list-alignment.patch b/app-text/vilistextum/files/vilistextum-2.8.0.20200411-list-alignment.patch
157 new file mode 100644
158 index 00000000000..65541b7a74f
159 --- /dev/null
160 +++ b/app-text/vilistextum/files/vilistextum-2.8.0.20200411-list-alignment.patch
161 @@ -0,0 +1,43 @@
162 +--- a/src/lists.c
163 ++++ b/src/lists.c
164 +@@ -74,6 +74,7 @@
165 + }
166 +
167 + spaces += tab;
168 ++ orderedlist++;
169 + #ifdef proc_debug
170 + printf("start_uls() ende\n");
171 + #endif
172 +@@ -82,6 +83,7 @@
173 + void end_uls()
174 + {
175 + spaces -= tab;
176 ++ orderedlist--;
177 + line_break();
178 +
179 + if (bullet_style=='%') { bullet_style='$'; }
180 +--- a/src/text.c
181 ++++ b/src/text.c
182 +@@ -387,7 +387,11 @@
183 + }
184 + i=0;
185 + while (i<spaces) { zeile_plus_wort(ONESPACE,1,1); i++; }
186 +- if (orderedlist>0) { zeile_plus_wort(ONESPACE,1,1); }
187 ++ if (orderedlist>0)
188 ++ {
189 ++ i=(spaces%tab) + 1;
190 ++ while (i>0) { zeile_plus_wort(ONESPACE,1,1); i--; }
191 ++ }
192 + zeile_plus_wort(wort, wort_len, wort_pos);
193 + }
194 + else if (zeilen_len != 0)
195 +--- a/src/text.h
196 ++++ b/src/text.h
197 +@@ -27,6 +27,7 @@
198 + extern int tab;
199 + extern int spaces;
200 + extern int quote;
201 ++extern int orderedlist;
202 +
203 + void print_zeile();
204 + int is_zeile_empty();
205
206 diff --git a/app-text/vilistextum/vilistextum-2.8.0.20200411.ebuild b/app-text/vilistextum/vilistextum-2.8.0.20200411.ebuild
207 new file mode 100644
208 index 00000000000..dd8c207c466
209 --- /dev/null
210 +++ b/app-text/vilistextum/vilistextum-2.8.0.20200411.ebuild
211 @@ -0,0 +1,80 @@
212 +# Copyright 1999-2020 Gentoo Authors
213 +# Distributed under the terms of the GNU General Public License v2
214 +
215 +EAPI=7
216 +
217 +inherit autotools flag-o-matic
218 +
219 +GITID="06cc8a637efd9097af4f138b1b7c755120ffaa88"
220 +DESCRIPTION="HTML to ASCII converter programmed to handle incorrect html"
221 +HOMEPAGE="https://bhaak.net/vilistextum/"
222 +SRC_URI="https://github.com/bhaak/vilistextum/archive/${GITID}.tar.gz -> ${P}.tar.gz"
223 +S="${WORKDIR}/${PN}-${GITID}"
224 +
225 +LICENSE="GPL-2"
226 +SLOT="0"
227 +KEYWORDS="~amd64 ~ppc ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris"
228 +IUSE="unicode"
229 +
230 +DEPEND="virtual/libiconv"
231 +RDEPEND=""
232 +
233 +src_prepare() {
234 + eapply "${FILESDIR}/${PN}-2.8.0-prefix.patch"
235 + eapply "${FILESDIR}/${PN}-2.8.0.20200411-blockquote.patch"
236 + eapply "${FILESDIR}/${PN}-2.8.0-towlower.patch"
237 + eapply "${FILESDIR}/${PN}-2.8.0.20200411-list-alignment.patch"
238 +
239 + eapply_user
240 + eautoreconf
241 +
242 + # wcscasecmp needs extensions, which aren't enabled
243 + export ac_cv_func_wcscasecmp=no
244 +}
245 +
246 +get_locale() {
247 + locale -a | grep -i "$1\.utf.*8\$"
248 +}
249 +
250 +find_locale() {
251 + local l t
252 +
253 + # we basically prefer to find en_US.UTF-8, but it may not always be
254 + # available, in which case it is better not to hardcode to use it
255 + l=$(get_locale en_US)
256 + if [[ -z ${l} ]] ; then
257 + for t in "en_GB" "en_.*" ".*" ; do
258 + l=$(get_locale ${t})
259 + if [[ -n ${l} ]] ; then
260 + l=${l%%$'\n'*}
261 + break;
262 + fi
263 + done
264 + fi
265 + [[ -z ${l} ]] && die "Failed to find a unicode locale"
266 + echo "${l}"
267 +}
268 +
269 +src_configure() {
270 + # need hardwired locale simply because locale -a | grep -i utf-8 | head -n1
271 + # isn't always returning the most sensical (and working) locale
272 + econf \
273 + $(use_enable unicode multibyte) \
274 + $(use_with unicode unicode-locale $(find_locale))
275 +}
276 +
277 +src_test() {
278 + if $(locale -a | grep -iq "en_US\.utf.*8"); then
279 + emake -j1 check
280 + else
281 + ewarn "If you like to run the test,"
282 + ewarn "please make sure en_US.UTF-8 is installed."
283 + die "en_US.UTF-8 locale is missing"
284 + fi
285 +}
286 +
287 +src_install() {
288 + default
289 + doman doc/${PN}.1
290 + dodoc doc/changes.xhtml doc/htmlmail.xhtml
291 +}