Diff power-profiles-daemon-0.23 with a getuto-9999

/usr/portage/app-portage/getuto/getuto-9999.ebuild 2024-12-25 14:59:47.723270055 +0300
1
# Copyright 1999-2025 Gentoo Authors
1
# Copyright 1999-2024 Gentoo Authors
2 2
# Distributed under the terms of the GNU General Public License v2
3 3

  
4 4
EAPI=8
5
PYTHON_COMPAT=( python3_{10..13} )
6 5

  
7
inherit meson python-single-r1 shell-completion systemd
6
DESCRIPTION="Standalone Gentoo gpg trust anchor generation tool for binpkgs"
7
HOMEPAGE="https://github.com/projg2/getuto"
8 8

  
9
DESCRIPTION="Makes power profiles handling available over D-Bus"
10
HOMEPAGE="https://gitlab.freedesktop.org/upower/power-profiles-daemon/"
11
SRC_URI="https://gitlab.freedesktop.org/upower/${PN}/-/archive/${PV}/${P}.tar.bz2"
12
LICENSE="GPL-3+"
13
SLOT="0"
14
KEYWORDS="amd64 ~arm arm64 ~loong ~ppc64 ~riscv x86"
9
if [[ ${PV} == 9999 ]] ; then
10
	EGIT_REPO_URI="https://github.com/projg2/getuto"
11
	inherit git-r3
12
else
13
	SRC_URI="
14
		https://github.com/projg2/getuto/archive/refs/tags/${P}.tar.gz
15
	"
16
	S=${WORKDIR}/${PN}-${P}
17

  
18
	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
19
fi
15 20

  
16
IUSE="bash-completion gtk-doc man selinux test zsh-completion"
17
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
21
SRC_URI+=" test? ( https://mirror.bytemark.co.uk/gentoo/releases/amd64/binpackages/23.0/x86-64/virtual/libc/libc-1-r1-1.gpkg.tar -> ${PN}-23.0-libc-1-r1-1.gpkg.tar )"
18 22

  
23
LICENSE="GPL-2"
24
SLOT="0"
25
IUSE="test"
19 26
RESTRICT="!test? ( test )"
20 27

  
21
RDEPEND="${PYTHON_DEPS}
22
	$(python_gen_cond_dep 'dev-python/pygobject:3[${PYTHON_USEDEP}]')
23
	dev-libs/glib:2
24
	>=dev-libs/libgudev-234
25
	>=sys-auth/polkit-0.99
26
	sys-power/upower
27
	selinux? ( sec-policy/selinux-powerprofiles )
28
"
29
DEPEND="${RDEPEND}"
30
BDEPEND="
31
	dev-util/glib-utils
32
	bash-completion? (
33
		>=app-shells/bash-completion-2.0
34
		$(python_gen_cond_dep '>=dev-python/shtab-1.7.0[${PYTHON_USEDEP}]')
35
	)
36
	gtk-doc? (
37
		dev-util/gi-docgen
38
		dev-util/gtk-doc
39
	)
40
	man? (
41
		$(python_gen_cond_dep 'dev-python/argparse-manpage[${PYTHON_USEDEP}]')
42
	)
43
	test? (
44
		dev-util/umockdev
45
		$(python_gen_cond_dep '
46
			dev-python/pygobject:3[${PYTHON_USEDEP}]
47
			dev-python/python-dbusmock[${PYTHON_USEDEP}]
48
		')
49
	)
50
	zsh-completion? (
51
		$(python_gen_cond_dep '>=dev-python/shtab-1.7.0[${PYTHON_USEDEP}]')
52
	)
28
RDEPEND="
29
	app-crypt/gnupg
30
	dev-libs/openssl
31
	sec-keys/openpgp-keys-gentoo-release
32
	sys-apps/gentoo-functions
53 33
"
54 34

  
55
python_check_deps() {
56
	if use test; then
57
		python_has_version "dev-python/python-dbusmock[${PYTHON_USEDEP}]" &&
58
		python_has_version "dev-python/pygobject:3[${PYTHON_USEDEP}]"
35
src_unpack() {
36
	if [[ ${PV} == 9999 ]] ; then
37
		git-r3_src_unpack
59 38
	else
60
		python_has_version "dev-python/pygobject:3[${PYTHON_USEDEP}]"
39
		# Don't mangle test data
40
		unpack ${P}.tar.gz
61 41
	fi
62 42

  
63
	if use bash-completion || use zsh-completion; then
64
		python_has_version ">=dev-python/shtab-1.7.0[${PYTHON_USEDEP}]"
43
	if use test ; then
44
		cp "${DISTDIR}"/${PN}-23.0-libc-1-r1-1.gpkg.tar "${S}/libc-1-r1-1.gpkg.tar" || die
65 45
	fi
66

  
67
	use man && python_has_version "dev-python/argparse-manpage[${PYTHON_USEDEP}]"
68
}
69

  
70
src_configure() {
71
	local emesonargs=(
72
		-Dpylint=disabled
73
		-Dsystemdsystemunitdir="$(systemd_get_systemunitdir)"
74
		$(meson_feature bash-completion bashcomp)
75
		$(meson_use gtk-doc gtk_doc)
76
		$(meson_feature man manpage)
77
		$(meson_use test tests)
78
	)
79
	use zsh-completion && emesonargs+=( -Dzshcomp="$(get_zshcompdir)" )
80
	meson_src_configure
81 46
}
82 47

  
83 48
src_install() {
84
	meson_src_install
85
	python_fix_shebang "${D}"/usr/bin/powerprofilesctl
86
	newinitd "${FILESDIR}/power-profiles-daemon.initd" power-profiles-daemon
87
}
88

  
89
pkg_postinst() {
90
	if [[ -z "${REPLACING_VERSIONS}" ]]; then
91
		elog "You need to enable the service:"
92
		if systemd_is_booted; then
93
			elog "# systemctl enable ${PN}"
94
		else
95
			elog "# rc-update add ${PN} default"
96
		fi
97
	fi
49
	dobin getuto
98 50
}
Thank you!