gentoo/dev-libs/libratbag/libratbag-0.18.ebuild
Alfred Wingate d83e25b6a5
*/*: depend on newer gobject-introspection as a workaround
sed -E '/dev-libs\/gobject-introspection(:=|\s|$|-[0-9]|\[)/ { s/(>=)?dev-libs\/gobject-introspection(-[0-9.r-]*)?/>=dev-libs\/gobject-introspection-1.82.0-r2/ }' */*/*.ebuild -i

+ manually going over to undo the false positives or if the version
  requirement was higher.

Bug: https://bugs.gentoo.org/947058
See-Also: ae37e3f389808700bd0f4343ee04888f0ef179d2
Signed-off-by: Alfred Wingate <parona@protonmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/44336
Closes: https://github.com/gentoo/gentoo/pull/44336
Signed-off-by: Sam James <sam@gentoo.org>
2025-10-26 03:26:28 +00:00

126 lines
2.7 KiB
Bash

# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{11..13} )
inherit linux-info meson python-single-r1 systemd udev
DESCRIPTION="Library to configure gaming mice"
HOMEPAGE="https://github.com/libratbag/libratbag"
if [[ ${PV} == 9999 ]]; then
inherit git-r3
EGIT_REPO_URI="https://github.com/libratbag/libratbag.git"
else
SRC_URI="https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
KEYWORDS="~amd64 ~x86"
fi
LICENSE="MIT"
SLOT="0"
IUSE="doc elogind systemd test"
REQUIRED_USE="
${PYTHON_REQUIRED_USE}
^^ ( elogind systemd )
"
RESTRICT="!test? ( test )"
BDEPEND="
${PYTHON_DEPS}
dev-lang/swig
virtual/pkgconfig
doc? (
$(python_gen_cond_dep '
dev-python/sphinx[${PYTHON_USEDEP}]
dev-python/sphinx-rtd-theme[${PYTHON_USEDEP}]
')
)
test? (
dev-libs/check
>=dev-libs/gobject-introspection-1.82.0-r2
dev-debug/valgrind
$(python_gen_cond_dep '
dev-python/evdev[${PYTHON_USEDEP}]
dev-python/pygobject:3[${PYTHON_USEDEP}]
')
)
"
RDEPEND="
${PYTHON_DEPS}
acct-group/plugdev
dev-libs/glib:2
dev-libs/json-glib
dev-libs/libevdev
dev-libs/libunistring:=
virtual/libudev:=
$(python_gen_cond_dep '
dev-python/pygobject:3[${PYTHON_USEDEP}]
dev-python/evdev[${PYTHON_USEDEP}]
')
elogind? ( sys-auth/elogind )
systemd? ( sys-apps/systemd )
"
DEPEND="
${RDEPEND}
>=dev-libs/gobject-introspection-1.82.0-r2
"
CONFIG_CHECK="~HIDRAW"
PATCHES=(
"${FILESDIR}"/${PN}-0.17-basename.patch
)
pkg_setup() {
linux-info_pkg_setup
python-single-r1_pkg_setup
}
src_prepare() {
default
if use elogind ; then
# Fix systemd includes for elogind
sed -i -e 's@include <systemd@include <elogind@' \
ratbagd/ratbag*.c || die
fi
}
src_configure() {
python_setup
local emesonargs=(
$(meson_use doc documentation)
$(meson_use systemd)
$(meson_use test tests)
-Ddbus-group="plugdev"
-Dlogind-provider=$(usex elogind elogind systemd)
-Dsystemd-unit-dir="$(systemd_get_systemunitdir)"
-Dudev-dir="${EPREFIX}$(get_udevdir)"
)
meson_src_configure
}
src_test() {
# ratbagctl-test writes a "devel" D-Bus policy to the build host. Note that
# test must be run as root with FEATURES="-userpriv" or it is skipped.
SANDBOX_WRITE+=":${EPREFIX}/etc/dbus-1/system.d" meson_src_test
}
src_install() {
meson_src_install
python_fix_shebang "${ED}"/usr/bin/
newinitd "${FILESDIR}"/ratbagd.init-r1 ratbagd
}
pkg_postinst() {
if [[ -z "${REPLACING_VERSIONS}" ]] ; then
elog 'You need to be in "plugdev" group in order to access the'
elog 'ratbagd dbus interface'
fi
elog 'You may be required to create and/or be part of the "games" group if you intend on using piper'
}