commit:     a552a2f91d8e69aead632fe512d520c25b987f4d
Author:     Ionen Wolkens <sudinave <AT> gmail <DOT> com>
AuthorDate: Tue Apr  6 20:00:19 2021 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Tue Apr  6 20:00:19 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a552a2f9

x11-drivers/nvidia-drivers: add README.gentoo, minor message changes

Like nvidia-driver.eclass used to it's primarily to leave something
behind about the video group should users have missed the message
(but no revbumps over installing this).

Signed-off-by: Ionen Wolkens <sudinave <AT> gmail.com>
Signed-off-by: David Seifert <soap <AT> gentoo.org>

 .../nvidia-drivers-390.141-r1.ebuild               | 37 +++++++++++-----------
 .../nvidia-drivers-450.102.04-r1.ebuild            | 28 ++++++++--------
 .../nvidia-drivers/nvidia-drivers-460.67.ebuild    | 28 ++++++++--------
 .../nvidia-drivers/nvidia-drivers-465.19.01.ebuild | 29 ++++++++---------
 4 files changed, 58 insertions(+), 64 deletions(-)

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-390.141-r1.ebuild 
b/x11-drivers/nvidia-drivers/nvidia-drivers-390.141-r1.ebuild
index ba2b3e55347..baff134c695 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-390.141-r1.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-390.141-r1.ebuild
@@ -4,8 +4,8 @@
 EAPI=7
 
 MODULES_OPTIONAL_USE="driver"
-inherit desktop linux-info linux-mod multilib-build \
-       optfeature systemd toolchain-funcs unpacker
+inherit desktop linux-info linux-mod multilib-build optfeature \
+       readme.gentoo-r1 systemd toolchain-funcs unpacker
 
 NV_KERNEL_MAX="5.10"
 NV_BIN_URI="https://download.nvidia.com/XFree86/Linux-";
@@ -82,6 +82,13 @@ DOCS=(
 )
 HTML_DOCS=( html/. )
 
+DISABLE_AUTOFORMATTING="yes"
+DOC_CONTENTS="Users should be in the 'video' group to use NVIDIA devices.
+You can add yourself by using: gpasswd -a my-user video
+
+For general information on using nvidia-drivers, please see:
+https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers";
+
 pkg_setup() {
        use driver || return
 
@@ -334,6 +341,7 @@ src_install() {
        multilib_foreach_abi nvidia-drivers_libs_install
 
        einstalldocs
+       readme.gentoo_create_doc
 }
 
 pkg_preinst() {
@@ -350,30 +358,21 @@ pkg_preinst() {
 pkg_postinst() {
        use driver && linux-mod_pkg_postinst
 
+       readme.gentoo_print_elog
+
        optfeature "wayland EGLStream with nvidia-drm.modeset=1" 
gui-libs/egl-wayland
 
        if [[ -r /proc/driver/nvidia/version &&
                $(grep -o '  [0-9.]*  ' /proc/driver/nvidia/version) != "  
${PV}  " ]]; then
                ewarn "Currently loaded NVIDIA modules do not match the newly 
installed"
                ewarn "libraries and will lead to GPU-using application issues."
-               use driver && ewarn "The easiest way to fix this is to reboot."
+               use driver && ewarn "The easiest way to fix this is usually to 
reboot."
        fi
 
-       if ! [[ ${REPLACING_VERSIONS} && $(getent group video | cut -d: -f4) 
]]; then
-               elog "***** WARNING *****"
-               elog "Users should be in the 'video' group to use NVIDIA 
devices."
-               elog "You can add yourself by using: gpasswd -a myuser video"
-       fi
-
-       if [[ ! ${REPLACING_VERSIONS} ]]; then
-               if use x86; then
-                       elog "Note that NVIDIA is no longer offering support 
for the unified memory"
-                       elog "module (nvidia-uvm) on x86 (32bit), as such the 
module was not built."
-                       elog "This means OpenCL/CUDA (and related, like nvenc) 
cannot be used."
-                       elog "Other functions, like OpenGL, will continue to 
work."
-                       elog
-               fi
-               elog "For general information with using NVIDIA on Gentoo, 
please see:"
-               elog "https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers";
+       if use x86 && [[ ! ${REPLACING_VERSIONS} ]]; then
+               elog "Note that NVIDIA is no longer offering support for the 
unified memory"
+               elog "module (nvidia-uvm) on x86 (32bit), as such the module 
was not built."
+               elog "This means OpenCL/CUDA (and related, like nvenc) cannot 
be used."
+               elog "Other functions, like OpenGL, will continue to work."
        fi
 }

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-450.102.04-r1.ebuild 
b/x11-drivers/nvidia-drivers/nvidia-drivers-450.102.04-r1.ebuild
index 65298315925..4b35ed9fa95 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-450.102.04-r1.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-450.102.04-r1.ebuild
@@ -4,8 +4,8 @@
 EAPI=7
 
 MODULES_OPTIONAL_USE="driver"
-inherit desktop linux-info linux-mod multilib-build \
-       optfeature systemd toolchain-funcs unpacker
+inherit desktop linux-info linux-mod multilib-build optfeature \
+       readme.gentoo-r1 systemd toolchain-funcs unpacker
 
 NV_KERNEL_MAX="5.10"
 NV_BIN_URI="https://download.nvidia.com/XFree86/Linux-";
@@ -81,6 +81,13 @@ DOCS=(
 )
 HTML_DOCS=( html/. )
 
+DISABLE_AUTOFORMATTING="yes"
+DOC_CONTENTS="Users should be in the 'video' group to use NVIDIA devices.
+You can add yourself by using: gpasswd -a my-user video
+
+For general information on using nvidia-drivers, please see:
+https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers";
+
 pkg_setup() {
        use driver || return
 
@@ -341,6 +348,7 @@ src_install() {
        systemd_dounit nvidia-{hibernate,resume,suspend}.service
 
        einstalldocs
+       readme.gentoo_create_doc
 }
 
 pkg_preinst() {
@@ -371,17 +379,18 @@ pkg_preinst() {
 pkg_postinst() {
        use driver && linux-mod_pkg_postinst
 
+       readme.gentoo_print_elog
+
        optfeature "wayland EGLStream with nvidia-drm.modeset=1" 
gui-libs/egl-wayland
 
        if [[ -r /proc/driver/nvidia/version &&
                $(grep -o '  [0-9.]*  ' /proc/driver/nvidia/version) != "  
${PV}  " ]]; then
                ewarn "Currently loaded NVIDIA modules do not match the newly 
installed"
                ewarn "libraries and will lead to GPU-using application issues."
-               use driver && ewarn "The easiest way to fix this is to reboot."
+               use driver && ewarn "The easiest way to fix this is usually to 
reboot."
        fi
 
        if [[ ${NV_LEGACY_MASK} ]]; then
-               ewarn "***** WARNING *****"
                ewarn "You are installing a version of nvidia-drivers known not 
to work"
                ewarn "with a GPU of the current system. If unwanted, add the 
mask:"
                if [[ -d ${EROOT}/etc/portage/package.mask ]]; then
@@ -392,15 +401,4 @@ pkg_postinst() {
                ewarn "...then downgrade to a legacy branch if possible. For 
details, see:"
                ewarn "https://www.nvidia.com/object/IO_32667.html";
        fi
-
-       if ! [[ ${REPLACING_VERSIONS} && $(getent group video | cut -d: -f4) 
]]; then
-               elog "***** WARNING *****"
-               elog "Users should be in the 'video' group to use NVIDIA 
devices."
-               elog "You can add yourself by using: gpasswd -a myuser video"
-       fi
-
-       if [[ ! ${REPLACING_VERSIONS} ]]; then
-               elog "For general information with using NVIDIA on Gentoo, 
please see:"
-               elog "https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers";
-       fi
 }

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-460.67.ebuild 
b/x11-drivers/nvidia-drivers/nvidia-drivers-460.67.ebuild
index d7602b8fcfa..18cbd4cb2f0 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-460.67.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-460.67.ebuild
@@ -4,8 +4,8 @@
 EAPI=7
 
 MODULES_OPTIONAL_USE="driver"
-inherit desktop linux-info linux-mod multilib-build \
-       optfeature systemd toolchain-funcs unpacker
+inherit desktop linux-info linux-mod multilib-build optfeature \
+       readme.gentoo-r1 systemd toolchain-funcs unpacker
 
 NV_KERNEL_MAX="5.11"
 NV_BIN_URI="https://download.nvidia.com/XFree86/Linux-";
@@ -81,6 +81,13 @@ DOCS=(
 )
 HTML_DOCS=( html/. )
 
+DISABLE_AUTOFORMATTING="yes"
+DOC_CONTENTS="Users should be in the 'video' group to use NVIDIA devices.
+You can add yourself by using: gpasswd -a my-user video
+
+For general information on using nvidia-drivers, please see:
+https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers";
+
 pkg_setup() {
        use driver || return
 
@@ -345,6 +352,7 @@ src_install() {
        systemd_dounit nvidia-{hibernate,resume,suspend}.service
 
        einstalldocs
+       readme.gentoo_create_doc
 }
 
 pkg_preinst() {
@@ -375,17 +383,18 @@ pkg_preinst() {
 pkg_postinst() {
        use driver && linux-mod_pkg_postinst
 
+       readme.gentoo_print_elog
+
        optfeature "wayland EGLStream with nvidia-drm.modeset=1" 
gui-libs/egl-wayland
 
        if [[ -r /proc/driver/nvidia/version &&
                $(grep -o '  [0-9.]*  ' /proc/driver/nvidia/version) != "  
${PV}  " ]]; then
                ewarn "Currently loaded NVIDIA modules do not match the newly 
installed"
                ewarn "libraries and will lead to GPU-using application issues."
-               use driver && ewarn "The easiest way to fix this is to reboot."
+               use driver && ewarn "The easiest way to fix this is usually to 
reboot."
        fi
 
        if [[ ${NV_LEGACY_MASK} ]]; then
-               ewarn "***** WARNING *****"
                ewarn "You are installing a version of nvidia-drivers known not 
to work"
                ewarn "with a GPU of the current system. If unwanted, add the 
mask:"
                if [[ -d ${EROOT}/etc/portage/package.mask ]]; then
@@ -396,15 +405,4 @@ pkg_postinst() {
                ewarn "...then downgrade to a legacy branch if possible. For 
details, see:"
                ewarn "https://www.nvidia.com/object/IO_32667.html";
        fi
-
-       if ! [[ ${REPLACING_VERSIONS} && $(getent group video | cut -d: -f4) 
]]; then
-               elog "***** WARNING *****"
-               elog "Users should be in the 'video' group to use NVIDIA 
devices."
-               elog "You can add yourself by using: gpasswd -a myuser video"
-       fi
-
-       if [[ ! ${REPLACING_VERSIONS} ]]; then
-               elog "For general information with using NVIDIA on Gentoo, 
please see:"
-               elog "https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers";
-       fi
 }

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-465.19.01.ebuild 
b/x11-drivers/nvidia-drivers/nvidia-drivers-465.19.01.ebuild
index dd0174cd027..33c06261278 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-465.19.01.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-465.19.01.ebuild
@@ -4,8 +4,8 @@
 EAPI=7
 
 MODULES_OPTIONAL_USE="driver"
-inherit desktop linux-info linux-mod multilib-build \
-       optfeature systemd toolchain-funcs unpacker
+inherit desktop linux-info linux-mod multilib-build optfeature \
+       readme.gentoo-r1 systemd toolchain-funcs unpacker
 
 NV_KERNEL_MAX="5.11"
 NV_BIN_URI="https://download.nvidia.com/XFree86/Linux-";
@@ -81,6 +81,13 @@ DOCS=(
 )
 HTML_DOCS=( html/. )
 
+DISABLE_AUTOFORMATTING="yes"
+DOC_CONTENTS="Users should be in the 'video' group to use NVIDIA devices.
+You can add yourself by using: gpasswd -a my-user video
+
+For general information on using nvidia-drivers, please see:
+https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers";
+
 pkg_setup() {
        use driver || return
 
@@ -107,6 +114,7 @@ pkg_setup() {
                nvidia-drm(video:kernel)
                nvidia-modeset(video:kernel)
                nvidia-uvm(video:kernel)"
+       # nvidia-peermem(video:kernel) - skipping unless there is a demand for 
it
 
        linux-mod_pkg_setup
 
@@ -345,6 +353,7 @@ src_install() {
        systemd_dounit systemd/system/nvidia-{hibernate,resume,suspend}.service
 
        einstalldocs
+       readme.gentoo_create_doc
 }
 
 pkg_preinst() {
@@ -375,17 +384,18 @@ pkg_preinst() {
 pkg_postinst() {
        use driver && linux-mod_pkg_postinst
 
+       readme.gentoo_print_elog
+
        optfeature "wayland EGLStream with nvidia-drm.modeset=1" 
gui-libs/egl-wayland
 
        if [[ -r /proc/driver/nvidia/version &&
                $(grep -o '  [0-9.]*  ' /proc/driver/nvidia/version) != "  
${PV}  " ]]; then
                ewarn "Currently loaded NVIDIA modules do not match the newly 
installed"
                ewarn "libraries and will lead to GPU-using application issues."
-               use driver && ewarn "The easiest way to fix this is to reboot."
+               use driver && ewarn "The easiest way to fix this is usually to 
reboot."
        fi
 
        if [[ ${NV_LEGACY_MASK} ]]; then
-               ewarn "***** WARNING *****"
                ewarn "You are installing a version of nvidia-drivers known not 
to work"
                ewarn "with a GPU of the current system. If unwanted, add the 
mask:"
                if [[ -d ${EROOT}/etc/portage/package.mask ]]; then
@@ -396,15 +406,4 @@ pkg_postinst() {
                ewarn "...then downgrade to a legacy branch if possible. For 
details, see:"
                ewarn "https://www.nvidia.com/object/IO_32667.html";
        fi
-
-       if ! [[ ${REPLACING_VERSIONS} && $(getent group video | cut -d: -f4) 
]]; then
-               elog "***** WARNING *****"
-               elog "Users should be in the 'video' group to use NVIDIA 
devices."
-               elog "You can add yourself by using: gpasswd -a myuser video"
-       fi
-
-       if [[ ! ${REPLACING_VERSIONS} ]]; then
-               elog "For general information with using NVIDIA on Gentoo, 
please see:"
-               elog "https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers";
-       fi
 }

Reply via email to