aboutsummaryrefslogtreecommitdiff
blob: a367100ef68d45fcba7e50f403535059dbccd0e0 (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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

MYPV="${PV/_rc/+rc}"
MYP="geopm-${MYPV}"
PYTHON_COMPAT=( python3_{8..11} )

inherit autotools python-single-r1

DESCRIPTION="Global Extensible Open Power Manager (Daemon)"
HOMEPAGE="https://github.com/geopm/geopm"
SRC_URI="https://github.com/geopm/geopm/archive/refs/tags/v${MYPV}.tar.gz -> ${MYP}.gh.tar.gz"
S="${WORKDIR}/geopm-${PV/_rc/-rc}/service"

LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64"
IUSE="debug doc systemd"

RDEPEND="
	${PYTHON_DEPS}
	$(python_gen_cond_dep '
		>=dev-python/cffi-1.15.0[${PYTHON_USEDEP}]
		>=dev-python/dasbus-1.6[${PYTHON_USEDEP}]
		>=dev-python/jsonschema-3.2.0[${PYTHON_USEDEP}]
		>=dev-python/psutil-5.9.0[${PYTHON_USEDEP}]
	')
	dev-cpp/json11
	systemd? ( sys-apps/systemd:= )
"
DEPEND="
	${RDEPEND}
	dev-cpp/gtest
"
BDEPEND="
	doc? (
		dev-python/sphinx
		dev-python/sphinx_rtd_theme
		dev-python/sphinxemoji
	)
"

PATCHES=(
	"${FILESDIR}/${P}-system-gtest.patch"
	"${FILESDIR}/${P}-system-json11.patch"
	"${FILESDIR}/${P}-no-Werror.patch"
)
REQUIRED_USE="${PYTHON_REQUIRED_USE}"

pkg_setup() {
	python-single-r1_pkg_setup
}

src_prepare() {
	rm -r contrib || die
	rm test/googletest.mk || die
	rm src/geopm/json11.hpp || die
	default
	echo "${PV}" > VERSION || die
	for ff in AUTHORS CODE_OF_CONDUCT.md CONTRIBUTING.rst COPYING COPYING-TPP; do
		if [[ ! -f ${ff} ]]; then
			cp ../${ff} . || die
		fi
	done
	eautoreconf
}

src_configure() {
	local myconf=(
		--disable-cnl-iogroup
		--disable-coverage
		--disable-dcgm
		--disable-levelzero
		--disable-nvml
		$(use_enable debug)
		$(use_enable doc docs)
		$(use_enable systemd)
	)
	econf "${myconf[@]}"
}

src_install() {
	default
	dodoc README.rst
	find "${ED}" -type f -name "*.la" -delete || die
}