*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / app-misc / solaar / solaar-0.9.2-r3.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5 PYTHON_COMPAT=( python{2_7,3_6} )
6
7 inherit distutils-r1 udev linux-info gnome2-utils
8
9 DESCRIPTION="A Linux device manager for Logitech's Unifying Receiver peripherals"
10 HOMEPAGE="https://pwr.github.com/Solaar/"
11 SRC_URI="https://github.com/pwr/Solaar/archive/${PV}.tar.gz -> ${P}.tar.gz"
12
13 LICENSE="GPL-2"
14 SLOT="0"
15 KEYWORDS="amd64 ~arm x86"
16 IUSE="doc"
17
18 RDEPEND="
19         acct-group/plugdev
20         >=dev-python/pyudev-0.13[${PYTHON_USEDEP}]
21         dev-python/pygobject:3[${PYTHON_USEDEP}]
22         x11-libs/gtk+:3[introspection]"
23
24 S=${WORKDIR}/Solaar-${PV}
25
26 CONFIG_CHECK="~HID_LOGITECH_DJ ~HIDRAW"
27
28 python_prepare_all() {
29         # don't autostart (bug #494608)
30         sed -i '/yield autostart_path/d' setup.py || die
31
32         # grant plugdev group rw access
33         sed -i 's/#MODE=/MODE=/' rules.d/42-logitech-unify-permissions.rules || die
34
35         distutils-r1_python_prepare_all
36 }
37
38 python_install_all() {
39         distutils-r1_python_install_all
40
41         udev_dorules rules.d/*.rules
42
43         dodoc docs/devices.md
44         if use doc; then
45                 dodoc -r docs/*
46         fi
47 }
48
49 pkg_postinst() {
50         if [[ -z ${REPLACING_VERSIONS} ]] ; then
51                 elog "Users must be in the plugdev group to use this application."
52         fi
53
54         gnome2_icon_cache_update
55 }
56
57 pkg_preinst() { gnome2_icon_savelist; }
58 pkg_postrm() { gnome2_icon_cache_update; }