blob: 251c4102a078b4cab23538b1d25d614da6fd9052 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit toolchain-funcs udev
DESCRIPTION="A program to read and control device brightness"
HOMEPAGE="https://github.com/Hummer12007/brightnessctl"
SRC_URI="https://github.com/Hummer12007/brightnessctl/archive/${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~arm64"
IUSE="systemd udev"
DEPEND="
systemd? ( sys-apps/systemd )
udev? ( virtual/udev )
"
RDEPEND="${DEPEND}"
BDEPEND="
systemd? ( virtual/pkgconfig )
"
PATCHES=(
"${FILESDIR}"/${PN}-0.5.1-Makefile.patch
)
src_compile() {
tc-export CC
use systemd && export ENABLE_SYSTEMD=1
emake
}
src_install() {
local myconf
# Upstream does not install udev rules if systemd is enabled
# Following this behaviour if both flags are enabled here
if use systemd && use udev; then
myconf="INSTALL_UDEV_RULES=0"
elif use udev; then
myconf="INSTALL_UDEV_RULES=1"
else
myconf="INSTALL_UDEV_RULES=0"
fi
emake ${myconf} DESTDIR="${D}" install
dodoc README.md
}
pkg_postinst() {
! use systemd && use udev && udev_reload
}
pkg_postrm() {
! use systemd && use udev && udev_reload
}
|