|
@@ -0,0 +1,42 @@
|
|
|
+# Copyright 2020 Gentoo Authors
|
|
|
+# Distributed under the terms of the GNU General Public License v2
|
|
|
+
|
|
|
+EAPI=7
|
|
|
+inherit unpacker
|
|
|
+
|
|
|
+DESCRIPTION="Power-management systemd services for proprietary nvidia-drivers"
|
|
|
+HOMEPAGE="https://www.nvidia.com/"
|
|
|
+AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
|
|
|
+NV_URI="https://us.download.nvidia.com/XFree86/"
|
|
|
+SRC_URI="
|
|
|
+ amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
|
|
|
+"
|
|
|
+
|
|
|
+LICENSE="GPL-2 NVIDIA-r2"
|
|
|
+SLOT="0/${PV%.*}"
|
|
|
+KEYWORDS="-* ~amd64"
|
|
|
+IUSE=""
|
|
|
+
|
|
|
+DEPEND="x11-drivers/nvidia-drivers:=[-amd64-fbsd]"
|
|
|
+RDEPEND="${DEPEND}
|
|
|
+ sys-apps/kbd
|
|
|
+ sys-apps/systemd"
|
|
|
+BDEPEND=""
|
|
|
+S=${WORKDIR}/
|
|
|
+
|
|
|
+src_install() {
|
|
|
+ insinto /lib/systemd/system
|
|
|
+ doins *.service
|
|
|
+ exeinto /lib/systemd/system-sleep
|
|
|
+ doexe nvidia
|
|
|
+ exeinto /usr/bin
|
|
|
+ doexe nvidia-sleep.sh
|
|
|
+
|
|
|
+ ewarn "To enable nvidia sleep services execute next commands:"
|
|
|
+ ewarn " systemctl enable nvidia-suspend.service"
|
|
|
+ ewarn " systemctl enable nvidia-hibernate.service"
|
|
|
+ ewarn " systemctl enable nvidia-resume.service"
|
|
|
+ ewarn "Also it's neccesary to add NVreg_PreserveVideoMemoryAllocations=1"
|
|
|
+ ewarn "to options line in /etc/modprobe.d/nvidia.conf and then reboot"
|
|
|
+ ewarn "More details at /usr/share/doc/nvidia-drivers-${PV}/html/powermanagement.html"
|
|
|
+}
|