1 |
|
# Copyright 1999-2024 Gentoo Authors
|
|
1 |
# Copyright 1999-2025 Gentoo Authors
|
2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
3 |
3 |
|
4 |
4 |
EAPI=8
|
5 |
5 |
|
6 |
6 |
DISTUTILS_USE_PEP517=setuptools
|
7 |
|
DISTUTILS_SINGLE_IMPL=1
|
8 |
|
PYTHON_COMPAT=( python3_{10..12} )
|
|
7 |
PYTHON_COMPAT=( python3_{10..13} )
|
9 |
8 |
|
10 |
9 |
inherit linux-info udev xdg distutils-r1
|
11 |
10 |
|
... | ... | |
22 |
21 |
|
23 |
22 |
LICENSE="GPL-2"
|
24 |
23 |
SLOT="0"
|
25 |
|
IUSE="doc appindicator libnotify"
|
|
24 |
IUSE="appindicator dbus doc libnotify test wayland"
|
|
25 |
RESTRICT="!test? ( test )"
|
26 |
26 |
|
27 |
27 |
RDEPEND="
|
28 |
28 |
acct-group/plugdev
|
29 |
|
$(python_gen_cond_dep '
|
30 |
|
dev-python/evdev[${PYTHON_USEDEP}]
|
31 |
|
dev-python/psutil[${PYTHON_USEDEP}]
|
32 |
|
dev-python/pygobject:3[${PYTHON_USEDEP}]
|
33 |
|
dev-python/python-xlib[${PYTHON_USEDEP}]
|
34 |
|
>=dev-python/pyudev-0.13[${PYTHON_USEDEP}]
|
35 |
|
dev-python/pyyaml[${PYTHON_USEDEP}]
|
36 |
|
|
37 |
|
')
|
|
29 |
dev-python/evdev[${PYTHON_USEDEP}]
|
|
30 |
dev-python/psutil[${PYTHON_USEDEP}]
|
|
31 |
dev-python/pygobject:3[${PYTHON_USEDEP}]
|
|
32 |
dev-python/python-xlib[${PYTHON_USEDEP}]
|
|
33 |
>=dev-python/pyudev-0.13[${PYTHON_USEDEP}]
|
|
34 |
dev-python/pyyaml[${PYTHON_USEDEP}]
|
|
35 |
dev-python/typing-extensions[${PYTHON_USEDEP}]
|
38 |
36 |
x11-libs/gtk+:3[introspection]
|
39 |
37 |
appindicator? ( dev-libs/libayatana-appindicator )
|
40 |
|
libnotify? ( x11-libs/libnotify[introspection] )"
|
|
38 |
libnotify? ( x11-libs/libnotify[introspection] )
|
|
39 |
dbus? ( dev-python/dbus-python )
|
|
40 |
"
|
|
41 |
BDEPEND="
|
|
42 |
test? (
|
|
43 |
dev-python/pytest-mock[${PYTHON_USEDEP}]
|
|
44 |
)
|
|
45 |
"
|
41 |
46 |
# libayatana-appindicator & libnotify are entirely optional and detected at runtime
|
42 |
47 |
|
43 |
48 |
CONFIG_CHECK="~HID_LOGITECH_DJ ~HIDRAW"
|
44 |
49 |
|
|
50 |
distutils_enable_tests pytest
|
|
51 |
|
45 |
52 |
python_prepare_all() {
|
46 |
53 |
# don't autostart (bug #494608)
|
47 |
|
sed -i \
|
|
54 |
sed -r \
|
48 |
55 |
-e '/yield autostart_path/d' \
|
49 |
|
setup.py || die
|
50 |
|
|
51 |
|
sed -i -r \
|
52 |
56 |
-e '/yield.*udev.*rules.d/{s,/etc,/lib,g}' \
|
53 |
|
setup.py || die
|
|
57 |
-i setup.py || die
|
54 |
58 |
|
55 |
59 |
# grant plugdev group rw access
|
56 |
|
sed -i 's/#MODE=/MODE=/' rules.d/42-logitech-unify-permissions.rules || die
|
|
60 |
sed 's/#MODE=/MODE=/' \
|
|
61 |
-i rules.d/42-logitech-unify-permissions.rules || die
|
|
62 |
# and the same for wayland (bug #933418)
|
|
63 |
sed 's/#MODE=/MODE=/' \
|
|
64 |
-i rules.d-uinput/42-logitech-unify-permissions.rules || die
|
57 |
65 |
|
58 |
66 |
distutils-r1_python_prepare_all
|
59 |
67 |
}
|
... | ... | |
61 |
69 |
python_install_all() {
|
62 |
70 |
distutils-r1_python_install_all
|
63 |
71 |
|
64 |
|
dodoc docs/devices.md ChangeLog.md
|
|
72 |
dodoc docs/devices.md CHANGELOG.md
|
65 |
73 |
if use doc; then
|
66 |
74 |
dodoc -r docs/*
|
67 |
75 |
else
|
68 |
76 |
newdoc docs/index.md README.md
|
69 |
77 |
fi
|
70 |
|
udev_dorules "${S}"/rules.d/42-logitech-unify-permissions.rules
|
|
78 |
|
|
79 |
# bug #933418
|
|
80 |
if use wayland; then
|
|
81 |
udev_dorules "${S}"/rules.d-uinput/42-logitech-unify-permissions.rules
|
|
82 |
else
|
|
83 |
udev_dorules "${S}"/rules.d/42-logitech-unify-permissions.rules
|
|
84 |
fi
|
|
85 |
}
|
|
86 |
|
|
87 |
python_test() {
|
|
88 |
local -a EPYTEST_DESELECT=(
|
|
89 |
# don't like sandbox
|
|
90 |
tests/logitech_receiver/test_desktop_notifications.py::test_notifications_available
|
|
91 |
tests/logitech_receiver/test_desktop_notifications.py::test_init
|
|
92 |
tests/logitech_receiver/test_desktop_notifications.py::test_show
|
|
93 |
tests/solaar/ui/test_desktop_notifications.py::test_notifications_available
|
|
94 |
tests/solaar/ui/test_desktop_notifications.py::test_init
|
|
95 |
)
|
|
96 |
|
|
97 |
distutils-r1_python_test
|
71 |
98 |
}
|
72 |
99 |
|
73 |
100 |
pkg_postinst() {
|