From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id A27B515A7D9 for ; Sun, 19 Mar 2023 16:56:48 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BB76AE08E0; Sun, 19 Mar 2023 16:56:47 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id A0DAEE08E0 for ; Sun, 19 Mar 2023 16:56:47 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A5D04341302 for ; Sun, 19 Mar 2023 16:56:46 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 3B74E8D7 for ; Sun, 19 Mar 2023 16:56:44 +0000 (UTC) From: "Pacho Ramos" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Pacho Ramos" Message-ID: <1679244992.40417f0c131cb66e15dc4442a3104a4cfd295a91.pacho@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-power/power-profiles-daemon/, sys-power/power-profiles-daemon/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-power/power-profiles-daemon/files/power-profiles-daemon.initd sys-power/power-profiles-daemon/power-profiles-daemon-0.12-r1.ebuild X-VCS-Directories: sys-power/power-profiles-daemon/files/ sys-power/power-profiles-daemon/ X-VCS-Committer: pacho X-VCS-Committer-Name: Pacho Ramos X-VCS-Revision: 40417f0c131cb66e15dc4442a3104a4cfd295a91 X-VCS-Branch: master Date: Sun, 19 Mar 2023 16:56:44 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 0c538865-8ef7-475f-97c3-8b8a7037f736 X-Archives-Hash: d57dacaae32acdcd9f7101a52b7e2bc0 commit: 40417f0c131cb66e15dc4442a3104a4cfd295a91 Author: Julien Roy jroy ca> AuthorDate: Thu Mar 16 22:29:38 2023 +0000 Commit: Pacho Ramos gentoo org> CommitDate: Sun Mar 19 16:56:32 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=40417f0c sys-power/power-profiles-daemon: add openrc init script Closes: https://bugs.gentoo.org/900901 Signed-off-by: Julien Roy jroy.ca> Closes: https://github.com/gentoo/gentoo/pull/30166 Signed-off-by: Pacho Ramos gentoo.org> .../files/power-profiles-daemon.initd | 14 +++++ .../power-profiles-daemon-0.12-r1.ebuild | 73 ++++++++++++++++++++++ 2 files changed, 87 insertions(+) diff --git a/sys-power/power-profiles-daemon/files/power-profiles-daemon.initd b/sys-power/power-profiles-daemon/files/power-profiles-daemon.initd new file mode 100644 index 000000000000..d16735e930f8 --- /dev/null +++ b/sys-power/power-profiles-daemon/files/power-profiles-daemon.initd @@ -0,0 +1,14 @@ +#!/sbin/openrc-run +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +name="power-profiles-daemon" +description="Makes power profiles handling available over D-Bus" + +pidfile="/run/power-profiles-daemon.pid" +command="/usr/libexec/power-profiles-daemon" +command_background=true + +start_pre() { + checkpath -d /var/lib/power-profiles-daemon +} diff --git a/sys-power/power-profiles-daemon/power-profiles-daemon-0.12-r1.ebuild b/sys-power/power-profiles-daemon/power-profiles-daemon-0.12-r1.ebuild new file mode 100644 index 000000000000..36656c234b6d --- /dev/null +++ b/sys-power/power-profiles-daemon/power-profiles-daemon-0.12-r1.ebuild @@ -0,0 +1,73 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 +PYTHON_COMPAT=( python3_{9..11} ) + +inherit meson python-single-r1 systemd + +DESCRIPTION="Makes power profiles handling available over D-Bus" +HOMEPAGE="https://gitlab.freedesktop.org/hadess/power-profiles-daemon/" +SRC_URI="https://gitlab.freedesktop.org/hadess/${PN}/-/archive/${PV}/${P}.tar.bz2" + +LICENSE="GPL-3+" +SLOT="0" +KEYWORDS="~amd64" + +IUSE="gtk-doc test" +REQUIRED_USE="${PYTHON_REQUIRED_USE}" + +RESTRICT="!test? ( test )" + +RDEPEND="${PYTHON_DEPS} + $(python_gen_cond_dep 'dev-python/pygobject:3[${PYTHON_USEDEP}]') + dev-libs/glib:2 + >=dev-libs/libgudev-234 + >=sys-auth/polkit-0.114 + sys-power/upower +" +DEPEND="${RDEPEND}" +BDEPEND=" + gtk-doc? ( dev-util/gi-docgen ) + test? ( + dev-util/umockdev + $(python_gen_cond_dep ' + dev-python/pygobject:3[${PYTHON_USEDEP}] + dev-python/python-dbusmock[${PYTHON_USEDEP}] + ') + ) +" + +python_check_deps() { + if use test; then + python_has_version "dev-python/python-dbusmock[${PYTHON_USEDEP}]" && + python_has_version "dev-python/pygobject:3[${PYTHON_USEDEP}]" + else + python_has_version "dev-python/pygobject:3[${PYTHON_USEDEP}]" + fi +} + +src_configure() { + local emesonargs=( + -Dsystemdsystemunitdir="$(systemd_get_systemunitdir)" + $(meson_use gtk-doc gtk_doc) + $(meson_use test tests) + ) + meson_src_configure +} + +src_install() { + meson_src_install + python_fix_shebang "${D}"/usr/bin/powerprofilesctl + + newinitd "${FILESDIR}/power-profiles-daemon.initd" power-profiles-daemon +} + +pkg_postinst() { + if [[ -z "${REPLACING_VERSIONS}" ]]; then + if systemd_is_booted; then + elog "You need to enable the service:" + elog "# systemctl enable ${PN}" + fi + fi +}