*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / dev-util / rosdep / rosdep-0.14.0.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} pypy3 )
6
7 SCM=""
8 if [ "${PV#9999}" != "${PV}" ] ; then
9         SCM="git-r3"
10         EGIT_REPO_URI="https://github.com/ros-infrastructure/rosdep"
11 fi
12
13 inherit ${SCM} distutils-r1
14
15 DESCRIPTION="Command-line tool for installing ROS system dependencies"
16 HOMEPAGE="http://wiki.ros.org/rosdep"
17 if [ "${PV#9999}" != "${PV}" ] ; then
18         SRC_URI=""
19         KEYWORDS=""
20 else
21         SRC_URI="http://download.ros.org/downloads/${PN}/${P}.tar.gz
22                 https://github.com/ros-infrastructure/rosdep/archive/${PV}.tar.gz -> ${P}.tar.gz
23         "
24         KEYWORDS="~amd64 ~arm"
25 fi
26
27 LICENSE="BSD"
28 SLOT="0"
29 IUSE="test"
30 RESTRICT="!test? ( test )"
31
32 RDEPEND="
33         dev-python/catkin_pkg[${PYTHON_USEDEP}]
34         dev-python/rospkg[${PYTHON_USEDEP}]
35         dev-python/rosdistro[${PYTHON_USEDEP}]
36         dev-python/pyyaml[${PYTHON_USEDEP}]"
37 DEPEND="${RDEPEND}"
38 BDEPEND="
39         dev-python/nose[${PYTHON_USEDEP}]
40         test? (
41                 dev-python/coverage[${PYTHON_USEDEP}]
42                 dev-python/mock[${PYTHON_USEDEP}]
43                 dev-python/flake8[${PYTHON_USEDEP}]
44         )
45 "
46
47 python_test() {
48         nosetests --with-coverage --cover-package=rosdep2 --with-xunit test || die
49 }
50
51 pkg_postrm() {
52         if [ "${ROOT:-/}" = "/" ] ; then
53                 einfo "Removing rosdep default sources list."
54                 rm -f "${EPREFIX}/etc/ros/rosdep/sources.list.d/20-default.list"
55         fi
56 }
57
58 pkg_postinst() {
59         if [ "${ROOT:-/}" = "/" -a ! -f "${EPREFIX}/etc/ros/rosdep/sources.list.d/20-default.list" ] ; then
60                 einfo "Initializing rosdep"
61                 rosdep init
62         fi
63 }