remove ia64 keywords
[gentoo-zh.git] / dev-libs / libratbag / libratbag-0.18.ebuild
blob51ed9a36c1cd6b051ca27cd5234335b3e4f8bad2
1 # Copyright 1999-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=8
6 PYTHON_COMPAT=( python3_{9..12} )
8 inherit meson python-single-r1 systemd udev
10 DESCRIPTION="Library to configure gaming mice"
11 HOMEPAGE="https://github.com/libratbag/libratbag"
13 SRC_URI="https://github.com/libratbag/libratbag/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
15 LICENSE="MIT"
16 SLOT="0"
17 KEYWORDS="~amd64 ~x86"
18 IUSE="doc elogind systemd test"
19 REQUIRED_USE="
20 ${PYTHON_REQUIRED_USE}
21 ^^ ( elogind systemd )
23 RESTRICT="mirror !test? ( test )"
25 BDEPEND="
26 ${PYTHON_DEPS}
27 dev-lang/swig
28 virtual/pkgconfig
29 doc? (
30 $(python_gen_cond_dep '
31 dev-python/sphinx[${PYTHON_USEDEP}]
32 dev-python/sphinx-rtd-theme[${PYTHON_USEDEP}]
35 test? (
36 dev-libs/check
37 dev-libs/gobject-introspection
38 dev-debug/valgrind
39 $(python_gen_cond_dep '
40 dev-python/pygobject:3[${PYTHON_USEDEP}]
41 dev-python/evdev[${PYTHON_USEDEP}]
45 RDEPEND="
46 ${PYTHON_DEPS}
47 acct-group/plugdev
48 dev-libs/glib:2
49 dev-libs/json-glib
50 dev-libs/libevdev
51 dev-libs/libunistring:=
52 virtual/libudev:=
53 $(python_gen_cond_dep '
54 dev-python/pygobject:3[${PYTHON_USEDEP}]
55 dev-python/evdev[${PYTHON_USEDEP}]
57 elogind? ( sys-auth/elogind )
58 systemd? ( sys-apps/systemd )
60 DEPEND="
61 ${RDEPEND}
62 dev-libs/gobject-introspection
65 src_prepare() {
66 default
68 if use elogind ; then
69 # Fix systemd includes for elogind
70 sed -i -e 's@include <systemd@include <elogind@' \
71 ratbagd/ratbag*.c || die
75 src_configure() {
76 python_setup
78 local emesonargs=(
79 $(meson_use doc documentation)
80 $(meson_use systemd)
81 $(meson_use test tests)
82 -Ddbus-group="plugdev"
83 -Dlogind-provider=$(usex elogind elogind systemd)
84 -Dsystemd-unit-dir="$(systemd_get_systemunitdir)"
85 -Dudev-dir="${EPREFIX}$(get_udevdir)"
88 meson_src_configure
91 src_install() {
92 meson_src_install
93 python_fix_shebang "${ED}"/usr/bin/
94 newinitd "${FILESDIR}"/ratbagd.init ratbagd
97 pkg_postinst() {
98 if [[ -z "${REPLACING_VERSIONS}" ]] ; then
99 elog 'You need to be in "plugdev" group in order to access the'
100 elog 'ratbagd dbus interface'
102 elog 'You may be required to create and/or be part of the "games" group if you intend on using piper'