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/files/, app-text/vilistextum/
Date: Wed, 05 Feb 2020 19:39:20
Message-Id: 1580931553.0dbb5a6b28d23592e42e3060caea924973dc6aab.grobian@gentoo
1 commit: 0dbb5a6b28d23592e42e3060caea924973dc6aab
2 Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
3 AuthorDate: Wed Feb 5 19:38:56 2020 +0000
4 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
5 CommitDate: Wed Feb 5 19:39:13 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0dbb5a6b
7
8 app-text/vilistextum-2.8.0.20191023: version bump
9
10 Package-Manager: Portage-2.3.84, Repoman-2.3.20
11 Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
12
13 app-text/vilistextum/Manifest | 1 +
14 .../files/vilistextum-2.8.0-blockquote.patch | 120 +++++++++++++++++++++
15 .../files/vilistextum-2.8.0-gentoo.patch | 11 ++
16 .../files/vilistextum-2.8.0-prefix.patch | 27 +++++
17 .../files/vilistextum-2.8.0-towlower.patch | 12 +++
18 .../vilistextum/vilistextum-2.8.0.20191023.ebuild | 80 ++++++++++++++
19 6 files changed, 251 insertions(+)
20
21 diff --git a/app-text/vilistextum/Manifest b/app-text/vilistextum/Manifest
22 index 485ac7c4b75..b14c6c710cf 100644
23 --- a/app-text/vilistextum/Manifest
24 +++ b/app-text/vilistextum/Manifest
25 @@ -1 +1,2 @@
26 DIST vilistextum-2.6.9.tar.bz2 147743 BLAKE2B 1cf6f187cb277271ddd9946984afb4d59336ea0cd446e62df3593070ccc63b3510a107e2b7e7b8dc757c63e4f5caf3790c7d998b6be325f4d22d2a6b9fea3432 SHA512 ce76a4061b766e4544d1a86986333314a3b6959439ba6995a2977c10b01b0142c524d4b215c3272a1dcfcc4f5b6fda03210de95d65cedecfc6a1c940cedf487d
27 +DIST vilistextum-2.8.0.20191023.tar.gz 219266 BLAKE2B b94f3179f9181711fd6fe2a8240c7654917f7f93f161495b3380c840bff687714862116d15dfd3f1817a521f0c2d2730221084b6fbe7d1242d4285b2fe21b18b SHA512 a68410993e1b9d3d9dbdfb5677941bf2e95805573d210c510f65be5ebad00cb09f50ef5e592f25a34e535b32a44fc23265e839195316d0ac3c8c8c3b626bfe98
28
29 diff --git a/app-text/vilistextum/files/vilistextum-2.8.0-blockquote.patch b/app-text/vilistextum/files/vilistextum-2.8.0-blockquote.patch
30 new file mode 100644
31 index 00000000000..74d44309669
32 --- /dev/null
33 +++ b/app-text/vilistextum/files/vilistextum-2.8.0-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 + int tab;
115 + int spaces;
116 ++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-gentoo.patch b/app-text/vilistextum/files/vilistextum-2.8.0-gentoo.patch
157 new file mode 100644
158 index 00000000000..a26ae717818
159 --- /dev/null
160 +++ b/app-text/vilistextum/files/vilistextum-2.8.0-gentoo.patch
161 @@ -0,0 +1,11 @@
162 +--- a/src/Makefile.am
163 ++++ b/src/Makefile.am
164 +@@ -6,7 +6,7 @@
165 + main.c main.h util.c util.h \
166 + multibyte.h unicode_entities.c unicode_entities.h
167 +
168 +-AM_CFLAGS = -Wall -O2 -ansi
169 ++AM_CFLAGS = -Wall -ansi
170 + AM_LDFLAGS = $(STATIC)
171 +
172 + EXTRA_DIST = kilistextum.kaptn
173
174 diff --git a/app-text/vilistextum/files/vilistextum-2.8.0-prefix.patch b/app-text/vilistextum/files/vilistextum-2.8.0-prefix.patch
175 new file mode 100644
176 index 00000000000..e5cb3ba2a18
177 --- /dev/null
178 +++ b/app-text/vilistextum/files/vilistextum-2.8.0-prefix.patch
179 @@ -0,0 +1,27 @@
180 +* don't look in /usr/local
181 +* try to hack around not being able to use AM_ICONV
182 +
183 +--- a/configure.ac
184 ++++ b/configure.ac
185 +@@ -21,10 +21,6 @@
186 + AC_HEADER_STDC
187 + AC_CHECK_HEADERS(getopt.h)
188 +
189 +-dnl add /usr/local
190 +-CFLAGS="$CFLAGS -I/usr/local/include"
191 +-LDFLAGS="$LDFLAGS -L/usr/local/lib"
192 +-
193 + dnl checking for options
194 + AC_MSG_CHECKING(if --enable-multibyte specified)
195 + AC_ARG_ENABLE(multibyte,
196 +@@ -41,7 +37,9 @@
197 + AC_CHECK_HEADERS(iconv.h,,
198 + AC_MSG_ERROR(Need libiconv or iconv.h for multibyte support))
199 +
200 +-AC_CHECK_LIB(iconv, iconv,,
201 ++dnl iconv_open_into is implemented only in GNU libiconv and not in other
202 ++dnl iconv implementations
203 ++AC_CHECK_LIB(iconv, libiconv_open_into,,
204 + AC_MSG_WARN([Generic iconv found but not libiconv. See INSTALL for details]))
205 +
206 + dnl setting INTERNAL_LOCALE
207
208 diff --git a/app-text/vilistextum/files/vilistextum-2.8.0-towlower.patch b/app-text/vilistextum/files/vilistextum-2.8.0-towlower.patch
209 new file mode 100644
210 index 00000000000..a9c8a96a752
211 --- /dev/null
212 +++ b/app-text/vilistextum/files/vilistextum-2.8.0-towlower.patch
213 @@ -0,0 +1,12 @@
214 +towlower is defined by wctype.h
215 +
216 +--- a/src/multibyte.h
217 ++++ b/src/multibyte.h
218 +@@ -2,6 +2,7 @@
219 +
220 + #ifdef MULTIBYTE
221 + #include <wchar.h>
222 ++#include <wctype.h>
223 + #define CHAR wchar_t
224 + #define STRLEN(s) wcslen(s)
225 + #define CPYSS(dest, src) wcscpy(dest, src) /* copy str to str */
226
227 diff --git a/app-text/vilistextum/vilistextum-2.8.0.20191023.ebuild b/app-text/vilistextum/vilistextum-2.8.0.20191023.ebuild
228 new file mode 100644
229 index 00000000000..d77ae962a94
230 --- /dev/null
231 +++ b/app-text/vilistextum/vilistextum-2.8.0.20191023.ebuild
232 @@ -0,0 +1,80 @@
233 +# Copyright 1999-2020 Gentoo Authors
234 +# Distributed under the terms of the GNU General Public License v2
235 +
236 +EAPI=7
237 +
238 +inherit autotools flag-o-matic
239 +
240 +GITID="f299bb5e5f661c345c4b85a3e8de9ad8615ad17a"
241 +DESCRIPTION="HTML to ASCII converter programmed to handle incorrect html"
242 +HOMEPAGE="https://bhaak.net/vilistextum/"
243 +SRC_URI="https://github.com/bhaak/vilistextum/tarball/${GITID} -> ${P}.tar.gz"
244 +S="${WORKDIR}/bhaak-${PN}-${GITID:0:7}"
245 +
246 +LICENSE="GPL-2"
247 +SLOT="0"
248 +KEYWORDS="~amd64 ~ppc ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris"
249 +IUSE="unicode"
250 +
251 +DEPEND="virtual/libiconv"
252 +RDEPEND=""
253 +
254 +src_prepare() {
255 + eapply "${FILESDIR}/${PN}-2.8.0-gentoo.patch"
256 + eapply "${FILESDIR}/${PN}-2.8.0-prefix.patch"
257 + eapply "${FILESDIR}/${PN}-2.8.0-blockquote.patch"
258 + eapply "${FILESDIR}/${PN}-2.8.0-towlower.patch"
259 +
260 + eapply_user
261 + eautoreconf
262 +
263 + # wcscasecmp needs extensions, which aren't enabled
264 + export ac_cv_func_wcscasecmp=no
265 +}
266 +
267 +get_locale() {
268 + locale -a | grep -i "$1\.utf.*8\$"
269 +}
270 +
271 +find_locale() {
272 + local l t
273 +
274 + # we basically prefer to find en_US.UTF-8, but it may not always be
275 + # available, in which case it is better not to hardcode to use it
276 + l=$(get_locale en_US)
277 + if [[ -z ${l} ]] ; then
278 + for t in "en_GB" "en_.*" ".*" ; do
279 + l=$(get_locale ${t})
280 + if [[ -n ${l} ]] ; then
281 + l=${l%%$'\n'*}
282 + break;
283 + fi
284 + done
285 + fi
286 + [[ -z ${l} ]] && die "Failed to find a unicode locale"
287 + echo "${l}"
288 +}
289 +
290 +src_configure() {
291 + # need hardwired locale simply because locale -a | grep -i utf-8 | head -n1
292 + # isn't always returning the most sensical (and working) locale
293 + econf \
294 + $(use_enable unicode multibyte) \
295 + $(use_with unicode unicode-locale $(find_locale))
296 +}
297 +
298 +src_test() {
299 + if $(locale -a | grep -iq "en_US\.utf.*8"); then
300 + emake -j1 check
301 + else
302 + ewarn "If you like to run the test,"
303 + ewarn "please make sure en_US.UTF-8 is installed."
304 + die "en_US.UTF-8 locale is missing"
305 + fi
306 +}
307 +
308 +src_install() {
309 + default
310 + doman doc/${PN}.1
311 + dodoc doc/changes.xhtml doc/htmlmail.xhtml
312 +}