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/
Date: Sun, 01 Nov 2020 11:51:51
Message-Id: 1604231398.539a232d6c9d5faca4e067bcf9c96cccac3acdc7.gyakovlev@gentoo
1 commit: 539a232d6c9d5faca4e067bcf9c96cccac3acdc7
2 Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
3 AuthorDate: Sun Nov 1 05:59:13 2020 +0000
4 Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
5 CommitDate: Sun Nov 1 11:49:58 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=539a232d
7
8 net-mail/notmuch: QA revbump: fix multiple issues
9
10 add apidoc flag, which depends on doxygen
11 split doxygen dep under apidoc flag
12 apidoc depends on doc, add required_use
13 add py3.9 and pypy3 support (all tests pass)
14 switch to cffi virtual
15 add missing PYTHON_USEDEP to cffi
16 add desktop file installation for emacs
17 regen desktop database if required
18 add python tests and pytest dep
19 remove mock dep, works fine with stdlib one
20 add perl dep where appropriate for some scripts
21 add missing subslot on zlib
22 use standard python subphase functions instead of bindings()
23 fix makefile target sed
24 use more standard funtion calls instead of hard to read hacks
25 work around a Makefile race emacs doc generation, it needs -j1
26 add python documentation installation
27 add basic docs, switch to einstalldocs
28 prevent automagic dependency on gnu parallel in tests
29 make tests more verbose
30 prevent automagic dependency on sphinx (bug #751535)
31 fix manpage installation
32 fix manpage compression
33 fix texinfo file installation
34 fix missing manpage symlink
35 fix overly generic manpage name
36 fix nmbug & friends shebangs
37 silence pushd/popd calls
38 move around some deps
39 misc style changes
40
41 TODO: more cleanup needed. nmbug need python dependencies.
42 TODO: remove old bindings to fix setuptools warning.
43 TODO: crypto tests fail ( probably #749969 )
44
45 Bug: https://bugs.gentoo.org/751535
46 Package-Manager: Portage-3.0.8, Repoman-3.0.2
47 Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
48
49 net-mail/notmuch/metadata.xml | 1 +
50 net-mail/notmuch/notmuch-0.31-r1.ebuild | 213 ------------------------
51 net-mail/notmuch/notmuch-0.31-r2.ebuild | 279 ++++++++++++++++++++++++++++++++
52 3 files changed, 280 insertions(+), 213 deletions(-)
53
54 diff --git a/net-mail/notmuch/metadata.xml b/net-mail/notmuch/metadata.xml
55 index 799fdb5f19a..9c4dc0d6dd2 100644
56 --- a/net-mail/notmuch/metadata.xml
57 +++ b/net-mail/notmuch/metadata.xml
58 @@ -10,6 +10,7 @@
59 <name>Proxy Maintainers</name>
60 </maintainer>
61 <use>
62 + <flag name="apidoc">Provide doxygen generated API docs</flag>
63 <flag name="doc">Install API documentation</flag>
64 <flag name="crypt">Support decryption and verification of PGP/MIME
65 messages and in Emacs UI - encryption; support also S/MIME
66
67 diff --git a/net-mail/notmuch/notmuch-0.31-r1.ebuild b/net-mail/notmuch/notmuch-0.31-r1.ebuild
68 deleted file mode 100644
69 index 07472ca4b03..00000000000
70 --- a/net-mail/notmuch/notmuch-0.31-r1.ebuild
71 +++ /dev/null
72 @@ -1,213 +0,0 @@
73 -# Copyright 1999-2020 Gentoo Authors
74 -# Distributed under the terms of the GNU General Public License v2
75 -
76 -EAPI=7
77 -
78 -DISTUTILS_OPTIONAL=1
79 -NEED_EMACS="24.1"
80 -PYTHON_COMPAT=( python3_{6,7,8} )
81 -
82 -inherit bash-completion-r1 distutils-r1 elisp-common eutils flag-o-matic \
83 - pax-utils toolchain-funcs
84 -
85 -DESCRIPTION="Thread-based e-mail indexer, supporting quick search and tagging"
86 -HOMEPAGE="https://notmuchmail.org/"
87 -SRC_URI="https://notmuchmail.org/releases/${P}.tar.xz
88 - test? ( https://notmuchmail.org/releases/test-databases/database-v1.tar.xz )"
89 -
90 -LICENSE="GPL-3"
91 -# Sub-slot corresponds to major wersion of libnotmuch.so.X.Y. Bump of Y is
92 -# meant to be binary backward compatible.
93 -SLOT="0/5"
94 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ppc64 ~x86"
95 -REQUIRED_USE="
96 - nmbug? ( python )
97 - python? ( ${PYTHON_REQUIRED_USE} )
98 - test? ( crypt emacs python valgrind )
99 -"
100 -IUSE="crypt doc emacs mutt nmbug python test valgrind"
101 -RESTRICT="!test? ( test )"
102 -
103 -BDEPEND="
104 - virtual/pkgconfig
105 - doc? (
106 - app-doc/doxygen
107 - dev-python/mock[${PYTHON_USEDEP}]
108 - dev-python/sphinx
109 - sys-apps/texinfo
110 - )
111 -"
112 -COMMON_DEPEND="
113 - dev-libs/glib
114 - dev-libs/gmime:3.0[crypt]
115 - >=dev-libs/xapian-1.4.0:=
116 - sys-libs/talloc
117 - sys-libs/zlib
118 - emacs? ( >=app-editors/emacs-${NEED_EMACS}:* )
119 - python? (
120 - ${PYTHON_DEPS}
121 - dev-python/cffi
122 - )
123 -"
124 -DEPEND="${COMMON_DEPEND}
125 - test? (
126 - >=app-editors/emacs-${NEED_EMACS}:*[libxml2]
127 - app-misc/dtach
128 - sys-devel/gdb
129 - crypt? (
130 - app-crypt/gnupg
131 - dev-libs/openssl
132 - )
133 - )
134 - valgrind? ( dev-util/valgrind )
135 -"
136 -RDEPEND="${COMMON_DEPEND}
137 - crypt? ( app-crypt/gnupg )
138 - mutt? (
139 - dev-perl/File-Which
140 - dev-perl/Mail-Box
141 - dev-perl/MailTools
142 - dev-perl/String-ShellQuote
143 - dev-perl/Term-ReadLine-Gnu
144 - virtual/perl-Digest-SHA
145 - virtual/perl-File-Path
146 - virtual/perl-Getopt-Long
147 - virtual/perl-Pod-Parser
148 - )
149 - nmbug? ( dev-vcs/git )
150 -"
151 -
152 -DOCS=( AUTHORS NEWS README )
153 -SITEFILE="50${PN}-gentoo.el"
154 -
155 -bindings() {
156 - local rc=0
157 - if use python; then
158 - # CFFI based bindings (recommended)
159 - pushd bindings/python-cffi || die
160 - ${@}
161 - rc=${?}
162 - popd || die
163 -
164 - # Old deprecated bindings, #736204. These are known to cause
165 - # memory loss and other issues. Avoid if at all possible.
166 - pushd bindings/python || die
167 - ${@}
168 - rc=${?}
169 - popd || die
170 - fi
171 - return ${rc}
172 -}
173 -
174 -pkg_setup() {
175 - use emacs && elisp-check-emacs-version
176 -}
177 -
178 -src_unpack() {
179 - unpack "${P}".tar.xz
180 - if use test; then
181 - mkdir -p "${S}"/test/test-databases || die
182 - cp "${DISTDIR}"/database-v1.tar.xz "${S}"/test/test-databases/ || die
183 - fi
184 -}
185 -
186 -src_prepare() {
187 - local _deps=""
188 - default
189 -
190 - # Python bindings
191 - bindings distutils-r1_src_prepare
192 - mv contrib/notmuch-mutt/README contrib/notmuch-mutt/README-mutt || die
193 -
194 - # Override dependencies for 'install' target
195 - use doc && _deps="install-info"
196 - sed -e "s/^install:.\+/install: all ${_deps}/" -i Makefile.local || die
197 -
198 - if use test; then
199 - append-cflags -g
200 - append-cxxflags -g
201 - fi
202 -
203 - if [[ ${CHOST} == *-solaris* ]] ; then
204 - # Non-autoconf configure
205 - append-ldflags -lnsl -lsocket
206 - fi
207 -}
208 -
209 -src_configure() {
210 - python_setup # For sphinx
211 - local _args=(
212 - --bashcompletiondir="$(get_bashcompdir)"
213 - --emacslispdir="${EPREFIX}/${SITELISP}/${PN}"
214 - --emacsetcdir="${EPREFIX}/${SITEETC}/${PN}"
215 - --without-desktop
216 - --without-ruby
217 - --zshcompletiondir="${EPREFIX}/usr/share/zsh/site-functions"
218 - $(use_with emacs)
219 - $(use_with doc api-docs)
220 - )
221 - tc-export CC CXX
222 - econf "${_args[@]}"
223 -}
224 -
225 -src_compile() {
226 - python_setup # For sphinx
227 - V=1 default
228 - bindings distutils-r1_src_compile
229 -
230 - if use mutt; then
231 - pushd contrib/notmuch-mutt || die
232 - emake notmuch-mutt.1
233 - popd || die
234 - fi
235 -}
236 -
237 -src_test() {
238 - pax-mark -m notmuch
239 - LD_LIBRARY_PATH="${WORKDIR}/${P}/lib" V=1 default
240 - pax-mark -ze notmuch
241 -}
242 -
243 -src_install() {
244 - default
245 - doman doc/_build/man/man?/*.?
246 -
247 - if use emacs; then
248 - elisp-site-file-install "${FILESDIR}/${SITEFILE}" || die
249 - fi
250 -
251 - if use nmbug; then
252 - dobin devel/nmbug/nmbug
253 - dobin devel/nmbug/notmuch-report
254 - fi
255 -
256 - if use mutt; then
257 - pushd contrib/notmuch-mutt || die
258 - dobin notmuch-mutt
259 - doman notmuch-mutt.1
260 - insinto /etc/mutt
261 - doins notmuch-mutt.rc
262 - dodoc README-mutt
263 - popd || die
264 - fi
265 -
266 - DOCS="" bindings distutils-r1_src_install
267 -}
268 -
269 -pkg_preinst() {
270 - local _rcfile="/etc/mutt/notmuch-mutt.rc"
271 - if use mutt && ! [[ -e ${ROOT}${_rcfile} ]]; then
272 - elog "To enable notmuch support in mutt, add the following line"
273 - elog "to your mutt config file:"
274 - elog ""
275 - elog " source ${_rcfile}"
276 - fi
277 -}
278 -
279 -pkg_postinst() {
280 - use emacs && elisp-site-regen
281 -}
282 -
283 -pkg_postrm() {
284 - use emacs && elisp-site-regen
285 -}
286
287 diff --git a/net-mail/notmuch/notmuch-0.31-r2.ebuild b/net-mail/notmuch/notmuch-0.31-r2.ebuild
288 new file mode 100644
289 index 00000000000..f9466e5398c
290 --- /dev/null
291 +++ b/net-mail/notmuch/notmuch-0.31-r2.ebuild
292 @@ -0,0 +1,279 @@
293 +# Copyright 1999-2020 Gentoo Authors
294 +# Distributed under the terms of the GNU General Public License v2
295 +
296 +EAPI=7
297 +
298 +DISTUTILS_OPTIONAL=1
299 +NEED_EMACS="24.1"
300 +PYTHON_COMPAT=( python3_{6,7,8,9} pypy3 )
301 +
302 +inherit bash-completion-r1 desktop distutils-r1 elisp-common eutils flag-o-matic pax-utils toolchain-funcs xdg-utils
303 +
304 +DESCRIPTION="Thread-based e-mail indexer, supporting quick search and tagging"
305 +HOMEPAGE="https://notmuchmail.org/"
306 +SRC_URI="https://notmuchmail.org/releases/${P}.tar.xz
307 + test? ( https://notmuchmail.org/releases/test-databases/database-v1.tar.xz )"
308 +
309 +LICENSE="GPL-3"
310 +# Sub-slot corresponds to major wersion of libnotmuch.so.X.Y. Bump of Y is
311 +# meant to be binary backward compatible.
312 +SLOT="0/5"
313 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ppc64 ~x86"
314 +REQUIRED_USE="
315 + apidoc? ( doc )
316 + nmbug? ( python )
317 + python? ( ${PYTHON_REQUIRED_USE} )
318 + test? ( crypt emacs python valgrind )
319 +"
320 +IUSE="apidoc crypt doc emacs mutt nmbug python test valgrind"
321 +RESTRICT="!test? ( test )"
322 +
323 +BDEPEND="
324 + virtual/pkgconfig
325 + apidoc? (
326 + app-doc/doxygen
327 + dev-lang/perl
328 + )
329 + doc? (
330 + dev-python/sphinx
331 + sys-apps/texinfo
332 + )
333 + python? ( dev-python/pytest[${PYTHON_USEDEP}] )
334 +"
335 +
336 +COMMON_DEPEND="
337 + dev-libs/glib
338 + dev-libs/gmime:3.0[crypt]
339 + >=dev-libs/xapian-1.4.0:=
340 + sys-libs/talloc
341 + sys-libs/zlib:=
342 + emacs? ( >=app-editors/emacs-${NEED_EMACS}:* )
343 + python? (
344 + ${PYTHON_DEPS}
345 + virtual/python-cffi[${PYTHON_USEDEP}]
346 + )
347 +"
348 +
349 +DEPEND="${COMMON_DEPEND}
350 + test? (
351 + >=app-editors/emacs-${NEED_EMACS}:*[libxml2]
352 + app-misc/dtach
353 + sys-devel/gdb
354 + crypt? (
355 + app-crypt/gnupg
356 + dev-libs/openssl
357 + )
358 + )
359 + valgrind? ( dev-util/valgrind )
360 +"
361 +
362 +RDEPEND="${COMMON_DEPEND}
363 + crypt? ( app-crypt/gnupg )
364 + mutt? (
365 + dev-perl/File-Which
366 + dev-perl/Mail-Box
367 + dev-perl/MailTools
368 + dev-perl/String-ShellQuote
369 + dev-perl/Term-ReadLine-Gnu
370 + virtual/perl-Digest-SHA
371 + virtual/perl-File-Path
372 + virtual/perl-Getopt-Long
373 + virtual/perl-Pod-Parser
374 + )
375 + nmbug? ( dev-vcs/git )
376 +"
377 +
378 +DOCS=( AUTHORS NEWS README )
379 +SITEFILE="50${PN}-gentoo.el"
380 +
381 +pkg_setup() {
382 + use emacs && elisp-check-emacs-version
383 +}
384 +
385 +src_unpack() {
386 + unpack "${P}".tar.xz
387 + if use test; then
388 + mkdir -p "${S}"/test/test-databases || die
389 + cp "${DISTDIR}"/database-v1.tar.xz "${S}"/test/test-databases/ || die
390 + fi
391 +}
392 +
393 +src_prepare() {
394 + default
395 +
396 + use python && distutils-r1_src_prepare
397 +
398 + mv contrib/notmuch-mutt/README contrib/notmuch-mutt/README-mutt || die
399 +
400 + # Override 'install' target, we want to install manpages with doman, but let it install texinfo files.
401 + sed -i "s/all install-man install-info/all $(usex doc install-info '')/" "Makefile.local" || die
402 +
403 + use test && append-flags '-g'
404 +
405 + # Non-autoconf configure
406 + [[ ${CHOST} == *-solaris* ]] && append-ldflags '-lnsl' '-lsocket'
407 +}
408 +
409 +src_configure() {
410 + python_setup # For sphinx
411 +
412 + tc-export CC CXX
413 +
414 + local myconf=(
415 + --bashcompletiondir="$(get_bashcompdir)"
416 + --emacslispdir="${EPREFIX}/${SITELISP}/${PN}"
417 + --emacsetcdir="${EPREFIX}/${SITEETC}/${PN}"
418 + --without-desktop
419 + --without-ruby
420 + --zshcompletiondir="${EPREFIX}/usr/share/zsh/site-functions"
421 + $(use_with apidoc api-docs)
422 + $(use_with doc docs)
423 + $(use_with emacs)
424 + )
425 +
426 + econf "${myconf[@]}"
427 +}
428 +
429 +python_compile() {
430 + pushd bindings/python-cffi > /dev/null || die
431 + distutils-r1_python_compile
432 + popd > /dev/null || die
433 +
434 + # TODO: we want to drop those, research revdeps
435 + pushd bindings/python > /dev/null || die
436 + distutils-r1_python_compile
437 + popd > /dev/null || die
438 +}
439 +
440 +python_compile_all() {
441 + use doc && emake -C bindings/python/docs html
442 +}
443 +
444 +src_compile() {
445 + python_setup # For sphinx
446 +
447 + # prevent race in emacs doc generation
448 + # FileNotFoundError: [Errno 2] No such file or directory: '..work/notmuch-0.31/emacs/notmuch.rsti'
449 + if use emacs; then
450 + use doc && emake -j1 -C emacs docstring.stamp V=1 #nowarn
451 + fi
452 +
453 + emake V=1
454 +
455 + use python && distutils-r1_src_compile
456 +
457 + if use mutt; then
458 + pushd contrib/notmuch-mutt > /dev/null || die
459 + emake notmuch-mutt.1
460 + popd > /dev/null || die
461 + fi
462 +}
463 +
464 +python_test() {
465 + # we only have tests for cffi bindings
466 + pushd bindings/python-cffi > /dev/null || die
467 + rm -f tox.ini || die
468 + pytest -vv || die "Tests failed with ${EPYTHON}"
469 + popd > /dev/null || die
470 +}
471 +
472 +src_test() {
473 + local test_failures=()
474 + # NOTMUCH_TEST_SERIALIZE is needed to avoid using gnu parallel (if it's installed)
475 + pax-mark -m notmuch
476 + NOTMUCH_TEST_SERIALIZE=1 \
477 + LD_LIBRARY_PATH="${S}/lib" \
478 + nonfatal emake test V=1 OPTIONS="--verbose --tee" || test_failures+=( "'emake tests'" )
479 + pax-mark -ze notmuch
480 +
481 + # both lib and bin needed for testsuite.
482 + if use python; then
483 + LD_LIBRARY_PATH="${S}/lib" \
484 + PATH="${S}:${PATH}" \
485 + nonfatal distutils-r1_src_test || test_failures+=( "'python tests'" )
486 + fi
487 +
488 + [[ ${test_failures} ]] && die "Tests failed: ${test_failures[@]}"
489 +}
490 +
491 +python_install() {
492 + pushd bindings/python-cffi > /dev/null || die
493 + distutils-r1_python_install
494 + popd > /dev/null || die
495 +
496 + pushd bindings/python > /dev/null || die
497 + distutils-r1_python_install
498 + popd > /dev/null || die
499 +}
500 +
501 +src_install() {
502 + default
503 +
504 + local DOCS=( README{,.rst} INSTALL NEWS )
505 +
506 + if use doc; then
507 + pushd doc/_build/man/man1 > /dev/null || die
508 + ln notmuch.1 notmuch-setup.1 || die
509 + popd > /dev/null || die
510 + if use apidoc; then
511 + # rename overly generic manpage to avoid clashes
512 + mv doc/_build/man/man3/deprecated.3 \
513 + doc/_build/man/man3/notmuch-deprecated.3 || die
514 + fi
515 + doman doc/_build/man/man?/*.?
516 + fi
517 +
518 +
519 + if use emacs; then
520 + elisp-site-file-install "${FILESDIR}/${SITEFILE}" || die
521 + domenu emacs/notmuch-emacs-mua.desktop
522 + fi
523 +
524 + if use nmbug; then
525 + # TODO: those guys need proper deps
526 + python_fix_shebang devel/nmbug/{nmbug,notmuch-report}
527 + dobin devel/nmbug/{nmbug,notmuch-report}
528 + fi
529 +
530 + if use mutt; then
531 + pushd contrib/notmuch-mutt > /dev/null || die
532 + dobin notmuch-mutt
533 + # this manpage is built by pod2man
534 + doman notmuch-mutt.1
535 + insinto /etc/mutt
536 + doins notmuch-mutt.rc
537 + DOCS+=( README-mutt )
538 + popd > /dev/null || die
539 + fi
540 +
541 + einstalldocs
542 +
543 + if use python; then
544 + use doc && local HTML_DOCS=( bindings/python/docs/html/. )
545 + distutils-r1_src_install
546 + fi
547 +}
548 +
549 +pkg_preinst() {
550 + local _rcfile="/etc/mutt/notmuch-mutt.rc"
551 + if use mutt && ! [[ -e ${ROOT}${_rcfile} ]]; then
552 + elog "To enable notmuch support in mutt, add the following line"
553 + elog "to your mutt config file:"
554 + elog ""
555 + elog " source ${_rcfile}"
556 + fi
557 +}
558 +
559 +pkg_postinst() {
560 + if use emacs; then
561 + elisp-site-regen
562 + xdg_desktop_database_update
563 + fi
564 +}
565 +
566 +pkg_postrm() {
567 + if use emacs; then
568 + elisp-site-regen
569 + xdg_desktop_database_update
570 + fi
571 +}