From 7e5b35c7304c7e06de0608318609443d775ddd62 Mon Sep 17 00:00:00 2001 From: Joe Kappus Date: Thu, 23 Apr 2026 02:41:51 -0400 Subject: [PATCH] sys-power/nvidia-exec: drop 0.2.7, add 0.3.2, initial openrc support Taking over maintainership. Signed-off-by: Joe Kappus --- sys-power/nvidia-exec/Manifest | 2 +- sys-power/nvidia-exec/files/nvx.initd | 18 ++++++++ sys-power/nvidia-exec/metadata.xml | 5 +- .../nvidia-exec/nvidia-exec-0.2.7-r1.ebuild | 42 ----------------- .../nvidia-exec/nvidia-exec-0.3.2.ebuild | 46 +++++++++++++++++++ sys-power/nvidia-exec/nvidia-exec-9999.ebuild | 22 +++++---- 6 files changed, 80 insertions(+), 55 deletions(-) create mode 100644 sys-power/nvidia-exec/files/nvx.initd delete mode 100644 sys-power/nvidia-exec/nvidia-exec-0.2.7-r1.ebuild create mode 100644 sys-power/nvidia-exec/nvidia-exec-0.3.2.ebuild diff --git a/sys-power/nvidia-exec/Manifest b/sys-power/nvidia-exec/Manifest index 865494e23b..a84f93f8ff 100644 --- a/sys-power/nvidia-exec/Manifest +++ b/sys-power/nvidia-exec/Manifest @@ -1 +1 @@ -DIST nvidia-exec-0.2.7.tar.gz 19024 BLAKE2B d7efb69bdadde9a60482e79c9d6e6595d4b89e27635d78d4f63976b328a8d2361a1cd4fb18cfc1ac02990a1c460fc83b778258b49f913ef10b5c1b0fe0c8aba5 SHA512 a7d1f4bca5b0e103952f7e06babf85896f68a04357dd0a8c0dc551d09ca3045d382cd5412900d832ba21373c0cc519614575668e58334bebe8032b1fb3fa803d +DIST nvidia-exec-0.3.2.tar.gz 18587 BLAKE2B bfcdbb491a2ff886e0f6f341227545effcc5255c5f31b697e1c8d52addd4e0ef273a6b8820d0b1df4c0605b08570b15ec5f2a4f3b5fba196f156a33ee6a3b3b7 SHA512 41aa66f1d49e2a358886e4a7ab911621fd3f82f916d5f1f3e24ed2bfdc916736958370a651f14a6deddd481e37b8c895c37dffbddbd61bbc2275095c9ece784e diff --git a/sys-power/nvidia-exec/files/nvx.initd b/sys-power/nvidia-exec/files/nvx.initd new file mode 100644 index 0000000000..45f7d9ce29 --- /dev/null +++ b/sys-power/nvidia-exec/files/nvx.initd @@ -0,0 +1,18 @@ +#!/sbin/openrc-run +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +description="nvidia-exec daemon for Nvidia Optimus GPU switching" + +command="/usr/bin/nvx" +command_args="daemon" +command_background="yes" +pidfile="/run/${RC_SVCNAME}.pid" + +output_log="/var/log/nvx.log" +error_log="/var/log/nvx.log" + +depend() { + after udev + before xdm display-manager +} diff --git a/sys-power/nvidia-exec/metadata.xml b/sys-power/nvidia-exec/metadata.xml index df8fe71ce3..e3a8cfcdac 100644 --- a/sys-power/nvidia-exec/metadata.xml +++ b/sys-power/nvidia-exec/metadata.xml @@ -2,11 +2,10 @@ - gonegrier.duarte@gmail.com - Gonçalo Negrier Duarte + joe@wt.gd + Joe Kappus pedro00dk/nvidia-exec - diff --git a/sys-power/nvidia-exec/nvidia-exec-0.2.7-r1.ebuild b/sys-power/nvidia-exec/nvidia-exec-0.2.7-r1.ebuild deleted file mode 100644 index 567564dc92..0000000000 --- a/sys-power/nvidia-exec/nvidia-exec-0.2.7-r1.ebuild +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -inherit systemd - -if [[ ${PV} == 9999 ]]; then - inherit git-r3 - EGIT_REPO_URI="https://github.com/pedro00dk/nvidia-exec.git" -else - SRC_URI="https://github.com/pedro00dk/nvidia-exec/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz" - KEYWORDS="~amd64" -fi - -DESCRIPTION="GPU switching without login out for Nvidia Optimus laptops under Linux" -HOMEPAGE="https://github.com/pedro00dk/nvidia-exec" - -LICENSE="GPL-3" -SLOT="0" - -RDEPEND=" - dev-lang/python - sys-apps/lshw - sys-process/lsof - x11-drivers/nvidia-drivers -" - -src_install() { - newbin "${WORKDIR}/${P}/nvx.py" nvx - systemd_dounit "${WORKDIR}/${P}/nvx.service" - insinto /usr/lib/modprobe.d - newins "${WORKDIR}/${P}/nvx-modprobe.conf" nvx.conf - insinto /etc/ - newins "${WORKDIR}/${P}/nvx-options.conf" nvx.conf -} - -pkg_postinst() { - ewarn "Don't forget to enable the nvx service:\nsystemctl enable --now nvx\n" - ewarn "\nThe nvx.service prevents nvidia modules from loading and turn off the graphics card during boot.\n" - ewarn "It is not necessary to handle files, configurations, PCI buses, etc, all that is done automatically.\n" -} diff --git a/sys-power/nvidia-exec/nvidia-exec-0.3.2.ebuild b/sys-power/nvidia-exec/nvidia-exec-0.3.2.ebuild new file mode 100644 index 0000000000..488fdeaad5 --- /dev/null +++ b/sys-power/nvidia-exec/nvidia-exec-0.3.2.ebuild @@ -0,0 +1,46 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit systemd + +if [[ ${PV} == 9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/pedro00dk/nvidia-exec.git" +else + SRC_URI="https://github.com/pedro00dk/nvidia-exec/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="~amd64" +fi + +DESCRIPTION="GPU switching without log out for Nvidia Optimus laptops under Linux" +HOMEPAGE="https://github.com/pedro00dk/nvidia-exec" + +LICENSE="GPL-3" +SLOT="0" + +RDEPEND=" + dev-lang/python + sys-apps/lshw + sys-process/lsof + x11-drivers/nvidia-drivers +" + +src_install() { + newbin "${S}/nvx.py" nvx + systemd_dounit "${S}/nvx.service" + newinitd "${FILESDIR}/nvx.initd" nvx + insinto /usr/lib/modprobe.d + newins "${S}/nvx-modprobe.conf" nvx.conf + insinto /etc/ + newins "${S}/nvx-options.conf" nvx.conf +} + +pkg_postinst() { + elog "To enable nvx at boot:" + elog " OpenRC: rc-update add nvx default" + elog " systemd: systemctl enable --now nvx" + elog "" + elog "The nvx service prevents nvidia modules from loading and turns off the graphics card during boot." + elog "It is not necessary to handle files, configurations, PCI buses, etc, all that is done automatically." +} diff --git a/sys-power/nvidia-exec/nvidia-exec-9999.ebuild b/sys-power/nvidia-exec/nvidia-exec-9999.ebuild index 567564dc92..488fdeaad5 100644 --- a/sys-power/nvidia-exec/nvidia-exec-9999.ebuild +++ b/sys-power/nvidia-exec/nvidia-exec-9999.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2023 Gentoo Authors +# Copyright 1999-2026 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 @@ -13,7 +13,7 @@ else KEYWORDS="~amd64" fi -DESCRIPTION="GPU switching without login out for Nvidia Optimus laptops under Linux" +DESCRIPTION="GPU switching without log out for Nvidia Optimus laptops under Linux" HOMEPAGE="https://github.com/pedro00dk/nvidia-exec" LICENSE="GPL-3" @@ -27,16 +27,20 @@ RDEPEND=" " src_install() { - newbin "${WORKDIR}/${P}/nvx.py" nvx - systemd_dounit "${WORKDIR}/${P}/nvx.service" + newbin "${S}/nvx.py" nvx + systemd_dounit "${S}/nvx.service" + newinitd "${FILESDIR}/nvx.initd" nvx insinto /usr/lib/modprobe.d - newins "${WORKDIR}/${P}/nvx-modprobe.conf" nvx.conf + newins "${S}/nvx-modprobe.conf" nvx.conf insinto /etc/ - newins "${WORKDIR}/${P}/nvx-options.conf" nvx.conf + newins "${S}/nvx-options.conf" nvx.conf } pkg_postinst() { - ewarn "Don't forget to enable the nvx service:\nsystemctl enable --now nvx\n" - ewarn "\nThe nvx.service prevents nvidia modules from loading and turn off the graphics card during boot.\n" - ewarn "It is not necessary to handle files, configurations, PCI buses, etc, all that is done automatically.\n" + elog "To enable nvx at boot:" + elog " OpenRC: rc-update add nvx default" + elog " systemd: systemctl enable --now nvx" + elog "" + elog "The nvx service prevents nvidia modules from loading and turns off the graphics card during boot." + elog "It is not necessary to handle files, configurations, PCI buses, etc, all that is done automatically." }