# Copyright 2026 Nadeŭka # Distributed under the terms of the GNU General Public License v2 EAPI=8 inherit udev DESCRIPTION='Control the brightness of backlight and keyboard LED devices on Linux' HOMEPAGE=https://gitlab.com/cameronnemo/brillo if [[ $PV == 9999 ]]; then inherit git-r3 EGIT_REPO_URI=https://gitlab.com/cameronnemo/brillo.git else SRC_URI="$HOMEPAGE/-/archive/v$PV/$PN-v$PV.tar.bz2 -> $P.tar.bz2" KEYWORDS='~amd64 ~arm64 ~x86' S="$WORKDIR/$PN-v$PV" fi LICENSE=GPL-3 SLOT=0 IUSE='apparmor man policykit setgid' BDEPEND='man? ( dev-go/go-md2man )' RDEPEND=virtual/udev : "${BRILLO_GROUP:=video}" src_install() { local targets=( install.bin install.udev ) use apparmor && targets+=( install.apparmor ) use man && targets+=( install.man ) use policykit && targets+=( install.polkit ) use setgid && targets+=( install.setgid ) emake DESTDIR="$D" GROUP="$BRILLO_GROUP" "${targets[@]}" einstalldocs newinitd "$FILESDIR/brillo.initd" brillo } pkg_postinst() { udev_reload if ! use policykit || ! use setgid; then elog 'When neither USE=policykit nor USE=setgid is set, brillo' elog "requires the calling user to be in the 'video' group to" elog 'control backlight and keyboard LEDs.' fi elog 'To make brightness persistent across reboots on OpenRC,' elog 'enable the service:' elog ' rc-update add brillo boot' elog ' rc-service brillo start' }