diff options
author | James Le Cuirot <chewi@gentoo.org> | 2021-03-19 22:53:26 +0000 |
---|---|---|
committer | James Le Cuirot <chewi@gentoo.org> | 2021-03-19 22:53:26 +0000 |
commit | 62bb5657d102475f934a1d79337406fc24f91452 (patch) | |
tree | a3cbe701c8e63ed58873f6becfc853d57c038c08 /games-util/game-device-udev-rules/game-device-udev-rules-20201228.ebuild | |
parent | x11-drivers/xf86-video-vboxvideo: Port to EAPI 7 (diff) | |
download | gentoo-62bb5657d102475f934a1d79337406fc24f91452.tar.gz gentoo-62bb5657d102475f934a1d79337406fc24f91452.tar.bz2 gentoo-62bb5657d102475f934a1d79337406fc24f91452.zip |
games-util/game-device-udev-rules: Bump to 20201228, drop old 20201209
Package-Manager: Portage-3.0.17, Repoman-3.0.2
Signed-off-by: James Le Cuirot <chewi@gentoo.org>
Diffstat (limited to 'games-util/game-device-udev-rules/game-device-udev-rules-20201228.ebuild')
-rw-r--r-- | games-util/game-device-udev-rules/game-device-udev-rules-20201228.ebuild | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/games-util/game-device-udev-rules/game-device-udev-rules-20201228.ebuild b/games-util/game-device-udev-rules/game-device-udev-rules-20201228.ebuild new file mode 100644 index 000000000000..a050aac120d1 --- /dev/null +++ b/games-util/game-device-udev-rules/game-device-udev-rules-20201228.ebuild @@ -0,0 +1,80 @@ +# Copyright 2020-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit udev + +# Although this is mainly a tweaked version of Steam's udev rules, it +# also has its own rules and more may be added later so we version it +# independently. + +STEAM_COMMIT="ebc0f6a9e30bc0db2344df298c061c2c3b01776f" +MY_P="steam-devices-${STEAM_COMMIT}" + +DESCRIPTION="udev rules for various game hardware devices" +HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Games" +SRC_URI="https://github.com/ValveSoftware/steam-devices/archive/${STEAM_COMMIT}.tar.gz -> ${MY_P}.tar.gz" +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64 ~arm ~x86" +IUSE="+acl elogind systemd" +REQUIRED_USE="acl? ( || ( elogind systemd ) )" + +RDEPEND=" + acl? ( + elogind? ( sys-auth/elogind[acl] ) + systemd? ( sys-apps/systemd[acl] ) + ) + !acl? ( + acct-group/input + ) + virtual/udev +" + +S="${WORKDIR}/${MY_P}" + +pkg_setup() { + if ! use acl; then + elog "Users of game hardware devices must be added to the input group." + + if use elogind || use systemd; then + ewarn "It is highly recommended that you enable USE=acl on this package instead" + ewarn "when using elogind or systemd as this is more secure and just works." + fi + fi +} + +src_prepare() { + default + + local SRC DEST EXTRA + for SRC in 60-steam-{input,vr}.rules; do + DEST=${SRC//steam/game} + EXTRA=${FILESDIR}/${DEST/./-${PV}.} + + # Make changes in a copy. + cp -v "${SRC}" "${DEST}" || die + + # Append our additional rules. + if [[ -f ${EXTRA} ]]; then + cat "${EXTRA}" >> "${DEST}" || die + fi + + # Clear any existing mode settings. + sed -i 's/, *MODE="[0-9]*"//' "${DEST}" || die + + if ! use acl; then + # Replace uaccess tag with our group+mode if not using ACL. + sed -i 's/, *TAG+="uaccess"/, GROUP="input", MODE="0660"/' "${DEST}" || die + fi + done +} + +src_install() { + udev_dorules 60-game-{input,vr}.rules +} + +pkg_postinst() { + udev_reload +} |