public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Pacho Ramos" <pacho@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-power/switcheroo-control/
Date: Sat, 27 Sep 2025 16:44:15 +0000 (UTC)	[thread overview]
Message-ID: <1758991447.f9597875e6b25c7919aafa5d2fbc234ce4033ab2.pacho@gentoo> (raw)

commit:     f9597875e6b25c7919aafa5d2fbc234ce4033ab2
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 27 16:01:52 2025 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Sat Sep 27 16:44:07 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f9597875

sys-power/switcheroo-control: add 3.0

Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>

 sys-power/switcheroo-control/Manifest              |  1 +
 .../switcheroo-control-3.0.ebuild                  | 87 ++++++++++++++++++++++
 2 files changed, 88 insertions(+)

diff --git a/sys-power/switcheroo-control/Manifest b/sys-power/switcheroo-control/Manifest
index 14c2fac1ed9e..c1a9404763de 100644
--- a/sys-power/switcheroo-control/Manifest
+++ b/sys-power/switcheroo-control/Manifest
@@ -1 +1,2 @@
 DIST switcheroo-control-2.6.tar.xz 29996 BLAKE2B 98204a1d0f3b92cc2b98ad9f382313aed4da5877ac6be607c48ee9386bd25087301e249907a7e1385eea357f0a3ce5fb2936fac688923dfa3555a9870f0d2e58 SHA512 ac8867a839ae958676f5c5c7bb4c25cbbcf70eb35a696bb3d80b388c31a9722e75311c041c4c60b8f1d00f405af97dd9173e99780a2be3c621ac759c4986a2d2
+DIST switcheroo-control-3.0.tar.xz 33380 BLAKE2B 3d69968383b34f624ec0068bd986cb2b0be408d5617af350b128c0583511e3bfe7618e49826308ef87ef19b6cf681c41e786d9ab5fdd3cd1b868be5dd409ee18 SHA512 f2b3df3f0254a13f2e046269b612f90d15c4f6ce22f9e6463b156a03de271d30519fed9002f7faae76ca84a5e6001550d8003901d5a228694375ae56a640ad61

diff --git a/sys-power/switcheroo-control/switcheroo-control-3.0.ebuild b/sys-power/switcheroo-control/switcheroo-control-3.0.ebuild
new file mode 100644
index 000000000000..5a151276c3b4
--- /dev/null
+++ b/sys-power/switcheroo-control/switcheroo-control-3.0.ebuild
@@ -0,0 +1,87 @@
+# Copyright 2021-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+PYTHON_COMPAT=( python3_{11..13} )
+
+inherit meson python-single-r1 systemd udev
+
+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/-/releases/${PV}/downloads/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~x86"
+
+IUSE="gtk-doc selinux test video_cards_amdgpu video_cards_nouveau"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="${PYTHON_DEPS}
+	$(python_gen_cond_dep 'dev-python/pygobject:3[${PYTHON_USEDEP}]')
+	>=dev-libs/glib-2.56.0:2
+	>=dev-libs/libgudev-232:=
+	>=x11-libs/libdrm-2.4.97[video_cards_amdgpu?,video_cards_nouveau?]
+	selinux? ( sec-policy/selinux-switcheroo )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+	$(python_gen_cond_dep 'dev-python/pygobject:3[${PYTHON_USEDEP}]')
+	dev-util/gdbus-codegen
+	gtk-doc? ( dev-util/gtk-doc )
+	test? (
+		$(python_gen_cond_dep 'dev-python/python-dbusmock[${PYTHON_USEDEP}]')
+		dev-util/umockdev
+	)
+"
+
+RESTRICT="!test? ( test )"
+
+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_prepare() {
+	default
+
+	# GPU detection fails when running on sandbox
+	sed -i -e '/discrete-detection/d' tests/meson.build || die
+}
+
+src_configure() {
+	local emesonargs=(
+		-Drulesdir="$(get_udevdir)"/rules.d
+		-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 "${ED}"/usr/bin/switcherooctl
+	newinitd "${FILESDIR}"/${PN}-init.d ${PN}
+}
+
+pkg_postinst() {
+	udev_reload
+
+	if [[ -z "${REPLACING_VERSIONS}" ]]; then
+		elog "You need to enable the service:"
+		if systemd_is_booted; then
+			elog "# systemctl enable ${PN}"
+		else
+			elog "# rc-update add ${PN} default"
+		fi
+	fi
+}
+
+pkg_postrm() {
+	udev_reload
+}


             reply	other threads:[~2025-09-27 16:44 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-27 16:44 Pacho Ramos [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-10-18  7:02 [gentoo-commits] repo/gentoo:master commit in: sys-power/switcheroo-control/ Arthur Zamarin
2025-10-12 20:11 Arthur Zamarin
2025-10-12 15:54 Sam James
2025-10-12 15:54 Sam James
2024-10-04  2:30 Sam James
2024-02-02 12:44 Arthur Zamarin
2023-12-25 11:25 Fabian Groffen
2023-12-18 10:19 Pacho Ramos
2023-12-18 10:19 Pacho Ramos
2023-11-14 21:49 Kenton Groombridge
2023-08-10  7:29 Jakov Smolić
2023-08-06 11:29 Sam James
2023-08-06 11:29 Sam James
2023-08-06  9:08 WANG Xuerui
2023-03-03 14:11 Pacho Ramos
2023-02-27 15:12 Pacho Ramos
2023-02-11  8:43 Pacho Ramos
2023-01-27 20:38 Pacho Ramos
2023-01-22 12:46 Pacho Ramos
2023-01-02  9:58 Pacho Ramos
2022-12-29 10:44 Pacho Ramos
2022-12-29 10:44 Pacho Ramos
2022-12-01 22:24 Jakov Smolić
2022-08-11  9:49 Sam James
2022-07-20 13:13 Pacho Ramos
2022-03-13 18:36 Pacho Ramos
2021-05-02 19:06 Pacho Ramos
2021-03-28 10:19 Pacho Ramos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1758991447.f9597875e6b25c7919aafa5d2fbc234ce4033ab2.pacho@gentoo \
    --to=pacho@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox