summaryrefslogtreecommitdiff
blob: edf3b3edbb4bdc6aea2e0ac8b22da1c3b4d078b8 (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
# Copyright 2021-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8
inherit meson

DESCRIPTION="D-Bus service to check the availability of dual-GPU"
HOMEPAGE="https://gitlab.freedesktop.org/hadess/switcheroo-control/"
SRC_URI="https://gitlab.freedesktop.org/hadess/switcheroo-control/uploads/accd4a9492979bfd91b587ae7e18d3a2/${P}.tar.xz"

LICENSE="GPL-3"
SLOT="0"
IUSE="gtk-doc test"

KEYWORDS="amd64"

RDEPEND="
	>=dev-libs/glib-2.56.0:2
	>=dev-libs/libgudev-232:=
	sys-apps/systemd
"
DEPEND="${RDEPEND}"
BDEPEND="
	gtk-doc? ( dev-util/gtk-doc )
	test? ( dev-util/umockdev )
"

RESTRICT="!test? ( test )"

src_configure() {
	local emesonargs=(
		$(meson_use gtk-doc gtk_doc)
	)
	meson_src_configure
}

pkg_postinst() {
	if [[ -z "${REPLACING_VERSIONS}" ]]; then
		elog "You need to run systemd and enable the service:"
		elog "# systemctl enable switcheroo-control"
	fi
}