*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / net-irc / limnoria / limnoria-99999999.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5 PYTHON_COMPAT=( python{2_7,3_6,3_7} )
6
7 inherit distutils-r1
8
9 MY_PV="${PV:0:4}-${PV:4:2}-${PV:6:2}"
10 MY_PN="Limnoria"
11 MY_P="${MY_PN}-${MY_PV}"
12
13 if [[ ${PV} == "99999999" ]]; then
14         EGIT_REPO_URI="https://github.com/ProgVal/${MY_PN}.git"
15         EGIT_BRANCH="testing"
16         inherit git-r3
17         SRC_URI=""
18 else
19         SRC_URI="https://github.com/ProgVal/${MY_PN}/archive/master-${MY_PV}.tar.gz -> ${P}.tar.gz"
20         KEYWORDS="~amd64 ~x86"
21         S="${WORKDIR}/${MY_PN}-master-${MY_PV}"
22 fi
23
24 DESCRIPTION="Python based extensible IRC infobot and channel bot"
25 HOMEPAGE="https://supybot.aperio.fr/"
26 LICENSE="BSD"
27 SLOT="0"
28 IUSE="crypt ssl test"
29
30 RDEPEND="
31         dev-python/chardet[${PYTHON_USEDEP}]
32         dev-python/ecdsa[${PYTHON_USEDEP}]
33         dev-python/feedparser[${PYTHON_USEDEP}]
34         dev-python/python-dateutil[${PYTHON_USEDEP}]
35         dev-python/pytz[${PYTHON_USEDEP}]
36         dev-python/PySocks[${PYTHON_USEDEP}]
37         dev-python/sqlalchemy[${PYTHON_USEDEP}]
38         crypt? ( dev-python/python-gnupg[${PYTHON_USEDEP}] )
39         ssl? ( dev-python/pyopenssl[${PYTHON_USEDEP}] )
40         !net-irc/supybot
41         !net-irc/supybot-plugins
42         "
43 DEPEND="${RDEPEND}
44         test? ( $(python_gen_cond_dep 'dev-python/mock[${PYTHON_USEDEP}]' python2_7) )"
45
46 RESTRICT="!test? ( test )"
47
48 src_unpack() {
49         if [[ ${PV} == "99999999" ]]; then
50                 git-r3_src_unpack
51         else
52                 unpack ${P}.tar.gz
53         fi
54 }
55
56 python_prepare(){
57         if python_is_python3; then
58                 einfo "Removing the RSS plugin because of clashes between libxml2's Python3"
59                 einfo "bindings and feedparser."
60                 rm -rf "plugins/RSS" || die
61         fi
62 }
63
64 python_install_all() {
65         distutils-r1_python_install_all
66         doman man/*
67 }
68
69 python_test() {
70         pushd "${T}" > /dev/null
71         PLUGINS_DIR="${BUILD_DIR}/lib/supybot/plugins"
72         EXCLUDE_PLUGINS=()
73         # intermittent failure due to issues loading libsandbox.so from LD_PRELOAD
74         # runs successfully when running the tests on the installed system
75         EXCLUDE_PLUGINS+=( --exclude="${PLUGINS_DIR}/Unix" )
76         # Runs despite --no-network (GH #1392)
77         EXCLUDE_PLUGINS+=( --exclude="${PLUGINS_DIR}/Aka" )
78         "${PYTHON}" "${BUILD_DIR}"/scripts/supybot-test "${BUILD_DIR}/../test" \
79                 --plugins-dir="${PLUGINS_DIR}" --no-network \
80                 --disable-multiprocessing "${EXCLUDE_PLUGINS[@]}" \
81                 || die "Tests failed under ${EPYTHON}"
82         popd > /dev/null
83 }
84
85 pkg_postinst() {
86         elog "Complete user documentation is available at https://limnoria-doc.readthedocs.org/"
87         elog ""
88         elog "Use supybot-wizard to create a configuration file."
89         elog "Run supybot </path/to/config> to use the bot."
90 }