Gentoo Archives: gentoo-commits

From: Georgy Yakovlev <gyakovlev@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-mail/notmuch/files/, net-mail/notmuch/
Date: Sun, 13 Jun 2021 07:10:24
Message-Id: 1623568174.719fd8b321b84fe261561a78f6d73212a31f0bec.gyakovlev@gentoo
1 commit: 719fd8b321b84fe261561a78f6d73212a31f0bec
2 Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jun 13 07:08:45 2021 +0000
4 Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
5 CommitDate: Sun Jun 13 07:09:34 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=719fd8b3
7
8 net-mail/notmuch: add 0.32.1
9
10 Closes: https://bugs.gentoo.org/791079
11 Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
12
13 net-mail/notmuch/Manifest | 1 +
14 net-mail/notmuch/files/notmuch-0.32.1-tests.patch | 174 +++++++++++++
15 net-mail/notmuch/notmuch-0.32.1.ebuild | 291 ++++++++++++++++++++++
16 3 files changed, 466 insertions(+)
17
18 diff --git a/net-mail/notmuch/Manifest b/net-mail/notmuch/Manifest
19 index 447108fd721..a3ebf895d3a 100644
20 --- a/net-mail/notmuch/Manifest
21 +++ b/net-mail/notmuch/Manifest
22 @@ -1,2 +1,3 @@
23 DIST database-v1.tar.xz 204876 BLAKE2B 846a8d2f17edb61ed1c3d3c655becd1f60b4046772058706f13d516f65421a5105593660f1c556907bb2bb9607a3c2521243d1be07bffb70817ad3b8461680ca SHA512 e2d87373e00b65756d7fea40c54fb236d7a37ce839145c3afd99ab26efdc17796e540c021e2c24e521df2d0a01ccbf918994f87a0d83235ff9b109a51555b3d0
24 DIST notmuch-0.31.3.tar.xz 713900 BLAKE2B 64aa5c707a74544d31f1dce4e49f3e19cf8c733dfe6f0761dec5522eae94bacf0c01ab7c8212373f1857eeecbad569482365a53a10f56dfee72cefc8d3f4f05a SHA512 99119216b7ef7f9e336b11d03ebb61d9667a8fbddcf6fccc49b17d07f07867f0342b2766375e164b58eaa9a43237ec4d6567d616fe8813b929d28b203aedfa44
25 +DIST notmuch-0.32.1.tar.xz 725196 BLAKE2B 6163f512e88f1b9415b93f7c4a146dc1af6e41bacdbbd29bdb48706af4af4822b626a719d50146f0cfe4d35508d8aa767b0e75eadebf9d619912f3ee6ba0e59e SHA512 c561658919a3c19bfe282e28a5c95db5d58030f044307fdfcaee02d3bf6fc15c9ae9d6d9d8a948c9e6f9b54f563dc82cde757a26a7d7c33eb976b3cfe7ce8c36
26
27 diff --git a/net-mail/notmuch/files/notmuch-0.32.1-tests.patch b/net-mail/notmuch/files/notmuch-0.32.1-tests.patch
28 new file mode 100644
29 index 00000000000..8a564325485
30 --- /dev/null
31 +++ b/net-mail/notmuch/files/notmuch-0.32.1-tests.patch
32 @@ -0,0 +1,174 @@
33 +From: Tomi Ollila <tomi.ollila@×××.fi>
34 +Date: Sat, 22 May 2021 13:39:57 +0000 (+0300)
35 +Subject: test: replace notmuch_passwd_sanitize() with _libconfig_sanitize()
36 +X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=commitdiff_plain;h=8675be1d307bc2df882107744641f6a7858e65ad;hp=3baa61e0e58402bc50c5df529fcf669bf4b2facb
37 +
38 +test: replace notmuch_passwd_sanitize() with _libconfig_sanitize()
39 +
40 +notmuch_passwd_sanitize() in test-lib.sh is too generic, it cannot
41 +work in many cases...
42 +
43 +The more specific version _libconfig_sanitize() replaces it in
44 +T590-libconfig.sh and the code that uses it is modified to output
45 +the keys (ascending numbers printed in hex) so the sanitizer knows
46 +what to sanitize in which lines...
47 +
48 +"@" + fqdn -> "@FQDN" replacement is used as fqdn could
49 +-- in theory -- be substring of 'USERNAME'.
50 +
51 +'user -> 'USER_FULL_NAME replacement to work in cases where user
52 +is empty -- as only first ' is replaced that works as expected.
53 +
54 +In addition to ".(none)" now also ".localdomain" is filtered from
55 +USERNAME@FQDN.
56 +
57 +/dev/fd/{n} is not defined in posix, but it is portable enough
58 +(if it weren't it is easy to fix -- now code looks clearer).
59 +---
60 +
61 +diff --git a/test/T590-libconfig.sh b/test/T590-libconfig.sh
62 +index 745e1bb4..bc7298f8 100755
63 +--- a/test/T590-libconfig.sh
64 ++++ b/test/T590-libconfig.sh
65 +@@ -5,6 +5,25 @@ test_description="library config API"
66 +
67 + add_email_corpus
68 +
69 ++_libconfig_sanitize() {
70 ++ ${NOTMUCH_PYTHON} /dev/fd/3 3<<'EOF'
71 ++import os, sys, pwd, socket
72 ++
73 ++pw = pwd.getpwuid(os.getuid())
74 ++user = pw.pw_name
75 ++name = pw.pw_gecos.partition(",")[0]
76 ++fqdn = socket.getaddrinfo(socket.gethostname(), 0, 0,
77 ++ socket.SOCK_STREAM, 0, socket.AI_CANONNAME)[0][3]
78 ++for l in sys.stdin:
79 ++ if l[:4] == "08: ":
80 ++ l = l.replace(user, "USERNAME", 1).replace("@" + fqdn, "@FQDN", 1)
81 ++ l = l.replace(".(none)", "", 1).replace(".localdomain", "", 1)
82 ++ elif l[:4] == "10: ":
83 ++ l = l.replace("'" + name, "'USER_FULL_NAME", 1)
84 ++ sys.stdout.write(l)
85 ++EOF
86 ++}
87 ++
88 + cat <<EOF > c_head
89 + #include <string.h>
90 + #include <stdlib.h>
91 +@@ -380,26 +399,26 @@ cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} '' %NULL%
92 + key < NOTMUCH_CONFIG_LAST;
93 + key = (notmuch_config_key_t)(key + 1)) {
94 + const char *val = notmuch_config_get (db, key);
95 +- printf("%s\n", val ? val : "NULL" );
96 ++ printf("%02d: '%s'\n", key, val ? val : "NULL" );
97 + }
98 + }
99 + EOF
100 +
101 +-notmuch_passwd_sanitize < OUTPUT > OUTPUT.clean
102 ++_libconfig_sanitize < OUTPUT > OUTPUT.clean
103 +
104 + cat <<'EOF' >EXPECTED
105 + == stdout ==
106 +-MAIL_DIR
107 +-MAIL_DIR
108 +-MAIL_DIR/.notmuch/hooks
109 +-MAIL_DIR/.notmuch/backups
110 +-
111 +-unread;inbox
112 +-
113 +-true
114 +-USERNAME@FQDN
115 +-NULL
116 +-USER_FULL_NAME
117 ++00: 'MAIL_DIR'
118 ++01: 'MAIL_DIR'
119 ++02: 'MAIL_DIR/.notmuch/hooks'
120 ++03: 'MAIL_DIR/.notmuch/backups'
121 ++04: ''
122 ++05: 'unread;inbox'
123 ++06: ''
124 ++07: 'true'
125 ++08: 'USERNAME@FQDN'
126 ++09: 'NULL'
127 ++10: 'USER_FULL_NAME'
128 + == stderr ==
129 + EOF
130 + unset MAILDIR
131 +@@ -694,23 +713,23 @@ cat c_head2 - c_tail <<'EOF' | test_C ${MAIL_DIR} %NULL% %NULL%
132 + key < NOTMUCH_CONFIG_LAST;
133 + key = (notmuch_config_key_t)(key + 1)) {
134 + const char *val = notmuch_config_get (db, key);
135 +- printf("%s\n", val ? val : "NULL" );
136 ++ printf("%x: '%s'\n", key, val ? val : "NULL" );
137 + }
138 + }
139 + EOF
140 + cat <<'EOF' >EXPECTED
141 + == stdout ==
142 +-MAIL_DIR
143 +-MAIL_DIR
144 +-MAIL_DIR/.notmuch/hooks
145 +-MAIL_DIR/.notmuch/backups
146 +-foo;bar;fub
147 +-unread;inbox
148 +-sekrit_junk
149 +-true
150 +-test_suite@×××××××××××.org
151 +-test_suite_other@×××××××××××.org;test_suite@×××××××××××.org
152 +-Notmuch Test Suite
153 ++0: 'MAIL_DIR'
154 ++1: 'MAIL_DIR'
155 ++2: 'MAIL_DIR/.notmuch/hooks'
156 ++3: 'MAIL_DIR/.notmuch/backups'
157 ++4: 'foo;bar;fub'
158 ++5: 'unread;inbox'
159 ++6: 'sekrit_junk'
160 ++7: 'true'
161 ++8: 'test_suite@×××××××××××.org'
162 ++9: 'test_suite_other@×××××××××××.org;test_suite@×××××××××××.org'
163 ++a: 'Notmuch Test Suite'
164 + == stderr ==
165 + EOF
166 + test_expect_equal_file EXPECTED OUTPUT
167 +@@ -723,25 +742,26 @@ cat c_head2 - c_tail <<'EOF' | test_C ${MAIL_DIR} /nonexistent %NULL%
168 + key < NOTMUCH_CONFIG_LAST;
169 + key = (notmuch_config_key_t)(key + 1)) {
170 + const char *val = notmuch_config_get (db, key);
171 +- printf("%s\n", val ? val : "NULL" );
172 ++ printf("%02d: '%s'\n", key, val ? val : "NULL" );
173 + }
174 + }
175 + EOF
176 +
177 +-notmuch_passwd_sanitize < OUTPUT > OUTPUT.clean
178 ++_libconfig_sanitize < OUTPUT > OUTPUT.clean
179 ++
180 + cat <<'EOF' >EXPECTED
181 + == stdout ==
182 +-MAIL_DIR
183 +-MAIL_DIR
184 +-MAIL_DIR/.notmuch/hooks
185 +-MAIL_DIR/.notmuch/backups
186 +-
187 +-unread;inbox
188 +-
189 +-true
190 +-USERNAME@FQDN
191 +-NULL
192 +-USER_FULL_NAME
193 ++00: 'MAIL_DIR'
194 ++01: 'MAIL_DIR'
195 ++02: 'MAIL_DIR/.notmuch/hooks'
196 ++03: 'MAIL_DIR/.notmuch/backups'
197 ++04: ''
198 ++05: 'unread;inbox'
199 ++06: ''
200 ++07: 'true'
201 ++08: 'USERNAME@FQDN'
202 ++09: 'NULL'
203 ++10: 'USER_FULL_NAME'
204 + == stderr ==
205 + EOF
206 + test_expect_equal_file EXPECTED OUTPUT.clean
207
208 diff --git a/net-mail/notmuch/notmuch-0.32.1.ebuild b/net-mail/notmuch/notmuch-0.32.1.ebuild
209 new file mode 100644
210 index 00000000000..26acc520cdb
211 --- /dev/null
212 +++ b/net-mail/notmuch/notmuch-0.32.1.ebuild
213 @@ -0,0 +1,291 @@
214 +# Copyright 1999-2021 Gentoo Authors
215 +# Distributed under the terms of the GNU General Public License v2
216 +
217 +EAPI=7
218 +
219 +DISTUTILS_OPTIONAL=1
220 +DISTUTILS_USE_SETUPTOOLS=manual
221 +NEED_EMACS="24.1"
222 +PYTHON_COMPAT=( python3_{7,8,9} pypy3 )
223 +
224 +inherit bash-completion-r1 desktop distutils-r1 elisp-common flag-o-matic pax-utils toolchain-funcs xdg-utils
225 +
226 +DESCRIPTION="Thread-based e-mail indexer, supporting quick search and tagging"
227 +HOMEPAGE="https://notmuchmail.org/"
228 +SRC_URI="https://notmuchmail.org/releases/${P}.tar.xz
229 + test? ( https://notmuchmail.org/releases/test-databases/database-v1.tar.xz )"
230 +
231 +LICENSE="GPL-3"
232 +# Sub-slot corresponds to major wersion of libnotmuch.so.X.Y. Bump of Y is
233 +# meant to be binary backward compatible.
234 +SLOT="0/5"
235 +KEYWORDS="~alpha amd64 ~arm ~arm64 ~ppc64 x86 ~x64-macos"
236 +REQUIRED_USE="
237 + apidoc? ( doc )
238 + nmbug? ( python )
239 + python? ( ${PYTHON_REQUIRED_USE} )
240 + test? ( crypt emacs python valgrind )
241 +"
242 +IUSE="apidoc crypt doc emacs mutt nmbug python test valgrind"
243 +RESTRICT="!test? ( test )"
244 +
245 +BDEPEND="
246 + virtual/pkgconfig
247 + apidoc? (
248 + app-doc/doxygen
249 + dev-lang/perl
250 + )
251 + doc? (
252 + dev-python/sphinx
253 + sys-apps/texinfo
254 + )
255 + python? (
256 + dev-python/setuptools[${PYTHON_USEDEP}]
257 + test? ( dev-python/pytest[${PYTHON_USEDEP}] )
258 + )
259 + test? ( sys-process/parallel )
260 +"
261 +
262 +COMMON_DEPEND="
263 + dev-libs/glib
264 + dev-libs/gmime:3.0[crypt]
265 + >=dev-libs/xapian-1.4.0:=
266 + sys-libs/talloc
267 + sys-libs/zlib:=
268 + emacs? ( >=app-editors/emacs-${NEED_EMACS}:* )
269 + python? (
270 + ${PYTHON_DEPS}
271 + virtual/python-cffi[${PYTHON_USEDEP}]
272 + )
273 +"
274 +
275 +DEPEND="${COMMON_DEPEND}
276 + test? (
277 + >=app-editors/emacs-${NEED_EMACS}:*[libxml2]
278 + app-misc/dtach
279 + sys-devel/gdb
280 + crypt? (
281 + app-crypt/gnupg
282 + dev-libs/openssl
283 + )
284 + )
285 + valgrind? ( dev-util/valgrind )
286 +"
287 +
288 +RDEPEND="${COMMON_DEPEND}
289 + crypt? ( app-crypt/gnupg )
290 + mutt? (
291 + dev-perl/File-Which
292 + dev-perl/Mail-Box
293 + dev-perl/MailTools
294 + dev-perl/String-ShellQuote
295 + dev-perl/Term-ReadLine-Gnu
296 + virtual/perl-Digest-SHA
297 + virtual/perl-File-Path
298 + virtual/perl-Getopt-Long
299 + virtual/perl-Pod-Parser
300 + )
301 + nmbug? ( dev-vcs/git )
302 +"
303 +
304 +SITEFILE="50${PN}-gentoo.el"
305 +
306 +PATCHES=(
307 + "${FILESDIR}/${P}-tests.patch"
308 +)
309 +
310 +pkg_setup() {
311 + use emacs && elisp-check-emacs-version
312 +}
313 +
314 +src_unpack() {
315 + unpack "${P}".tar.xz
316 + if use test; then
317 + mkdir -p "${S}"/test/test-databases || die
318 + cp "${DISTDIR}"/database-v1.tar.xz "${S}"/test/test-databases/ || die
319 + fi
320 +}
321 +
322 +src_prepare() {
323 + default
324 +
325 + use python && distutils-r1_src_prepare
326 +
327 + mv contrib/notmuch-mutt/README contrib/notmuch-mutt/README-mutt || die
328 +
329 + # Override 'install' target, we want to install manpages with doman, but let it install texinfo files.
330 + sed -i "s/all install-man install-info/all $(usex doc install-info '')/" "Makefile.local" || die
331 +
332 + use test && append-flags '-g'
333 +
334 + # Non-autoconf configure
335 + [[ ${CHOST} == *-solaris* ]] && append-ldflags '-lnsl' '-lsocket'
336 +
337 + # sphinx-4 broke everything. https://bugs.gentoo.org/789492
338 + echo 'man_make_section_directory = False' >> doc/conf.py || die
339 +}
340 +
341 +src_configure() {
342 + python_setup # For sphinx
343 +
344 + tc-export CC CXX
345 +
346 + local myconf=(
347 + --bashcompletiondir="$(get_bashcompdir)"
348 + --emacslispdir="${EPREFIX}/${SITELISP}/${PN}"
349 + --emacsetcdir="${EPREFIX}/${SITEETC}/${PN}"
350 + --without-desktop
351 + --without-ruby
352 + --zshcompletiondir="${EPREFIX}/usr/share/zsh/site-functions"
353 + $(use_with apidoc api-docs)
354 + $(use_with doc docs)
355 + $(use_with emacs)
356 + )
357 +
358 + econf "${myconf[@]}"
359 +}
360 +
361 +python_compile() {
362 + pushd bindings/python-cffi > /dev/null || die
363 + distutils-r1_python_compile
364 + # copy stuff just in case
365 + if use test; then
366 + mkdir -p build/stage/tests || die
367 + cp -v tests/*.py build/stage/tests || die
368 + fi
369 + popd > /dev/null || die
370 +
371 + # TODO: we want to drop those, research revdeps
372 + pushd bindings/python > /dev/null || die
373 + distutils-r1_python_compile
374 + popd > /dev/null || die
375 +}
376 +
377 +python_compile_all() {
378 + use doc && emake -C bindings/python/docs html
379 +}
380 +
381 +src_compile() {
382 + python_setup # For sphinx
383 +
384 + # prevent race in emacs doc generation
385 + # FileNotFoundError: [Errno 2] No such file or directory: '..work/notmuch-0.31/emacs/notmuch.rsti'
386 + if use emacs; then
387 + use doc && emake -j1 -C emacs docstring.stamp V=1 #nowarn
388 + fi
389 +
390 + emake V=1
391 +
392 + use python && distutils-r1_src_compile
393 +
394 + if use mutt; then
395 + pushd contrib/notmuch-mutt > /dev/null || die
396 + emake notmuch-mutt.1
397 + popd > /dev/null || die
398 + fi
399 +}
400 +
401 +python_test() {
402 + # we only have tests for cffi bindings
403 + pushd bindings/python-cffi > /dev/null || die
404 + rm -f tox.ini || die
405 + pytest -vv || die "Tests failed with ${EPYTHON}"
406 + popd > /dev/null || die
407 +}
408 +
409 +src_test() {
410 + local test_failures=()
411 + pax-mark -m notmuch
412 + LD_LIBRARY_PATH="${S}/lib" \
413 + nonfatal emake test V=1 OPTIONS="--verbose --tee" || test_failures+=( "'emake tests'" )
414 + pax-mark -ze notmuch
415 +
416 + # both lib and bin needed for testsuite.
417 + if use python; then
418 + LD_LIBRARY_PATH="${S}/lib" \
419 + PATH="${S}:${PATH}" \
420 + nonfatal distutils-r1_src_test || test_failures+=( "'python tests'" )
421 + fi
422 +
423 + [[ ${test_failures} ]] && die "Tests failed: ${test_failures[@]}"
424 +}
425 +
426 +python_install() {
427 + pushd bindings/python-cffi > /dev/null || die
428 + distutils-r1_python_install
429 + popd > /dev/null || die
430 +
431 + pushd bindings/python > /dev/null || die
432 + distutils-r1_python_install
433 + popd > /dev/null || die
434 +}
435 +
436 +src_install() {
437 + default
438 +
439 + if use doc; then
440 + pushd doc/_build/man/man1 > /dev/null || die
441 + ln notmuch.1 notmuch-setup.1 || die
442 + popd > /dev/null || die
443 + if use apidoc; then
444 + # rename overly generic manpage to avoid clashes
445 + mv doc/_build/man/man3/deprecated.3 \
446 + doc/_build/man/man3/notmuch-deprecated.3 || die
447 + fi
448 + doman doc/_build/man/man?/*.?
449 + fi
450 +
451 + if use emacs; then
452 + elisp-site-file-install "${FILESDIR}/${SITEFILE}" || die
453 + domenu emacs/notmuch-emacs-mua.desktop
454 + fi
455 +
456 + if use nmbug; then
457 + # TODO: those guys need proper deps
458 + python_fix_shebang devel/nmbug/{nmbug,notmuch-report}
459 + dobin devel/nmbug/{nmbug,notmuch-report}
460 + fi
461 +
462 + if use mutt; then
463 + pushd contrib/notmuch-mutt > /dev/null || die
464 + dobin notmuch-mutt
465 + # this manpage is built by pod2man
466 + doman notmuch-mutt.1
467 + insinto /etc/mutt
468 + doins notmuch-mutt.rc
469 + dodoc README-mutt
470 + popd > /dev/null || die
471 + fi
472 +
473 + local DOCS=( README{,.rst} INSTALL NEWS )
474 + einstalldocs
475 +
476 + if use python; then
477 + use doc && local HTML_DOCS=( bindings/python/docs/html/. )
478 + distutils-r1_src_install
479 + fi
480 +}
481 +
482 +pkg_preinst() {
483 + local _rcfile="/etc/mutt/notmuch-mutt.rc"
484 + if use mutt && ! [[ -e "${EROOT}"${_rcfile} ]]; then
485 + elog "To enable notmuch support in mutt, add the following line"
486 + elog "to your mutt config file:"
487 + elog ""
488 + elog " source ${_rcfile}"
489 + fi
490 +}
491 +
492 +pkg_postinst() {
493 + if use emacs; then
494 + elisp-site-regen
495 + xdg_desktop_database_update
496 + fi
497 +}
498 +
499 +pkg_postrm() {
500 + if use emacs; then
501 + elisp-site-regen
502 + xdg_desktop_database_update
503 + fi
504 +}