1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
7 PYTHON_COMPAT=( python{3_6,3_7} )
9 inherit bash-completion-r1 elisp-common eutils flag-o-matic pax-utils \
10 distutils-r1 toolchain-funcs
12 DESCRIPTION="Thread-based e-mail indexer, supporting quick search and tagging"
13 HOMEPAGE="https://notmuchmail.org/"
14 SRC_URI="https://notmuchmail.org/releases/${P}.tar.xz
15 test? ( https://notmuchmail.org/releases/test-databases/database-v1.tar.xz )"
18 # Sub-slot corresponds to major wersion of libnotmuch.so.X.Y. Bump of Y is
19 # meant to be binary backward compatible.
21 KEYWORDS="~alpha amd64 x86 ~x64-solaris"
24 python? ( ${PYTHON_REQUIRED_USE} )
25 test? ( crypt emacs python valgrind )
27 IUSE="crypt doc emacs mutt nmbug python test valgrind"
29 RESTRICT="!test? ( test )"
32 !!<app-shells/bash-completion-1.9
33 >=dev-libs/glib-2.22:2
34 >=dev-libs/gmime-3.0.3:3.0
35 >=dev-libs/xapian-1.4.8:=
38 >=sys-libs/zlib-1.2.5.2
40 crypt? ( dev-libs/gmime:3.0[crypt] )
41 emacs? ( >=app-editors/emacs-24.1:* )
42 python? ( ${PYTHON_DEPS} )
48 dev-python/mock[${PYTHON_USEDEP}]
52 >=app-editors/emacs-24.1:*[libxml2]
54 crypt? ( app-crypt/gnupg dev-libs/openssl )
56 valgrind? ( dev-util/valgrind )
59 crypt? ( app-crypt/gnupg )
60 nmbug? ( dev-vcs/git )
65 dev-perl/String-ShellQuote
66 dev-perl/Term-ReadLine-Gnu
67 virtual/perl-Digest-SHA
68 virtual/perl-File-Path
69 virtual/perl-Getopt-Long
70 virtual/perl-Pod-Parser
74 DOCS=( AUTHORS NEWS README )
76 SITEFILE="50${PN}-gentoo.el"
77 MY_LD_LIBRARY_PATH="${WORKDIR}/${P}/lib"
79 "${FILESDIR}"/${PV}-0001-Use-loopback-IP-address-rather-than-name.patch
86 pushd bindings/$1 || die
97 if has_version '<net-mail/notmuch-0.18'; then
99 ewarn "There are few not backward compatible changes between"
100 ewarn "<notmuch-0.18 and >=notmuch-0.18. See NEWS file"
101 ewarn "(0.18 section) for details before first use!"
107 use emacs && elisp-check-emacs-version
113 mkdir -p "${S}"/test/test-databases || die
114 cp "${DISTDIR}"/database-v1.tar.xz "${S}"/test/test-databases/ || die
121 bindings python distutils-r1_src_prepare
122 bindings python mv README README-python || die
123 mv contrib/notmuch-mutt/README contrib/notmuch-mutt/README-mutt || die
125 # assure that new Makefile.config will be generated
126 rm -f Makefile.config || die
128 sed -e 's@^install: all install-man install-info$@install: all install-info@' -i Makefile.local
135 if [[ ${CHOST} == *-solaris* ]] ; then
136 append-ldflags -lnsl -lsocket # non-autoconf configure
141 python_setup # for sphinx
144 --bashcompletiondir="$(get_bashcompdir)"
145 --emacslispdir="${EPREFIX}/${SITELISP}/${PN}"
146 --emacsetcdir="${EPREFIX}/${SITEETC}/${PN}"
149 --zshcompletiondir="${EPREFIX}/usr/share/zsh/site-functions"
151 $(use_with doc api-docs)
154 econf "${myeconfargs[@]}"
158 python_setup # for sphinx
161 bindings python distutils-r1_src_compile
164 pushd contrib/notmuch-mutt || die
173 rm -r html/_sources || die
174 rm html/{objects.inv,.buildinfo} || die
175 mkdir -p ../html && mv html ../html/python || die
178 LD_LIBRARY_PATH="${MY_LD_LIBRARY_PATH}" bindings python pydocs
184 LD_LIBRARY_PATH="${MY_LD_LIBRARY_PATH}" V=1 default
192 doman doc/_build/man/man?/*.?
196 elisp-site-file-install "${FILESDIR}/${SITEFILE}" || die
200 dobin devel/nmbug/nmbug
201 dobin devel/nmbug/notmuch-report
205 pushd contrib/notmuch-mutt || die
209 doins notmuch-mutt.rc
214 DOCS="" bindings python distutils-r1_src_install
215 use doc && bindings python dodoc -r html
219 if use mutt && ! [[ -e ${ROOT}/etc/mutt/notmuch-mutt.rc ]]; then
220 elog "To enable notmuch support in mutt, add the following line into"
221 elog "your mutt config file, please:"
223 elog " source /etc/mutt/notmuch-mutt.rc"
228 use emacs && elisp-site-regen
232 use emacs && elisp-site-regen