*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / mail-client / alot / alot-0.8.1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 PYTHON_COMPAT=( python3_{6,7} )
7
8 inherit distutils-r1
9
10 DESCRIPTION="Experimental terminal UI for net-mail/notmuch written in Python"
11 HOMEPAGE="https://github.com/pazz/alot"
12 SRC_URI="https://github.com/pazz/alot/archive/${PV}.tar.gz -> ${P}.tar.gz"
13
14 LICENSE="GPL-3"
15 SLOT="0"
16 KEYWORDS="~amd64 ~x86"
17 IUSE="doc test"
18 RESTRICT="!test? ( test )"
19
20 RDEPEND="
21         >=app-crypt/gpgme-1.9.0[python,${PYTHON_USEDEP}]
22         >=dev-python/configobj-4.7.0[${PYTHON_USEDEP}]
23         dev-python/python-magic[${PYTHON_USEDEP}]
24         >=dev-python/urwid-1.3.0[${PYTHON_USEDEP}]
25         >=dev-python/urwidtrees-1.0[${PYTHON_USEDEP}]
26         dev-python/twisted[${PYTHON_USEDEP}]
27         net-mail/mailbase
28         >=net-mail/notmuch-0.27[crypt,python]
29         "
30 DEPEND="
31         dev-python/setuptools[${PYTHON_USEDEP}]
32         doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
33         test? (
34                 ${RDEPEND}
35                 dev-python/mock[${PYTHON_USEDEP}]
36         )
37         "
38
39 PATCHES=(
40         "${FILESDIR}/${PV}-0001-remove-non-working-test.patch"
41         )
42
43 python_compile_all() {
44         if use doc; then
45                 emake -C docs html
46                 HTML_DOCS=( docs/build/html/. )
47         fi
48 }
49
50 src_test() {
51         esetup.py test
52 }
53
54 python_install_all() {
55         distutils-r1_python_install_all
56
57         insinto /usr/share/alot
58         doins -r extra
59 }
60
61 pkg_postinst() {
62         if [[ -z ${REPLACING_VERSIONS} ]] ; then
63                 elog ""
64                 elog "If you are new to Alot you may want to take a look at"
65                 elog "the user manual:"
66                 elog "   https://alot.readthedocs.io/en/latest/"
67                 elog ""
68         else
69                 local rv
70                 for rv in ${REPLACING_VERSIONS} ; do
71                         if ver_test "${rv}" -le "0.5.1"; then
72                                 ewarn ""
73                                 ewarn "Since 0.6 version the GPG engine has switched to app-crypt/gpgme"
74                                 ewarn "to use GPG signing operations, you can pass the key id has arg"
75                                 ewarn "or setup the gpg_key value in your config file, see"
76                                 ewarn "  https://alot.readthedocs.io/en/latest/usage/crypto.html?highlight=gpg"
77                                 ewarn ""
78                                 break
79                         fi
80                 done
81         fi
82 }