From c3e067938bfd36156714f1de18d888523f0438a4 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Fri, 13 Sep 2024 11:47:44 +0100 Subject: Revert "x11-drivers/nvidia-drivers : revision bump" This reverts commit 27439cb35ab396896be80dc87fd54d728bd9f829. --- .../x11-drivers/nvidia-drivers-390.157-r10 | 17 + .../x11-drivers/nvidia-drivers-390.157-r11 | 17 - .../x11-drivers/nvidia-drivers-470.256.02-r1 | 17 + .../x11-drivers/nvidia-drivers-470.256.02-r2 | 17 - .../x11-drivers/nvidia-drivers-550.107.02-r1 | 17 + .../x11-drivers/nvidia-drivers-550.107.02-r2 | 17 - metadata/pkg_desc_index | 2 +- .../nvidia-drivers-390.157-r10.ebuild | 346 +++++++++++++++++++++ .../nvidia-drivers-390.157-r11.ebuild | 346 --------------------- .../nvidia-drivers-470.256.02-r1.ebuild | 322 +++++++++++++++++++ .../nvidia-drivers-470.256.02-r2.ebuild | 322 ------------------- .../nvidia-drivers-550.107.02-r1.ebuild | 342 ++++++++++++++++++++ .../nvidia-drivers-550.107.02-r2.ebuild | 342 -------------------- 13 files changed, 1062 insertions(+), 1062 deletions(-) create mode 100644 metadata/md5-cache/x11-drivers/nvidia-drivers-390.157-r10 delete mode 100644 metadata/md5-cache/x11-drivers/nvidia-drivers-390.157-r11 create mode 100644 metadata/md5-cache/x11-drivers/nvidia-drivers-470.256.02-r1 delete mode 100644 metadata/md5-cache/x11-drivers/nvidia-drivers-470.256.02-r2 create mode 100644 metadata/md5-cache/x11-drivers/nvidia-drivers-550.107.02-r1 delete mode 100644 metadata/md5-cache/x11-drivers/nvidia-drivers-550.107.02-r2 create mode 100644 x11-drivers/nvidia-drivers/nvidia-drivers-390.157-r10.ebuild delete mode 100644 x11-drivers/nvidia-drivers/nvidia-drivers-390.157-r11.ebuild create mode 100644 x11-drivers/nvidia-drivers/nvidia-drivers-470.256.02-r1.ebuild delete mode 100644 x11-drivers/nvidia-drivers/nvidia-drivers-470.256.02-r2.ebuild create mode 100644 x11-drivers/nvidia-drivers/nvidia-drivers-550.107.02-r1.ebuild delete mode 100644 x11-drivers/nvidia-drivers/nvidia-drivers-550.107.02-r2.ebuild diff --git a/metadata/md5-cache/x11-drivers/nvidia-drivers-390.157-r10 b/metadata/md5-cache/x11-drivers/nvidia-drivers-390.157-r10 new file mode 100644 index 00000000..230165dd --- /dev/null +++ b/metadata/md5-cache/x11-drivers/nvidia-drivers-390.157-r10 @@ -0,0 +1,17 @@ +BDEPEND=sys-devel/m4 virtual/pkgconfig virtual/pkgconfig +DEFINED_PHASES=compile install postinst postrm preinst prepare setup unpack +DEPEND=acct-group/video persistenced? ( acct-user/nvpd net-libs/libtirpc:= ) x11-base/xorg-proto x11-libs/libX11 x11-libs/libXext +DESCRIPTION=NVIDIA Accelerated Graphics Driver +EAPI=8 +HOMEPAGE=https://www.nvidia.com/download/index.aspx +INHERIT=desktop flag-o-matic multilib readme.gentoo-r1 systemd toolchain-funcs unpacker user-info +IUSE=abi_x86_32 abi_x86_64 +acpi +dkms +persistenced +tools +X +KEYWORDS=-* amd64 +LICENSE=NVIDIA-r2 BSD BSD-2 GPL-2 MIT +PDEPEND=tools? ( x11-misc/nvidia-settings:3 ) +RDEPEND=acct-group/video persistenced? ( acct-user/nvpd net-libs/libtirpc:= ) sys-libs/glibc !!x11-drivers/nvidia-drivers:4 !!x11-drivers/nvidia-drivers:5 acpi? ( sys-power/acpid ) dkms? ( ~sys-kernel/nvidia-drivers-dkms-390.157:3 ) X? ( media-libs/libglvnd[X,abi_x86_32(-)?] x11-libs/libX11[abi_x86_32(-)?] x11-libs/libXext[abi_x86_32(-)?] ) +RESTRICT=strip +SLOT=3 +SRC_URI=https://download.nvidia.com/XFree86/Linux-x86_64/390.157/NVIDIA-Linux-x86_64-390.157.run https://download.nvidia.com/XFree86/nvidia-installer/nvidia-installer-390.157.tar.bz2 https://download.nvidia.com/XFree86/nvidia-modprobe/nvidia-modprobe-390.157.tar.bz2 https://download.nvidia.com/XFree86/nvidia-persistenced/nvidia-persistenced-390.157.tar.bz2 https://download.nvidia.com/XFree86/nvidia-xconfig/nvidia-xconfig-390.157.tar.bz2 +_eclasses_=desktop 56973babb9c5f19cab0eeb53ece644c6 flag-o-matic fa33e3696fe4689dda7e9affe92e2c94 multilib 7e1347c006a76bb812f3a9f663b79991 multiprocessing e644caa6eb7ce7e5ab0864383ac13ad9 readme.gentoo-r1 32b48460d813533d85f082897cec1b80 systemd 0f241b5c9f3758c3d3423df59a7f655a toolchain-funcs 948855ec7ad9f11351edf9066708dfa9 unpacker fb4b84181244b3b9990fa0bf40232dd2 user-info 9951b1a0e4f026d16c33a001fd2d5cdf +_md5_=091223e6ffc2ec54a76b4035f36276a0 diff --git a/metadata/md5-cache/x11-drivers/nvidia-drivers-390.157-r11 b/metadata/md5-cache/x11-drivers/nvidia-drivers-390.157-r11 deleted file mode 100644 index 65398ffa..00000000 --- a/metadata/md5-cache/x11-drivers/nvidia-drivers-390.157-r11 +++ /dev/null @@ -1,17 +0,0 @@ -BDEPEND=sys-devel/m4 virtual/pkgconfig virtual/pkgconfig -DEFINED_PHASES=compile install postinst postrm preinst prepare setup unpack -DEPEND=acct-group/video persistenced? ( acct-user/nvpd net-libs/libtirpc:= ) x11-base/xorg-proto x11-libs/libX11 x11-libs/libXext -DESCRIPTION=NVIDIA Accelerated Graphics Driver -EAPI=8 -HOMEPAGE=https://www.nvidia.com/download/index.aspx -INHERIT=desktop flag-o-matic multilib readme.gentoo-r1 systemd toolchain-funcs unpacker user-info -IUSE=abi_x86_32 abi_x86_64 +acpi +dkms +persistenced +tools +X -KEYWORDS=-* amd64 -LICENSE=NVIDIA-r2 BSD BSD-2 GPL-2 MIT -PDEPEND=tools? ( x11-misc/nvidia-settings:3 ) -RDEPEND=acct-group/video persistenced? ( acct-user/nvpd net-libs/libtirpc:= ) sys-libs/glibc !!x11-drivers/nvidia-drivers:4 !!x11-drivers/nvidia-drivers:5 acpi? ( sys-power/acpid ) dkms? ( ~sys-kernel/nvidia-drivers-dkms-390.157:3 ) X? ( media-libs/libglvnd[X,abi_x86_32(-)?] x11-libs/libX11[abi_x86_32(-)?] x11-libs/libXext[abi_x86_32(-)?] ) -RESTRICT=strip -SLOT=3 -SRC_URI=https://download.nvidia.com/XFree86/Linux-x86_64/390.157/NVIDIA-Linux-x86_64-390.157.run https://download.nvidia.com/XFree86/nvidia-installer/nvidia-installer-390.157.tar.bz2 https://download.nvidia.com/XFree86/nvidia-modprobe/nvidia-modprobe-390.157.tar.bz2 https://download.nvidia.com/XFree86/nvidia-persistenced/nvidia-persistenced-390.157.tar.bz2 https://download.nvidia.com/XFree86/nvidia-xconfig/nvidia-xconfig-390.157.tar.bz2 -_eclasses_=desktop 56973babb9c5f19cab0eeb53ece644c6 flag-o-matic fa33e3696fe4689dda7e9affe92e2c94 multilib 7e1347c006a76bb812f3a9f663b79991 multiprocessing e644caa6eb7ce7e5ab0864383ac13ad9 readme.gentoo-r1 32b48460d813533d85f082897cec1b80 systemd 0f241b5c9f3758c3d3423df59a7f655a toolchain-funcs 948855ec7ad9f11351edf9066708dfa9 unpacker fb4b84181244b3b9990fa0bf40232dd2 user-info 9951b1a0e4f026d16c33a001fd2d5cdf -_md5_=2cfcb3ed547c80075331750fd905aee6 diff --git a/metadata/md5-cache/x11-drivers/nvidia-drivers-470.256.02-r1 b/metadata/md5-cache/x11-drivers/nvidia-drivers-470.256.02-r1 new file mode 100644 index 00000000..4e2b2425 --- /dev/null +++ b/metadata/md5-cache/x11-drivers/nvidia-drivers-470.256.02-r1 @@ -0,0 +1,17 @@ +BDEPEND=sys-devel/m4 virtual/pkgconfig virtual/pkgconfig +DEFINED_PHASES=compile install postinst postrm preinst prepare setup unpack +DEPEND=acct-group/video persistenced? ( acct-user/nvpd net-libs/libtirpc:= ) x11-base/xorg-proto x11-libs/libX11 x11-libs/libXext +DESCRIPTION=NVIDIA Accelerated Graphics Driver +EAPI=8 +HOMEPAGE=https://www.nvidia.com/download/index.aspx +INHERIT=desktop flag-o-matic multilib readme.gentoo-r1 systemd toolchain-funcs unpacker user-info +IUSE=abi_x86_32 abi_x86_64 +acpi +dkms +persistenced +tools +X +KEYWORDS=-* amd64 +LICENSE=NVIDIA-r2 BSD BSD-2 GPL-2 MIT ZLIB curl openssl +PDEPEND=tools? ( x11-misc/nvidia-settings:4 ) +RDEPEND=acct-group/video persistenced? ( acct-user/nvpd net-libs/libtirpc:= ) sys-libs/glibc !!x11-drivers/nvidia-drivers:3 !!x11-drivers/nvidia-drivers:5 acpi? ( sys-power/acpid ) dkms? ( ~sys-kernel/nvidia-drivers-dkms-470.256.02:4 ) X? ( media-libs/libglvnd[X,abi_x86_32(-)?] x11-libs/libX11[abi_x86_32(-)?] x11-libs/libXext[abi_x86_32(-)?] ) +RESTRICT=strip +SLOT=4 +SRC_URI=https://download.nvidia.com/XFree86/Linux-x86_64/470.256.02/NVIDIA-Linux-x86_64-470.256.02.run https://download.nvidia.com/XFree86/nvidia-installer/nvidia-installer-470.256.02.tar.bz2 https://download.nvidia.com/XFree86/nvidia-modprobe/nvidia-modprobe-470.256.02.tar.bz2 https://download.nvidia.com/XFree86/nvidia-persistenced/nvidia-persistenced-470.256.02.tar.bz2 https://download.nvidia.com/XFree86/nvidia-xconfig/nvidia-xconfig-470.256.02.tar.bz2 +_eclasses_=desktop 56973babb9c5f19cab0eeb53ece644c6 flag-o-matic fa33e3696fe4689dda7e9affe92e2c94 multilib 7e1347c006a76bb812f3a9f663b79991 multiprocessing e644caa6eb7ce7e5ab0864383ac13ad9 readme.gentoo-r1 32b48460d813533d85f082897cec1b80 systemd 0f241b5c9f3758c3d3423df59a7f655a toolchain-funcs 948855ec7ad9f11351edf9066708dfa9 unpacker fb4b84181244b3b9990fa0bf40232dd2 user-info 9951b1a0e4f026d16c33a001fd2d5cdf +_md5_=dd2d87a41eb50bc254fba9d8ef0c354c diff --git a/metadata/md5-cache/x11-drivers/nvidia-drivers-470.256.02-r2 b/metadata/md5-cache/x11-drivers/nvidia-drivers-470.256.02-r2 deleted file mode 100644 index 0da6e683..00000000 --- a/metadata/md5-cache/x11-drivers/nvidia-drivers-470.256.02-r2 +++ /dev/null @@ -1,17 +0,0 @@ -BDEPEND=sys-devel/m4 virtual/pkgconfig virtual/pkgconfig -DEFINED_PHASES=compile install postinst postrm preinst prepare setup unpack -DEPEND=acct-group/video persistenced? ( acct-user/nvpd net-libs/libtirpc:= ) x11-base/xorg-proto x11-libs/libX11 x11-libs/libXext -DESCRIPTION=NVIDIA Accelerated Graphics Driver -EAPI=8 -HOMEPAGE=https://www.nvidia.com/download/index.aspx -INHERIT=desktop flag-o-matic multilib readme.gentoo-r1 systemd toolchain-funcs unpacker user-info -IUSE=abi_x86_32 abi_x86_64 +acpi +dkms +persistenced +tools +X -KEYWORDS=-* amd64 -LICENSE=NVIDIA-r2 BSD BSD-2 GPL-2 MIT ZLIB curl openssl -PDEPEND=tools? ( x11-misc/nvidia-settings:4 ) -RDEPEND=acct-group/video persistenced? ( acct-user/nvpd net-libs/libtirpc:= ) sys-libs/glibc !!x11-drivers/nvidia-drivers:3 !!x11-drivers/nvidia-drivers:5 acpi? ( sys-power/acpid ) dkms? ( ~sys-kernel/nvidia-drivers-dkms-470.256.02:4 ) X? ( media-libs/libglvnd[X,abi_x86_32(-)?] x11-libs/libX11[abi_x86_32(-)?] x11-libs/libXext[abi_x86_32(-)?] ) -RESTRICT=strip -SLOT=4 -SRC_URI=https://download.nvidia.com/XFree86/Linux-x86_64/470.256.02/NVIDIA-Linux-x86_64-470.256.02.run https://download.nvidia.com/XFree86/nvidia-installer/nvidia-installer-470.256.02.tar.bz2 https://download.nvidia.com/XFree86/nvidia-modprobe/nvidia-modprobe-470.256.02.tar.bz2 https://download.nvidia.com/XFree86/nvidia-persistenced/nvidia-persistenced-470.256.02.tar.bz2 https://download.nvidia.com/XFree86/nvidia-xconfig/nvidia-xconfig-470.256.02.tar.bz2 -_eclasses_=desktop 56973babb9c5f19cab0eeb53ece644c6 flag-o-matic fa33e3696fe4689dda7e9affe92e2c94 multilib 7e1347c006a76bb812f3a9f663b79991 multiprocessing e644caa6eb7ce7e5ab0864383ac13ad9 readme.gentoo-r1 32b48460d813533d85f082897cec1b80 systemd 0f241b5c9f3758c3d3423df59a7f655a toolchain-funcs 948855ec7ad9f11351edf9066708dfa9 unpacker fb4b84181244b3b9990fa0bf40232dd2 user-info 9951b1a0e4f026d16c33a001fd2d5cdf -_md5_=5d6013c2bfe31d77300eaf99dce8d991 diff --git a/metadata/md5-cache/x11-drivers/nvidia-drivers-550.107.02-r1 b/metadata/md5-cache/x11-drivers/nvidia-drivers-550.107.02-r1 new file mode 100644 index 00000000..229790d4 --- /dev/null +++ b/metadata/md5-cache/x11-drivers/nvidia-drivers-550.107.02-r1 @@ -0,0 +1,17 @@ +BDEPEND=sys-devel/m4 virtual/pkgconfig virtual/pkgconfig +DEFINED_PHASES=compile install postinst postrm preinst prepare setup unpack +DEPEND=acct-group/video X? ( x11-libs/libpciaccess ) persistenced? ( acct-user/nvpd net-libs/libtirpc:= ) x11-base/xorg-proto x11-libs/libX11 x11-libs/libXext +DESCRIPTION=NVIDIA Accelerated Graphics Driver +EAPI=8 +HOMEPAGE=https://www.nvidia.com/download/index.aspx +INHERIT=desktop flag-o-matic readme.gentoo-r1 systemd toolchain-funcs unpacker user-info +IUSE=abi_x86_32 abi_x86_64 +acpi +dkms +persistenced +powerd +tools +wayland +X +KEYWORDS=-* amd64 +LICENSE=NVIDIA-r2 Apache-2.0 BSD BSD-2 GPL-2 MIT ZLIB curl openssl +PDEPEND=tools? ( x11-misc/nvidia-settings:5 ) +RDEPEND=acct-group/video X? ( x11-libs/libpciaccess ) persistenced? ( acct-user/nvpd net-libs/libtirpc:= ) dev-libs/openssl:0/3 sys-libs/glibc !!x11-drivers/nvidia-drivers:3 !!x11-drivers/nvidia-drivers:4 acpi? ( sys-power/acpid ) dkms? ( ~sys-kernel/nvidia-drivers-dkms-550.107.02:5 ) X? ( media-libs/libglvnd[X,abi_x86_32(-)?] x11-libs/libX11[abi_x86_32(-)?] x11-libs/libXext[abi_x86_32(-)?] ) powerd? ( sys-apps/dbus[abi_x86_32(-)?] ) wayland? ( gui-libs/egl-gbm >=gui-libs/egl-wayland-1.1.10 ) +RESTRICT=strip +SLOT=5 +SRC_URI=https://download.nvidia.com/XFree86/Linux-x86_64/550.107.02/NVIDIA-Linux-x86_64-550.107.02.run https://download.nvidia.com/XFree86/nvidia-installer/nvidia-installer-550.107.02.tar.bz2 https://download.nvidia.com/XFree86/nvidia-modprobe/nvidia-modprobe-550.107.02.tar.bz2 https://download.nvidia.com/XFree86/nvidia-persistenced/nvidia-persistenced-550.107.02.tar.bz2 https://download.nvidia.com/XFree86/nvidia-xconfig/nvidia-xconfig-550.107.02.tar.bz2 +_eclasses_=desktop 56973babb9c5f19cab0eeb53ece644c6 flag-o-matic fa33e3696fe4689dda7e9affe92e2c94 multilib 7e1347c006a76bb812f3a9f663b79991 multiprocessing e644caa6eb7ce7e5ab0864383ac13ad9 readme.gentoo-r1 32b48460d813533d85f082897cec1b80 systemd 0f241b5c9f3758c3d3423df59a7f655a toolchain-funcs 948855ec7ad9f11351edf9066708dfa9 unpacker fb4b84181244b3b9990fa0bf40232dd2 user-info 9951b1a0e4f026d16c33a001fd2d5cdf +_md5_=bf119f76a6d58bb353ff7bb17f2cda66 diff --git a/metadata/md5-cache/x11-drivers/nvidia-drivers-550.107.02-r2 b/metadata/md5-cache/x11-drivers/nvidia-drivers-550.107.02-r2 deleted file mode 100644 index 3cbeab1f..00000000 --- a/metadata/md5-cache/x11-drivers/nvidia-drivers-550.107.02-r2 +++ /dev/null @@ -1,17 +0,0 @@ -BDEPEND=sys-devel/m4 virtual/pkgconfig virtual/pkgconfig -DEFINED_PHASES=compile install postinst postrm preinst prepare setup unpack -DEPEND=acct-group/video X? ( x11-libs/libpciaccess ) persistenced? ( acct-user/nvpd net-libs/libtirpc:= ) x11-base/xorg-proto x11-libs/libX11 x11-libs/libXext -DESCRIPTION=NVIDIA Accelerated Graphics Driver -EAPI=8 -HOMEPAGE=https://www.nvidia.com/download/index.aspx -INHERIT=desktop flag-o-matic readme.gentoo-r1 systemd toolchain-funcs unpacker user-info -IUSE=abi_x86_32 abi_x86_64 +acpi +dkms +persistenced +powerd +tools +wayland +X -KEYWORDS=-* amd64 -LICENSE=NVIDIA-r2 Apache-2.0 BSD BSD-2 GPL-2 MIT ZLIB curl openssl -PDEPEND=tools? ( x11-misc/nvidia-settings:5 ) -RDEPEND=acct-group/video X? ( x11-libs/libpciaccess ) persistenced? ( acct-user/nvpd net-libs/libtirpc:= ) dev-libs/openssl:0/3 sys-libs/glibc !!x11-drivers/nvidia-drivers:3 !!x11-drivers/nvidia-drivers:4 acpi? ( sys-power/acpid ) dkms? ( ~sys-kernel/nvidia-drivers-dkms-550.107.02:5 ) X? ( media-libs/libglvnd[X,abi_x86_32(-)?] x11-libs/libX11[abi_x86_32(-)?] x11-libs/libXext[abi_x86_32(-)?] ) powerd? ( sys-apps/dbus[abi_x86_32(-)?] ) wayland? ( gui-libs/egl-gbm >=gui-libs/egl-wayland-1.1.10 ) -RESTRICT=strip -SLOT=5 -SRC_URI=https://download.nvidia.com/XFree86/Linux-x86_64/550.107.02/NVIDIA-Linux-x86_64-550.107.02.run https://download.nvidia.com/XFree86/nvidia-installer/nvidia-installer-550.107.02.tar.bz2 https://download.nvidia.com/XFree86/nvidia-modprobe/nvidia-modprobe-550.107.02.tar.bz2 https://download.nvidia.com/XFree86/nvidia-persistenced/nvidia-persistenced-550.107.02.tar.bz2 https://download.nvidia.com/XFree86/nvidia-xconfig/nvidia-xconfig-550.107.02.tar.bz2 -_eclasses_=desktop 56973babb9c5f19cab0eeb53ece644c6 flag-o-matic fa33e3696fe4689dda7e9affe92e2c94 multilib 7e1347c006a76bb812f3a9f663b79991 multiprocessing e644caa6eb7ce7e5ab0864383ac13ad9 readme.gentoo-r1 32b48460d813533d85f082897cec1b80 systemd 0f241b5c9f3758c3d3423df59a7f655a toolchain-funcs 948855ec7ad9f11351edf9066708dfa9 unpacker fb4b84181244b3b9990fa0bf40232dd2 user-info 9951b1a0e4f026d16c33a001fd2d5cdf -_md5_=429f1e9f7678ba2794363edb5a6477c8 diff --git a/metadata/pkg_desc_index b/metadata/pkg_desc_index index 13765b1a..f0625c63 100644 --- a/metadata/pkg_desc_index +++ b/metadata/pkg_desc_index @@ -82,7 +82,7 @@ virtual/tmpfiles 1.314.1337-r1: Virtual to select between different tmpfiles.d h virtual/udev 314.1337-r1: Virtual to select between different udev daemon providers www-client/ungoogled-chromium 128.0.6613.84: Modifications to Chromium for removing Google integration and enhancing privacy x11-base/xorg-drivers 21.1-r100: Meta package containing deps on all xorg drivers (dummy package) -x11-drivers/nvidia-drivers 390.157-r11 470.256.02-r2 550.107.02-r2: NVIDIA Accelerated Graphics Driver +x11-drivers/nvidia-drivers 390.157-r10 470.256.02-r1 550.107.02-r1: NVIDIA Accelerated Graphics Driver x11-libs/gtk+ 2.24.33-r5 3.24.41-r5: Gimp ToolKit + x11-misc/nvidia-prime 314: NVIDIA Prime Render Offload configuration and utilities x11-misc/nvidia-settings 390.157-r7 470.256.02 550.107.02: NVIDIA Linux X11 Settings Utility diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-390.157-r10.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-390.157-r10.ebuild new file mode 100644 index 00000000..0a584315 --- /dev/null +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-390.157-r10.ebuild @@ -0,0 +1,346 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit desktop flag-o-matic multilib readme.gentoo-r1 +inherit systemd toolchain-funcs unpacker user-info + +NV_URI="https://download.nvidia.com/XFree86/" + +DESCRIPTION="NVIDIA Accelerated Graphics Driver" +HOMEPAGE="https://www.nvidia.com/download/index.aspx" +SRC_URI=" + ${NV_URI}Linux-x86_64/${PV}/NVIDIA-Linux-x86_64-${PV}.run + $(printf "${NV_URI}%s/%s-${PV}.tar.bz2 " \ + nvidia-{installer,modprobe,persistenced,xconfig}{,}) +" +# nvidia-installer is unused but here for GPL-2's "distribute sources" +S=${WORKDIR} + +LICENSE="NVIDIA-r2 BSD BSD-2 GPL-2 MIT" +SLOT="3" +KEYWORDS="-* amd64" +IUSE="abi_x86_32 abi_x86_64 +acpi +dkms +persistenced +tools +X" +RESTRICT="strip" + +COMMON_DEPEND=" + acct-group/video + persistenced? ( + acct-user/nvpd + net-libs/libtirpc:= + ) +" +RDEPEND=" + ${COMMON_DEPEND} + sys-libs/glibc + !!x11-drivers/nvidia-drivers:4 + !!x11-drivers/nvidia-drivers:5 + acpi? ( sys-power/acpid ) + dkms? ( ~sys-kernel/${PN}-dkms-${PV}:${SLOT} ) + X? ( + media-libs/libglvnd[X,abi_x86_32(-)?] + x11-libs/libX11[abi_x86_32(-)?] + x11-libs/libXext[abi_x86_32(-)?] + ) +" +DEPEND=" + ${COMMON_DEPEND} + x11-base/xorg-proto + x11-libs/libX11 + x11-libs/libXext +" +BDEPEND=" + sys-devel/m4 + virtual/pkgconfig +" +PDEPEND=" + tools? ( x11-misc/nvidia-settings:${SLOT} ) +" + +QA_PREBUILT="opt/bin/* usr/lib*" + +PATCHES=( + # note: no plans to add patches for newer kernels here, when the last + # working 6.1.x LTS is EOL then 390 will simply be removed from the tree + "${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch +) + +pkg_setup() { + local CONFIG_CHECK=" + PROC_FS + ~DRM_KMS_HELPER + ~SYSVIPC + ~!AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT + ~!LOCKDEP + ~!X86_KERNEL_IBT + !DEBUG_MUTEXES + " + + local ERROR_DRM_KMS_HELPER="CONFIG_DRM_KMS_HELPER: is not set but needed for Xorg auto-detection + of drivers (no custom config), and optional nvidia-drm.modeset=1. + With 390.xx drivers, also used by a GLX workaround needed for OpenGL. + Cannot be directly selected in the kernel's menuconfig, and may need + selection of a DRM device even if unused, e.g. CONFIG_DRM_AMDGPU=m or + DRM_I915=y, DRM_NOUVEAU=m also acceptable if a module and not built-in." + + local ERROR_X86_KERNEL_IBT="CONFIG_X86_KERNEL_IBT: is set and, if the CPU supports the feature, + this will likely lead to modules load failure with ENDBR errors. + Please ignore if not having issues, but otherwise try to unset or + pass ibt=off to the kernel's command line." #911142 + + CONFIG_CHECK+=" X86_PAT" #817764 +} + +src_prepare() { + # make patches usable across versions + rm nvidia-modprobe && mv nvidia-modprobe{-${PV},} || die + rm nvidia-persistenced && mv nvidia-persistenced{-${PV},} || die + rm nvidia-xconfig && mv nvidia-xconfig{-${PV},} || die + + eapply "${FILESDIR}"/nvidia-drivers-390.154-clang15.patch + + default + + # prevent detection of incomplete kernel DRM support (bug #603818) + sed 's/defined(CONFIG_DRM/defined(CONFIG_DRM_KMS_HELPER/g' \ + -i kernel/conftest.sh || die + + sed 's/__USER__/nvpd/' \ + nvidia-persistenced/init/systemd/nvidia-persistenced.service.template \ + > "${T}"/nvidia-persistenced.service || die + + # use alternative vulkan icd option if USE=-X (bug #909181) + sed "s/__NV_VK_ICD__/lib$(usex X GLX EGL)_nvidia.so.0/" \ + nvidia_icd.json.template > nvidia_icd.json || die + + # 390 has legacy glx needing a modified .conf (bug #713546) + # directory is not quite right, but kept for any existing custom xorg.conf + sed "s|@LIBDIR@|${EPREFIX}/usr/$(get_libdir)|" \ + "${FILESDIR}"/nvidia-drm-outputclass-390.conf > nvidia-drm-outputclass.conf || die +} + +src_compile() { + tc-export AR CC CXX LD OBJCOPY OBJDUMP PKG_CONFIG + local -x RAW_LDFLAGS="$(get_abi_LDFLAGS) $(raw-ldflags)" # raw-ldflags.patch + + # latest branches has proper fixes, but legacy have more issues and are + # not worth the trouble, so doing the lame "fix" for gcc14 (bug #921370) + local noerr=( + -Wno-error=implicit-function-declaration + -Wno-error=incompatible-pointer-types + ) + # not *FLAGS to ensure it's used everywhere including conftest.sh + CC+=" $(test-flags-CC "${noerr[@]}")" + + NV_ARGS=( + PREFIX="${EPREFIX}"/usr + HOST_CC="$(tc-getBUILD_CC)" + HOST_LD="$(tc-getBUILD_LD)" + NV_USE_BUNDLED_LIBJANSSON=0 + NV_VERBOSE=1 DO_STRIP= MANPAGE_GZIP= OUTPUTDIR=out + ) + + if use persistenced; then + # 390.xx persistenced does not auto-detect libtirpc + LIBS=$(${PKG_CONFIG} --libs libtirpc || die) \ + common_cflags=$(${PKG_CONFIG} --cflags libtirpc || die) \ + emake "${NV_ARGS[@]}" -C nvidia-persistenced + fi + + emake "${NV_ARGS[@]}" -C nvidia-modprobe + use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig +} + +src_install() { + local libdir=$(get_libdir) libdir32=$(ABI=x86 get_libdir) + + NV_ARGS+=( DESTDIR="${D}" LIBDIR="${ED}"/usr/${libdir} ) + + local -A paths=( + [APPLICATION_PROFILE]=/usr/share/nvidia + [CUDA_ICD]=/etc/OpenCL/vendors + [EGL_EXTERNAL_PLATFORM_JSON]=/usr/share/egl/egl_external_platform.d + [GLVND_EGL_ICD_JSON]=/usr/share/glvnd/egl_vendor.d + [VULKAN_ICD_JSON]=/usr/share/vulkan/icd.d + [XORG_OUTPUTCLASS_CONFIG]=/usr/share/X11/xorg.conf.d + + [GLX_MODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules/extensions + [GLX_MODULE_SYMLINK]=/usr/${libdir}/extensions/nvidia + [XMODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules + [XMODULE_SYMLINK]=/usr/${libdir}/xorg/modules + ) + + local skip_files=( + $(usev !X "libGLX_nvidia libglx libnvidia-ifr") + libGLX_indirect # non-glvnd unused fallback + libnvidia-gtk nvidia-{settings,xconfig} # built from source + libnvidia-egl-wayland 10_nvidia_wayland # gui-libs/egl-wayland + ) + local skip_modules=( + $(usev !X "nvfbc vdpau xdriver") + installer nvpd # handled separately / built from source + ) + local skip_types=( + GLVND_LIB GLVND_SYMLINK EGL_CLIENT.\* GLX_CLIENT.\* # media-libs/libglvnd + OPENCL_WRAPPER.\* # virtual/opencl + DOCUMENTATION DOT_DESKTOP # handled separately + XMODULE_NEWSYM # use xorg's libwfb.so, nvidia also keeps it if it exists + .\*_SRC DKMS_CONF LIBGL_LA OPENGL_HEADER # unused + ) + + local DOCS=( + README.txt NVIDIA_Changelog + ) + local HTML_DOCS=( html/. ) + einstalldocs + + local DISABLE_AUTOFORMATTING=yes + local DOC_CONTENTS="\ +Trusted users should be in the 'video' group to use NVIDIA devices. +You can add yourself by using: gpasswd -a my-user video\ + +390.xx libglvnd support is partial and requires different Xorg modules +for working OpenGL/GLX. If using the default Xorg configuration these +should be used automatically, otherwise manually add the ModulePath +from: '${EPREFIX}/${paths[XORG_OUTPUTCLASS_CONFIG]#/}/nvidia-drm-outputclass.conf'\ + +Note that NVIDIA is no longer offering support for the unified memory +module (nvidia-uvm) on x86 (32bit), as such the module is missing. +This means OpenCL/CUDA (and related, like nvenc) cannot be used. +Other functions, like OpenGL, will continue to work. + +Support from NVIDIA for 390.xx will end in December 2022, how long +Gentoo will be able to reasonably support it beyond that is unknown. +If wish to continue using this hardware, should consider switching +to the Nouveau open source driver. +https://nvidia.custhelp.com/app/answers/detail/a_id/3142/ + +For additional information or for troubleshooting issues, please see +https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers and NVIDIA's own +documentation that is installed alongside this README." + readme.gentoo_create_doc + + insinto /etc/modprobe.d + newins "${FILESDIR}"/nvidia-390.conf nvidia.conf + + emake "${NV_ARGS[@]}" -C nvidia-modprobe install + fowners :video /usr/bin/nvidia-modprobe #505092 + fperms 4710 /usr/bin/nvidia-modprobe + + if use persistenced; then + emake "${NV_ARGS[@]}" -C nvidia-persistenced install + newconfd "${FILESDIR}"/nvidia-persistenced.confd nvidia-persistenced + newinitd "${FILESDIR}"/nvidia-persistenced.initd nvidia-persistenced + systemd_dounit "${T}"/nvidia-persistenced.service + fi + + use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig install + + # mimic nvidia-installer by reading .manifest to install files + # 0:file 1:perms 2:type 3+:subtype/arguments -:module + local m into + while IFS=' ' read -ra m; do + ! [[ ${#m[@]} -ge 2 && ${m[-1]} =~ MODULE: ]] || + [[ " ${m[0]##*/}" =~ ^(\ ${skip_files[*]/%/.*|\\} )$ ]] || + [[ " ${m[2]}" =~ ^(\ ${skip_types[*]/%/|\\} )$ ]] || + has ${m[-1]#MODULE:} "${skip_modules[@]}" && continue + + case ${m[2]} in + MANPAGE) + gzip -dc ${m[0]} | newman - ${m[0]%.gz}; assert + continue + ;; + GLX_MODULE_SYMLINK|XMODULE_NEWSYM) + # messy symlinks for non-glvnd xorg modules overrides put + # in a different directory to avoid collisions (390-only) + m[4]=../../xorg/modules/${m[3]#/}${m[4]} + m[3]=/ + ;; + TLS_LIB) [[ ${m[4]} == CLASSIC ]] && continue;; # segfaults (bug #785289) + VDPAU_SYMLINK) m[4]=vdpau/; m[5]=${m[5]#vdpau/};; # .so to vdpau/ + VULKAN_ICD_JSON) m[0]=${m[0]%.template};; + esac + + if [[ -v 'paths[${m[2]}]' ]]; then + into=${paths[${m[2]}]} + elif [[ ${m[2]} == *_BINARY ]]; then + into=/opt/bin + elif [[ ${m[3]} == COMPAT32 ]]; then + use abi_x86_32 || continue + into=/usr/${libdir32} + elif [[ ${m[2]} == *_@(LIB|SYMLINK) ]]; then + into=/usr/${libdir} + else + die "No known installation path for ${m[0]}" + fi + [[ ${m[3]: -2} == ?/ ]] && into+=/${m[3]%/} + [[ ${m[4]: -2} == ?/ ]] && into+=/${m[4]%/} + + if [[ ${m[2]} =~ _SYMLINK$|_NEWSYM$ ]]; then + [[ ${m[4]: -1} == / ]] && m[4]=${m[5]} + dosym ${m[4]} ${into}/${m[0]} + continue + fi + + printf -v m[1] %o $((m[1] | 0200)) # 444->644 + insopts -m${m[1]} + insinto ${into} + doins ${m[0]} + done < .manifest || die + insopts -m0644 # reset + + # MODULE:installer non-skipped extras + dolib.so libnvidia-cfg.so.${PV} + dosym libnvidia-cfg.so.${PV} /usr/${libdir}/libnvidia-cfg.so.1 + dosym libnvidia-cfg.so.${PV} /usr/${libdir}/libnvidia-cfg.so + + dobin nvidia-bug-report.sh + + # symlink non-versioned so nvidia-settings can use it even if misdetected + dosym nvidia-application-profiles-${PV}-key-documentation \ + ${paths[APPLICATION_PROFILE]}/nvidia-application-profiles-key-documentation + + # sandbox issues with /dev/nvidiactl are widespread and sometime + # affect revdeps of packages built with USE=opencl/cuda making it + # hard to manage in ebuilds (minimal set, ebuilds should handle + # manually if need others or addwrite) + insinto /etc/sandbox.d + newins - 20nvidia <<<'SANDBOX_PREDICT="/dev/nvidiactl"' +} + +_dracut_initramfs_regen() { + if [ -x $(which dracut) ]; then + dracut -N -f --no-hostonly-cmdline + fi +} + +pkg_preinst() { + # set video group id based on live system (bug #491414) + local g=$(egetent group video | cut -d: -f3) + [[ ${g} =~ ^[0-9]+$ ]] || die "Failed to determine video group id (got '${g}')" + sed -i "s/@VIDEOGID@/${g}/" "${ED}"/etc/modprobe.d/nvidia.conf || die +} + +pkg_postinst() { + if [ $(stat -c %d:%i /) == $(stat -c %d:%i /proc/1/root/.) ]; then + _dracut_initramfs_regen + fi + + readme.gentoo_print_elog + ewarn + ewarn "Be warned/reminded that the 390.xx branch reached end-of-life and" + ewarn "NVIDIA is no longer fixing issues (including security). Free to keep" + ewarn "using (for now) but it is recommended to either switch to nouveau or" + ewarn "replace hardware. Will be kept in-tree while possible, but expect it" + ewarn "to be removed likely in early 2027 or earlier if major issues arise." + ewarn + ewarn "Note that there is no plans to patch in support for kernels branches" + ewarn "newer than 6.1.x which will be supported upstream until December 2026." +} + +pkg_postrm() { + if [ $(stat -c %d:%i /) == $(stat -c %d:%i /proc/1/root/.) ]; then + _dracut_initramfs_regen + fi +} diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-390.157-r11.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-390.157-r11.ebuild deleted file mode 100644 index be5e9eca..00000000 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-390.157-r11.ebuild +++ /dev/null @@ -1,346 +0,0 @@ -# Copyright 1999-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -inherit desktop flag-o-matic multilib readme.gentoo-r1 -inherit systemd toolchain-funcs unpacker user-info - -NV_URI="https://download.nvidia.com/XFree86/" - -DESCRIPTION="NVIDIA Accelerated Graphics Driver" -HOMEPAGE="https://www.nvidia.com/download/index.aspx" -SRC_URI=" - ${NV_URI}Linux-x86_64/${PV}/NVIDIA-Linux-x86_64-${PV}.run - $(printf "${NV_URI}%s/%s-${PV}.tar.bz2 " \ - nvidia-{installer,modprobe,persistenced,xconfig}{,}) -" -# nvidia-installer is unused but here for GPL-2's "distribute sources" -S=${WORKDIR} - -LICENSE="NVIDIA-r2 BSD BSD-2 GPL-2 MIT" -SLOT="3" -KEYWORDS="-* amd64" -IUSE="abi_x86_32 abi_x86_64 +acpi +dkms +persistenced +tools +X" -RESTRICT="strip" - -COMMON_DEPEND=" - acct-group/video - persistenced? ( - acct-user/nvpd - net-libs/libtirpc:= - ) -" -RDEPEND=" - ${COMMON_DEPEND} - sys-libs/glibc - !!x11-drivers/nvidia-drivers:4 - !!x11-drivers/nvidia-drivers:5 - acpi? ( sys-power/acpid ) - dkms? ( ~sys-kernel/${PN}-dkms-${PV}:${SLOT} ) - X? ( - media-libs/libglvnd[X,abi_x86_32(-)?] - x11-libs/libX11[abi_x86_32(-)?] - x11-libs/libXext[abi_x86_32(-)?] - ) -" -DEPEND=" - ${COMMON_DEPEND} - x11-base/xorg-proto - x11-libs/libX11 - x11-libs/libXext -" -BDEPEND=" - sys-devel/m4 - virtual/pkgconfig -" -PDEPEND=" - tools? ( x11-misc/nvidia-settings:${SLOT} ) -" - -QA_PREBUILT="opt/bin/* usr/lib*" - -PATCHES=( - # note: no plans to add patches for newer kernels here, when the last - # working 6.1.x LTS is EOL then 390 will simply be removed from the tree - "${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch -) - -pkg_setup() { - local CONFIG_CHECK=" - PROC_FS - ~DRM_KMS_HELPER - ~SYSVIPC - ~!AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT - ~!LOCKDEP - ~!X86_KERNEL_IBT - !DEBUG_MUTEXES - " - - local ERROR_DRM_KMS_HELPER="CONFIG_DRM_KMS_HELPER: is not set but needed for Xorg auto-detection - of drivers (no custom config), and optional nvidia-drm.modeset=1. - With 390.xx drivers, also used by a GLX workaround needed for OpenGL. - Cannot be directly selected in the kernel's menuconfig, and may need - selection of a DRM device even if unused, e.g. CONFIG_DRM_AMDGPU=m or - DRM_I915=y, DRM_NOUVEAU=m also acceptable if a module and not built-in." - - local ERROR_X86_KERNEL_IBT="CONFIG_X86_KERNEL_IBT: is set and, if the CPU supports the feature, - this will likely lead to modules load failure with ENDBR errors. - Please ignore if not having issues, but otherwise try to unset or - pass ibt=off to the kernel's command line." #911142 - - CONFIG_CHECK+=" X86_PAT" #817764 -} - -src_prepare() { - # make patches usable across versions - rm nvidia-modprobe && mv nvidia-modprobe{-${PV},} || die - rm nvidia-persistenced && mv nvidia-persistenced{-${PV},} || die - rm nvidia-xconfig && mv nvidia-xconfig{-${PV},} || die - - eapply "${FILESDIR}"/nvidia-drivers-390.154-clang15.patch - - default - - # prevent detection of incomplete kernel DRM support (bug #603818) - sed 's/defined(CONFIG_DRM/defined(CONFIG_DRM_KMS_HELPER/g' \ - -i kernel/conftest.sh || die - - sed 's/__USER__/nvpd/' \ - nvidia-persistenced/init/systemd/nvidia-persistenced.service.template \ - > "${T}"/nvidia-persistenced.service || die - - # use alternative vulkan icd option if USE=-X (bug #909181) - sed "s/__NV_VK_ICD__/lib$(usex X GLX EGL)_nvidia.so.0/" \ - nvidia_icd.json.template > nvidia_icd.json || die - - # 390 has legacy glx needing a modified .conf (bug #713546) - # directory is not quite right, but kept for any existing custom xorg.conf - sed "s|@LIBDIR@|${EPREFIX}/usr/$(get_libdir)|" \ - "${FILESDIR}"/nvidia-drm-outputclass-390.conf > nvidia-drm-outputclass.conf || die -} - -src_compile() { - tc-export AR CC CXX LD OBJCOPY OBJDUMP PKG_CONFIG - local -x RAW_LDFLAGS="$(get_abi_LDFLAGS) $(raw-ldflags)" # raw-ldflags.patch - - # latest branches has proper fixes, but legacy have more issues and are - # not worth the trouble, so doing the lame "fix" for gcc14 (bug #921370) - local noerr=( - -Wno-error=implicit-function-declaration - -Wno-error=incompatible-pointer-types - ) - # not *FLAGS to ensure it's used everywhere including conftest.sh - CC+=" $(test-flags-CC "${noerr[@]}")" - - NV_ARGS=( - PREFIX="${EPREFIX}"/usr - HOST_CC="$(tc-getBUILD_CC)" - HOST_LD="$(tc-getBUILD_LD)" - NV_USE_BUNDLED_LIBJANSSON=0 - NV_VERBOSE=1 DO_STRIP= MANPAGE_GZIP= OUTPUTDIR=out - ) - - if use persistenced; then - # 390.xx persistenced does not auto-detect libtirpc - LIBS=$(${PKG_CONFIG} --libs libtirpc || die) \ - common_cflags=$(${PKG_CONFIG} --cflags libtirpc || die) \ - emake "${NV_ARGS[@]}" -C nvidia-persistenced - fi - - emake "${NV_ARGS[@]}" -C nvidia-modprobe - use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig -} - -src_install() { - local libdir=$(get_libdir) libdir32=$(ABI=x86 get_libdir) - - NV_ARGS+=( DESTDIR="${D}" LIBDIR="${ED}"/usr/${libdir} ) - - local -A paths=( - [APPLICATION_PROFILE]=/usr/share/nvidia - [CUDA_ICD]=/etc/OpenCL/vendors - [EGL_EXTERNAL_PLATFORM_JSON]=/usr/share/egl/egl_external_platform.d - [GLVND_EGL_ICD_JSON]=/usr/share/glvnd/egl_vendor.d - [VULKAN_ICD_JSON]=/usr/share/vulkan/icd.d - [XORG_OUTPUTCLASS_CONFIG]=/usr/share/X11/xorg.conf.d - - [GLX_MODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules/extensions - [GLX_MODULE_SYMLINK]=/usr/${libdir}/extensions/nvidia - [XMODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules - [XMODULE_SYMLINK]=/usr/${libdir}/xorg/modules - ) - - local skip_files=( - $(usev !X "libGLX_nvidia libglx libnvidia-ifr") - libGLX_indirect # non-glvnd unused fallback - libnvidia-gtk nvidia-xconfig # built from source - libnvidia-egl-wayland 10_nvidia_wayland # gui-libs/egl-wayland - ) - local skip_modules=( - $(usev !X "nvfbc vdpau xdriver") - installer nvpd # handled separately / built from source - ) - local skip_types=( - GLVND_LIB GLVND_SYMLINK EGL_CLIENT.\* GLX_CLIENT.\* # media-libs/libglvnd - OPENCL_WRAPPER.\* # virtual/opencl - DOCUMENTATION DOT_DESKTOP # handled separately - XMODULE_NEWSYM # use xorg's libwfb.so, nvidia also keeps it if it exists - .\*_SRC DKMS_CONF LIBGL_LA OPENGL_HEADER # unused - ) - - local DOCS=( - README.txt NVIDIA_Changelog - ) - local HTML_DOCS=( html/. ) - einstalldocs - - local DISABLE_AUTOFORMATTING=yes - local DOC_CONTENTS="\ -Trusted users should be in the 'video' group to use NVIDIA devices. -You can add yourself by using: gpasswd -a my-user video\ - -390.xx libglvnd support is partial and requires different Xorg modules -for working OpenGL/GLX. If using the default Xorg configuration these -should be used automatically, otherwise manually add the ModulePath -from: '${EPREFIX}/${paths[XORG_OUTPUTCLASS_CONFIG]#/}/nvidia-drm-outputclass.conf'\ - -Note that NVIDIA is no longer offering support for the unified memory -module (nvidia-uvm) on x86 (32bit), as such the module is missing. -This means OpenCL/CUDA (and related, like nvenc) cannot be used. -Other functions, like OpenGL, will continue to work. - -Support from NVIDIA for 390.xx will end in December 2022, how long -Gentoo will be able to reasonably support it beyond that is unknown. -If wish to continue using this hardware, should consider switching -to the Nouveau open source driver. -https://nvidia.custhelp.com/app/answers/detail/a_id/3142/ - -For additional information or for troubleshooting issues, please see -https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers and NVIDIA's own -documentation that is installed alongside this README." - readme.gentoo_create_doc - - insinto /etc/modprobe.d - newins "${FILESDIR}"/nvidia-390.conf nvidia.conf - - emake "${NV_ARGS[@]}" -C nvidia-modprobe install - fowners :video /usr/bin/nvidia-modprobe #505092 - fperms 4710 /usr/bin/nvidia-modprobe - - if use persistenced; then - emake "${NV_ARGS[@]}" -C nvidia-persistenced install - newconfd "${FILESDIR}"/nvidia-persistenced.confd nvidia-persistenced - newinitd "${FILESDIR}"/nvidia-persistenced.initd nvidia-persistenced - systemd_dounit "${T}"/nvidia-persistenced.service - fi - - use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig install - - # mimic nvidia-installer by reading .manifest to install files - # 0:file 1:perms 2:type 3+:subtype/arguments -:module - local m into - while IFS=' ' read -ra m; do - ! [[ ${#m[@]} -ge 2 && ${m[-1]} =~ MODULE: ]] || - [[ " ${m[0]##*/}" =~ ^(\ ${skip_files[*]/%/.*|\\} )$ ]] || - [[ " ${m[2]}" =~ ^(\ ${skip_types[*]/%/|\\} )$ ]] || - has ${m[-1]#MODULE:} "${skip_modules[@]}" && continue - - case ${m[2]} in - MANPAGE) - gzip -dc ${m[0]} | newman - ${m[0]%.gz}; assert - continue - ;; - GLX_MODULE_SYMLINK|XMODULE_NEWSYM) - # messy symlinks for non-glvnd xorg modules overrides put - # in a different directory to avoid collisions (390-only) - m[4]=../../xorg/modules/${m[3]#/}${m[4]} - m[3]=/ - ;; - TLS_LIB) [[ ${m[4]} == CLASSIC ]] && continue;; # segfaults (bug #785289) - VDPAU_SYMLINK) m[4]=vdpau/; m[5]=${m[5]#vdpau/};; # .so to vdpau/ - VULKAN_ICD_JSON) m[0]=${m[0]%.template};; - esac - - if [[ -v 'paths[${m[2]}]' ]]; then - into=${paths[${m[2]}]} - elif [[ ${m[2]} == *_BINARY ]]; then - into=/opt/bin - elif [[ ${m[3]} == COMPAT32 ]]; then - use abi_x86_32 || continue - into=/usr/${libdir32} - elif [[ ${m[2]} == *_@(LIB|SYMLINK) ]]; then - into=/usr/${libdir} - else - die "No known installation path for ${m[0]}" - fi - [[ ${m[3]: -2} == ?/ ]] && into+=/${m[3]%/} - [[ ${m[4]: -2} == ?/ ]] && into+=/${m[4]%/} - - if [[ ${m[2]} =~ _SYMLINK$|_NEWSYM$ ]]; then - [[ ${m[4]: -1} == / ]] && m[4]=${m[5]} - dosym ${m[4]} ${into}/${m[0]} - continue - fi - - printf -v m[1] %o $((m[1] | 0200)) # 444->644 - insopts -m${m[1]} - insinto ${into} - doins ${m[0]} - done < .manifest || die - insopts -m0644 # reset - - # MODULE:installer non-skipped extras - dolib.so libnvidia-cfg.so.${PV} - dosym libnvidia-cfg.so.${PV} /usr/${libdir}/libnvidia-cfg.so.1 - dosym libnvidia-cfg.so.${PV} /usr/${libdir}/libnvidia-cfg.so - - dobin nvidia-bug-report.sh - - # symlink non-versioned so nvidia-settings can use it even if misdetected - dosym nvidia-application-profiles-${PV}-key-documentation \ - ${paths[APPLICATION_PROFILE]}/nvidia-application-profiles-key-documentation - - # sandbox issues with /dev/nvidiactl are widespread and sometime - # affect revdeps of packages built with USE=opencl/cuda making it - # hard to manage in ebuilds (minimal set, ebuilds should handle - # manually if need others or addwrite) - insinto /etc/sandbox.d - newins - 20nvidia <<<'SANDBOX_PREDICT="/dev/nvidiactl"' -} - -_dracut_initramfs_regen() { - if [ -x $(which dracut) ]; then - dracut -N -f --no-hostonly-cmdline - fi -} - -pkg_preinst() { - # set video group id based on live system (bug #491414) - local g=$(egetent group video | cut -d: -f3) - [[ ${g} =~ ^[0-9]+$ ]] || die "Failed to determine video group id (got '${g}')" - sed -i "s/@VIDEOGID@/${g}/" "${ED}"/etc/modprobe.d/nvidia.conf || die -} - -pkg_postinst() { - if [ $(stat -c %d:%i /) == $(stat -c %d:%i /proc/1/root/.) ]; then - _dracut_initramfs_regen - fi - - readme.gentoo_print_elog - ewarn - ewarn "Be warned/reminded that the 390.xx branch reached end-of-life and" - ewarn "NVIDIA is no longer fixing issues (including security). Free to keep" - ewarn "using (for now) but it is recommended to either switch to nouveau or" - ewarn "replace hardware. Will be kept in-tree while possible, but expect it" - ewarn "to be removed likely in early 2027 or earlier if major issues arise." - ewarn - ewarn "Note that there is no plans to patch in support for kernels branches" - ewarn "newer than 6.1.x which will be supported upstream until December 2026." -} - -pkg_postrm() { - if [ $(stat -c %d:%i /) == $(stat -c %d:%i /proc/1/root/.) ]; then - _dracut_initramfs_regen - fi -} diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-470.256.02-r1.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-470.256.02-r1.ebuild new file mode 100644 index 00000000..6f731093 --- /dev/null +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-470.256.02-r1.ebuild @@ -0,0 +1,322 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit desktop flag-o-matic multilib readme.gentoo-r1 +inherit systemd toolchain-funcs unpacker user-info + +NV_URI="https://download.nvidia.com/XFree86/" + +DESCRIPTION="NVIDIA Accelerated Graphics Driver" +HOMEPAGE="https://www.nvidia.com/download/index.aspx" +SRC_URI=" + ${NV_URI}Linux-x86_64/${PV}/NVIDIA-Linux-x86_64-${PV}.run + $(printf "${NV_URI}%s/%s-${PV}.tar.bz2 " \ + nvidia-{installer,modprobe,persistenced,xconfig}{,}) +" +# nvidia-installer is unused but here for GPL-2's "distribute sources" +S=${WORKDIR} + +LICENSE="NVIDIA-r2 BSD BSD-2 GPL-2 MIT ZLIB curl openssl" +SLOT="4" +KEYWORDS="-* amd64" +IUSE="abi_x86_32 abi_x86_64 +acpi +dkms +persistenced +tools +X" +RESTRICT="strip" + +COMMON_DEPEND=" + acct-group/video + persistenced? ( + acct-user/nvpd + net-libs/libtirpc:= + ) +" +RDEPEND=" + ${COMMON_DEPEND} + sys-libs/glibc + !!x11-drivers/nvidia-drivers:3 + !!x11-drivers/nvidia-drivers:5 + acpi? ( sys-power/acpid ) + dkms? ( ~sys-kernel/${PN}-dkms-${PV}:${SLOT} ) + X? ( + media-libs/libglvnd[X,abi_x86_32(-)?] + x11-libs/libX11[abi_x86_32(-)?] + x11-libs/libXext[abi_x86_32(-)?] + ) +" +DEPEND=" + ${COMMON_DEPEND} + x11-base/xorg-proto + x11-libs/libX11 + x11-libs/libXext +" +BDEPEND=" + sys-devel/m4 + virtual/pkgconfig +" +PDEPEND=" + tools? ( x11-misc/nvidia-settings:${SLOT} ) +" + +QA_PREBUILT="lib/firmware/* opt/bin/* usr/lib*" + +PATCHES=( + "${FILESDIR}"/nvidia-drivers-470.141.03-clang15.patch + "${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch +) + +pkg_setup() { + local CONFIG_CHECK=" + PROC_FS + ~DRM_KMS_HELPER + ~SYSVIPC + ~!AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT + ~!LOCKDEP + ~!SLUB_DEBUG_ON + ~!X86_KERNEL_IBT + !DEBUG_MUTEXES + " + + local ERROR_DRM_KMS_HELPER="CONFIG_DRM_KMS_HELPER: is not set but needed for Xorg auto-detection + of drivers (no custom config), and for nvidia-drm.modeset=1 if used. + Cannot be directly selected in the kernel's menuconfig, and may need + selection of a DRM device even if unused, e.g. CONFIG_DRM_AMDGPU=m or + DRM_I915=y, DRM_NOUVEAU=m also acceptable if a module and not built-in." + + local ERROR_X86_KERNEL_IBT="CONFIG_X86_KERNEL_IBT: is set and, if the CPU supports the feature, + this *could* lead to modules load failure with ENDBR errors, or to + broken CUDA/NVENC. Please ignore if not having issues, but otherwise + try to unset or pass ibt=off to the kernel's command line." #911142 + + CONFIG_CHECK+=" X86_PAT" #817764 +} + +src_prepare() { + # make patches usable across versions + rm nvidia-modprobe && mv nvidia-modprobe{-${PV},} || die + rm nvidia-persistenced && mv nvidia-persistenced{-${PV},} || die + rm nvidia-xconfig && mv nvidia-xconfig{-${PV},} || die + + default + + # prevent detection of incomplete kernel DRM support (bug #603818) + sed 's/defined(CONFIG_DRM/defined(CONFIG_DRM_KMS_HELPER/g' \ + -i kernel/conftest.sh || die + + sed 's/__USER__/nvpd/' \ + nvidia-persistenced/init/systemd/nvidia-persistenced.service.template \ + > "${T}"/nvidia-persistenced.service || die +} + +src_compile() { + tc-export AR CC CXX LD OBJCOPY OBJDUMP PKG_CONFIG + local -x RAW_LDFLAGS="$(get_abi_LDFLAGS) $(raw-ldflags)" # raw-ldflags.patch + + # latest branches has proper fixes, but legacy have more issues and are + # not worth the trouble, so doing the lame "fix" for gcc14 (bug #921370) + # TODO: check if still needed on bumps given this branch is supported, + # and reminder to cleanup the CC="${KERNEL_CC}" in modargs if removing + local noerr=( + -Wno-error=implicit-function-declaration + -Wno-error=incompatible-pointer-types + ) + # not *FLAGS to ensure it's used everywhere including conftest.sh + CC+=" $(test-flags-CC "${noerr[@]}")" + + local xnvflags=-fPIC #840389 + # lto static libraries tend to cause problems without fat objects + tc-is-lto && xnvflags+=" $(test-flags-CC -ffat-lto-objects)" + + NV_ARGS=( + PREFIX="${EPREFIX}"/usr + HOST_CC="$(tc-getBUILD_CC)" + HOST_LD="$(tc-getBUILD_LD)" + NV_USE_BUNDLED_LIBJANSSON=0 + NV_VERBOSE=1 DO_STRIP= MANPAGE_GZIP= OUTPUTDIR=out + XNVCTRL_CFLAGS="${xnvflags}" + ) + + use persistenced && emake "${NV_ARGS[@]}" -C nvidia-persistenced + + emake "${NV_ARGS[@]}" -C nvidia-modprobe + use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig +} + +src_install() { + local libdir=$(get_libdir) libdir32=$(ABI=x86 get_libdir) + + NV_ARGS+=( DESTDIR="${D}" LIBDIR="${ED}"/usr/${libdir} ) + + local -A paths=( + [APPLICATION_PROFILE]=/usr/share/nvidia + [CUDA_ICD]=/etc/OpenCL/vendors + [EGL_EXTERNAL_PLATFORM_JSON]=/usr/share/egl/egl_external_platform.d + [FIRMWARE]=/lib/firmware/nvidia/${PV} + [GLVND_EGL_ICD_JSON]=/usr/share/glvnd/egl_vendor.d + [VULKAN_ICD_JSON]=/usr/share/vulkan + [WINE_LIB]=/usr/${libdir}/nvidia/wine + [XORG_OUTPUTCLASS_CONFIG]=/usr/share/X11/xorg.conf.d + + [GLX_MODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules/extensions + [GLX_MODULE_SYMLINK]=/usr/${libdir}/xorg/modules + [XMODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules + ) + + local skip_files=( + $(usev !X "libGLX_nvidia libglxserver_nvidia libnvidia-ifr") + libGLX_indirect # non-glvnd unused fallback + libnvidia-gtk nvidia-{settings,xconfig} # built from source + # skip wayland-related files, largely broken with 470 at this point + libnvidia-egl-wayland 10_nvidia_wayland libnvidia-vulkan-producer + ) + local skip_modules=( + $(usev !X "nvfbc vdpau xdriver") + $(usev !dkms gsp) + installer nvpd # handled separately / built from source + ) + local skip_types=( + GLVND_LIB GLVND_SYMLINK EGL_CLIENT.\* GLX_CLIENT.\* # media-libs/libglvnd + OPENCL_WRAPPER.\* # virtual/opencl + DOCUMENTATION DOT_DESKTOP .\*_SRC DKMS_CONF # handled separately / unused + ) + + local DOCS=( + README.txt NVIDIA_Changelog supported-gpus/supported-gpus.json + ) + local HTML_DOCS=( html/. ) + einstalldocs + + local DISABLE_AUTOFORMATTING=yes + local DOC_CONTENTS="\ +Trusted users should be in the 'video' group to use NVIDIA devices. +You can add yourself by using: gpasswd -a my-user video\ + +See '${EPREFIX}/etc/modprobe.d/nvidia.conf' for modules options.\ + +Note that without USE=abi_x86_32 on ${PN}, 32bit applications +(typically using wine / steam) will not be able to use GPU acceleration.\ + +For additional information or for troubleshooting issues, please see +https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers and NVIDIA's own +documentation that is installed alongside this README." + readme.gentoo_create_doc + + insinto /etc/modprobe.d + newins "${FILESDIR}"/nvidia-470.conf nvidia.conf + + emake "${NV_ARGS[@]}" -C nvidia-modprobe install + fowners :video /usr/bin/nvidia-modprobe #505092 + fperms 4710 /usr/bin/nvidia-modprobe + + if use persistenced; then + emake "${NV_ARGS[@]}" -C nvidia-persistenced install + newconfd "${FILESDIR}"/nvidia-persistenced.confd nvidia-persistenced + newinitd "${FILESDIR}"/nvidia-persistenced.initd nvidia-persistenced + systemd_dounit "${T}"/nvidia-persistenced.service + fi + + use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig install + + # mimic nvidia-installer by reading .manifest to install files + # 0:file 1:perms 2:type 3+:subtype/arguments -:module + local m into + while IFS=' ' read -ra m; do + ! [[ ${#m[@]} -ge 2 && ${m[-1]} =~ MODULE: ]] || + [[ " ${m[0]##*/}" =~ ^(\ ${skip_files[*]/%/.*|\\} )$ ]] || + [[ " ${m[2]}" =~ ^(\ ${skip_types[*]/%/|\\} )$ ]] || + has ${m[-1]#MODULE:} "${skip_modules[@]}" && continue + + case ${m[2]} in + MANPAGE) + gzip -dc ${m[0]} | newman - ${m[0]%.gz}; assert + continue + ;; + VDPAU_SYMLINK) m[4]=vdpau/; m[5]=${m[5]#vdpau/};; # .so to vdpau/ + esac + + if [[ -v 'paths[${m[2]}]' ]]; then + into=${paths[${m[2]}]} + elif [[ ${m[2]} == *_BINARY ]]; then + into=/opt/bin + elif [[ ${m[3]} == COMPAT32 ]]; then + use abi_x86_32 || continue + into=/usr/${libdir32} + elif [[ ${m[2]} == *_@(LIB|SYMLINK) ]]; then + into=/usr/${libdir} + else + die "No known installation path for ${m[0]}" + fi + [[ ${m[3]: -2} == ?/ ]] && into+=/${m[3]%/} + [[ ${m[4]: -2} == ?/ ]] && into+=/${m[4]%/} + + if [[ ${m[2]} =~ _SYMLINK$ ]]; then + [[ ${m[4]: -1} == / ]] && m[4]=${m[5]} + dosym ${m[4]} ${into}/${m[0]} + continue + fi + [[ ${m[0]} =~ ^libnvidia-ngx.so ]] && + dosym ${m[0]} ${into}/${m[0]%.so*}.so.1 # soname not in .manifest + + printf -v m[1] %o $((m[1] | 0200)) # 444->644 + insopts -m${m[1]} + insinto ${into} + doins ${m[0]} + done < .manifest || die + insopts -m0644 # reset + + # MODULE:installer non-skipped extras + : "$(systemd_get_sleepdir)" + exeinto "${_#"${EPREFIX}"}" + doexe systemd/system-sleep/nvidia + dobin systemd/nvidia-sleep.sh + systemd_dounit systemd/system/nvidia-{hibernate,resume,suspend}.service + + dobin nvidia-bug-report.sh + + # symlink non-versioned so nvidia-settings can use it even if misdetected + dosym nvidia-application-profiles-${PV}-key-documentation \ + ${paths[APPLICATION_PROFILE]}/nvidia-application-profiles-key-documentation + + # don't attempt to strip firmware files (silences errors) + dostrip -x ${paths[FIRMWARE]} + + # sandbox issues with /dev/nvidiactl (and /dev/char wrt bug #904292) + # are widespread and sometime affect revdeps of packages built with + # USE=opencl/cuda making it hard to manage in ebuilds (minimal set, + # ebuilds should handle manually if need others or addwrite) + insinto /etc/sandbox.d + newins - 20nvidia <<<'SANDBOX_PREDICT="/dev/nvidiactl:/dev/char"' +} + +_dracut_initramfs_regen() { + if [ -x $(which dracut) ]; then + dracut -N -f --no-hostonly-cmdline + fi +} + +pkg_preinst() { + # set video group id based on live system (bug #491414) + local g=$(egetent group video | cut -d: -f3) + [[ ${g} =~ ^[0-9]+$ ]] || die "Failed to determine video group id (got '${g}')" + sed -i "s/@VIDEOGID@/${g}/" "${ED}"/etc/modprobe.d/nvidia.conf || die +} + +pkg_postinst() { + if [ $(stat -c %d:%i /) == $(stat -c %d:%i /proc/1/root/.) ]; then + _dracut_initramfs_regen + fi + + readme.gentoo_print_elog + + if [[ $( "${T}"/nvidia-persistenced.service || die -} - -src_compile() { - tc-export AR CC CXX LD OBJCOPY OBJDUMP PKG_CONFIG - local -x RAW_LDFLAGS="$(get_abi_LDFLAGS) $(raw-ldflags)" # raw-ldflags.patch - - # latest branches has proper fixes, but legacy have more issues and are - # not worth the trouble, so doing the lame "fix" for gcc14 (bug #921370) - # TODO: check if still needed on bumps given this branch is supported, - # and reminder to cleanup the CC="${KERNEL_CC}" in modargs if removing - local noerr=( - -Wno-error=implicit-function-declaration - -Wno-error=incompatible-pointer-types - ) - # not *FLAGS to ensure it's used everywhere including conftest.sh - CC+=" $(test-flags-CC "${noerr[@]}")" - - local xnvflags=-fPIC #840389 - # lto static libraries tend to cause problems without fat objects - tc-is-lto && xnvflags+=" $(test-flags-CC -ffat-lto-objects)" - - NV_ARGS=( - PREFIX="${EPREFIX}"/usr - HOST_CC="$(tc-getBUILD_CC)" - HOST_LD="$(tc-getBUILD_LD)" - NV_USE_BUNDLED_LIBJANSSON=0 - NV_VERBOSE=1 DO_STRIP= MANPAGE_GZIP= OUTPUTDIR=out - XNVCTRL_CFLAGS="${xnvflags}" - ) - - use persistenced && emake "${NV_ARGS[@]}" -C nvidia-persistenced - - emake "${NV_ARGS[@]}" -C nvidia-modprobe - use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig -} - -src_install() { - local libdir=$(get_libdir) libdir32=$(ABI=x86 get_libdir) - - NV_ARGS+=( DESTDIR="${D}" LIBDIR="${ED}"/usr/${libdir} ) - - local -A paths=( - [APPLICATION_PROFILE]=/usr/share/nvidia - [CUDA_ICD]=/etc/OpenCL/vendors - [EGL_EXTERNAL_PLATFORM_JSON]=/usr/share/egl/egl_external_platform.d - [FIRMWARE]=/lib/firmware/nvidia/${PV} - [GLVND_EGL_ICD_JSON]=/usr/share/glvnd/egl_vendor.d - [VULKAN_ICD_JSON]=/usr/share/vulkan - [WINE_LIB]=/usr/${libdir}/nvidia/wine - [XORG_OUTPUTCLASS_CONFIG]=/usr/share/X11/xorg.conf.d - - [GLX_MODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules/extensions - [GLX_MODULE_SYMLINK]=/usr/${libdir}/xorg/modules - [XMODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules - ) - - local skip_files=( - $(usev !X "libGLX_nvidia libglxserver_nvidia libnvidia-ifr") - libGLX_indirect # non-glvnd unused fallback - libnvidia-gtk nvidia-xconfig # built from source - # skip wayland-related files, largely broken with 470 at this point - libnvidia-egl-wayland 10_nvidia_wayland libnvidia-vulkan-producer - ) - local skip_modules=( - $(usev !X "nvfbc vdpau xdriver") - $(usev !dkms gsp) - installer nvpd # handled separately / built from source - ) - local skip_types=( - GLVND_LIB GLVND_SYMLINK EGL_CLIENT.\* GLX_CLIENT.\* # media-libs/libglvnd - OPENCL_WRAPPER.\* # virtual/opencl - DOCUMENTATION DOT_DESKTOP .\*_SRC DKMS_CONF # handled separately / unused - ) - - local DOCS=( - README.txt NVIDIA_Changelog supported-gpus/supported-gpus.json - ) - local HTML_DOCS=( html/. ) - einstalldocs - - local DISABLE_AUTOFORMATTING=yes - local DOC_CONTENTS="\ -Trusted users should be in the 'video' group to use NVIDIA devices. -You can add yourself by using: gpasswd -a my-user video\ - -See '${EPREFIX}/etc/modprobe.d/nvidia.conf' for modules options.\ - -Note that without USE=abi_x86_32 on ${PN}, 32bit applications -(typically using wine / steam) will not be able to use GPU acceleration.\ - -For additional information or for troubleshooting issues, please see -https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers and NVIDIA's own -documentation that is installed alongside this README." - readme.gentoo_create_doc - - insinto /etc/modprobe.d - newins "${FILESDIR}"/nvidia-470.conf nvidia.conf - - emake "${NV_ARGS[@]}" -C nvidia-modprobe install - fowners :video /usr/bin/nvidia-modprobe #505092 - fperms 4710 /usr/bin/nvidia-modprobe - - if use persistenced; then - emake "${NV_ARGS[@]}" -C nvidia-persistenced install - newconfd "${FILESDIR}"/nvidia-persistenced.confd nvidia-persistenced - newinitd "${FILESDIR}"/nvidia-persistenced.initd nvidia-persistenced - systemd_dounit "${T}"/nvidia-persistenced.service - fi - - use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig install - - # mimic nvidia-installer by reading .manifest to install files - # 0:file 1:perms 2:type 3+:subtype/arguments -:module - local m into - while IFS=' ' read -ra m; do - ! [[ ${#m[@]} -ge 2 && ${m[-1]} =~ MODULE: ]] || - [[ " ${m[0]##*/}" =~ ^(\ ${skip_files[*]/%/.*|\\} )$ ]] || - [[ " ${m[2]}" =~ ^(\ ${skip_types[*]/%/|\\} )$ ]] || - has ${m[-1]#MODULE:} "${skip_modules[@]}" && continue - - case ${m[2]} in - MANPAGE) - gzip -dc ${m[0]} | newman - ${m[0]%.gz}; assert - continue - ;; - VDPAU_SYMLINK) m[4]=vdpau/; m[5]=${m[5]#vdpau/};; # .so to vdpau/ - esac - - if [[ -v 'paths[${m[2]}]' ]]; then - into=${paths[${m[2]}]} - elif [[ ${m[2]} == *_BINARY ]]; then - into=/opt/bin - elif [[ ${m[3]} == COMPAT32 ]]; then - use abi_x86_32 || continue - into=/usr/${libdir32} - elif [[ ${m[2]} == *_@(LIB|SYMLINK) ]]; then - into=/usr/${libdir} - else - die "No known installation path for ${m[0]}" - fi - [[ ${m[3]: -2} == ?/ ]] && into+=/${m[3]%/} - [[ ${m[4]: -2} == ?/ ]] && into+=/${m[4]%/} - - if [[ ${m[2]} =~ _SYMLINK$ ]]; then - [[ ${m[4]: -1} == / ]] && m[4]=${m[5]} - dosym ${m[4]} ${into}/${m[0]} - continue - fi - [[ ${m[0]} =~ ^libnvidia-ngx.so ]] && - dosym ${m[0]} ${into}/${m[0]%.so*}.so.1 # soname not in .manifest - - printf -v m[1] %o $((m[1] | 0200)) # 444->644 - insopts -m${m[1]} - insinto ${into} - doins ${m[0]} - done < .manifest || die - insopts -m0644 # reset - - # MODULE:installer non-skipped extras - : "$(systemd_get_sleepdir)" - exeinto "${_#"${EPREFIX}"}" - doexe systemd/system-sleep/nvidia - dobin systemd/nvidia-sleep.sh - systemd_dounit systemd/system/nvidia-{hibernate,resume,suspend}.service - - dobin nvidia-bug-report.sh - - # symlink non-versioned so nvidia-settings can use it even if misdetected - dosym nvidia-application-profiles-${PV}-key-documentation \ - ${paths[APPLICATION_PROFILE]}/nvidia-application-profiles-key-documentation - - # don't attempt to strip firmware files (silences errors) - dostrip -x ${paths[FIRMWARE]} - - # sandbox issues with /dev/nvidiactl (and /dev/char wrt bug #904292) - # are widespread and sometime affect revdeps of packages built with - # USE=opencl/cuda making it hard to manage in ebuilds (minimal set, - # ebuilds should handle manually if need others or addwrite) - insinto /etc/sandbox.d - newins - 20nvidia <<<'SANDBOX_PREDICT="/dev/nvidiactl:/dev/char"' -} - -_dracut_initramfs_regen() { - if [ -x $(which dracut) ]; then - dracut -N -f --no-hostonly-cmdline - fi -} - -pkg_preinst() { - # set video group id based on live system (bug #491414) - local g=$(egetent group video | cut -d: -f3) - [[ ${g} =~ ^[0-9]+$ ]] || die "Failed to determine video group id (got '${g}')" - sed -i "s/@VIDEOGID@/${g}/" "${ED}"/etc/modprobe.d/nvidia.conf || die -} - -pkg_postinst() { - if [ $(stat -c %d:%i /) == $(stat -c %d:%i /proc/1/root/.) ]; then - _dracut_initramfs_regen - fi - - readme.gentoo_print_elog - - if [[ $( "${T}"/nvidia-persistenced.service || die + sed -i "s|/usr|${EPREFIX}/opt|" systemd/system/nvidia-powerd.service || die + + # use alternative vulkan icd option if USE=-X (bug #909181) + use X || sed -i 's/"libGLX/"libEGL/' nvidia_{layers,icd}.json || die + + # enable nvidia-drm.modeset=1 by default with USE=wayland + cp "${FILESDIR}"/nvidia-545.conf "${T}"/nvidia.conf || die + use !wayland || sed -i '/^#.*modeset=1$/s/^#//' "${T}"/nvidia.conf || die +} + +src_compile() { + tc-export AR CC CXX LD OBJCOPY OBJDUMP PKG_CONFIG + + local xnvflags=-fPIC #840389 + # lto static libraries tend to cause problems without fat objects + tc-is-lto && xnvflags+=" $(test-flags-CC -ffat-lto-objects)" + + NV_ARGS=( + PREFIX="${EPREFIX}"/usr + HOST_CC="$(tc-getBUILD_CC)" + HOST_LD="$(tc-getBUILD_LD)" + BUILD_GTK2LIB= + NV_USE_BUNDLED_LIBJANSSON=0 + NV_VERBOSE=1 DO_STRIP= MANPAGE_GZIP= OUTPUTDIR=out + WAYLAND_AVAILABLE=$(usex wayland 1 0) + XNVCTRL_CFLAGS="${xnvflags}" + ) + + use persistenced && emake "${NV_ARGS[@]}" -C nvidia-persistenced + + emake "${NV_ARGS[@]}" -C nvidia-modprobe + use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig +} + +src_install() { + local libdir=$(get_libdir) libdir32=$(ABI=x86 get_libdir) + + NV_ARGS+=( DESTDIR="${D}" LIBDIR="${ED}"/usr/${libdir} ) + + local -A paths=( + [APPLICATION_PROFILE]=/usr/share/nvidia + [CUDA_ICD]=/etc/OpenCL/vendors + [EGL_EXTERNAL_PLATFORM_JSON]=/usr/share/egl/egl_external_platform.d + [FIRMWARE]=/lib/firmware/nvidia/${PV} + [GBM_BACKEND_LIB_SYMLINK]=/usr/${libdir}/gbm + [GLVND_EGL_ICD_JSON]=/usr/share/glvnd/egl_vendor.d + [OPENGL_DATA]=/usr/share/nvidia + [VULKAN_ICD_JSON]=/usr/share/vulkan + [WINE_LIB]=/usr/${libdir}/nvidia/wine + [XORG_OUTPUTCLASS_CONFIG]=/usr/share/X11/xorg.conf.d + + [GLX_MODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules/extensions + [GLX_MODULE_SYMLINK]=/usr/${libdir}/xorg/modules + [XMODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules + ) + + local skip_files=( + $(usev !X "libGLX_nvidia libglxserver_nvidia") + libGLX_indirect # non-glvnd unused fallback + libnvidia-{gtk,wayland-client} nvidia-{settings,xconfig} # from source + libnvidia-egl-gbm 15_nvidia_gbm # gui-libs/egl-gbm + libnvidia-egl-wayland 10_nvidia_wayland # gui-libs/egl-wayland + libnvidia-pkcs11.so # using the openssl3 version instead + ) + local skip_modules=( + $(usev !X "nvfbc vdpau xdriver") + $(usev !dkms gsp) + $(usev !powerd powerd) + installer nvpd # handled separately / built from source + ) + local skip_types=( + GLVND_LIB GLVND_SYMLINK EGL_CLIENT.\* GLX_CLIENT.\* # media-libs/libglvnd + OPENCL_WRAPPER.\* # virtual/opencl + DOCUMENTATION DOT_DESKTOP .\*_SRC DKMS_CONF SYSTEMD_UNIT # handled separately / unused + ) + + local DOCS=( + README.txt NVIDIA_Changelog supported-gpus/supported-gpus.json + ) + local HTML_DOCS=( html/. ) + einstalldocs + + local DISABLE_AUTOFORMATTING=yes + local DOC_CONTENTS="\ +Trusted users should be in the 'video' group to use NVIDIA devices. +You can add yourself by using: gpasswd -a my-user video\ + +See '${EPREFIX}/etc/modprobe.d/nvidia.conf' for modules options.\ + +Note that without USE=abi_x86_32 on ${PN}, 32bit applications +(typically using wine / steam) will not be able to use GPU acceleration.\ + +For additional information or for troubleshooting issues, please see +https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers and NVIDIA's own +documentation that is installed alongside this README." + readme.gentoo_create_doc + + insinto /etc/modprobe.d + doins "${T}"/nvidia.conf + + emake "${NV_ARGS[@]}" -C nvidia-modprobe install + fowners :video /usr/bin/nvidia-modprobe #505092 + fperms 4710 /usr/bin/nvidia-modprobe + + if use persistenced; then + emake "${NV_ARGS[@]}" -C nvidia-persistenced install + newconfd "${FILESDIR}"/nvidia-persistenced.confd nvidia-persistenced + newinitd "${FILESDIR}"/nvidia-persistenced.initd nvidia-persistenced + systemd_dounit "${T}"/nvidia-persistenced.service + fi + + use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig install + + # mimic nvidia-installer by reading .manifest to install files + # 0:file 1:perms 2:type 3+:subtype/arguments -:module + local m into + while IFS=' ' read -ra m; do + ! [[ ${#m[@]} -ge 2 && ${m[-1]} =~ MODULE: ]] || + [[ " ${m[0]##*/}" =~ ^(\ ${skip_files[*]/%/.*|\\} )$ ]] || + [[ " ${m[2]}" =~ ^(\ ${skip_types[*]/%/|\\} )$ ]] || + has ${m[-1]#MODULE:} "${skip_modules[@]}" && continue + + case ${m[2]} in + MANPAGE) + gzip -dc ${m[0]} | newman - ${m[0]%.gz}; assert + continue + ;; + GBM_BACKEND_LIB_SYMLINK) m[4]=../${m[4]};; # missing ../ + VDPAU_SYMLINK) m[4]=vdpau/; m[5]=${m[5]#vdpau/};; # .so to vdpau/ + esac + + if [[ -v 'paths[${m[2]}]' ]]; then + into=${paths[${m[2]}]} + elif [[ ${m[2]} == EXPLICIT_PATH ]]; then + into=${m[3]} + elif [[ ${m[2]} == *_BINARY ]]; then + into=/opt/bin + elif [[ ${m[3]} == COMPAT32 ]]; then + use abi_x86_32 || continue + into=/usr/${libdir32} + elif [[ ${m[2]} == *_@(LIB|SYMLINK) ]]; then + into=/usr/${libdir} + else + die "No known installation path for ${m[0]}" + fi + [[ ${m[3]: -2} == ?/ ]] && into+=/${m[3]%/} + [[ ${m[4]: -2} == ?/ ]] && into+=/${m[4]%/} + + if [[ ${m[2]} =~ _SYMLINK$ ]]; then + [[ ${m[4]: -1} == / ]] && m[4]=${m[5]} + dosym ${m[4]} ${into}/${m[0]} + continue + fi + [[ ${m[0]} =~ ^libnvidia-ngx.so|^libnvidia-egl-gbm.so ]] && + dosym ${m[0]} ${into}/${m[0]%.so*}.so.1 # soname not in .manifest + + printf -v m[1] %o $((m[1] | 0200)) # 444->644 + insopts -m${m[1]} + insinto ${into} + doins ${m[0]} + done < .manifest || die + insopts -m0644 # reset + + # MODULE:installer non-skipped extras + : "$(systemd_get_sleepdir)" + exeinto "${_#"${EPREFIX}"}" + doexe systemd/system-sleep/nvidia + dobin systemd/nvidia-sleep.sh + systemd_dounit systemd/system/nvidia-{hibernate,resume,suspend}.service + + dobin nvidia-bug-report.sh + + # MODULE:powerd extras + if use powerd; then + newinitd "${FILESDIR}"/nvidia-powerd.initd nvidia-powerd #923117 + systemd_dounit systemd/system/nvidia-powerd.service + + insinto /usr/share/dbus-1/system.d + doins nvidia-dbus.conf + fi + + # symlink non-versioned so nvidia-settings can use it even if misdetected + dosym nvidia-application-profiles-${PV}-key-documentation \ + ${paths[APPLICATION_PROFILE]}/nvidia-application-profiles-key-documentation + + # don't attempt to strip firmware files (silences errors) + dostrip -x ${paths[FIRMWARE]} + + # sandbox issues with /dev/nvidiactl others (bug #904292,#921578) + # are widespread and sometime affect revdeps of packages built with + # USE=opencl/cuda making it hard to manage in ebuilds (minimal set, + # ebuilds should handle manually if need others or addwrite) + insinto /etc/sandbox.d + newins - 20nvidia <<<'SANDBOX_PREDICT="/dev/nvidiactl:/dev/nvidia-caps:/dev/char"' +} + +_dracut_initramfs_regen() { + if [ -x $(which dracut) ]; then + dracut -N -f --no-hostonly-cmdline + fi +} + +pkg_preinst() { + # set video group id based on live system (bug #491414) + local g=$(egetent group video | cut -d: -f3) + [[ ${g} =~ ^[0-9]+$ ]] || die "Failed to determine video group id (got '${g}')" + sed -i "s/@VIDEOGID@/${g}/" "${ED}"/etc/modprobe.d/nvidia.conf || die +} + +pkg_postinst() { + if [ $(stat -c %d:%i /) == $(stat -c %d:%i /proc/1/root/.) ]; then + _dracut_initramfs_regen + fi + + readme.gentoo_print_elog + + if [[ $( "${T}"/nvidia-persistenced.service || die - sed -i "s|/usr|${EPREFIX}/opt|" systemd/system/nvidia-powerd.service || die - - # use alternative vulkan icd option if USE=-X (bug #909181) - use X || sed -i 's/"libGLX/"libEGL/' nvidia_{layers,icd}.json || die - - # enable nvidia-drm.modeset=1 by default with USE=wayland - cp "${FILESDIR}"/nvidia-545.conf "${T}"/nvidia.conf || die - use !wayland || sed -i '/^#.*modeset=1$/s/^#//' "${T}"/nvidia.conf || die -} - -src_compile() { - tc-export AR CC CXX LD OBJCOPY OBJDUMP PKG_CONFIG - - local xnvflags=-fPIC #840389 - # lto static libraries tend to cause problems without fat objects - tc-is-lto && xnvflags+=" $(test-flags-CC -ffat-lto-objects)" - - NV_ARGS=( - PREFIX="${EPREFIX}"/usr - HOST_CC="$(tc-getBUILD_CC)" - HOST_LD="$(tc-getBUILD_LD)" - BUILD_GTK2LIB= - NV_USE_BUNDLED_LIBJANSSON=0 - NV_VERBOSE=1 DO_STRIP= MANPAGE_GZIP= OUTPUTDIR=out - WAYLAND_AVAILABLE=$(usex wayland 1 0) - XNVCTRL_CFLAGS="${xnvflags}" - ) - - use persistenced && emake "${NV_ARGS[@]}" -C nvidia-persistenced - - emake "${NV_ARGS[@]}" -C nvidia-modprobe - use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig -} - -src_install() { - local libdir=$(get_libdir) libdir32=$(ABI=x86 get_libdir) - - NV_ARGS+=( DESTDIR="${D}" LIBDIR="${ED}"/usr/${libdir} ) - - local -A paths=( - [APPLICATION_PROFILE]=/usr/share/nvidia - [CUDA_ICD]=/etc/OpenCL/vendors - [EGL_EXTERNAL_PLATFORM_JSON]=/usr/share/egl/egl_external_platform.d - [FIRMWARE]=/lib/firmware/nvidia/${PV} - [GBM_BACKEND_LIB_SYMLINK]=/usr/${libdir}/gbm - [GLVND_EGL_ICD_JSON]=/usr/share/glvnd/egl_vendor.d - [OPENGL_DATA]=/usr/share/nvidia - [VULKAN_ICD_JSON]=/usr/share/vulkan - [WINE_LIB]=/usr/${libdir}/nvidia/wine - [XORG_OUTPUTCLASS_CONFIG]=/usr/share/X11/xorg.conf.d - - [GLX_MODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules/extensions - [GLX_MODULE_SYMLINK]=/usr/${libdir}/xorg/modules - [XMODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules - ) - - local skip_files=( - $(usev !X "libGLX_nvidia libglxserver_nvidia") - libGLX_indirect # non-glvnd unused fallback - libnvidia-{gtk,wayland-client} nvidia-xconfig # from source - libnvidia-egl-gbm 15_nvidia_gbm # gui-libs/egl-gbm - libnvidia-egl-wayland 10_nvidia_wayland # gui-libs/egl-wayland - libnvidia-pkcs11.so # using the openssl3 version instead - ) - local skip_modules=( - $(usev !X "nvfbc vdpau xdriver") - $(usev !dkms gsp) - $(usev !powerd powerd) - installer nvpd # handled separately / built from source - ) - local skip_types=( - GLVND_LIB GLVND_SYMLINK EGL_CLIENT.\* GLX_CLIENT.\* # media-libs/libglvnd - OPENCL_WRAPPER.\* # virtual/opencl - DOCUMENTATION DOT_DESKTOP .\*_SRC DKMS_CONF SYSTEMD_UNIT # handled separately / unused - ) - - local DOCS=( - README.txt NVIDIA_Changelog supported-gpus/supported-gpus.json - ) - local HTML_DOCS=( html/. ) - einstalldocs - - local DISABLE_AUTOFORMATTING=yes - local DOC_CONTENTS="\ -Trusted users should be in the 'video' group to use NVIDIA devices. -You can add yourself by using: gpasswd -a my-user video\ - -See '${EPREFIX}/etc/modprobe.d/nvidia.conf' for modules options.\ - -Note that without USE=abi_x86_32 on ${PN}, 32bit applications -(typically using wine / steam) will not be able to use GPU acceleration.\ - -For additional information or for troubleshooting issues, please see -https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers and NVIDIA's own -documentation that is installed alongside this README." - readme.gentoo_create_doc - - insinto /etc/modprobe.d - doins "${T}"/nvidia.conf - - emake "${NV_ARGS[@]}" -C nvidia-modprobe install - fowners :video /usr/bin/nvidia-modprobe #505092 - fperms 4710 /usr/bin/nvidia-modprobe - - if use persistenced; then - emake "${NV_ARGS[@]}" -C nvidia-persistenced install - newconfd "${FILESDIR}"/nvidia-persistenced.confd nvidia-persistenced - newinitd "${FILESDIR}"/nvidia-persistenced.initd nvidia-persistenced - systemd_dounit "${T}"/nvidia-persistenced.service - fi - - use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig install - - # mimic nvidia-installer by reading .manifest to install files - # 0:file 1:perms 2:type 3+:subtype/arguments -:module - local m into - while IFS=' ' read -ra m; do - ! [[ ${#m[@]} -ge 2 && ${m[-1]} =~ MODULE: ]] || - [[ " ${m[0]##*/}" =~ ^(\ ${skip_files[*]/%/.*|\\} )$ ]] || - [[ " ${m[2]}" =~ ^(\ ${skip_types[*]/%/|\\} )$ ]] || - has ${m[-1]#MODULE:} "${skip_modules[@]}" && continue - - case ${m[2]} in - MANPAGE) - gzip -dc ${m[0]} | newman - ${m[0]%.gz}; assert - continue - ;; - GBM_BACKEND_LIB_SYMLINK) m[4]=../${m[4]};; # missing ../ - VDPAU_SYMLINK) m[4]=vdpau/; m[5]=${m[5]#vdpau/};; # .so to vdpau/ - esac - - if [[ -v 'paths[${m[2]}]' ]]; then - into=${paths[${m[2]}]} - elif [[ ${m[2]} == EXPLICIT_PATH ]]; then - into=${m[3]} - elif [[ ${m[2]} == *_BINARY ]]; then - into=/opt/bin - elif [[ ${m[3]} == COMPAT32 ]]; then - use abi_x86_32 || continue - into=/usr/${libdir32} - elif [[ ${m[2]} == *_@(LIB|SYMLINK) ]]; then - into=/usr/${libdir} - else - die "No known installation path for ${m[0]}" - fi - [[ ${m[3]: -2} == ?/ ]] && into+=/${m[3]%/} - [[ ${m[4]: -2} == ?/ ]] && into+=/${m[4]%/} - - if [[ ${m[2]} =~ _SYMLINK$ ]]; then - [[ ${m[4]: -1} == / ]] && m[4]=${m[5]} - dosym ${m[4]} ${into}/${m[0]} - continue - fi - [[ ${m[0]} =~ ^libnvidia-ngx.so|^libnvidia-egl-gbm.so ]] && - dosym ${m[0]} ${into}/${m[0]%.so*}.so.1 # soname not in .manifest - - printf -v m[1] %o $((m[1] | 0200)) # 444->644 - insopts -m${m[1]} - insinto ${into} - doins ${m[0]} - done < .manifest || die - insopts -m0644 # reset - - # MODULE:installer non-skipped extras - : "$(systemd_get_sleepdir)" - exeinto "${_#"${EPREFIX}"}" - doexe systemd/system-sleep/nvidia - dobin systemd/nvidia-sleep.sh - systemd_dounit systemd/system/nvidia-{hibernate,resume,suspend}.service - - dobin nvidia-bug-report.sh - - # MODULE:powerd extras - if use powerd; then - newinitd "${FILESDIR}"/nvidia-powerd.initd nvidia-powerd #923117 - systemd_dounit systemd/system/nvidia-powerd.service - - insinto /usr/share/dbus-1/system.d - doins nvidia-dbus.conf - fi - - # symlink non-versioned so nvidia-settings can use it even if misdetected - dosym nvidia-application-profiles-${PV}-key-documentation \ - ${paths[APPLICATION_PROFILE]}/nvidia-application-profiles-key-documentation - - # don't attempt to strip firmware files (silences errors) - dostrip -x ${paths[FIRMWARE]} - - # sandbox issues with /dev/nvidiactl others (bug #904292,#921578) - # are widespread and sometime affect revdeps of packages built with - # USE=opencl/cuda making it hard to manage in ebuilds (minimal set, - # ebuilds should handle manually if need others or addwrite) - insinto /etc/sandbox.d - newins - 20nvidia <<<'SANDBOX_PREDICT="/dev/nvidiactl:/dev/nvidia-caps:/dev/char"' -} - -_dracut_initramfs_regen() { - if [ -x $(which dracut) ]; then - dracut -N -f --no-hostonly-cmdline - fi -} - -pkg_preinst() { - # set video group id based on live system (bug #491414) - local g=$(egetent group video | cut -d: -f3) - [[ ${g} =~ ^[0-9]+$ ]] || die "Failed to determine video group id (got '${g}')" - sed -i "s/@VIDEOGID@/${g}/" "${ED}"/etc/modprobe.d/nvidia.conf || die -} - -pkg_postinst() { - if [ $(stat -c %d:%i /) == $(stat -c %d:%i /proc/1/root/.) ]; then - _dracut_initramfs_regen - fi - - readme.gentoo_print_elog - - if [[ $(