public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: x11-drivers/nvidia-drivers/, x11-drivers/nvidia-drivers/files/
@ 2015-12-06  5:32 Jeroen Roovers
  0 siblings, 0 replies; 33+ messages in thread
From: Jeroen Roovers @ 2015-12-06  5:32 UTC (permalink / raw
  To: gentoo-commits

commit:     5b59b721ce933854d4f6191fc67536d0f5e0113a
Author:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
AuthorDate: Sun Dec  6 05:32:13 2015 +0000
Commit:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
CommitDate: Sun Dec  6 05:32:13 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5b59b721

x11-drivers/nvidia-drivers: Unload nvidia-modeset as needed (bug #566242 by Adam Shea).

Package-Manager: portage-2.2.26

 x11-drivers/nvidia-drivers/files/nvidia-rmmod.conf                     | 3 +++
 .../{nvidia-drivers-358.16.ebuild => nvidia-drivers-358.16-r1.ebuild}  | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-rmmod.conf b/x11-drivers/nvidia-drivers/files/nvidia-rmmod.conf
new file mode 100644
index 0000000..48a8273
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-rmmod.conf
@@ -0,0 +1,3 @@
+# Nvidia UVM support
+
+remove nvidia modprobe -r --ignore-remove nvidia-modeset nvidia-uvm nvidia

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-358.16.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-358.16-r1.ebuild
similarity index 99%
rename from x11-drivers/nvidia-drivers/nvidia-drivers-358.16.ebuild
rename to x11-drivers/nvidia-drivers/nvidia-drivers-358.16-r1.ebuild
index 44a9162..e81b1bc 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-358.16.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-358.16-r1.ebuild
@@ -244,7 +244,7 @@ src_install() {
 		# pkg_preinst, see bug #491414
 		insinto /etc/modprobe.d
 		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
-		use uvm && doins "${FILESDIR}"/nvidia-uvm.conf
+		doins "${FILESDIR}"/nvidia-rmmod.conf
 
 		# Ensures that our device nodes are created when not using X
 		exeinto "$(get_udevdir)"


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: x11-drivers/nvidia-drivers/, x11-drivers/nvidia-drivers/files/
@ 2016-01-31  9:23 Jeroen Roovers
  0 siblings, 0 replies; 33+ messages in thread
From: Jeroen Roovers @ 2016-01-31  9:23 UTC (permalink / raw
  To: gentoo-commits

commit:     83deb920c140df1c67f23ff49a28b43f91b710fc
Author:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 31 09:10:56 2016 +0000
Commit:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
CommitDate: Sun Jan 31 09:19:07 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=83deb920

x11-drivers/nvidia-drivers: Fix desktop file (bug #562910)

Package-Manager: portage-2.2.27

 .../nvidia-drivers/files/nvidia-settings.desktop   |   7 +
 .../nvidia-drivers-304.131-r2.ebuild               | 488 +++++++++++++++++++
 .../nvidia-drivers/nvidia-drivers-340.96-r3.ebuild | 517 ++++++++++++++++++++
 .../nvidia-drivers/nvidia-drivers-346.96-r4.ebuild | 528 ++++++++++++++++++++
 .../nvidia-drivers/nvidia-drivers-352.79-r2.ebuild | 527 ++++++++++++++++++++
 .../nvidia-drivers/nvidia-drivers-358.16-r3.ebuild | 539 +++++++++++++++++++++
 .../nvidia-drivers/nvidia-drivers-361.18-r3.ebuild | 530 ++++++++++++++++++++
 7 files changed, 3136 insertions(+)

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-settings.desktop b/x11-drivers/nvidia-drivers/files/nvidia-settings.desktop
new file mode 100644
index 0000000..b4b452e
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-settings.desktop
@@ -0,0 +1,7 @@
+[Desktop Entry]
+Type=Application
+Name=NVIDIA X Server Settings
+Comment=Configure NVIDIA X Server Settings
+Exec=/usr/bin/nvidia-settings
+Icon=nvidia-settings
+Categories=System;Settings;

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-304.131-r2.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-304.131-r2.ebuild
new file mode 100644
index 0000000..1ff7a6c
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-304.131-r2.ebuild
@@ -0,0 +1,488 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \
+	portability toolchain-funcs unpacker user versionator udev
+
+NV_URI="http://us.download.nvidia.com/XFree86/"
+X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
+AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
+X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
+AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
+
+DESCRIPTION="NVIDIA Accelerated Graphics Driver"
+HOMEPAGE="http://www.nvidia.com/"
+SRC_URI="
+	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
+	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
+	x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
+	x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
+	tools? ( ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2 )
+"
+
+LICENSE="GPL-2 NVIDIA-r1"
+SLOT="0/${PV%.*}"
+KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
+IUSE="acpi multilib kernel_FreeBSD kernel_linux pax_kernel static-libs +tools +X"
+RESTRICT="bindist mirror strip"
+EMULTILIB_PKG="true"
+
+COMMON="
+	app-eselect/eselect-opencl
+	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
+	tools? (
+		dev-libs/atk
+		dev-libs/glib:2
+		x11-libs/gdk-pixbuf
+		x11-libs/gtk+:2
+		x11-libs/libX11
+		x11-libs/libXext
+		x11-libs/pango[X]
+		x11-libs/pangox-compat
+	)
+	X? (
+		>=app-eselect/eselect-opengl-1.0.9
+	)
+"
+DEPEND="${COMMON}
+	kernel_linux? (
+		virtual/linux-sources
+		virtual/pkgconfig
+	)"
+RDEPEND="${COMMON}
+	acpi? ( sys-power/acpid )
+	tools? ( !media-video/nvidia-settings )
+	X? (
+		<x11-base/xorg-server-1.18.99:=
+		x11-libs/libXvMC
+		multilib? (
+			>=x11-libs/libX11-1.6.2[abi_x86_32]
+			>=x11-libs/libXext-1.3.2[abi_x86_32]
+		)
+	)
+"
+PDEPEND="X? ( >=x11-libs/libvdpau-0.3-r1 )"
+
+REQUIRED_USE="
+	tools? ( X )
+	static-libs? ( tools )
+"
+
+QA_PREBUILT="opt/* usr/lib*"
+
+S=${WORKDIR}/
+
+pkg_pretend() {
+
+	if use amd64 && has_multilib_profile && \
+		[ "${DEFAULT_ABI}" != "amd64" ]; then
+		eerror "This ebuild doesn't currently support changing your default ABI"
+		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
+	fi
+
+	if use kernel_linux && kernel_is ge 4 4; then
+		ewarn "Gentoo supports kernels which are supported by NVIDIA"
+		ewarn "which are limited to the following kernels:"
+		ewarn "<sys-kernel/gentoo-sources-4.4"
+		ewarn "<sys-kernel/vanilla-sources-4.4"
+		ewarn ""
+		ewarn "You are free to utilize epatch_user to provide whatever"
+		ewarn "support you feel is appropriate, but will not receive"
+		ewarn "support as a result of those changes."
+		ewarn ""
+		ewarn "Do not file a bug report about this."
+		ewarn ""
+	fi
+
+	# Since Nvidia ships many different series of drivers, we need to give the user
+	# some kind of guidance as to what version they should install. This tries
+	# to point the user in the right direction but can't be perfect. check
+	# nvidia-driver.eclass
+	nvidia-driver-check-warning
+
+	# Kernel features/options to check for
+	CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
+	use x86 && CONFIG_CHECK+=" ~HIGHMEM"
+
+	# Now do the above checks
+	use kernel_linux && check_extra_config
+}
+
+pkg_setup() {
+	# try to turn off distcc and ccache for people that have a problem with it
+	export DISTCC_DISABLE=1
+	export CCACHE_DISABLE=1
+
+	if use kernel_linux; then
+		linux-mod_pkg_setup
+		MODULE_NAMES="nvidia(video:${S}/kernel)"
+		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
+		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC)"
+		# linux-mod_src_compile calls set_arch_to_kernel, which
+		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
+		# expects x86_64 or i386 and then converts it to x86
+		# later on in the build process
+		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
+	fi
+
+	# set variables to where files are in the package structure
+	if use kernel_FreeBSD; then
+		use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
+		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
+		NV_DOC="${S}/doc"
+		NV_OBJ="${S}/obj"
+		NV_SRC="${S}/src"
+		NV_MAN="${S}/x11/man"
+		NV_X11="${S}/obj"
+		NV_SOVER=1
+	elif use kernel_linux; then
+		NV_DOC="${S}"
+		NV_OBJ="${S}"
+		NV_SRC="${S}/kernel"
+		NV_MAN="${S}"
+		NV_X11="${S}"
+		NV_SOVER=${PV}
+	else
+		die "Could not determine proper NVIDIA package"
+	fi
+}
+
+src_prepare() {
+	# Please add a brief description for every added patch
+
+	if use kernel_linux; then
+		if kernel_is lt 2 6 9 ; then
+			eerror "You must build this against 2.6.9 or higher kernels."
+		fi
+
+		# If greater than 2.6.5 use M= instead of SUBDIR=
+		convert_to_m "${NV_SRC}"/Makefile.kbuild
+	fi
+
+	if use pax_kernel; then
+		ewarn "Using PAX patches is not supported. You will be asked to"
+		ewarn "use a standard kernel should you have issues. Should you"
+		ewarn "need support with these patches, contact the PaX team."
+		epatch "${FILESDIR}"/${PN}-pax-const.patch
+		epatch "${FILESDIR}"/${PN}-pax-usercopy.patch
+	fi
+
+	cat <<- EOF > "${S}"/nvidia.icd
+		/usr/$(get_libdir)/libnvidia-opencl.so
+	EOF
+
+	# Allow user patches so they can support RC kernels and whatever else
+	epatch_user
+}
+
+src_compile() {
+	# This is already the default on Linux, as there's no toplevel Makefile, but
+	# on FreeBSD there's one and triggers the kernel module build, as we install
+	# it by itself, pass this.
+
+	cd "${NV_SRC}"
+	if use kernel_FreeBSD; then
+		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
+			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
+	elif use kernel_linux; then
+		MAKEOPTS=-j1 linux-mod_src_compile
+	fi
+
+	if use tools; then
+		emake -C "${S}"/nvidia-settings-${PV}/src/libXNVCtrl clean
+		emake -C "${S}"/nvidia-settings-${PV}/src/libXNVCtrl \
+			AR="$(tc-getAR)" \
+			CC="$(tc-getCC)" \
+			RANLIB="$(tc-getRANLIB)" \
+			libXNVCtrl.a
+		emake -C "${S}"/nvidia-settings-${PV}/src \
+			AR="$(tc-getAR)" \
+			CC="$(tc-getCC)" \
+			LD="$(tc-getCC)" \
+			LIBDIR="$(get_libdir)" \
+			NVML_ENABLED=0 \
+			NV_USE_BUNDLED_LIBJANSSON=0 \
+			NV_VERBOSE=1 \
+			RANLIB="$(tc-getRANLIB)" \
+			STRIP_CMD=true
+	fi
+}
+
+# Install nvidia library:
+# the first parameter is the library to install
+# the second parameter is the provided soversion
+# the third parameter is the target directory if its not /usr/lib
+donvidia() {
+	# Full path to library minus SOVER
+	MY_LIB="$1"
+
+	# SOVER to use
+	MY_SOVER="$2"
+
+	# Where to install
+	MY_DEST="$3"
+
+	if [[ -z "${MY_DEST}" ]]; then
+		MY_DEST="/usr/$(get_libdir)"
+		action="dolib.so"
+	else
+		exeinto ${MY_DEST}
+		action="doexe"
+	fi
+
+	# Get just the library name
+	libname=$(basename $1)
+
+	# Install the library with the correct SOVER
+	${action} ${MY_LIB}.${MY_SOVER} || \
+		die "failed to install ${libname}"
+
+	# If SOVER wasn't 1, then we need to create a .1 symlink
+	if [[ "${MY_SOVER}" != "1" ]]; then
+		dosym ${libname}.${MY_SOVER} \
+			${MY_DEST}/${libname}.1 || \
+			die "failed to create ${libname} symlink"
+	fi
+
+	# Always create the symlink from the raw lib to the .1
+	dosym ${libname}.1 \
+		${MY_DEST}/${libname} || \
+		die "failed to create ${libname} symlink"
+}
+
+src_install() {
+	if use kernel_linux; then
+		linux-mod_src_install
+
+		# Add the aliases
+		# This file is tweaked with the appropriate video group in
+		# pkg_preinst, see bug #491414
+		insinto /etc/modprobe.d
+		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
+
+		# Ensures that our device nodes are created when not using X
+		exeinto "$(get_udevdir)"
+		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
+		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
+	elif use kernel_FreeBSD; then
+		if use x86-fbsd; then
+			insinto /boot/modules
+			doins "${S}/src/nvidia.kld"
+		fi
+
+		exeinto /boot/modules
+		doexe "${S}/src/nvidia.ko"
+	fi
+
+	# NVIDIA kernel <-> userspace driver config lib
+	donvidia ${NV_OBJ}/libnvidia-cfg.so ${NV_SOVER}
+
+	if use kernel_linux; then
+		# NVIDIA video decode <-> CUDA
+		donvidia ${NV_OBJ}/libnvcuvid.so ${NV_SOVER}
+	fi
+
+	if use X; then
+		# Xorg DDX driver
+		insinto /usr/$(get_libdir)/xorg/modules/drivers
+		doins ${NV_X11}/nvidia_drv.so
+
+		# Xorg GLX driver
+		donvidia ${NV_X11}/libglx.so ${NV_SOVER} \
+			/usr/$(get_libdir)/opengl/nvidia/extensions
+
+		# XvMC driver
+		dolib.a ${NV_X11}/libXvMCNVIDIA.a || \
+			die "failed to install libXvMCNVIDIA.so"
+		donvidia ${NV_X11}/libXvMCNVIDIA.so ${NV_SOVER}
+		dosym libXvMCNVIDIA.so.${NV_SOVER} \
+			/usr/$(get_libdir)/libXvMCNVIDIA_dynamic.so.1 || \
+			die "failed to create libXvMCNVIDIA_dynamic.so symlink"
+	fi
+
+	# OpenCL ICD for NVIDIA
+	if use kernel_linux; then
+		insinto /etc/OpenCL/vendors
+		doins nvidia.icd
+		donvidia ${NV_OBJ}/libnvidia-opencl.so ${NV_SOVER}
+	fi
+
+	# Documentation
+	dohtml ${NV_DOC}/html/*
+	if use kernel_FreeBSD; then
+		dodoc "${NV_DOC}/README"
+		use X && doman "${NV_MAN}/nvidia-xconfig.1"
+		use tools && doman "${NV_MAN}/nvidia-settings.1"
+	else
+		# Docs
+		newdoc "${NV_DOC}/README.txt" README
+		dodoc "${NV_DOC}/NVIDIA_Changelog"
+		doman "${NV_MAN}/nvidia-smi.1.gz"
+		use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
+		use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
+		doman "${NV_MAN}/nvidia-cuda-proxy-control.1.gz"
+	fi
+
+	# Helper Apps
+	exeinto /opt/bin/
+
+	if use X; then
+		doexe ${NV_OBJ}/nvidia-xconfig
+	fi
+
+	if use kernel_linux ; then
+		doexe ${NV_OBJ}/nvidia-debugdump
+		doexe ${NV_OBJ}/nvidia-cuda-proxy-control
+		doexe ${NV_OBJ}/nvidia-cuda-proxy-server
+		doexe ${NV_OBJ}/nvidia-smi
+		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
+	fi
+
+	dobin ${NV_OBJ}/nvidia-bug-report.sh
+
+	# Desktop entries for nvidia-settings
+	if use tools ; then
+		emake -C "${S}"/nvidia-settings-${PV}/src/ \
+			DESTDIR="${D}" \
+			LIBDIR="${D}/usr/$(get_libdir)" \
+			PREFIX=/usr \
+			NV_USE_BUNDLED_LIBJANSSON=0 \
+			install
+
+		if use static-libs; then
+			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
+
+			insinto /usr/include/NVCtrl
+			doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
+		fi
+
+		# There is no icon in the FreeBSD tarball.
+		use kernel_FreeBSD || \
+			doicon ${NV_OBJ}/nvidia-settings.png
+
+		domenu "${FILESDIR}"/nvidia-settings.desktop
+
+		exeinto /etc/X11/xinit/xinitrc.d
+		doexe "${FILESDIR}"/95-nvidia-settings
+	fi
+
+	#doenvd "${FILESDIR}"/50nvidia-prelink-blacklist
+
+	if has_multilib_profile && use multilib ; then
+		local OABI=${ABI}
+		for ABI in $(get_install_abis) ; do
+			src_install-libs
+		done
+		ABI=${OABI}
+		unset OABI
+	else
+		src_install-libs
+	fi
+
+	is_final_abi || die "failed to iterate through all ABIs"
+
+	readme.gentoo_create_doc
+}
+
+src_install-libs() {
+	local inslibdir=$(get_libdir)
+	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
+	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
+	local libdir=${NV_OBJ}
+
+	if use kernel_linux && has_multilib_profile && \
+			[[ ${ABI} == "x86" ]] ; then
+		libdir=${NV_OBJ}/32
+	fi
+
+	if use X; then
+		# The GLX libraries
+		donvidia ${libdir}/libGL.so ${NV_SOVER} ${GL_ROOT}
+		donvidia ${libdir}/libnvidia-glcore.so ${NV_SOVER}
+		if use kernel_FreeBSD; then
+			donvidia ${libdir}/libnvidia-tls.so ${NV_SOVER} ${GL_ROOT}
+		else
+			donvidia ${libdir}/tls/libnvidia-tls.so ${NV_SOVER} ${GL_ROOT}
+		fi
+
+		# VDPAU
+		donvidia ${libdir}/libvdpau_nvidia.so ${NV_SOVER}
+	fi
+
+	# NVIDIA monitoring library
+	if use kernel_linux ; then
+		donvidia ${libdir}/libnvidia-ml.so ${NV_SOVER}
+	fi
+
+	# CUDA & OpenCL
+	if use kernel_linux; then
+		donvidia ${libdir}/libcuda.so ${NV_SOVER}
+		donvidia ${libdir}/libnvidia-compiler.so ${NV_SOVER}
+		donvidia ${libdir}/libOpenCL.so 1.0.0 ${CL_ROOT}
+	fi
+}
+
+pkg_preinst() {
+	if use kernel_linux; then
+		linux-mod_pkg_preinst
+
+		local videogroup="$(egetent group video | cut -d ':' -f 3)"
+		if [ -z "${videogroup}" ]; then
+			eerror "Failed to determine the video group gid"
+			die "Failed to determine the video group gid"
+		else
+			sed -i \
+				-e "s:PACKAGE:${PF}:g" \
+				-e "s:VIDEOGID:${videogroup}:" \
+				"${D}"/etc/modprobe.d/nvidia.conf || die
+		fi
+	fi
+
+	# Clean the dynamic libGL stuff's home to ensure
+	# we dont have stale libs floating around
+	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ] ; then
+		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
+	fi
+	# Make sure we nuke the old nvidia-glx's env.d file
+	if [ -e "${ROOT}"/etc/env.d/09nvidia ] ; then
+		rm -f "${ROOT}"/etc/env.d/09nvidia
+	fi
+}
+
+pkg_postinst() {
+	use kernel_linux && linux-mod_pkg_postinst
+
+	# Switch to the nvidia implementation
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
+	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
+
+	readme.gentoo_print_elog
+
+	if ! use X; then
+		elog "You have elected to not install the X.org driver. Along with"
+		elog "this the OpenGL libraries, XvMC, and VDPAU libraries were not"
+		elog "installed. Additionally, once the driver is loaded your card"
+		elog "and fan will run at max speed which may not be desirable."
+		elog "Use the 'nvidia-smi' init script to have your card and fan"
+		elog "speed scale appropriately."
+		elog
+	fi
+	if ! use tools; then
+		elog "USE=tools controls whether the nvidia-settings application"
+		elog "is installed. If you would like to use it, enable that"
+		elog "flag and re-emerge this ebuild. Optionally you can install"
+		elog "media-video/nvidia-settings"
+		elog
+	fi
+}
+
+pkg_prerm() {
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+	use kernel_linux && linux-mod_pkg_postrm
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-340.96-r3.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-340.96-r3.ebuild
new file mode 100644
index 0000000..27e2ed8
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-340.96-r3.ebuild
@@ -0,0 +1,517 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \
+	portability toolchain-funcs unpacker user udev
+
+NV_URI="http://us.download.nvidia.com/XFree86/"
+X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
+AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
+X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
+AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
+
+DESCRIPTION="NVIDIA Accelerated Graphics Driver"
+HOMEPAGE="http://www.nvidia.com/"
+SRC_URI="
+	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
+	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
+	x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
+	x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
+	tools? ( ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2 )
+"
+
+LICENSE="GPL-2 NVIDIA-r2"
+SLOT="0/${PV%.*}"
+KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
+IUSE="acpi multilib kernel_FreeBSD kernel_linux pax_kernel static-libs +tools +X uvm"
+RESTRICT="bindist mirror strip"
+EMULTILIB_PKG="true"
+
+COMMON="
+	app-eselect/eselect-opencl
+	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
+	tools? (
+		dev-libs/atk
+		dev-libs/glib:2
+		dev-libs/jansson
+		x11-libs/gdk-pixbuf
+		>=x11-libs/gtk+-2.4:2
+		x11-libs/libX11
+		x11-libs/libXext
+		x11-libs/pango[X]
+	)
+	X? (
+		>=app-eselect/eselect-opengl-1.0.9
+	)
+"
+DEPEND="
+	${COMMON}
+	app-arch/xz-utils
+	kernel_linux? ( virtual/linux-sources )
+"
+RDEPEND="
+	${COMMON}
+	acpi? ( sys-power/acpid )
+	tools? ( !media-video/nvidia-settings )
+	X? (
+		<x11-base/xorg-server-1.18.99:=
+		>=x11-libs/libvdpau-0.3-r1
+		multilib? (
+			>=x11-libs/libX11-1.6.2[abi_x86_32]
+			>=x11-libs/libXext-1.3.2[abi_x86_32]
+		)
+	)
+"
+
+REQUIRED_USE="tools? ( X )"
+
+QA_PREBUILT="opt/* usr/lib*"
+
+S=${WORKDIR}/
+
+pkg_pretend() {
+	if use amd64 && has_multilib_profile && \
+		[ "${DEFAULT_ABI}" != "amd64" ]; then
+		eerror "This ebuild doesn't currently support changing your default ABI"
+		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
+	fi
+
+	if use kernel_linux && kernel_is ge 4 4; then
+		ewarn "Gentoo supports kernels which are supported by NVIDIA"
+		ewarn "which are limited to the following kernels:"
+		ewarn "<sys-kernel/gentoo-sources-4.4"
+		ewarn "<sys-kernel/vanilla-sources-4.4"
+		ewarn ""
+		ewarn "You are free to utilize epatch_user to provide whatever"
+		ewarn "support you feel is appropriate, but will not receive"
+		ewarn "support as a result of those changes."
+		ewarn ""
+		ewarn "Do not file a bug report about this."
+		ewarn ""
+	fi
+
+	# Since Nvidia ships many different series of drivers, we need to give the user
+	# some kind of guidance as to what version they should install. This tries
+	# to point the user in the right direction but can't be perfect. check
+	# nvidia-driver.eclass
+	nvidia-driver-check-warning
+
+	# Kernel features/options to check for
+	CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
+	use x86 && CONFIG_CHECK+=" ~HIGHMEM"
+
+	# Now do the above checks
+	use kernel_linux && check_extra_config
+}
+
+pkg_setup() {
+	# try to turn off distcc and ccache for people that have a problem with it
+	export DISTCC_DISABLE=1
+	export CCACHE_DISABLE=1
+
+	if use kernel_linux; then
+		MODULE_NAMES="nvidia(video:${S}/kernel)"
+		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel/uvm)"
+
+		# This needs to run after MODULE_NAMES (so that the eclass checks
+		# whether the kernel supports loadable modules) but before BUILD_PARAMS
+		# is set (so that KV_DIR is populated).
+		linux-mod_pkg_setup
+
+		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
+		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC)"
+
+		# linux-mod_src_compile calls set_arch_to_kernel, which
+		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
+		# expects x86_64 or i386 and then converts it to x86
+		# later on in the build process
+		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
+	fi
+
+	# set variables to where files are in the package structure
+	if use kernel_FreeBSD; then
+		use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
+		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
+		NV_DOC="${S}/doc"
+		NV_OBJ="${S}/obj"
+		NV_SRC="${S}/src"
+		NV_MAN="${S}/x11/man"
+		NV_X11="${S}/obj"
+		NV_SOVER=1
+	elif use kernel_linux; then
+		NV_DOC="${S}"
+		NV_OBJ="${S}"
+		NV_SRC="${S}/kernel"
+		NV_MAN="${S}"
+		NV_X11="${S}"
+		NV_SOVER=${PV}
+	else
+		die "Could not determine proper NVIDIA package"
+	fi
+}
+
+src_prepare() {
+	# Please add a brief description for every added patch
+
+	if use kernel_linux; then
+		if kernel_is lt 2 6 9 ; then
+			eerror "You must build this against 2.6.9 or higher kernels."
+		fi
+
+		# If greater than 2.6.5 use M= instead of SUBDIR=
+#		convert_to_m "${NV_SRC}"/Makefile.kbuild
+	fi
+
+	if use pax_kernel; then
+		ewarn "Using PAX patches is not supported. You will be asked to"
+		ewarn "use a standard kernel should you have issues. Should you"
+		ewarn "need support with these patches, contact the PaX team."
+		epatch "${FILESDIR}"/${PN}-331.13-pax-usercopy.patch
+		epatch "${FILESDIR}"/${PN}-337.12-pax-constify.patch
+	fi
+
+	# Allow user patches so they can support RC kernels and whatever else
+	epatch_user
+}
+
+src_compile() {
+	# This is already the default on Linux, as there's no toplevel Makefile, but
+	# on FreeBSD there's one and triggers the kernel module build, as we install
+	# it by itself, pass this.
+
+	cd "${NV_SRC}"
+	if use kernel_FreeBSD; then
+		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
+			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
+	elif use kernel_linux; then
+		use uvm && MAKEOPTS=-j1
+		linux-mod_src_compile
+	fi
+
+	if use tools; then
+		emake -C "${S}"/nvidia-settings-${PV}/src/libXNVCtrl clean
+		emake -C "${S}"/nvidia-settings-${PV}/src/libXNVCtrl \
+			AR="$(tc-getAR)" \
+			CC="$(tc-getCC)" \
+			RANLIB="$(tc-getRANLIB)" \
+			libXNVCtrl.a
+		emake -C "${S}"/nvidia-settings-${PV}/src \
+			AR="$(tc-getAR)" \
+			CC="$(tc-getCC)" \
+			LD="$(tc-getCC)" \
+			LIBDIR="$(get_libdir)" \
+			NVML_ENABLED=0 \
+			NV_USE_BUNDLED_LIBJANSSON=0 \
+			NV_VERBOSE=1 \
+			RANLIB="$(tc-getRANLIB)" \
+			STRIP_CMD=true
+	fi
+}
+
+# Install nvidia library:
+# the first parameter is the library to install
+# the second parameter is the provided soversion
+# the third parameter is the target directory if its not /usr/lib
+donvidia() {
+	# Full path to library minus SOVER
+	MY_LIB="$1"
+
+	# SOVER to use
+	MY_SOVER="$2"
+
+	# Where to install
+	MY_DEST="$3"
+
+	if [[ -z "${MY_DEST}" ]]; then
+		MY_DEST="/usr/$(get_libdir)"
+		action="dolib.so"
+	else
+		exeinto ${MY_DEST}
+		action="doexe"
+	fi
+
+	# Get just the library name
+	libname=$(basename $1)
+
+	# Install the library with the correct SOVER
+	${action} ${MY_LIB}.${MY_SOVER} || \
+		die "failed to install ${libname}"
+
+	# If SOVER wasn't 1, then we need to create a .1 symlink
+	if [[ "${MY_SOVER}" != "1" ]]; then
+		dosym ${libname}.${MY_SOVER} \
+			${MY_DEST}/${libname}.1 || \
+			die "failed to create ${libname} symlink"
+	fi
+
+	# Always create the symlink from the raw lib to the .1
+	dosym ${libname}.1 \
+		${MY_DEST}/${libname} || \
+		die "failed to create ${libname} symlink"
+}
+
+src_install() {
+	if use kernel_linux; then
+		linux-mod_src_install
+
+		# Add the aliases
+		# This file is tweaked with the appropriate video group in
+		# pkg_preinst, see bug #491414
+		insinto /etc/modprobe.d
+		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
+		use uvm && doins "${FILESDIR}"/nvidia-uvm.conf
+
+		# Ensures that our device nodes are created when not using X
+		exeinto "$(get_udevdir)"
+		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
+		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
+	elif use kernel_FreeBSD; then
+		if use x86-fbsd; then
+			insinto /boot/modules
+			doins "${S}/src/nvidia.kld"
+		fi
+
+		exeinto /boot/modules
+		doexe "${S}/src/nvidia.ko"
+	fi
+
+	# NVIDIA kernel <-> userspace driver config lib
+	donvidia ${NV_OBJ}/libnvidia-cfg.so ${NV_SOVER}
+
+	# NVIDIA framebuffer capture library
+	donvidia ${NV_OBJ}/libnvidia-fbc.so ${NV_SOVER}
+
+	# NVIDIA video encode/decode <-> CUDA
+	if use kernel_linux; then
+		donvidia ${NV_OBJ}/libnvcuvid.so ${NV_SOVER}
+		donvidia ${NV_OBJ}/libnvidia-encode.so ${NV_SOVER}
+	fi
+
+	if use X; then
+		# Xorg DDX driver
+		insinto /usr/$(get_libdir)/xorg/modules/drivers
+		doins ${NV_X11}/nvidia_drv.so
+
+		# Xorg GLX driver
+		donvidia ${NV_X11}/libglx.so ${NV_SOVER} \
+			/usr/$(get_libdir)/opengl/nvidia/extensions
+	fi
+
+	# OpenCL ICD for NVIDIA
+	if use kernel_linux; then
+		insinto /etc/OpenCL/vendors
+		doins ${NV_OBJ}/nvidia.icd
+	fi
+
+	# Documentation
+	dohtml ${NV_DOC}/html/*
+	if use kernel_FreeBSD; then
+		dodoc "${NV_DOC}/README"
+		use X && doman "${NV_MAN}/nvidia-xconfig.1"
+		use tools && doman "${NV_MAN}/nvidia-settings.1"
+	else
+		# Docs
+		newdoc "${NV_DOC}/README.txt" README
+		dodoc "${NV_DOC}/NVIDIA_Changelog"
+		doman "${NV_MAN}/nvidia-smi.1.gz"
+		use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
+		use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
+		doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
+	fi
+
+	# Helper Apps
+	exeinto /opt/bin/
+
+	if use X; then
+		doexe ${NV_OBJ}/nvidia-xconfig
+	fi
+
+	if use kernel_linux ; then
+		doexe ${NV_OBJ}/nvidia-cuda-mps-control
+		doexe ${NV_OBJ}/nvidia-cuda-mps-server
+		doexe ${NV_OBJ}/nvidia-debugdump
+		doexe ${NV_OBJ}/nvidia-persistenced
+		doexe ${NV_OBJ}/nvidia-smi
+
+		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
+		doexe ${NV_OBJ}/nvidia-modprobe
+		fowners root:video /opt/bin/nvidia-modprobe
+		fperms 4710 /opt/bin/nvidia-modprobe
+		dosym /{opt,usr}/bin/nvidia-modprobe
+
+		doman nvidia-cuda-mps-control.1.gz
+		doman nvidia-modprobe.1.gz
+		doman nvidia-persistenced.1.gz
+		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
+		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
+		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
+	fi
+
+	if use tools; then
+		emake -C "${S}"/nvidia-settings-${PV}/src/ \
+			DESTDIR="${D}" \
+			LIBDIR="${D}/usr/$(get_libdir)" \
+			PREFIX=/usr \
+			NV_USE_BUNDLED_LIBJANSSON=0 \
+			install
+
+		if use static-libs; then
+			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
+
+			insinto /usr/include/NVCtrl
+			doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
+		fi
+
+		insinto /usr/share/nvidia/
+		doins nvidia-application-profiles-${PV}-key-documentation
+
+		insinto /etc/nvidia
+		newins \
+			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
+
+		# There is no icon in the FreeBSD tarball.
+		use kernel_FreeBSD || \
+			doicon ${NV_OBJ}/nvidia-settings.png
+
+		domenu "${FILESDIR}"/nvidia-settings.desktop
+
+		exeinto /etc/X11/xinit/xinitrc.d
+		doexe "${FILESDIR}"/95-nvidia-settings
+
+	fi
+
+	dobin ${NV_OBJ}/nvidia-bug-report.sh
+
+	#doenvd "${FILESDIR}"/50nvidia-prelink-blacklist
+
+	if has_multilib_profile && use multilib ; then
+		local OABI=${ABI}
+		for ABI in $(get_install_abis) ; do
+			src_install-libs
+		done
+		ABI=${OABI}
+		unset OABI
+	else
+		src_install-libs
+	fi
+
+	is_final_abi || die "failed to iterate through all ABIs"
+
+	readme.gentoo_create_doc
+}
+
+src_install-libs() {
+	local inslibdir=$(get_libdir)
+	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
+	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
+	local libdir=${NV_OBJ}
+
+	if use kernel_linux && has_multilib_profile && \
+			[[ ${ABI} == "x86" ]] ; then
+		libdir=${NV_OBJ}/32
+	fi
+
+	if use X; then
+		# The GLX libraries
+		donvidia ${libdir}/libEGL.so ${NV_SOVER} ${GL_ROOT}
+		donvidia ${libdir}/libGL.so ${NV_SOVER} ${GL_ROOT}
+		donvidia ${libdir}/libGLESv1_CM.so ${NV_SOVER} ${GL_ROOT}
+		donvidia ${libdir}/libnvidia-eglcore.so ${NV_SOVER}
+		donvidia ${libdir}/libnvidia-glcore.so ${NV_SOVER}
+		donvidia ${libdir}/libnvidia-glsi.so ${NV_SOVER}
+		donvidia ${libdir}/libnvidia-ifr.so ${NV_SOVER}
+		if use kernel_FreeBSD; then
+			donvidia ${libdir}/libnvidia-tls.so ${NV_SOVER}
+		else
+			donvidia ${libdir}/tls/libnvidia-tls.so ${NV_SOVER}
+		fi
+
+		# VDPAU
+		donvidia ${libdir}/libvdpau_nvidia.so ${NV_SOVER}
+
+		# GLES v2 libraries
+		insinto ${GL_ROOT}
+		doexe ${libdir}/libGLESv2.so.${PV}
+		dosym libGLESv2.so.${PV} ${GL_ROOT}/libGLESv2.so.2
+		dosym libGLESv2.so.2 ${GL_ROOT}/libGLESv2.so
+	fi
+
+	# NVIDIA monitoring library
+	if use kernel_linux ; then
+		donvidia ${libdir}/libnvidia-ml.so ${NV_SOVER}
+	fi
+
+	# CUDA & OpenCL
+	if use kernel_linux; then
+		donvidia ${libdir}/libcuda.so ${NV_SOVER}
+		donvidia ${libdir}/libnvidia-compiler.so ${NV_SOVER}
+		donvidia ${libdir}/libOpenCL.so 1.0.0 ${CL_ROOT}
+		donvidia ${libdir}/libnvidia-opencl.so ${NV_SOVER}
+	fi
+}
+
+pkg_preinst() {
+	if use kernel_linux; then
+		linux-mod_pkg_preinst
+
+		local videogroup="$(egetent group video | cut -d ':' -f 3)"
+		if [ -z "${videogroup}" ]; then
+			eerror "Failed to determine the video group gid"
+			die "Failed to determine the video group gid"
+		else
+			sed -i \
+				-e "s:PACKAGE:${PF}:g" \
+				-e "s:VIDEOGID:${videogroup}:" \
+				"${D}"/etc/modprobe.d/nvidia.conf || die
+		fi
+	fi
+
+	# Clean the dynamic libGL stuff's home to ensure
+	# we dont have stale libs floating around
+	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ] ; then
+		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
+	fi
+	# Make sure we nuke the old nvidia-glx's env.d file
+	if [ -e "${ROOT}"/etc/env.d/09nvidia ] ; then
+		rm -f "${ROOT}"/etc/env.d/09nvidia
+	fi
+}
+
+pkg_postinst() {
+	use kernel_linux && linux-mod_pkg_postinst
+
+	# Switch to the nvidia implementation
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
+	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
+
+	readme.gentoo_print_elog
+
+	if ! use X; then
+		elog "You have elected to not install the X.org driver. Along with"
+		elog "this the OpenGL libraries and VDPAU libraries were not"
+		elog "installed. Additionally, once the driver is loaded your card"
+		elog "and fan will run at max speed which may not be desirable."
+		elog "Use the 'nvidia-smi' init script to have your card and fan"
+		elog "speed scale appropriately."
+		elog
+	fi
+	if ! use tools; then
+		elog "USE=tools controls whether the nvidia-settings application"
+		elog "is installed. If you would like to use it, enable that"
+		elog "flag and re-emerge this ebuild. Optionally you can install"
+		elog "media-video/nvidia-settings"
+		elog
+	fi
+}
+
+pkg_prerm() {
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+	use kernel_linux && linux-mod_pkg_postrm
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-346.96-r4.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-346.96-r4.ebuild
new file mode 100644
index 0000000..9254313
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-346.96-r4.ebuild
@@ -0,0 +1,528 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \
+	portability toolchain-funcs unpacker user udev
+
+NV_URI="http://us.download.nvidia.com/XFree86/"
+X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
+AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
+X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
+AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
+
+DESCRIPTION="NVIDIA Accelerated Graphics Driver"
+HOMEPAGE="http://www.nvidia.com/"
+SRC_URI="
+	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
+	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
+	x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
+	x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
+	tools? ( ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2 )
+"
+
+LICENSE="GPL-2 NVIDIA-r2"
+SLOT="0/${PV%.*}"
+KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
+RESTRICT="bindist mirror strip"
+EMULTILIB_PKG="true"
+
+IUSE="acpi gtk3 kernel_FreeBSD kernel_linux multilib pax_kernel static-libs +tools uvm +X"
+REQUIRED_USE="
+	tools? ( X )
+	static-libs? ( tools )
+"
+
+COMMON="
+	app-eselect/eselect-opencl
+	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
+	tools? (
+		dev-libs/atk
+		dev-libs/glib:2
+		dev-libs/jansson
+		gtk3? ( x11-libs/gtk+:3 )
+		x11-libs/cairo
+		x11-libs/gdk-pixbuf[X]
+		x11-libs/gtk+:2
+		x11-libs/libX11
+		x11-libs/libXext
+		x11-libs/libXrandr
+		x11-libs/libXv
+		x11-libs/libXxf86vm
+		x11-libs/pango[X]
+	)
+	X? (
+		>=app-eselect/eselect-opengl-1.0.9
+	)
+"
+DEPEND="
+	${COMMON}
+	app-arch/xz-utils
+	kernel_linux? ( virtual/linux-sources )
+"
+RDEPEND="
+	${COMMON}
+	acpi? ( sys-power/acpid )
+	tools? ( !media-video/nvidia-settings )
+	X? (
+		<x11-base/xorg-server-1.18.99:=
+		>=x11-libs/libvdpau-0.3-r1
+		multilib? (
+			>=x11-libs/libX11-1.6.2[abi_x86_32]
+			>=x11-libs/libXext-1.3.2[abi_x86_32]
+		)
+	)
+"
+
+QA_PREBUILT="opt/* usr/lib*"
+
+S=${WORKDIR}/
+
+pkg_pretend() {
+	if use amd64 && has_multilib_profile && \
+		[ "${DEFAULT_ABI}" != "amd64" ]; then
+		eerror "This ebuild doesn't currently support changing your default ABI"
+		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
+	fi
+
+	if use kernel_linux && kernel_is ge 4 3; then
+		ewarn "Gentoo supports kernels which are supported by NVIDIA"
+		ewarn "which are limited to the following kernels:"
+		ewarn "<sys-kernel/gentoo-sources-4.3"
+		ewarn "<sys-kernel/vanilla-sources-4.3"
+		ewarn ""
+		ewarn "You are free to utilize epatch_user to provide whatever"
+		ewarn "support you feel is appropriate, but will not receive"
+		ewarn "support as a result of those changes."
+		ewarn ""
+		ewarn "Do not file a bug report about this."
+	fi
+
+	# Since Nvidia ships many different series of drivers, we need to give the user
+	# some kind of guidance as to what version they should install. This tries
+	# to point the user in the right direction but can't be perfect. check
+	# nvidia-driver.eclass
+	nvidia-driver-check-warning
+
+	# Kernel features/options to check for
+	CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
+	use x86 && CONFIG_CHECK+=" ~HIGHMEM"
+
+	# Now do the above checks
+	use kernel_linux && check_extra_config
+}
+
+pkg_setup() {
+	# try to turn off distcc and ccache for people that have a problem with it
+	export DISTCC_DISABLE=1
+	export CCACHE_DISABLE=1
+
+	if use kernel_linux; then
+		MODULE_NAMES="nvidia(video:${S}/kernel)"
+		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel/uvm)"
+
+		# This needs to run after MODULE_NAMES (so that the eclass checks
+		# whether the kernel supports loadable modules) but before BUILD_PARAMS
+		# is set (so that KV_DIR is populated).
+		linux-mod_pkg_setup
+
+		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
+		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC)"
+
+		# linux-mod_src_compile calls set_arch_to_kernel, which
+		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
+		# expects x86_64 or i386 and then converts it to x86
+		# later on in the build process
+		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
+	fi
+
+	# set variables to where files are in the package structure
+	if use kernel_FreeBSD; then
+		use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
+		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
+		NV_DOC="${S}/doc"
+		NV_OBJ="${S}/obj"
+		NV_SRC="${S}/src"
+		NV_MAN="${S}/x11/man"
+		NV_X11="${S}/obj"
+		NV_SOVER=1
+	elif use kernel_linux; then
+		NV_DOC="${S}"
+		NV_OBJ="${S}"
+		NV_SRC="${S}/kernel"
+		NV_MAN="${S}"
+		NV_X11="${S}"
+		NV_SOVER=${PV}
+	else
+		die "Could not determine proper NVIDIA package"
+	fi
+}
+
+src_prepare() {
+	# Please add a brief description for every added patch
+
+	if use kernel_linux; then
+		if kernel_is lt 2 6 9 ; then
+			eerror "You must build this against 2.6.9 or higher kernels."
+		fi
+
+		# If greater than 2.6.5 use M= instead of SUBDIR=
+#		convert_to_m "${NV_SRC}"/Makefile.kbuild
+	fi
+
+	if use pax_kernel; then
+		ewarn "Using PAX patches is not supported. You will be asked to"
+		ewarn "use a standard kernel should you have issues. Should you"
+		ewarn "need support with these patches, contact the PaX team."
+		epatch "${FILESDIR}"/${PN}-346.16-pax-usercopy.patch
+		epatch "${FILESDIR}"/${PN}-346.16-pax-constify.patch
+	fi
+
+	# Allow user patches so they can support RC kernels and whatever else
+	epatch_user
+}
+
+src_compile() {
+	# This is already the default on Linux, as there's no toplevel Makefile, but
+	# on FreeBSD there's one and triggers the kernel module build, as we install
+	# it by itself, pass this.
+
+	cd "${NV_SRC}"
+	if use kernel_FreeBSD; then
+		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
+			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
+	elif use kernel_linux; then
+		MAKEOPTS=-j1
+		linux-mod_src_compile
+	fi
+
+	if use tools; then
+		emake -C "${S}"/nvidia-settings-${PV}/src \
+			AR="$(tc-getAR)" \
+			CC="$(tc-getCC)" \
+			LIBDIR="$(get_libdir)" \
+			RANLIB="$(tc-getRANLIB)" \
+			build-xnvctrl
+
+		emake -C "${S}"/nvidia-settings-${PV}/src \
+			CC="$(tc-getCC)" \
+			GTK3_AVAILABLE=$(usex gtk3 1 0) \
+			LD="$(tc-getCC)" \
+			LIBDIR="$(get_libdir)" \
+			NVML_ENABLED=0 \
+			NV_USE_BUNDLED_LIBJANSSON=0 \
+			NV_VERBOSE=1 \
+			STRIP_CMD=true
+	fi
+}
+
+# Install nvidia library:
+# the first parameter is the library to install
+# the second parameter is the provided soversion
+# the third parameter is the target directory if its not /usr/lib
+donvidia() {
+	# Full path to library minus SOVER
+	MY_LIB="$1"
+
+	# SOVER to use
+	MY_SOVER="$2"
+
+	# Where to install
+	MY_DEST="$3"
+
+	if [[ -z "${MY_DEST}" ]]; then
+		MY_DEST="/usr/$(get_libdir)"
+		action="dolib.so"
+	else
+		exeinto ${MY_DEST}
+		action="doexe"
+	fi
+
+	# Get just the library name
+	libname=$(basename $1)
+
+	# Install the library with the correct SOVER
+	${action} ${MY_LIB}.${MY_SOVER} || \
+		die "failed to install ${libname}"
+
+	# If SOVER wasn't 1, then we need to create a .1 symlink
+	if [[ "${MY_SOVER}" != "1" ]]; then
+		dosym ${libname}.${MY_SOVER} \
+			${MY_DEST}/${libname}.1 || \
+			die "failed to create ${libname} symlink"
+	fi
+
+	# Always create the symlink from the raw lib to the .1
+	dosym ${libname}.1 \
+		${MY_DEST}/${libname} || \
+		die "failed to create ${libname} symlink"
+}
+
+src_install() {
+	if use kernel_linux; then
+		linux-mod_src_install
+
+		# Add the aliases
+		# This file is tweaked with the appropriate video group in
+		# pkg_preinst, see bug #491414
+		insinto /etc/modprobe.d
+		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
+		use uvm && doins "${FILESDIR}"/nvidia-uvm.conf
+
+		# Ensures that our device nodes are created when not using X
+		exeinto "$(get_udevdir)"
+		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
+		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
+	elif use kernel_FreeBSD; then
+		if use x86-fbsd; then
+			insinto /boot/modules
+			doins "${S}/src/nvidia.kld"
+		fi
+
+		exeinto /boot/modules
+		doexe "${S}/src/nvidia.ko"
+	fi
+
+	# NVIDIA kernel <-> userspace driver config lib
+	donvidia ${NV_OBJ}/libnvidia-cfg.so ${NV_SOVER}
+
+	# NVIDIA framebuffer capture library
+	donvidia ${NV_OBJ}/libnvidia-fbc.so ${NV_SOVER}
+
+	# NVIDIA video encode/decode <-> CUDA
+	if use kernel_linux; then
+		donvidia ${NV_OBJ}/libnvcuvid.so ${NV_SOVER}
+		donvidia ${NV_OBJ}/libnvidia-encode.so ${NV_SOVER}
+	fi
+
+	if use X; then
+		# Xorg DDX driver
+		insinto /usr/$(get_libdir)/xorg/modules/drivers
+		doins ${NV_X11}/nvidia_drv.so
+
+		# Xorg GLX driver
+		donvidia ${NV_X11}/libglx.so ${NV_SOVER} \
+			/usr/$(get_libdir)/opengl/nvidia/extensions
+
+		# Xorg nvidia.conf
+		if has_version '>=x11-base/xorg-server-1.16'; then
+			insinto /usr/share/X11/xorg.conf.d
+			newins {,50-}nvidia-drm-outputclass.conf
+		fi
+	fi
+
+	# OpenCL ICD for NVIDIA
+	if use kernel_linux; then
+		insinto /etc/OpenCL/vendors
+		doins ${NV_OBJ}/nvidia.icd
+	fi
+
+	# Documentation
+	dohtml ${NV_DOC}/html/*
+	if use kernel_FreeBSD; then
+		dodoc "${NV_DOC}/README"
+		use X && doman "${NV_MAN}/nvidia-xconfig.1"
+		use tools && doman "${NV_MAN}/nvidia-settings.1"
+	else
+		# Docs
+		newdoc "${NV_DOC}/README.txt" README
+		dodoc "${NV_DOC}/NVIDIA_Changelog"
+		doman "${NV_MAN}/nvidia-smi.1.gz"
+		use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
+		use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
+		doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
+	fi
+
+	# Helper Apps
+	exeinto /opt/bin/
+
+	if use X; then
+		doexe ${NV_OBJ}/nvidia-xconfig
+	fi
+
+	if use kernel_linux ; then
+		doexe ${NV_OBJ}/nvidia-cuda-mps-control
+		doexe ${NV_OBJ}/nvidia-cuda-mps-server
+		doexe ${NV_OBJ}/nvidia-debugdump
+		doexe ${NV_OBJ}/nvidia-persistenced
+		doexe ${NV_OBJ}/nvidia-smi
+
+		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
+		doexe ${NV_OBJ}/nvidia-modprobe
+		fowners root:video /opt/bin/nvidia-modprobe
+		fperms 4710 /opt/bin/nvidia-modprobe
+		dosym /{opt,usr}/bin/nvidia-modprobe
+
+		doman nvidia-cuda-mps-control.1.gz
+		doman nvidia-modprobe.1.gz
+		doman nvidia-persistenced.1.gz
+		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
+		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
+		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
+	fi
+
+	if use tools; then
+		emake -C "${S}"/nvidia-settings-${PV}/src/ \
+			DESTDIR="${D}" \
+			GTK3_AVAILABLE=$(usex gtk3 1 0) \
+			LIBDIR="${D}/usr/$(get_libdir)" \
+			PREFIX=/usr \
+			NV_USE_BUNDLED_LIBJANSSON=0 \
+			install
+
+		if use static-libs; then
+			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
+
+			insinto /usr/include/NVCtrl
+			doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
+		fi
+
+		insinto /usr/share/nvidia/
+		doins nvidia-application-profiles-${PV}-key-documentation
+
+		insinto /etc/nvidia
+		newins \
+			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
+
+		# There is no icon in the FreeBSD tarball.
+		use kernel_FreeBSD || \
+			doicon ${NV_OBJ}/nvidia-settings.png
+
+		domenu "${FILESDIR}"/nvidia-settings.desktop
+
+		exeinto /etc/X11/xinit/xinitrc.d
+		doexe "${FILESDIR}"/95-nvidia-settings
+	fi
+
+	dobin ${NV_OBJ}/nvidia-bug-report.sh
+
+	if has_multilib_profile && use multilib ; then
+		local OABI=${ABI}
+		for ABI in $(get_install_abis) ; do
+			src_install-libs
+		done
+		ABI=${OABI}
+		unset OABI
+	else
+		src_install-libs
+	fi
+
+	is_final_abi || die "failed to iterate through all ABIs"
+
+	readme.gentoo_create_doc
+}
+
+src_install-libs() {
+	local inslibdir=$(get_libdir)
+	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
+	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
+	local libdir=${NV_OBJ}
+
+	if use kernel_linux && has_multilib_profile && \
+			[[ ${ABI} == "x86" ]] ; then
+		libdir=${NV_OBJ}/32
+	fi
+
+	if use X; then
+		# The GLX libraries
+		donvidia ${libdir}/libEGL.so ${NV_SOVER} ${GL_ROOT}
+		donvidia ${libdir}/libGL.so ${NV_SOVER} ${GL_ROOT}
+		donvidia ${libdir}/libGLESv1_CM.so ${NV_SOVER} ${GL_ROOT}
+		donvidia ${libdir}/libnvidia-eglcore.so ${NV_SOVER}
+		donvidia ${libdir}/libnvidia-glcore.so ${NV_SOVER}
+		donvidia ${libdir}/libnvidia-glsi.so ${NV_SOVER}
+		donvidia ${libdir}/libnvidia-ifr.so ${NV_SOVER}
+		if use kernel_FreeBSD; then
+			donvidia ${libdir}/libnvidia-tls.so ${NV_SOVER}
+		else
+			donvidia ${libdir}/tls/libnvidia-tls.so ${NV_SOVER}
+		fi
+
+		# VDPAU
+		donvidia ${libdir}/libvdpau_nvidia.so ${NV_SOVER}
+
+		# GLES v2 libraries
+		insinto ${GL_ROOT}
+		doexe ${libdir}/libGLESv2.so.${PV}
+		dosym libGLESv2.so.${PV} ${GL_ROOT}/libGLESv2.so.2
+		dosym libGLESv2.so.2 ${GL_ROOT}/libGLESv2.so
+	fi
+
+	# NVIDIA monitoring library
+	if use kernel_linux ; then
+		donvidia ${libdir}/libnvidia-ml.so ${NV_SOVER}
+	fi
+
+	# CUDA & OpenCL
+	if use kernel_linux; then
+		donvidia ${libdir}/libcuda.so ${NV_SOVER}
+		donvidia ${libdir}/libnvidia-compiler.so ${NV_SOVER}
+		donvidia ${libdir}/libOpenCL.so 1.0.0 ${CL_ROOT}
+		donvidia ${libdir}/libnvidia-opencl.so ${NV_SOVER}
+	fi
+}
+
+pkg_preinst() {
+	if use kernel_linux; then
+		linux-mod_pkg_preinst
+
+		local videogroup="$(egetent group video | cut -d ':' -f 3)"
+		if [ -z "${videogroup}" ]; then
+			eerror "Failed to determine the video group gid"
+			die "Failed to determine the video group gid"
+		else
+			sed -i \
+				-e "s:PACKAGE:${PF}:g" \
+				-e "s:VIDEOGID:${videogroup}:" \
+				"${D}"/etc/modprobe.d/nvidia.conf || die
+		fi
+	fi
+
+	# Clean the dynamic libGL stuff's home to ensure
+	# we dont have stale libs floating around
+	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ] ; then
+		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
+	fi
+	# Make sure we nuke the old nvidia-glx's env.d file
+	if [ -e "${ROOT}"/etc/env.d/09nvidia ] ; then
+		rm -f "${ROOT}"/etc/env.d/09nvidia
+	fi
+}
+
+pkg_postinst() {
+	use kernel_linux && linux-mod_pkg_postinst
+
+	# Switch to the nvidia implementation
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
+	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
+
+	readme.gentoo_print_elog
+
+	if ! use X; then
+		elog "You have elected to not install the X.org driver. Along with"
+		elog "this the OpenGL libraries and VDPAU libraries were not"
+		elog "installed. Additionally, once the driver is loaded your card"
+		elog "and fan will run at max speed which may not be desirable."
+		elog "Use the 'nvidia-smi' init script to have your card and fan"
+		elog "speed scale appropriately."
+		elog
+	fi
+	if ! use tools; then
+		elog "USE=tools controls whether the nvidia-settings application"
+		elog "is installed. If you would like to use it, enable that"
+		elog "flag and re-emerge this ebuild. Optionally you can install"
+		elog "media-video/nvidia-settings"
+		elog
+	fi
+}
+
+pkg_prerm() {
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+	use kernel_linux && linux-mod_pkg_postrm
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-352.79-r2.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-352.79-r2.ebuild
new file mode 100644
index 0000000..d329052
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-352.79-r2.ebuild
@@ -0,0 +1,527 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \
+	portability toolchain-funcs unpacker user udev
+
+NV_URI="http://us.download.nvidia.com/XFree86/"
+X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
+AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
+X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
+AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
+
+DESCRIPTION="NVIDIA Accelerated Graphics Driver"
+HOMEPAGE="http://www.nvidia.com/"
+SRC_URI="
+	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
+	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
+	x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
+	x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
+	tools? ( ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2 )
+"
+
+LICENSE="GPL-2 NVIDIA-r2"
+SLOT="0/${PV%.*}"
+KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
+RESTRICT="bindist mirror strip"
+EMULTILIB_PKG="true"
+
+IUSE="acpi gtk3 multilib kernel_FreeBSD kernel_linux pax_kernel static-libs +tools +X uvm"
+REQUIRED_USE="
+	tools? ( X )
+	static-libs? ( tools )
+"
+
+COMMON="
+	app-eselect/eselect-opencl
+	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
+	tools? (
+		dev-libs/atk
+		dev-libs/glib:2
+		dev-libs/jansson
+		gtk3? (
+			x11-libs/gtk+:3
+		)
+		x11-libs/cairo
+		x11-libs/gdk-pixbuf[X]
+		x11-libs/gtk+:2
+		x11-libs/libX11
+		x11-libs/libXext
+		x11-libs/libXrandr
+		x11-libs/libXv
+		x11-libs/libXxf86vm
+		x11-libs/pango[X]
+	)
+	X? (
+		>=app-eselect/eselect-opengl-1.0.9
+	)
+"
+DEPEND="
+	${COMMON}
+	kernel_linux? ( virtual/linux-sources )
+"
+RDEPEND="
+	${COMMON}
+	acpi? ( sys-power/acpid )
+	tools? ( !media-video/nvidia-settings )
+	X? (
+		<x11-base/xorg-server-1.18.99:=
+		>=x11-libs/libvdpau-0.3-r1
+		multilib? (
+			>=x11-libs/libX11-1.6.2[abi_x86_32]
+			>=x11-libs/libXext-1.3.2[abi_x86_32]
+		)
+	)
+"
+
+QA_PREBUILT="opt/* usr/lib*"
+
+S=${WORKDIR}/
+
+pkg_pretend() {
+	if use amd64 && has_multilib_profile && \
+		[ "${DEFAULT_ABI}" != "amd64" ]; then
+		eerror "This ebuild doesn't currently support changing your default ABI"
+		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
+	fi
+
+	if use kernel_linux && kernel_is ge 4 4; then
+		ewarn "Gentoo supports kernels which are supported by NVIDIA"
+		ewarn "which are limited to the following kernels:"
+		ewarn "<sys-kernel/gentoo-sources-4.4"
+		ewarn "<sys-kernel/vanilla-sources-4.4"
+		ewarn ""
+		ewarn "You are free to utilize epatch_user to provide whatever"
+		ewarn "support you feel is appropriate, but will not receive"
+		ewarn "support as a result of those changes."
+		ewarn ""
+		ewarn "Do not file a bug report about this."
+		ewarn ""
+	fi
+
+	# Since Nvidia ships many different series of drivers, we need to give the user
+	# some kind of guidance as to what version they should install. This tries
+	# to point the user in the right direction but can't be perfect. check
+	# nvidia-driver.eclass
+	nvidia-driver-check-warning
+
+	# Kernel features/options to check for
+	CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
+	use x86 && CONFIG_CHECK+=" ~HIGHMEM"
+
+	# Now do the above checks
+	use kernel_linux && check_extra_config
+}
+
+pkg_setup() {
+	# try to turn off distcc and ccache for people that have a problem with it
+	export DISTCC_DISABLE=1
+	export CCACHE_DISABLE=1
+
+	if use kernel_linux; then
+		MODULE_NAMES="nvidia(video:${S}/kernel)"
+		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel/uvm)"
+
+		# This needs to run after MODULE_NAMES (so that the eclass checks
+		# whether the kernel supports loadable modules) but before BUILD_PARAMS
+		# is set (so that KV_DIR is populated).
+		linux-mod_pkg_setup
+
+		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
+		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC)"
+
+		# linux-mod_src_compile calls set_arch_to_kernel, which
+		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
+		# expects x86_64 or i386 and then converts it to x86
+		# later on in the build process
+		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
+	fi
+
+	# set variables to where files are in the package structure
+	if use kernel_FreeBSD; then
+		use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
+		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
+		NV_DOC="${S}/doc"
+		NV_OBJ="${S}/obj"
+		NV_SRC="${S}/src"
+		NV_MAN="${S}/x11/man"
+		NV_X11="${S}/obj"
+		NV_SOVER=1
+	elif use kernel_linux; then
+		NV_DOC="${S}"
+		NV_OBJ="${S}"
+		NV_SRC="${S}/kernel"
+		NV_MAN="${S}"
+		NV_X11="${S}"
+		NV_SOVER=${PV}
+	else
+		die "Could not determine proper NVIDIA package"
+	fi
+}
+
+src_prepare() {
+	# Please add a brief description for every added patch
+
+	if use kernel_linux; then
+		if kernel_is lt 2 6 9 ; then
+			eerror "You must build this against 2.6.9 or higher kernels."
+		fi
+
+		# If greater than 2.6.5 use M= instead of SUBDIR=
+#		convert_to_m "${NV_SRC}"/Makefile.kbuild
+	fi
+
+	if use pax_kernel; then
+		ewarn "Using PAX patches is not supported. You will be asked to"
+		ewarn "use a standard kernel should you have issues. Should you"
+		ewarn "need support with these patches, contact the PaX team."
+		epatch "${FILESDIR}"/${PN}-346.16-pax-usercopy.patch
+		epatch "${FILESDIR}"/${PN}-346.16-pax-constify.patch
+	fi
+
+	# Allow user patches so they can support RC kernels and whatever else
+	epatch_user
+}
+
+src_compile() {
+	# This is already the default on Linux, as there's no toplevel Makefile, but
+	# on FreeBSD there's one and triggers the kernel module build, as we install
+	# it by itself, pass this.
+
+	cd "${NV_SRC}"
+	if use kernel_FreeBSD; then
+		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
+			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
+	elif use kernel_linux; then
+		MAKEOPTS=-j1
+		linux-mod_src_compile
+	fi
+
+	if use tools; then
+		emake -C "${S}"/nvidia-settings-${PV}/src \
+			AR="$(tc-getAR)" \
+			CC="$(tc-getCC)" \
+			LIBDIR="$(get_libdir)" \
+			RANLIB="$(tc-getRANLIB)" \
+			build-xnvctrl
+
+		emake -C "${S}"/nvidia-settings-${PV}/src \
+			CC="$(tc-getCC)" \
+			GTK3_AVAILABLE=$(usex gtk3 1 0) \
+			LD="$(tc-getCC)" \
+			LIBDIR="$(get_libdir)" \
+			NVML_ENABLED=0 \
+			NV_USE_BUNDLED_LIBJANSSON=0 \
+			NV_VERBOSE=1 \
+			STRIP_CMD=true
+	fi
+}
+
+# Install nvidia library:
+# the first parameter is the library to install
+# the second parameter is the provided soversion
+# the third parameter is the target directory if its not /usr/lib
+donvidia() {
+	# Full path to library minus SOVER
+	MY_LIB="$1"
+
+	# SOVER to use
+	MY_SOVER="$2"
+
+	# Where to install
+	MY_DEST="$3"
+
+	if [[ -z "${MY_DEST}" ]]; then
+		MY_DEST="/usr/$(get_libdir)"
+		action="dolib.so"
+	else
+		exeinto ${MY_DEST}
+		action="doexe"
+	fi
+
+	# Get just the library name
+	libname=$(basename $1)
+
+	# Install the library with the correct SOVER
+	${action} ${MY_LIB}.${MY_SOVER} || \
+		die "failed to install ${libname}"
+
+	# If SOVER wasn't 1, then we need to create a .1 symlink
+	if [[ "${MY_SOVER}" != "1" ]]; then
+		dosym ${libname}.${MY_SOVER} \
+			${MY_DEST}/${libname}.1 || \
+			die "failed to create ${libname} symlink"
+	fi
+
+	# Always create the symlink from the raw lib to the .1
+	dosym ${libname}.1 \
+		${MY_DEST}/${libname} || \
+		die "failed to create ${libname} symlink"
+}
+
+src_install() {
+	if use kernel_linux; then
+		linux-mod_src_install
+
+		# Add the aliases
+		# This file is tweaked with the appropriate video group in
+		# pkg_preinst, see bug #491414
+		insinto /etc/modprobe.d
+		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
+		use uvm && doins "${FILESDIR}"/nvidia-uvm.conf
+
+		# Ensures that our device nodes are created when not using X
+		exeinto "$(get_udevdir)"
+		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
+		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
+	elif use kernel_FreeBSD; then
+		if use x86-fbsd; then
+			insinto /boot/modules
+			doins "${S}/src/nvidia.kld"
+		fi
+
+		exeinto /boot/modules
+		doexe "${S}/src/nvidia.ko"
+	fi
+
+	# NVIDIA kernel <-> userspace driver config lib
+	donvidia ${NV_OBJ}/libnvidia-cfg.so ${NV_SOVER}
+
+	# NVIDIA framebuffer capture library
+	donvidia ${NV_OBJ}/libnvidia-fbc.so ${NV_SOVER}
+
+	# NVIDIA video encode/decode <-> CUDA
+	if use kernel_linux; then
+		donvidia ${NV_OBJ}/libnvcuvid.so ${NV_SOVER}
+		donvidia ${NV_OBJ}/libnvidia-encode.so ${NV_SOVER}
+	fi
+
+	if use X; then
+		# Xorg DDX driver
+		insinto /usr/$(get_libdir)/xorg/modules/drivers
+		doins ${NV_X11}/nvidia_drv.so
+
+		# Xorg GLX driver
+		donvidia ${NV_X11}/libglx.so ${NV_SOVER} \
+			/usr/$(get_libdir)/opengl/nvidia/extensions
+
+		# Xorg nvidia.conf
+		if has_version '>=x11-base/xorg-server-1.16'; then
+			insinto /usr/share/X11/xorg.conf.d
+			newins {,50-}nvidia-drm-outputclass.conf
+		fi
+	fi
+
+	# OpenCL ICD for NVIDIA
+	if use kernel_linux; then
+		insinto /etc/OpenCL/vendors
+		doins ${NV_OBJ}/nvidia.icd
+	fi
+
+	# Documentation
+	dohtml ${NV_DOC}/html/*
+	if use kernel_FreeBSD; then
+		dodoc "${NV_DOC}/README"
+		use X && doman "${NV_MAN}/nvidia-xconfig.1"
+		use tools && doman "${NV_MAN}/nvidia-settings.1"
+	else
+		# Docs
+		newdoc "${NV_DOC}/README.txt" README
+		dodoc "${NV_DOC}/NVIDIA_Changelog"
+		doman "${NV_MAN}/nvidia-smi.1.gz"
+		use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
+		use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
+		doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
+	fi
+
+	# Helper Apps
+	exeinto /opt/bin/
+
+	if use X; then
+		doexe ${NV_OBJ}/nvidia-xconfig
+	fi
+
+	if use kernel_linux ; then
+		doexe ${NV_OBJ}/nvidia-cuda-mps-control
+		doexe ${NV_OBJ}/nvidia-cuda-mps-server
+		doexe ${NV_OBJ}/nvidia-debugdump
+		doexe ${NV_OBJ}/nvidia-persistenced
+		doexe ${NV_OBJ}/nvidia-smi
+
+		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
+		doexe ${NV_OBJ}/nvidia-modprobe
+		fowners root:video /opt/bin/nvidia-modprobe
+		fperms 4710 /opt/bin/nvidia-modprobe
+		dosym /{opt,usr}/bin/nvidia-modprobe
+
+		doman nvidia-cuda-mps-control.1.gz
+		doman nvidia-modprobe.1.gz
+		doman nvidia-persistenced.1.gz
+		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
+		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
+		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
+	fi
+
+	if use tools; then
+		emake -C "${S}"/nvidia-settings-${PV}/src/ \
+			DESTDIR="${D}" \
+			GTK3_AVAILABLE=$(usex gtk3 1 0) \
+			LIBDIR="${D}/usr/$(get_libdir)" \
+			PREFIX=/usr \
+			NV_USE_BUNDLED_LIBJANSSON=0 \
+			install
+
+		if use static-libs; then
+			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
+
+			insinto /usr/share/nvidia/
+			doins nvidia-application-profiles-${PV}-key-documentation
+		fi
+
+		insinto /etc/nvidia
+		newins \
+			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
+
+		# There is no icon in the FreeBSD tarball.
+		use kernel_FreeBSD || \
+			doicon ${NV_OBJ}/nvidia-settings.png
+
+		domenu "${FILESDIR}"/nvidia-settings.desktop
+
+		exeinto /etc/X11/xinit/xinitrc.d
+		doexe "${FILESDIR}"/95-nvidia-settings
+	fi
+
+	dobin ${NV_OBJ}/nvidia-bug-report.sh
+
+	if has_multilib_profile && use multilib ; then
+		local OABI=${ABI}
+		for ABI in $(get_install_abis) ; do
+			src_install-libs
+		done
+		ABI=${OABI}
+		unset OABI
+	else
+		src_install-libs
+	fi
+
+	is_final_abi || die "failed to iterate through all ABIs"
+
+	readme.gentoo_create_doc
+}
+
+src_install-libs() {
+	local inslibdir=$(get_libdir)
+	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
+	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
+	local libdir=${NV_OBJ}
+
+	if use kernel_linux && has_multilib_profile && \
+			[[ ${ABI} == "x86" ]] ; then
+		libdir=${NV_OBJ}/32
+	fi
+
+	if use X; then
+		# The GLX libraries
+		donvidia ${libdir}/libEGL.so ${NV_SOVER} ${GL_ROOT}
+		donvidia ${libdir}/libGL.so ${NV_SOVER} ${GL_ROOT}
+		donvidia ${libdir}/libGLESv1_CM.so ${NV_SOVER} ${GL_ROOT}
+		donvidia ${libdir}/libnvidia-eglcore.so ${NV_SOVER}
+		donvidia ${libdir}/libnvidia-glcore.so ${NV_SOVER}
+		donvidia ${libdir}/libnvidia-glsi.so ${NV_SOVER}
+		donvidia ${libdir}/libnvidia-ifr.so ${NV_SOVER}
+		if use kernel_FreeBSD; then
+			donvidia ${libdir}/libnvidia-tls.so ${NV_SOVER}
+		else
+			donvidia ${libdir}/tls/libnvidia-tls.so ${NV_SOVER}
+		fi
+
+		# VDPAU
+		donvidia ${libdir}/libvdpau_nvidia.so ${NV_SOVER}
+
+		# GLES v2 libraries
+		insinto ${GL_ROOT}
+		doexe ${libdir}/libGLESv2.so.${PV}
+		dosym libGLESv2.so.${PV} ${GL_ROOT}/libGLESv2.so.2
+		dosym libGLESv2.so.2 ${GL_ROOT}/libGLESv2.so
+	fi
+
+	# NVIDIA monitoring library
+	if use kernel_linux ; then
+		donvidia ${libdir}/libnvidia-ml.so ${NV_SOVER}
+	fi
+
+	# CUDA & OpenCL
+	if use kernel_linux; then
+		donvidia ${libdir}/libcuda.so ${NV_SOVER}
+		donvidia ${libdir}/libnvidia-compiler.so ${NV_SOVER}
+		donvidia ${libdir}/libOpenCL.so 1.0.0 ${CL_ROOT}
+		donvidia ${libdir}/libnvidia-opencl.so ${NV_SOVER}
+	fi
+}
+
+pkg_preinst() {
+	if use kernel_linux; then
+		linux-mod_pkg_preinst
+
+		local videogroup="$(egetent group video | cut -d ':' -f 3)"
+		if [ -z "${videogroup}" ]; then
+			eerror "Failed to determine the video group gid"
+			die "Failed to determine the video group gid"
+		else
+			sed -i \
+				-e "s:PACKAGE:${PF}:g" \
+				-e "s:VIDEOGID:${videogroup}:" \
+				"${D}"/etc/modprobe.d/nvidia.conf || die
+		fi
+	fi
+
+	# Clean the dynamic libGL stuff's home to ensure
+	# we dont have stale libs floating around
+	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ] ; then
+		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
+	fi
+	# Make sure we nuke the old nvidia-glx's env.d file
+	if [ -e "${ROOT}"/etc/env.d/09nvidia ] ; then
+		rm -f "${ROOT}"/etc/env.d/09nvidia
+	fi
+}
+
+pkg_postinst() {
+	use kernel_linux && linux-mod_pkg_postinst
+
+	# Switch to the nvidia implementation
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
+	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
+
+	readme.gentoo_print_elog
+
+	if ! use X; then
+		elog "You have elected to not install the X.org driver. Along with"
+		elog "this the OpenGL libraries and VDPAU libraries were not"
+		elog "installed. Additionally, once the driver is loaded your card"
+		elog "and fan will run at max speed which may not be desirable."
+		elog "Use the 'nvidia-smi' init script to have your card and fan"
+		elog "speed scale appropriately."
+		elog
+	fi
+	if ! use tools; then
+		elog "USE=tools controls whether the nvidia-settings application"
+		elog "is installed. If you would like to use it, enable that"
+		elog "flag and re-emerge this ebuild. Optionally you can install"
+		elog "media-video/nvidia-settings"
+		elog
+	fi
+}
+
+pkg_prerm() {
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+	use kernel_linux && linux-mod_pkg_postrm
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-358.16-r3.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-358.16-r3.ebuild
new file mode 100644
index 0000000..4a9bf0f
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-358.16-r3.ebuild
@@ -0,0 +1,539 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \
+	portability toolchain-funcs unpacker user udev
+
+NV_URI="http://us.download.nvidia.com/XFree86/"
+X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
+AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
+X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
+AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
+
+DESCRIPTION="NVIDIA Accelerated Graphics Driver"
+HOMEPAGE="http://www.nvidia.com/"
+SRC_URI="
+	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
+	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
+	x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
+	x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
+	tools? ( ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2 )
+"
+
+LICENSE="GPL-2 NVIDIA-r2"
+SLOT="0/${PV%.*}"
+KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
+RESTRICT="bindist mirror strip"
+EMULTILIB_PKG="true"
+
+IUSE="acpi multilib kernel_FreeBSD kernel_linux +kms pax_kernel static-libs +tools gtk3 +X uvm"
+REQUIRED_USE="
+	tools? ( X )
+	static-libs? ( tools )
+"
+
+COMMON="
+	app-eselect/eselect-opencl
+	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
+	tools? (
+		dev-libs/atk
+		dev-libs/glib:2
+		dev-libs/jansson
+		gtk3? ( x11-libs/gtk+:3 )
+		x11-libs/cairo
+		x11-libs/gdk-pixbuf[X]
+		x11-libs/gtk+:2
+		x11-libs/libX11
+		x11-libs/libXext
+		x11-libs/libXrandr
+		x11-libs/libXv
+		x11-libs/libXxf86vm
+		x11-libs/pango[X]
+	)
+	X? (
+		>=app-eselect/eselect-opengl-1.0.9
+	)
+"
+DEPEND="
+	${COMMON}
+	kernel_linux? ( virtual/linux-sources )
+"
+RDEPEND="
+	${COMMON}
+	acpi? ( sys-power/acpid )
+	tools? ( !media-video/nvidia-settings )
+	X? (
+		<x11-base/xorg-server-1.18.99:=
+		>=x11-libs/libvdpau-0.3-r1
+		multilib? (
+			>=x11-libs/libX11-1.6.2[abi_x86_32]
+			>=x11-libs/libXext-1.3.2[abi_x86_32]
+		)
+	)
+"
+
+QA_PREBUILT="opt/* usr/lib*"
+
+S=${WORKDIR}/
+
+pkg_pretend() {
+	if use amd64 && has_multilib_profile && \
+		[ "${DEFAULT_ABI}" != "amd64" ]; then
+		eerror "This ebuild doesn't currently support changing your default ABI"
+		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
+	fi
+
+	if use kernel_linux && kernel_is ge 4 4; then
+		ewarn "Gentoo supports kernels which are supported by NVIDIA"
+		ewarn "which are limited to the following kernels:"
+		ewarn "<sys-kernel/gentoo-sources-4.4"
+		ewarn "<sys-kernel/vanilla-sources-4.4"
+		ewarn ""
+		ewarn "You are free to utilize epatch_user to provide whatever"
+		ewarn "support you feel is appropriate, but will not receive"
+		ewarn "support as a result of those changes."
+		ewarn ""
+		ewarn "Do not file a bug report about this."
+		ewarn ""
+	fi
+
+	# Since Nvidia ships many different series of drivers, we need to give the user
+	# some kind of guidance as to what version they should install. This tries
+	# to point the user in the right direction but can't be perfect. check
+	# nvidia-driver.eclass
+	nvidia-driver-check-warning
+
+	# Kernel features/options to check for
+	CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
+	use x86 && CONFIG_CHECK+=" ~HIGHMEM"
+
+	# Now do the above checks
+	use kernel_linux && check_extra_config
+}
+
+pkg_setup() {
+	# try to turn off distcc and ccache for people that have a problem with it
+	export DISTCC_DISABLE=1
+	export CCACHE_DISABLE=1
+
+	if use kernel_linux; then
+		MODULE_NAMES="nvidia(video:${S}/kernel)"
+		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
+		use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel)"
+
+		# This needs to run after MODULE_NAMES (so that the eclass checks
+		# whether the kernel supports loadable modules) but before BUILD_PARAMS
+		# is set (so that KV_DIR is populated).
+		linux-mod_pkg_setup
+
+		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
+		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
+
+		# linux-mod_src_compile calls set_arch_to_kernel, which
+		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
+		# expects x86_64 or i386 and then converts it to x86
+		# later on in the build process
+		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
+	fi
+
+	# set variables to where files are in the package structure
+	if use kernel_FreeBSD; then
+		use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
+		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
+		NV_DOC="${S}/doc"
+		NV_OBJ="${S}/obj"
+		NV_SRC="${S}/src"
+		NV_MAN="${S}/x11/man"
+		NV_X11="${S}/obj"
+		NV_SOVER=1
+	elif use kernel_linux; then
+		NV_DOC="${S}"
+		NV_OBJ="${S}"
+		NV_SRC="${S}/kernel"
+		NV_MAN="${S}"
+		NV_X11="${S}"
+		NV_SOVER=${PV}
+	else
+		die "Could not determine proper NVIDIA package"
+	fi
+}
+
+src_prepare() {
+	# Please add a brief description for every added patch
+
+	if use kernel_linux; then
+		if kernel_is lt 2 6 9; then
+			eerror "You must build this against 2.6.9 or higher kernels."
+		fi
+
+		# If greater than 2.6.5 use M= instead of SUBDIR=
+#		convert_to_m "${NV_SRC}"/Makefile.kbuild
+	fi
+
+	if use pax_kernel; then
+		ewarn "Using PAX patches is not supported. You will be asked to"
+		ewarn "use a standard kernel should you have issues. Should you"
+		ewarn "need support with these patches, contact the PaX team."
+		epatch "${FILESDIR}"/${PN}-355.06-pax.patch
+	fi
+
+	# Allow user patches so they can support RC kernels and whatever else
+	epatch_user
+}
+
+src_compile() {
+	# This is already the default on Linux, as there's no toplevel Makefile, but
+	# on FreeBSD there's one and triggers the kernel module build, as we install
+	# it by itself, pass this.
+
+	cd "${NV_SRC}"
+	if use kernel_FreeBSD; then
+		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
+			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
+	elif use kernel_linux; then
+		MAKEOPTS=-j1
+		linux-mod_src_compile
+	fi
+
+	if use tools; then
+		emake -C "${S}"/nvidia-settings-${PV}/src \
+			AR="$(tc-getAR)" \
+			CC="$(tc-getCC)" \
+			LIBDIR="$(get_libdir)" \
+			RANLIB="$(tc-getRANLIB)" \
+			build-xnvctrl
+
+		emake -C "${S}"/nvidia-settings-${PV}/src \
+			CC="$(tc-getCC)" \
+			GTK3_AVAILABLE=$(usex gtk3 1 0) \
+			LD="$(tc-getCC)" \
+			LIBDIR="$(get_libdir)" \
+			NVML_ENABLED=0 \
+			NV_USE_BUNDLED_LIBJANSSON=0 \
+			NV_VERBOSE=1 \
+			STRIP_CMD=true
+	fi
+}
+
+# Install nvidia library:
+# the first parameter is the library to install
+# the second parameter is the provided soversion
+# the third parameter is the target directory if it is not /usr/lib
+donvidia() {
+	# Full path to library minus SOVER
+	MY_LIB="$1"
+
+	# SOVER to use
+	MY_SOVER="$2"
+
+	# Where to install
+	MY_DEST="$3"
+
+	if [[ -z "${MY_DEST}" ]]; then
+		MY_DEST="/usr/$(get_libdir)"
+		action="dolib.so"
+	else
+		exeinto ${MY_DEST}
+		action="doexe"
+	fi
+
+	# Get just the library name
+	libname=$(basename $1)
+
+	# Install the library with the correct SOVER
+	${action} ${MY_LIB}.${MY_SOVER} || \
+		die "failed to install ${libname}"
+
+	# If SOVER wasn't 1, then we need to create a .1 symlink
+	if [[ "${MY_SOVER}" != "1" ]]; then
+		dosym ${libname}.${MY_SOVER} \
+			${MY_DEST}/${libname}.1 || \
+			die "failed to create ${libname} symlink"
+	fi
+
+	# Always create the symlink from the raw lib to the .1
+	dosym ${libname}.1 \
+		${MY_DEST}/${libname} || \
+		die "failed to create ${libname} symlink"
+}
+
+src_install() {
+	if use kernel_linux; then
+		linux-mod_src_install
+
+		# Add the aliases
+		# This file is tweaked with the appropriate video group in
+		# pkg_preinst, see bug #491414
+		insinto /etc/modprobe.d
+		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
+		doins "${FILESDIR}"/nvidia-rmmod.conf
+
+		# Ensures that our device nodes are created when not using X
+		exeinto "$(get_udevdir)"
+		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
+		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
+	elif use kernel_FreeBSD; then
+		if use x86-fbsd; then
+			insinto /boot/modules
+			doins "${S}/src/nvidia.kld"
+		fi
+
+		exeinto /boot/modules
+		doexe "${S}/src/nvidia.ko"
+	fi
+
+	# NVIDIA kernel <-> userspace driver config lib
+	donvidia ${NV_OBJ}/libnvidia-cfg.so ${NV_SOVER}
+
+	# NVIDIA framebuffer capture library
+	donvidia ${NV_OBJ}/libnvidia-fbc.so ${NV_SOVER}
+
+	# NVIDIA video encode/decode <-> CUDA
+	if use kernel_linux; then
+		donvidia ${NV_OBJ}/libnvcuvid.so ${NV_SOVER}
+		donvidia ${NV_OBJ}/libnvidia-encode.so ${NV_SOVER}
+	fi
+
+	if use X; then
+		# Xorg DDX driver
+		insinto /usr/$(get_libdir)/xorg/modules/drivers
+		doins ${NV_X11}/nvidia_drv.so
+
+		# Xorg GLX driver
+		donvidia ${NV_X11}/libglx.so ${NV_SOVER} \
+			/usr/$(get_libdir)/opengl/nvidia/extensions
+
+		# Xorg nvidia.conf
+		if has_version '>=x11-base/xorg-server-1.16'; then
+			insinto /usr/share/X11/xorg.conf.d
+			newins {,50-}nvidia-drm-outputclass.conf
+		fi
+	fi
+
+	# OpenCL ICD for NVIDIA
+	if use kernel_linux; then
+		insinto /etc/OpenCL/vendors
+		doins ${NV_OBJ}/nvidia.icd
+	fi
+
+	# Documentation
+	dohtml ${NV_DOC}/html/*
+	if use kernel_FreeBSD; then
+		dodoc "${NV_DOC}/README"
+		use X && doman "${NV_MAN}/nvidia-xconfig.1"
+		use tools && doman "${NV_MAN}/nvidia-settings.1"
+	else
+		# Docs
+		newdoc "${NV_DOC}/README.txt" README
+		dodoc "${NV_DOC}/NVIDIA_Changelog"
+		doman "${NV_MAN}/nvidia-smi.1.gz"
+		use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
+		use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
+		doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
+	fi
+
+	# Helper Apps
+	exeinto /opt/bin/
+
+	if use X; then
+		doexe ${NV_OBJ}/nvidia-xconfig
+	fi
+
+	if use kernel_linux; then
+		doexe ${NV_OBJ}/nvidia-cuda-mps-control
+		doexe ${NV_OBJ}/nvidia-cuda-mps-server
+		doexe ${NV_OBJ}/nvidia-debugdump
+		doexe ${NV_OBJ}/nvidia-persistenced
+		doexe ${NV_OBJ}/nvidia-smi
+
+		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
+		doexe ${NV_OBJ}/nvidia-modprobe
+		fowners root:video /opt/bin/nvidia-modprobe
+		fperms 4710 /opt/bin/nvidia-modprobe
+		dosym /{opt,usr}/bin/nvidia-modprobe
+
+		doman nvidia-cuda-mps-control.1.gz
+		doman nvidia-modprobe.1.gz
+		doman nvidia-persistenced.1.gz
+		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
+		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
+		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
+	fi
+
+	if use tools; then
+		emake -C "${S}"/nvidia-settings-${PV}/src/ \
+			DESTDIR="${D}" \
+			GTK3_AVAILABLE=$(usex gtk3 1 0) \
+			LIBDIR="${D}/usr/$(get_libdir)" \
+			PREFIX=/usr \
+			NV_USE_BUNDLED_LIBJANSSON=0 \
+			install
+
+		if use static-libs; then
+			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
+
+			insinto /usr/include/NVCtrl
+			doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
+		fi
+
+		insinto /usr/share/nvidia/
+		doins nvidia-application-profiles-${PV}-key-documentation
+
+		insinto /etc/nvidia
+		newins \
+			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
+
+		# There is no icon in the FreeBSD tarball.
+		use kernel_FreeBSD || \
+			doicon ${NV_OBJ}/nvidia-settings.png
+
+		domenu "${FILESDIR}"/nvidia-settings.desktop
+
+		exeinto /etc/X11/xinit/xinitrc.d
+		doexe "${FILESDIR}"/95-nvidia-settings
+	fi
+
+	dobin ${NV_OBJ}/nvidia-bug-report.sh
+
+	if has_multilib_profile && use multilib; then
+		local OABI=${ABI}
+		for ABI in $(get_install_abis); do
+			src_install-libs
+		done
+		ABI=${OABI}
+		unset OABI
+	else
+		src_install-libs
+	fi
+
+	is_final_abi || die "failed to iterate through all ABIs"
+
+	readme.gentoo_create_doc
+}
+
+src_install-libs() {
+	local inslibdir=$(get_libdir)
+	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
+	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
+	local libdir=${NV_OBJ}
+
+	if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
+		libdir=${NV_OBJ}/32
+	fi
+
+	if use X; then
+		NV_GLX_LIBRARIES=(
+			"libEGL.so 1 ${GL_ROOT}"
+			"libEGL_nvidia.so 0 ${GL_ROOT}"
+			"libGL.so ${NV_SOVER} ${GL_ROOT}"
+			"libGLESv1_CM.so ${NV_SOVER} ${GL_ROOT}"
+			"libGLdispatch.so 0 ${GL_ROOT}"
+			"libOpenCL.so 1.0.0 ${CL_ROOT}"
+			"libOpenGL.so 0 ${GL_ROOT}"
+			"libcuda.so ${NV_SOVER}"
+			"libnvcuvid.so ${NV_SOVER}"
+			"libnvidia-compiler.so ${NV_SOVER}"
+			"libnvidia-eglcore.so ${NV_SOVER}"
+			"libnvidia-encode.so ${NV_SOVER}"
+			"libnvidia-fbc.so ${NV_SOVER}"
+			"libnvidia-glcore.so ${NV_SOVER}"
+			"libnvidia-glsi.so ${NV_SOVER}"
+			"libnvidia-ifr.so ${NV_SOVER}"
+			"libnvidia-opencl.so ${NV_SOVER}"
+			"libvdpau.so ${NV_SOVER} ${GL_ROOT}"
+			"libvdpau_nvidia.so ${NV_SOVER}"
+			"libvdpau_trace.so ${NV_SOVER} ${GL_ROOT}"
+		)
+		if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
+		then
+			NV_GLX_LIBRARIES+=( "libnvidia-wfb.so ${NV_SOVER}" )
+		fi
+
+		if use kernel_FreeBSD; then
+			NV_GLX_LIBRARIES+=( "libnvidia-tls.so ${NV_SOVER}" )
+		fi
+
+		if use kernel_linux; then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-ml.so ${NV_SOVER}"
+				"tls/libnvidia-tls.so ${NV_SOVER}"
+			)
+		fi
+
+		for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
+			donvidia ${libdir}/${NV_LIB}
+		done
+
+		# GLES v2 library is special
+		insinto ${GL_ROOT}
+		doexe ${libdir}/libGLESv2.so.${PV}
+		dosym libGLESv2.so.${PV} ${GL_ROOT}/libGLESv2.so.2
+		dosym libGLESv2.so.2 ${GL_ROOT}/libGLESv2.so
+	fi
+}
+
+pkg_preinst() {
+	if use kernel_linux; then
+		linux-mod_pkg_preinst
+
+		local videogroup="$(egetent group video | cut -d ':' -f 3)"
+		if [ -z "${videogroup}" ]; then
+			eerror "Failed to determine the video group gid"
+			die "Failed to determine the video group gid"
+		else
+			sed -i \
+				-e "s:PACKAGE:${PF}:g" \
+				-e "s:VIDEOGID:${videogroup}:" \
+				"${D}"/etc/modprobe.d/nvidia.conf || die
+		fi
+	fi
+
+	# Clean the dynamic libGL stuff's home to ensure
+	# we dont have stale libs floating around
+	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ]; then
+		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
+	fi
+	# Make sure we nuke the old nvidia-glx's env.d file
+	if [ -e "${ROOT}"/etc/env.d/09nvidia ]; then
+		rm -f "${ROOT}"/etc/env.d/09nvidia
+	fi
+}
+
+pkg_postinst() {
+	use kernel_linux && linux-mod_pkg_postinst
+
+	# Switch to the nvidia implementation
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
+	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
+
+	readme.gentoo_print_elog
+
+	if ! use X; then
+		elog "You have elected to not install the X.org driver. Along with"
+		elog "this the OpenGL libraries and VDPAU libraries were not"
+		elog "installed. Additionally, once the driver is loaded your card"
+		elog "and fan will run at max speed which may not be desirable."
+		elog "Use the 'nvidia-smi' init script to have your card and fan"
+		elog "speed scale appropriately."
+		elog
+	fi
+	if ! use tools; then
+		elog "USE=tools controls whether the nvidia-settings application"
+		elog "is installed. If you would like to use it, enable that"
+		elog "flag and re-emerge this ebuild. Optionally you can install"
+		elog "media-video/nvidia-settings"
+		elog
+	fi
+}
+
+pkg_prerm() {
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+	use kernel_linux && linux-mod_pkg_postrm
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-361.18-r3.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-361.18-r3.ebuild
new file mode 100644
index 0000000..8d5f919
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-361.18-r3.ebuild
@@ -0,0 +1,530 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \
+	portability toolchain-funcs unpacker user udev
+
+NV_URI="http://us.download.nvidia.com/XFree86/"
+X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
+AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
+X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
+AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
+
+DESCRIPTION="NVIDIA Accelerated Graphics Driver"
+HOMEPAGE="http://www.nvidia.com/"
+SRC_URI="
+	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
+	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
+	x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
+	x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
+	tools? ( ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2 )
+"
+
+LICENSE="GPL-2 NVIDIA-r2"
+SLOT="0/${PV%.*}"
+KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
+RESTRICT="bindist mirror strip"
+EMULTILIB_PKG="true"
+
+IUSE="acpi +driver gtk3 kernel_FreeBSD kernel_linux +kms multilib pax_kernel static-libs +tools uvm +X"
+REQUIRED_USE="
+	tools? ( X )
+	static-libs? ( tools )
+"
+
+COMMON="
+	app-eselect/eselect-opencl
+	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
+	tools? (
+		dev-libs/atk
+		dev-libs/glib:2
+		dev-libs/jansson
+		gtk3? ( x11-libs/gtk+:3 )
+		x11-libs/cairo
+		x11-libs/gdk-pixbuf[X]
+		x11-libs/gtk+:2
+		x11-libs/libX11
+		x11-libs/libXext
+		x11-libs/libXrandr
+		x11-libs/libXv
+		x11-libs/libXxf86vm
+		x11-libs/pango[X]
+	)
+	X? (
+		>=app-eselect/eselect-opengl-1.0.9
+		app-misc/pax-utils
+	)
+"
+DEPEND="
+	${COMMON}
+	kernel_linux? ( virtual/linux-sources )
+"
+RDEPEND="
+	${COMMON}
+	acpi? ( sys-power/acpid )
+	tools? ( !media-video/nvidia-settings )
+	X? (
+		<x11-base/xorg-server-1.18.99:=
+		>=x11-libs/libvdpau-0.3-r1
+		multilib? (
+			>=x11-libs/libX11-1.6.2[abi_x86_32]
+			>=x11-libs/libXext-1.3.2[abi_x86_32]
+		)
+	)
+"
+
+QA_PREBUILT="opt/* usr/lib*"
+
+S=${WORKDIR}/
+
+pkg_pretend() {
+	if use amd64 && has_multilib_profile && \
+		[ "${DEFAULT_ABI}" != "amd64" ]; then
+		eerror "This ebuild doesn't currently support changing your default ABI"
+		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
+	fi
+
+	if use kernel_linux && kernel_is ge 4 5; then
+		ewarn "Gentoo supports kernels which are supported by NVIDIA"
+		ewarn "which are limited to the following kernels:"
+		ewarn "<sys-kernel/gentoo-sources-4.5"
+		ewarn "<sys-kernel/vanilla-sources-4.5"
+		ewarn ""
+		ewarn "You are free to utilize epatch_user to provide whatever"
+		ewarn "support you feel is appropriate, but will not receive"
+		ewarn "support as a result of those changes."
+		ewarn ""
+		ewarn "Do not file a bug report about this."
+		ewarn ""
+	fi
+
+	# Since Nvidia ships many different series of drivers, we need to give the user
+	# some kind of guidance as to what version they should install. This tries
+	# to point the user in the right direction but can't be perfect. check
+	# nvidia-driver.eclass
+	nvidia-driver-check-warning
+
+	# Kernel features/options to check for
+	CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
+	use x86 && CONFIG_CHECK+=" ~HIGHMEM"
+
+	# Now do the above checks
+	use kernel_linux && check_extra_config
+}
+
+pkg_setup() {
+	# try to turn off distcc and ccache for people that have a problem with it
+	export DISTCC_DISABLE=1
+	export CCACHE_DISABLE=1
+
+	if use driver && use kernel_linux; then
+		MODULE_NAMES="nvidia(video:${S}/kernel)"
+		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
+		use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel)"
+
+		# This needs to run after MODULE_NAMES (so that the eclass checks
+		# whether the kernel supports loadable modules) but before BUILD_PARAMS
+		# is set (so that KV_DIR is populated).
+		linux-mod_pkg_setup
+
+		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
+		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
+
+		# linux-mod_src_compile calls set_arch_to_kernel, which
+		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
+		# expects x86_64 or i386 and then converts it to x86
+		# later on in the build process
+		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
+	fi
+
+	if use kernel_linux && kernel_is lt 2 6 9; then
+		eerror "You must build this against 2.6.9 or higher kernels."
+	fi
+
+	# set variables to where files are in the package structure
+	if use kernel_FreeBSD; then
+		use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
+		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
+		NV_DOC="${S}/doc"
+		NV_OBJ="${S}/obj"
+		NV_SRC="${S}/src"
+		NV_MAN="${S}/x11/man"
+		NV_X11="${S}/obj"
+		NV_SOVER=1
+	elif use kernel_linux; then
+		NV_DOC="${S}"
+		NV_OBJ="${S}"
+		NV_SRC="${S}/kernel"
+		NV_MAN="${S}"
+		NV_X11="${S}"
+		NV_SOVER=${PV}
+	else
+		die "Could not determine proper NVIDIA package"
+	fi
+}
+
+src_prepare() {
+	if use pax_kernel; then
+		ewarn "Using PAX patches is not supported. You will be asked to"
+		ewarn "use a standard kernel should you have issues. Should you"
+		ewarn "need support with these patches, contact the PaX team."
+		epatch "${FILESDIR}"/${PN}-355.06-pax.patch
+	fi
+
+	# Allow user patches so they can support RC kernels and whatever else
+	epatch_user
+}
+
+src_compile() {
+	# This is already the default on Linux, as there's no toplevel Makefile, but
+	# on FreeBSD there's one and triggers the kernel module build, as we install
+	# it by itself, pass this.
+
+	cd "${NV_SRC}"
+	if use kernel_FreeBSD; then
+		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
+			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
+	elif use driver && use kernel_linux; then
+		MAKEOPTS=-j1
+		linux-mod_src_compile
+	fi
+
+	if use tools; then
+		emake -C "${S}"/nvidia-settings-${PV}/src \
+			AR="$(tc-getAR)" \
+			CC="$(tc-getCC)" \
+			LIBDIR="$(get_libdir)" \
+			RANLIB="$(tc-getRANLIB)" \
+			build-xnvctrl
+
+		emake -C "${S}"/nvidia-settings-${PV}/src \
+			CC="$(tc-getCC)" \
+			GTK3_AVAILABLE=$(usex gtk3 1 0) \
+			LD="$(tc-getCC)" \
+			LIBDIR="$(get_libdir)" \
+			NVML_ENABLED=0 \
+			NV_USE_BUNDLED_LIBJANSSON=0 \
+			NV_VERBOSE=1 \
+			STRIP_CMD=true
+	fi
+}
+
+# Install nvidia library:
+# the first parameter is the library to install
+# the second parameter is the provided soversion
+# the third parameter is the target directory if it is not /usr/lib
+donvidia() {
+	# Full path to library
+	nv_LIB="${1}"
+
+	# SOVER to use
+	nv_SOVER="$(scanelf -qF'%S#F' ${nv_LIB})"
+
+	# Where to install
+	nv_DEST="${2}"
+
+	# Get just the library name
+	nv_LIBNAME=$(basename "${nv_LIB}")
+
+	if [[ "${nv_DEST}" ]]; then
+		exeinto ${nv_DEST}
+		action="doexe"
+	else
+		nv_DEST="/usr/$(get_libdir)"
+		action="dolib.so"
+	fi
+
+	# Install the library
+	${action} ${nv_LIB} || die "failed to install ${nv_LIBNAME}"
+
+	# If the library has a SONAME and SONAME does not match the library name,
+	# then we need to create a symlink
+	if [[ ${nv_SOVER} ]] && ! [[ "${nv_SOVER}" = "${nv_LIBNAME}" ]]; then
+		dosym ${nv_LIBNAME} ${nv_DEST}/${nv_SOVER} \
+			|| die "failed to create ${nv_DEST}/${nv_SOVER} symlink"
+	fi
+
+	dosym ${nv_LIBNAME} ${nv_DEST}/${nv_LIBNAME/.so*/.so} \
+		|| die "failed to create ${nv_LIBNAME/.so*/.so} symlink"
+}
+
+src_install() {
+	if use driver && use kernel_linux; then
+		linux-mod_src_install
+
+		# Add the aliases
+		# This file is tweaked with the appropriate video group in
+		# pkg_preinst, see bug #491414
+		insinto /etc/modprobe.d
+		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
+		doins "${FILESDIR}"/nvidia-rmmod.conf
+
+		# Ensures that our device nodes are created when not using X
+		exeinto "$(get_udevdir)"
+		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
+		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
+	elif use kernel_FreeBSD; then
+		if use x86-fbsd; then
+			insinto /boot/modules
+			doins "${S}/src/nvidia.kld"
+		fi
+
+		exeinto /boot/modules
+		doexe "${S}/src/nvidia.ko"
+	fi
+
+	# NVIDIA kernel <-> userspace driver config lib
+	donvidia ${NV_OBJ}/libnvidia-cfg.so.${NV_SOVER}
+
+	# NVIDIA framebuffer capture library
+	donvidia ${NV_OBJ}/libnvidia-fbc.so.${NV_SOVER}
+
+	# NVIDIA video encode/decode <-> CUDA
+	if use kernel_linux; then
+		donvidia ${NV_OBJ}/libnvcuvid.so.${NV_SOVER}
+		donvidia ${NV_OBJ}/libnvidia-encode.so.${NV_SOVER}
+	fi
+
+	if use X; then
+		# Xorg DDX driver
+		insinto /usr/$(get_libdir)/xorg/modules/drivers
+		doins ${NV_X11}/nvidia_drv.so
+
+		# Xorg GLX driver
+		donvidia ${NV_X11}/libglx.so.${NV_SOVER} \
+			/usr/$(get_libdir)/opengl/nvidia/extensions
+
+		# Xorg nvidia.conf
+		if has_version '>=x11-base/xorg-server-1.16'; then
+			insinto /usr/share/X11/xorg.conf.d
+			newins {,50-}nvidia-drm-outputclass.conf
+		fi
+	fi
+
+	# OpenCL ICD for NVIDIA
+	if use kernel_linux; then
+		insinto /etc/OpenCL/vendors
+		doins ${NV_OBJ}/nvidia.icd
+	fi
+
+	# Documentation
+	dohtml ${NV_DOC}/html/*
+	if use kernel_FreeBSD; then
+		dodoc "${NV_DOC}/README"
+		use X && doman "${NV_MAN}/nvidia-xconfig.1"
+		use tools && doman "${NV_MAN}/nvidia-settings.1"
+	else
+		# Docs
+		newdoc "${NV_DOC}/README.txt" README
+		dodoc "${NV_DOC}/NVIDIA_Changelog"
+		doman "${NV_MAN}/nvidia-smi.1.gz"
+		use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
+		use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
+		doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
+	fi
+
+	# Helper Apps
+	exeinto /opt/bin/
+
+	if use X; then
+		doexe ${NV_OBJ}/nvidia-xconfig
+	fi
+
+	if use kernel_linux; then
+		doexe ${NV_OBJ}/nvidia-cuda-mps-control
+		doexe ${NV_OBJ}/nvidia-cuda-mps-server
+		doexe ${NV_OBJ}/nvidia-debugdump
+		doexe ${NV_OBJ}/nvidia-persistenced
+		doexe ${NV_OBJ}/nvidia-smi
+
+		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
+		doexe ${NV_OBJ}/nvidia-modprobe
+		fowners root:video /opt/bin/nvidia-modprobe
+		fperms 4710 /opt/bin/nvidia-modprobe
+		dosym /{opt,usr}/bin/nvidia-modprobe
+
+		doman nvidia-cuda-mps-control.1.gz
+		doman nvidia-modprobe.1.gz
+		doman nvidia-persistenced.1.gz
+		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
+		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
+		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
+	fi
+
+	if use tools; then
+		emake -C "${S}"/nvidia-settings-${PV}/src/ \
+			DESTDIR="${D}" \
+			GTK3_AVAILABLE=$(usex gtk3 1 0) \
+			LIBDIR="${D}/usr/$(get_libdir)" \
+			PREFIX=/usr \
+			NV_USE_BUNDLED_LIBJANSSON=0 \
+			install
+
+		if use static-libs; then
+			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
+
+			insinto /usr/include/NVCtrl
+			doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
+		fi
+
+		insinto /usr/share/nvidia/
+		doins nvidia-application-profiles-${PV}-key-documentation
+
+		insinto /etc/nvidia
+		newins \
+			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
+
+		# There is no icon in the FreeBSD tarball.
+		use kernel_FreeBSD || \
+			doicon ${NV_OBJ}/nvidia-settings.png
+
+		domenu "${FILESDIR}"/nvidia-settings.desktop
+
+		exeinto /etc/X11/xinit/xinitrc.d
+		doexe "${FILESDIR}"/95-nvidia-settings
+	fi
+
+	dobin ${NV_OBJ}/nvidia-bug-report.sh
+
+	if has_multilib_profile && use multilib; then
+		local OABI=${ABI}
+		for ABI in $(get_install_abis); do
+			src_install-libs
+		done
+		ABI=${OABI}
+		unset OABI
+	else
+		src_install-libs
+	fi
+
+	is_final_abi || die "failed to iterate through all ABIs"
+
+	readme.gentoo_create_doc
+}
+
+src_install-libs() {
+	local inslibdir=$(get_libdir)
+	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
+	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
+	local libdir=${NV_OBJ}
+
+	if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
+		libdir=${NV_OBJ}/32
+	fi
+
+	if use X; then
+		NV_GLX_LIBRARIES=(
+			"libEGL.so.1 ${GL_ROOT}"
+			"libEGL_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGL.so.1 ${GL_ROOT}"
+			"libGLESv1_CM.so.1 ${GL_ROOT}"
+			"libGLESv1_CM_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGLESv2.so.2 ${GL_ROOT}"
+			"libGLESv2_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGLX.so.0 ${GL_ROOT}"
+			"libGLX_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGLdispatch.so.0 ${GL_ROOT}"
+			"libOpenCL.so.1.0.0 ${CL_ROOT}"
+			"libOpenGL.so.0 ${GL_ROOT}"
+			"libcuda.so.${NV_SOVER}"
+			"libnvcuvid.so.${NV_SOVER}"
+			"libnvidia-compiler.so.${NV_SOVER}"
+			"libnvidia-eglcore.so.${NV_SOVER}"
+			"libnvidia-encode.so.${NV_SOVER}"
+			"libnvidia-fatbinaryloader.so.${NV_SOVER}"
+			"libnvidia-fbc.so.${NV_SOVER}"
+			"libnvidia-glcore.so.${NV_SOVER}"
+			"libnvidia-glsi.so.${NV_SOVER}"
+			"libnvidia-ifr.so.${NV_SOVER}"
+			"libnvidia-opencl.so.${NV_SOVER}"
+			"libnvidia-ptxjitcompiler.so.${NV_SOVER}"
+			"libvdpau_nvidia.so.${NV_SOVER}"
+		)
+
+		if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
+		then
+			NV_GLX_LIBRARIES+=( "libnvidia-wfb.so.${NV_SOVER}" )
+		fi
+
+		if use kernel_FreeBSD; then
+			NV_GLX_LIBRARIES+=( "libnvidia-tls.so.${NV_SOVER}" )
+		fi
+
+		if use kernel_linux; then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-ml.so.${NV_SOVER}"
+				"tls/libnvidia-tls.so.${NV_SOVER}"
+			)
+		fi
+
+		for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
+			donvidia ${libdir}/${NV_LIB}
+		done
+	fi
+}
+
+pkg_preinst() {
+	if use driver && use kernel_linux; then
+		linux-mod_pkg_preinst
+
+		local videogroup="$(egetent group video | cut -d ':' -f 3)"
+		if [ -z "${videogroup}" ]; then
+			eerror "Failed to determine the video group gid"
+			die "Failed to determine the video group gid"
+		else
+			sed -i \
+				-e "s:PACKAGE:${PF}:g" \
+				-e "s:VIDEOGID:${videogroup}:" \
+				"${D}"/etc/modprobe.d/nvidia.conf || die
+		fi
+	fi
+
+	# Clean the dynamic libGL stuff's home to ensure
+	# we dont have stale libs floating around
+	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ]; then
+		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
+	fi
+	# Make sure we nuke the old nvidia-glx's env.d file
+	if [ -e "${ROOT}"/etc/env.d/09nvidia ]; then
+		rm -f "${ROOT}"/etc/env.d/09nvidia
+	fi
+}
+
+pkg_postinst() {
+	use driver && use kernel_linux && linux-mod_pkg_postinst
+
+	# Switch to the nvidia implementation
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
+	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
+
+	readme.gentoo_print_elog
+
+	if ! use X; then
+		elog "You have elected to not install the X.org driver. Along with"
+		elog "this the OpenGL libraries and VDPAU libraries were not"
+		elog "installed. Additionally, once the driver is loaded your card"
+		elog "and fan will run at max speed which may not be desirable."
+		elog "Use the 'nvidia-smi' init script to have your card and fan"
+		elog "speed scale appropriately."
+		elog
+	fi
+	if ! use tools; then
+		elog "USE=tools controls whether the nvidia-settings application"
+		elog "is installed. If you would like to use it, enable that"
+		elog "flag and re-emerge this ebuild. Optionally you can install"
+		elog "media-video/nvidia-settings"
+		elog
+	fi
+}
+
+pkg_prerm() {
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+	use driver && use kernel_linux && linux-mod_pkg_postrm
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: x11-drivers/nvidia-drivers/, x11-drivers/nvidia-drivers/files/
@ 2016-01-31 19:19 Jeroen Roovers
  0 siblings, 0 replies; 33+ messages in thread
From: Jeroen Roovers @ 2016-01-31 19:19 UTC (permalink / raw
  To: gentoo-commits

commit:     2dbc40c273a4db85ba4629d46ab91777ac90b72a
Author:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 31 19:19:06 2016 +0000
Commit:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
CommitDate: Sun Jan 31 19:19:37 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2dbc40c2

x11-drivers/nvidia-drivers: Fix nvidia-settings location in /etc/X11/xinit/xinitrc.d/95-nvidia-settings (bug #573452 by Constantin Baranov).

Package-Manager: portage-2.2.27

 x11-drivers/nvidia-drivers/files/95-nvidia-settings-r1                  | 2 ++
 ...vidia-drivers-304.131-r2.ebuild => nvidia-drivers-304.131-r3.ebuild} | 2 +-
 ...{nvidia-drivers-340.96-r3.ebuild => nvidia-drivers-340.96-r4.ebuild} | 2 +-
 ...{nvidia-drivers-346.96-r4.ebuild => nvidia-drivers-346.96-r5.ebuild} | 2 +-
 ...{nvidia-drivers-352.79-r2.ebuild => nvidia-drivers-352.79-r3.ebuild} | 2 +-
 ...{nvidia-drivers-358.16-r3.ebuild => nvidia-drivers-358.16-r4.ebuild} | 2 +-
 ...{nvidia-drivers-361.18-r3.ebuild => nvidia-drivers-361.18-r4.ebuild} | 2 +-
 7 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/x11-drivers/nvidia-drivers/files/95-nvidia-settings-r1 b/x11-drivers/nvidia-drivers/files/95-nvidia-settings-r1
new file mode 100644
index 0000000..48c41d8
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/95-nvidia-settings-r1
@@ -0,0 +1,2 @@
+#!/bin/sh
+/usr/bin/nvidia-settings --load-config-only

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-304.131-r2.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-304.131-r3.ebuild
similarity index 99%
rename from x11-drivers/nvidia-drivers/nvidia-drivers-304.131-r2.ebuild
rename to x11-drivers/nvidia-drivers/nvidia-drivers-304.131-r3.ebuild
index 1ff7a6c..31b8b3a 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-304.131-r2.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-304.131-r3.ebuild
@@ -365,7 +365,7 @@ src_install() {
 		domenu "${FILESDIR}"/nvidia-settings.desktop
 
 		exeinto /etc/X11/xinit/xinitrc.d
-		doexe "${FILESDIR}"/95-nvidia-settings
+		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
 	fi
 
 	#doenvd "${FILESDIR}"/50nvidia-prelink-blacklist

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-340.96-r3.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-340.96-r4.ebuild
similarity index 99%
rename from x11-drivers/nvidia-drivers/nvidia-drivers-340.96-r3.ebuild
rename to x11-drivers/nvidia-drivers/nvidia-drivers-340.96-r4.ebuild
index 27e2ed8..d688da9 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-340.96-r3.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-340.96-r4.ebuild
@@ -379,7 +379,7 @@ src_install() {
 		domenu "${FILESDIR}"/nvidia-settings.desktop
 
 		exeinto /etc/X11/xinit/xinitrc.d
-		doexe "${FILESDIR}"/95-nvidia-settings
+		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
 
 	fi
 

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-346.96-r4.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-346.96-r5.ebuild
similarity index 99%
rename from x11-drivers/nvidia-drivers/nvidia-drivers-346.96-r4.ebuild
rename to x11-drivers/nvidia-drivers/nvidia-drivers-346.96-r5.ebuild
index 9254313..cc9166c 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-346.96-r4.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-346.96-r5.ebuild
@@ -393,7 +393,7 @@ src_install() {
 		domenu "${FILESDIR}"/nvidia-settings.desktop
 
 		exeinto /etc/X11/xinit/xinitrc.d
-		doexe "${FILESDIR}"/95-nvidia-settings
+		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
 	fi
 
 	dobin ${NV_OBJ}/nvidia-bug-report.sh

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-352.79-r2.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-352.79-r3.ebuild
similarity index 99%
rename from x11-drivers/nvidia-drivers/nvidia-drivers-352.79-r2.ebuild
rename to x11-drivers/nvidia-drivers/nvidia-drivers-352.79-r3.ebuild
index d329052..27abf7f 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-352.79-r2.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-352.79-r3.ebuild
@@ -392,7 +392,7 @@ src_install() {
 		domenu "${FILESDIR}"/nvidia-settings.desktop
 
 		exeinto /etc/X11/xinit/xinitrc.d
-		doexe "${FILESDIR}"/95-nvidia-settings
+		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
 	fi
 
 	dobin ${NV_OBJ}/nvidia-bug-report.sh

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-358.16-r3.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-358.16-r4.ebuild
similarity index 99%
rename from x11-drivers/nvidia-drivers/nvidia-drivers-358.16-r3.ebuild
rename to x11-drivers/nvidia-drivers/nvidia-drivers-358.16-r4.ebuild
index 4a9bf0f..45ab3e6 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-358.16-r3.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-358.16-r4.ebuild
@@ -393,7 +393,7 @@ src_install() {
 		domenu "${FILESDIR}"/nvidia-settings.desktop
 
 		exeinto /etc/X11/xinit/xinitrc.d
-		doexe "${FILESDIR}"/95-nvidia-settings
+		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
 	fi
 
 	dobin ${NV_OBJ}/nvidia-bug-report.sh

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-361.18-r3.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-361.18-r4.ebuild
similarity index 99%
rename from x11-drivers/nvidia-drivers/nvidia-drivers-361.18-r3.ebuild
rename to x11-drivers/nvidia-drivers/nvidia-drivers-361.18-r4.ebuild
index 8d5f919..319a228 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-361.18-r3.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-361.18-r4.ebuild
@@ -384,7 +384,7 @@ src_install() {
 		domenu "${FILESDIR}"/nvidia-settings.desktop
 
 		exeinto /etc/X11/xinit/xinitrc.d
-		doexe "${FILESDIR}"/95-nvidia-settings
+		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
 	fi
 
 	dobin ${NV_OBJ}/nvidia-bug-report.sh


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: x11-drivers/nvidia-drivers/, x11-drivers/nvidia-drivers/files/
@ 2016-07-24 11:37 Jeroen Roovers
  0 siblings, 0 replies; 33+ messages in thread
From: Jeroen Roovers @ 2016-07-24 11:37 UTC (permalink / raw
  To: gentoo-commits

commit:     72c82581f8411316b2031bb9b4ad1b9010002b30
Author:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 24 11:35:41 2016 +0000
Commit:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
CommitDate: Sun Jul 24 11:37:17 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=72c82581

x11-drivers/nvidia-drivers: Patch nvidia-settings profiles by oleg (bug #589590).

Package-Manager: portage-2.3.0

 .../files/nvidia-drivers-367.35-profiles-rc.patch  |  11 +
 .../nvidia-drivers/nvidia-drivers-367.35-r1.ebuild | 552 +++++++++++++++++++++
 2 files changed, 563 insertions(+)

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-367.35-profiles-rc.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-367.35-profiles-rc.patch
new file mode 100644
index 0000000..77b676c
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-367.35-profiles-rc.patch
@@ -0,0 +1,11 @@
+--- a/nvidia-application-profiles-367.35-rc
++++ b/nvidia-application-profiles-367.35-rc
+@@ -44,7 +44,7 @@
+         {
+           "name" : "NamedVertexAttributesApplyDivisor",
+           "settings" : [ "GL23cd0e", 1 ]
+-        },
++        }
+     ],
+     "rules" : [
+         {

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-367.35-r1.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-367.35-r1.ebuild
new file mode 100644
index 0000000..ef62b08
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-367.35-r1.ebuild
@@ -0,0 +1,552 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \
+	portability toolchain-funcs unpacker user udev
+
+NV_URI="http://us.download.nvidia.com/XFree86/"
+X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
+AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
+ARM_NV_PACKAGE="NVIDIA-Linux-armv7l-gnueabihf-${PV}"
+X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
+AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
+
+DESCRIPTION="NVIDIA Accelerated Graphics Driver"
+HOMEPAGE="http://www.nvidia.com/ http://www.nvidia.com/Download/Find.aspx"
+SRC_URI="
+	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
+	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
+	arm? ( ${NV_URI}Linux-x86-ARM/${PV}/${ARM_NV_PACKAGE}.run )
+	x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
+	x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
+	tools? ( ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2 )
+"
+
+LICENSE="GPL-2 NVIDIA-r2"
+SLOT="0/${PV%.*}"
+KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
+RESTRICT="bindist mirror"
+EMULTILIB_PKG="true"
+
+IUSE="acpi compat +driver gtk3 kernel_FreeBSD kernel_linux +kms multilib pax_kernel static-libs +tools uvm wayland +X"
+REQUIRED_USE="
+	tools? ( X )
+	static-libs? ( tools )
+"
+
+COMMON="
+	app-eselect/eselect-opencl
+	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
+	tools? (
+		dev-libs/atk
+		dev-libs/glib:2
+		dev-libs/jansson
+		gtk3? ( x11-libs/gtk+:3 )
+		x11-libs/cairo
+		x11-libs/gdk-pixbuf[X]
+		x11-libs/gtk+:2
+		x11-libs/libX11
+		x11-libs/libXext
+		x11-libs/libXrandr
+		x11-libs/libXv
+		x11-libs/libXxf86vm
+		x11-libs/pango[X]
+	)
+	X? (
+		>=app-eselect/eselect-opengl-1.0.9
+		app-misc/pax-utils
+	)
+"
+DEPEND="
+	${COMMON}
+	kernel_linux? ( virtual/linux-sources )
+"
+RDEPEND="
+	${COMMON}
+	acpi? ( sys-power/acpid )
+	tools? ( !media-video/nvidia-settings )
+	wayland? ( dev-libs/wayland )
+	X? (
+		<x11-base/xorg-server-1.18.99:=
+		>=x11-libs/libvdpau-1.0
+		multilib? (
+			>=x11-libs/libX11-1.6.2[abi_x86_32]
+			>=x11-libs/libXext-1.3.2[abi_x86_32]
+		)
+	)
+"
+
+QA_PREBUILT="opt/* usr/lib*"
+
+S=${WORKDIR}/
+
+pkg_pretend() {
+	if use amd64 && has_multilib_profile && \
+		[ "${DEFAULT_ABI}" != "amd64" ]; then
+		eerror "This ebuild doesn't currently support changing your default ABI"
+		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
+	fi
+
+	if use kernel_linux && kernel_is ge 4 7; then
+		ewarn "Gentoo supports kernels which are supported by NVIDIA"
+		ewarn "which are limited to the following kernels:"
+		ewarn "<sys-kernel/gentoo-sources-4.7"
+		ewarn "<sys-kernel/vanilla-sources-4.7"
+		ewarn ""
+		ewarn "You are free to utilize epatch_user to provide whatever"
+		ewarn "support you feel is appropriate, but will not receive"
+		ewarn "support as a result of those changes."
+		ewarn ""
+		ewarn "Do not file a bug report about this."
+		ewarn ""
+	fi
+
+	# Since Nvidia ships many different series of drivers, we need to give the user
+	# some kind of guidance as to what version they should install. This tries
+	# to point the user in the right direction but can't be perfect. check
+	# nvidia-driver.eclass
+	nvidia-driver-check-warning
+
+	# Kernel features/options to check for
+	CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
+	use x86 && CONFIG_CHECK+=" ~HIGHMEM"
+
+	# Now do the above checks
+	use kernel_linux && check_extra_config
+}
+
+pkg_setup() {
+	# try to turn off distcc and ccache for people that have a problem with it
+	export DISTCC_DISABLE=1
+	export CCACHE_DISABLE=1
+
+	if use driver && use kernel_linux; then
+		MODULE_NAMES="nvidia(video:${S}/kernel)"
+		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
+		use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel) nvidia-drm(video:${S}/kernel)"
+
+		# This needs to run after MODULE_NAMES (so that the eclass checks
+		# whether the kernel supports loadable modules) but before BUILD_PARAMS
+		# is set (so that KV_DIR is populated).
+		linux-mod_pkg_setup
+
+		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
+		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
+
+		# linux-mod_src_compile calls set_arch_to_kernel, which
+		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
+		# expects x86_64 or i386 and then converts it to x86
+		# later on in the build process
+		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
+	fi
+
+	if use kernel_linux && kernel_is lt 2 6 9; then
+		eerror "You must build this against 2.6.9 or higher kernels."
+	fi
+
+	# set variables to where files are in the package structure
+	if use kernel_FreeBSD; then
+		use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
+		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
+		NV_DOC="${S}/doc"
+		NV_OBJ="${S}/obj"
+		NV_SRC="${S}/src"
+		NV_MAN="${S}/x11/man"
+		NV_X11="${S}/obj"
+		NV_SOVER=1
+	elif use kernel_linux; then
+		NV_DOC="${S}"
+		NV_OBJ="${S}"
+		NV_SRC="${S}/kernel"
+		NV_MAN="${S}"
+		NV_X11="${S}"
+		NV_SOVER=${PV}
+	else
+		die "Could not determine proper NVIDIA package"
+	fi
+}
+
+src_prepare() {
+	epatch "${FILESDIR}"/${PN}-367.35-profiles-rc.patch
+
+	if use pax_kernel; then
+		ewarn "Using PAX patches is not supported. You will be asked to"
+		ewarn "use a standard kernel should you have issues. Should you"
+		ewarn "need support with these patches, contact the PaX team."
+		epatch "${FILESDIR}"/${PN}-364.12-pax.patch
+	fi
+
+	# Allow user patches so they can support RC kernels and whatever else
+	epatch_user
+}
+
+src_compile() {
+	# This is already the default on Linux, as there's no toplevel Makefile, but
+	# on FreeBSD there's one and triggers the kernel module build, as we install
+	# it by itself, pass this.
+
+	cd "${NV_SRC}"
+	if use kernel_FreeBSD; then
+		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
+			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
+	elif use driver && use kernel_linux; then
+		MAKEOPTS=-j1 linux-mod_src_compile
+	fi
+
+	if use tools; then
+		emake -C "${S}"/nvidia-settings-${PV}/src \
+			AR="$(tc-getAR)" \
+			CC="$(tc-getCC)" \
+			LIBDIR="$(get_libdir)" \
+			NV_VERBOSE=1 \
+			RANLIB="$(tc-getRANLIB)" \
+			DO_STRIP= \
+			build-xnvctrl
+
+		emake -C "${S}"/nvidia-settings-${PV}/src \
+			CC="$(tc-getCC)" \
+			GTK3_AVAILABLE=$(usex gtk3 1 0) \
+			LD="$(tc-getCC)" \
+			LIBDIR="$(get_libdir)" \
+			NVML_ENABLED=0 \
+			NV_USE_BUNDLED_LIBJANSSON=0 \
+			NV_VERBOSE=1 \
+			DO_STRIP=
+	fi
+}
+
+# Install nvidia library:
+# the first parameter is the library to install
+# the second parameter is the provided soversion
+# the third parameter is the target directory if it is not /usr/lib
+donvidia() {
+	# Full path to library
+	nv_LIB="${1}"
+
+	# SOVER to use
+	nv_SOVER="$(scanelf -qF'%S#F' ${nv_LIB})"
+
+	# Where to install
+	nv_DEST="${2}"
+
+	# Get just the library name
+	nv_LIBNAME=$(basename "${nv_LIB}")
+
+	if [[ "${nv_DEST}" ]]; then
+		exeinto ${nv_DEST}
+		action="doexe"
+	else
+		nv_DEST="/usr/$(get_libdir)"
+		action="dolib.so"
+	fi
+
+	# Install the library
+	${action} ${nv_LIB} || die "failed to install ${nv_LIBNAME}"
+
+	# If the library has a SONAME and SONAME does not match the library name,
+	# then we need to create a symlink
+	if [[ ${nv_SOVER} ]] && ! [[ "${nv_SOVER}" = "${nv_LIBNAME}" ]]; then
+		dosym ${nv_LIBNAME} ${nv_DEST}/${nv_SOVER} \
+			|| die "failed to create ${nv_DEST}/${nv_SOVER} symlink"
+	fi
+
+	dosym ${nv_LIBNAME} ${nv_DEST}/${nv_LIBNAME/.so*/.so} \
+		|| die "failed to create ${nv_LIBNAME/.so*/.so} symlink"
+}
+
+src_install() {
+	if use driver && use kernel_linux; then
+		linux-mod_src_install
+
+		# Add the aliases
+		# This file is tweaked with the appropriate video group in
+		# pkg_preinst, see bug #491414
+		insinto /etc/modprobe.d
+		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
+		doins "${FILESDIR}"/nvidia-rmmod.conf
+
+		# Ensures that our device nodes are created when not using X
+		exeinto "$(get_udevdir)"
+		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
+		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
+	elif use kernel_FreeBSD; then
+		if use x86-fbsd; then
+			insinto /boot/modules
+			doins "${S}/src/nvidia.kld"
+		fi
+
+		exeinto /boot/modules
+		doexe "${S}/src/nvidia.ko"
+	fi
+
+	# NVIDIA kernel <-> userspace driver config lib
+	donvidia ${NV_OBJ}/libnvidia-cfg.so.${NV_SOVER}
+
+	# NVIDIA framebuffer capture library
+	donvidia ${NV_OBJ}/libnvidia-fbc.so.${NV_SOVER}
+
+	# NVIDIA video encode/decode <-> CUDA
+	if use kernel_linux; then
+		donvidia ${NV_OBJ}/libnvcuvid.so.${NV_SOVER}
+		donvidia ${NV_OBJ}/libnvidia-encode.so.${NV_SOVER}
+	fi
+
+	if use X; then
+		# Xorg DDX driver
+		insinto /usr/$(get_libdir)/xorg/modules/drivers
+		doins ${NV_X11}/nvidia_drv.so
+
+		# Xorg GLX driver
+		donvidia ${NV_X11}/libglx.so.${NV_SOVER} \
+			/usr/$(get_libdir)/opengl/nvidia/extensions
+
+		# Xorg nvidia.conf
+		if has_version '>=x11-base/xorg-server-1.16'; then
+			insinto /usr/share/X11/xorg.conf.d
+			newins {,50-}nvidia-drm-outputclass.conf
+		fi
+	fi
+
+	# OpenCL ICD for NVIDIA
+	if use kernel_linux; then
+		insinto /etc/OpenCL/vendors
+		doins ${NV_OBJ}/nvidia.icd
+	fi
+
+	# Documentation
+	dohtml ${NV_DOC}/html/*
+	if use kernel_FreeBSD; then
+		dodoc "${NV_DOC}/README"
+		use X && doman "${NV_MAN}/nvidia-xconfig.1"
+		use tools && doman "${NV_MAN}/nvidia-settings.1"
+	else
+		# Docs
+		newdoc "${NV_DOC}/README.txt" README
+		dodoc "${NV_DOC}/NVIDIA_Changelog"
+		doman "${NV_MAN}/nvidia-smi.1.gz"
+		use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
+		use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
+		doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
+	fi
+
+	# Helper Apps
+	exeinto /opt/bin/
+
+	if use X; then
+		doexe ${NV_OBJ}/nvidia-xconfig
+	fi
+
+	if use kernel_linux; then
+		doexe ${NV_OBJ}/nvidia-cuda-mps-control
+		doexe ${NV_OBJ}/nvidia-cuda-mps-server
+		doexe ${NV_OBJ}/nvidia-debugdump
+		doexe ${NV_OBJ}/nvidia-persistenced
+		doexe ${NV_OBJ}/nvidia-smi
+
+		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
+		doexe ${NV_OBJ}/nvidia-modprobe
+		fowners root:video /opt/bin/nvidia-modprobe
+		fperms 4710 /opt/bin/nvidia-modprobe
+		dosym /{opt,usr}/bin/nvidia-modprobe
+
+		doman nvidia-cuda-mps-control.1.gz
+		doman nvidia-modprobe.1.gz
+		doman nvidia-persistenced.1.gz
+		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
+		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
+		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
+	fi
+
+	if use tools; then
+		emake -C "${S}"/nvidia-settings-${PV}/src/ \
+			DESTDIR="${D}" \
+			GTK3_AVAILABLE=$(usex gtk3 1 0) \
+			LIBDIR="${D}/usr/$(get_libdir)" \
+			NV_USE_BUNDLED_LIBJANSSON=0 \
+			NV_VERBOSE=1 \
+			PREFIX=/usr \
+			DO_STRIP= \
+			install
+
+		if use static-libs; then
+			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
+
+			insinto /usr/include/NVCtrl
+			doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
+		fi
+
+		insinto /usr/share/nvidia/
+		doins nvidia-application-profiles-${PV}-key-documentation
+
+		insinto /etc/nvidia
+		newins \
+			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
+
+		# There is no icon in the FreeBSD tarball.
+		use kernel_FreeBSD || \
+			doicon ${NV_OBJ}/nvidia-settings.png
+
+		domenu "${FILESDIR}"/nvidia-settings.desktop
+
+		exeinto /etc/X11/xinit/xinitrc.d
+		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
+
+		insinto /etc/vulkan/icd.d
+		doins nvidia_icd.json
+	fi
+
+	dobin ${NV_OBJ}/nvidia-bug-report.sh
+
+	if has_multilib_profile && use multilib; then
+		local OABI=${ABI}
+		for ABI in $(get_install_abis); do
+			src_install-libs
+		done
+		ABI=${OABI}
+		unset OABI
+	else
+		src_install-libs
+	fi
+
+	is_final_abi || die "failed to iterate through all ABIs"
+
+	readme.gentoo_create_doc
+}
+
+src_install-libs() {
+	local inslibdir=$(get_libdir)
+	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
+	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
+	local libdir=${NV_OBJ}
+
+	if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
+		libdir=${NV_OBJ}/32
+	fi
+
+	if use X; then
+		NV_GLX_LIBRARIES=(
+			"libEGL.so.1 ${GL_ROOT}"
+			"libEGL_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGL.so.$(usex compat ${NV_SOVER} 1.0.0) ${GL_ROOT}"
+			"libGLESv1_CM.so.1 ${GL_ROOT}"
+			"libGLESv1_CM_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGLESv2.so.2 ${GL_ROOT}"
+			"libGLESv2_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGLX.so.0 ${GL_ROOT}"
+			"libGLX_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGLdispatch.so.0 ${GL_ROOT}"
+			"libOpenCL.so.1.0.0 ${CL_ROOT}"
+			"libOpenGL.so.0 ${GL_ROOT}"
+			"libcuda.so.${NV_SOVER}"
+			"libnvcuvid.so.${NV_SOVER}"
+			"libnvidia-compiler.so.${NV_SOVER}"
+			"libnvidia-eglcore.so.${NV_SOVER}"
+			"libnvidia-encode.so.${NV_SOVER}"
+			"libnvidia-fatbinaryloader.so.${NV_SOVER}"
+			"libnvidia-fbc.so.${NV_SOVER}"
+			"libnvidia-glcore.so.${NV_SOVER}"
+			"libnvidia-glsi.so.${NV_SOVER}"
+			"libnvidia-ifr.so.${NV_SOVER}"
+			"libnvidia-opencl.so.${NV_SOVER}"
+			"libnvidia-ptxjitcompiler.so.${NV_SOVER}"
+			"libvdpau_nvidia.so.${NV_SOVER}"
+		)
+
+		if use wayland && has_multilib_profile && [[ ${ABI} == "amd64" ]];
+		then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-egl-wayland.so.${NV_SOVER}"
+			)
+		fi
+
+		if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
+		then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-wfb.so.${NV_SOVER}"
+			)
+		fi
+
+		if use kernel_FreeBSD; then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-tls.so.${NV_SOVER}"
+			)
+		fi
+
+		if use kernel_linux; then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-ml.so.${NV_SOVER}"
+				"tls/libnvidia-tls.so.${NV_SOVER}"
+			)
+		fi
+
+		for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
+			donvidia ${libdir}/${NV_LIB}
+		done
+	fi
+}
+
+pkg_preinst() {
+	if use driver && use kernel_linux; then
+		linux-mod_pkg_preinst
+
+		local videogroup="$(egetent group video | cut -d ':' -f 3)"
+		if [ -z "${videogroup}" ]; then
+			eerror "Failed to determine the video group gid"
+			die "Failed to determine the video group gid"
+		else
+			sed -i \
+				-e "s:PACKAGE:${PF}:g" \
+				-e "s:VIDEOGID:${videogroup}:" \
+				"${D}"/etc/modprobe.d/nvidia.conf || die
+		fi
+	fi
+
+	# Clean the dynamic libGL stuff's home to ensure
+	# we dont have stale libs floating around
+	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ]; then
+		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
+	fi
+	# Make sure we nuke the old nvidia-glx's env.d file
+	if [ -e "${ROOT}"/etc/env.d/09nvidia ]; then
+		rm -f "${ROOT}"/etc/env.d/09nvidia
+	fi
+}
+
+pkg_postinst() {
+	use driver && use kernel_linux && linux-mod_pkg_postinst
+
+	# Switch to the nvidia implementation
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
+	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
+
+	readme.gentoo_print_elog
+
+	if ! use X; then
+		elog "You have elected to not install the X.org driver. Along with"
+		elog "this the OpenGL libraries and VDPAU libraries were not"
+		elog "installed. Additionally, once the driver is loaded your card"
+		elog "and fan will run at max speed which may not be desirable."
+		elog "Use the 'nvidia-smi' init script to have your card and fan"
+		elog "speed scale appropriately."
+		elog
+	fi
+	if ! use tools; then
+		elog "USE=tools controls whether the nvidia-settings application"
+		elog "is installed. If you would like to use it, enable that"
+		elog "flag and re-emerge this ebuild. Optionally you can install"
+		elog "media-video/nvidia-settings"
+		elog
+	fi
+}
+
+pkg_prerm() {
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+	use driver && use kernel_linux && linux-mod_pkg_postrm
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: x11-drivers/nvidia-drivers/, x11-drivers/nvidia-drivers/files/
@ 2016-08-17  5:49 Jeroen Roovers
  0 siblings, 0 replies; 33+ messages in thread
From: Jeroen Roovers @ 2016-08-17  5:49 UTC (permalink / raw
  To: gentoo-commits

commit:     f4963931ab564b42b1a8b6e7324c71b024c2064c
Author:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 17 05:44:00 2016 +0000
Commit:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
CommitDate: Wed Aug 17 05:49:37 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f4963931

x11-drivers/nvidia-drivers: Version bump.

Package-Manager: portage-2.3.0

 x11-drivers/nvidia-drivers/Manifest                |   6 +
 .../files/nvidia-drivers-370.23-profiles-rc.patch  |  11 +
 .../nvidia-drivers/nvidia-drivers-370.23.ebuild    | 552 +++++++++++++++++++++
 3 files changed, 569 insertions(+)

diff --git a/x11-drivers/nvidia-drivers/Manifest b/x11-drivers/nvidia-drivers/Manifest
index 74aedda..93471ea 100644
--- a/x11-drivers/nvidia-drivers/Manifest
+++ b/x11-drivers/nvidia-drivers/Manifest
@@ -17,6 +17,7 @@ DIST NVIDIA-FreeBSD-x86-364.19.tar.gz 65807198 SHA256 5096640e9ad8a774fa76d0b64d
 DIST NVIDIA-FreeBSD-x86-367.18.tar.gz 66752524 SHA256 48f91a7f0ccc252f3812eba00facb5683b32087bf855ead9667135ba228e650d SHA512 70184e2feaa2546748e275aa8c4e69a692e542460f80636f21cfc29f63303c23e7c7d371d5fc4b15a2153ec9fff033ab1ca584e60eab930a72d146afbcf821f9 WHIRLPOOL d526280998a9a7290ff532a7b55aa1e8a76f289003283c1f2f3ca912d4397b8abeac23ec8ce957a2d0b64743514ce0a364b43203223d18ee5aaa379497f5a7fa
 DIST NVIDIA-FreeBSD-x86-367.27.tar.gz 62605521 SHA256 906038b40f46b2a5c8915b57aaeb0432eb4e60f6d156845e6e2afd49ec9d78b8 SHA512 166bd578b5536772e81f05f411e1bbdd2d9cd81f7210e96a388eff758bd1bb714fbf5dc2f3e4204e08e7555558e74901d6ad96607ee9c7b32ca4fe0b0cf373b5 WHIRLPOOL a31e9fe0e5817f1232a2dba8719110e9404f9b2feee4e0d6fe49ec50b63fd24852863670f0c36de357c9ed357738c30d1951e8fb1e6f40b5b2f8a1e2c7a8dc84
 DIST NVIDIA-FreeBSD-x86-367.35.tar.gz 62636433 SHA256 2edf78801213dea72ddd6c40acd860893623224166ad522fd47e202443cb6d50 SHA512 7b056814be81532dcf63bae13a55a3f190325c207e6e675151b01f655c861ec85804792a43b8c82a3e733394c92b336411ec4e2e70d308c70036f6625d55eb78 WHIRLPOOL a7768389f1e69b7a373e7e2a4cbcddb2f451a8b44346987ee898093c4c87c57a69744c1f7538fd41d1f81b44e02e505107f73c7584c07bce4104dc09349ece4c
+DIST NVIDIA-FreeBSD-x86-370.23.tar.gz 58560696 SHA256 d70aa4a7334e0592f359d089eb073b7731901c947dd7bc5b1346ee775330f05f SHA512 a5b208053d76b044687431d8e72bb75b7f7ccf1c041da82d910ca3fc9038c707b1bf0f8fd3f57d191c42d8caaaec46a3df5fc628f00b12f63ebfefc6042efcb6 WHIRLPOOL 33f589b8d57108e3202f22844bf7c12c6c38e631097ef4a8f81c7acc2284d983cb49d49ea81c362e642392967eea4155e986e3fe7357fa6b8c84677db25ef531
 DIST NVIDIA-FreeBSD-x86-96.43.23.tar.gz 15463464 SHA256 18d855db8381eda1a6cf548c9e5095fc5bb8694bf1d6e24fc1072fba4e54cd78 SHA512 42d7b1b76cdb3b23680363e565614a22112162a5dd3639cb804fe670c0c3f3f23595bbefa3f78afdc6a8ca848446dee853c7a355f2c96a0d01b354753ba2785c WHIRLPOOL f8e59ce521990cd9edee441e73f973f074db492952807a0931e362102874cddbb47604ff5c5eb20a0cbde27f9b6d4e440dd12cc2e5a20c9cb65bf3c0b3e62511
 DIST NVIDIA-FreeBSD-x86_64-304.131.tar.gz 35812363 SHA256 e10aa34f4aeb6981c0bc6762f37e6ad57de52b45c7322d0caef9781c1a43858a SHA512 0df69d11c79cfd66f40f5adf091f9c3ad494b89fbe9200a1a01fef8cb2d2591ffdeb703d82a263e050384d39ef81af3a717ac24716f96b1fd8386d1758bcf45b WHIRLPOOL a7e01ac4646d52229efb1d22df9b4db98bfd6bc30c79fc4c65273001b1cd09c4db823a0141a060f8c53926ae23a33fe66e27aec805879228d64bf3f45aa66bcd
 DIST NVIDIA-FreeBSD-x86_64-340.93.tar.gz 60215584 SHA256 07208f6a832c2da8748b1c4f8b5ce42a7b617f2ee1ac59155fecaff952c30988 SHA512 c480df2f36c3d6eba53af9c3070e1561ae7c56cd5d31fb531dcb6897ca02d0d205c0ce99597304ea36b7b75b173e31a9a4c07ddd143ad13884aff0a7c3479bce WHIRLPOOL c1b28898ffe733961bdb622e8b430715c74871cfaab0348a9e5990df5a92676e8fb8c199ea1f1a06fa6c6ded65877b987b802a7a9ea0b7023cbaa62fb52eda01
@@ -36,8 +37,10 @@ DIST NVIDIA-FreeBSD-x86_64-364.19.tar.gz 62553892 SHA256 3b691c259b2a85da49d16ce
 DIST NVIDIA-FreeBSD-x86_64-367.18.tar.gz 63499863 SHA256 be862c654e290b32d78275d05fe38843b969e50f14d5e089ae800dab2a08b558 SHA512 565b606e006ce9263bb578501032aa19f3b55c76d4119f4ab5c6a6a6c0b872b8d7398dfa8d7ecc74609b9cea965e762eeffb9fa951aeb712632b0056c5fa637d WHIRLPOOL 60252d5d6b382108d6c0a52f404365f8d456fa2cc64dd4bfc008f1da74efff7905634141cf0f5a9b4c3513be414d8f20e310b7662057a3fa91ad128e0d3984c5
 DIST NVIDIA-FreeBSD-x86_64-367.27.tar.gz 59357230 SHA256 dea9bf156229b9353e033fa3cf02685c14e539d959d7c2759f233ad1f707f2d2 SHA512 3eb129723317d277c0788b966709369c382035e287e4e14000fae09b98bc12359e5218205a86abcb08894978343f3185986d643df3ceeb81b35ba475bb16b99f WHIRLPOOL a33ae3d01d953b090e169e651ff9cc478d91ea21753cbd4c806dc08898edbd078d191d91ae1f7d46dea8ba931bc63f722bb88e728e31cf98a7681c1d806bd1a5
 DIST NVIDIA-FreeBSD-x86_64-367.35.tar.gz 59393955 SHA256 b33057ce23ce1ae44ddd246a7d2d9e2b0aa2ed5a289d8a83e849249de81a1035 SHA512 724735dbe9a79edd50405b8ccd76bfca35d706b61f489fb57c6b7b71d070148ea97603abb96deab68df1c56e2a48e301eee75fc0de99b15b56d112660ef3bf14 WHIRLPOOL 690220131b40c8e84184c8fc0a5c4f511b44c84863f73b7610451ad9dbc6f563ce8b3b86b38b0f5b2311a2721288d788044c3477a4d76563effad1ed706cfa06
+DIST NVIDIA-FreeBSD-x86_64-370.23.tar.gz 57734638 SHA256 e661ca8442580cef98520d8247b5b74e6ecf5de34e8b903258b078ae401049c0 SHA512 ebcf65a03e31b573f29cd4697683d8cbfaacdada8e56058e9bf26be00e8476af48fb8b2a395b735294ca7b041100524a2f22c07ec6d1aefee75f0298dbbc8e11 WHIRLPOOL 6d4df4c4295daada5e8f9459cc81826c28a087190db7cb189a8d694cbc956fd020a0013166897d220265afcd6d47dd7bd00732596f722d862429a107afd6825c
 DIST NVIDIA-Linux-armv7l-gnueabihf-367.27.run 25585174 SHA256 ae0855b247d5a5474561c76a79536fe82c44bd10e6154792978c5572d11c47f9 SHA512 dd60292f262e1d7d6cca09a35c3f8b65820d216d46f2b94feb208554496b30a983a73ffb8b2a1473cef0b7e08a3cda901eeca855e1db77f4f6dd23779772580b WHIRLPOOL c55d4102a6717f81d8bde7e66d1772c7b1f370d4d610ef61561c94f5ea6cc4797b5f15b9cbc31216b2ef9ef9132a66682b280d9ef5b74c4a57ee2ee8da6c1122
 DIST NVIDIA-Linux-armv7l-gnueabihf-367.35.run 25628654 SHA256 6087bd2cc594f860d27d26e30acd3593310ce00938c10e5729175f037efa222e SHA512 3157c3dc9d07dd0eb8aaa0bf21edf62aa1338f10c1431981494d2a7b1f0be8a1eee8b5bc41914cfca9b4c76773b0056e7ad5c80a4c7acadfadb52a7647baabbe WHIRLPOOL 49c8896d1a40e1f634224227100b303c3d2ebc66ee93f31aa18bc39c898585eba49400d148f47476e4253d35d7379047dbcf7f43cf027df0b16179bfc8912db0
+DIST NVIDIA-Linux-armv7l-gnueabihf-370.23.run 26484565 SHA256 9fc44fc0a109606349a88b6f312adf92767c0ea8f6e83f9cfa49ccbb0068edae SHA512 12f0d46a6eb52755b05cef06f71d557ef40e9b9df3765faef09116f6161cf52a3c5cd82f72009761fdf7f9a3b03c4bec93e8f5bb003783cb427901e39dd61bff WHIRLPOOL b10b932bfc955d418bdc39cba36dc68a177f9899cc4562942808b48482240d5fb00ce10e755f4436ff9981e92fedf9c80300cb95c9571265e84fedff79d6ab3d
 DIST NVIDIA-Linux-x86-173.14.39-pkg0.run 15134997 SHA256 a09935f37121ed3db8ae3da63a0d8e9d4348a19c859811c9fe44d6ce8e3eab23 SHA512 e24e15ccec725d3cbca502c2b77061776a81ef92917a950adec4ff6bdc34f10903aa654433177ea74be0dade4af81c5380d5710d375a5ea445940d06154bde93 WHIRLPOOL fce3d8e4f6cdf698f5a057514b6fe220bb1011025bdce5bd4cf0e424fb4d306d38251b6726bda03f290ea8137d5a95ed418cf8751722879f9042462abd9181b6
 DIST NVIDIA-Linux-x86-304.131.run 40893199 SHA256 d2554bb6f7867e7762d0ecedcac5bde7de0634e43b952bf466323ea8b4032da8 SHA512 3e67c40648554dc49472081eee88ae982c3b235b3346e4d9e7fb5ae33ec5f10ed088da804ac7d8bd1565995df3861f12b3560030cd3a19339a2d35768b0a943e WHIRLPOOL 88e9cc0270a4fc64ed8475a217c7c8c50e6ea21fe14b5b5beb16f494bd62bf5ada2f47e26e5380dd3d0bc678091e29f0e26937eef1ee3c7bdc5805153201bae3
 DIST NVIDIA-Linux-x86-340.93.run 38703394 SHA256 4a81c158302c595e1e72b5a1812eb3c67c8cf584ca74b1bc24163dad5289d612 SHA512 7507553bd4b11cac2cd882cd8afba59e773f58a26e67ee7e781c488be963a4f1eb54dcd72b40b29d33dd81c74d4748a76c1632b2c8ea08b524b4318c18b5dfe5 WHIRLPOOL 242190999da74f2fe4bfe4b223f43dec6ec73d97afd1e84e2c78c5fd5616d9814b647067ddf3f591ea8064d29234491de1c6f87b442e240d2aac4a1e598aefad
@@ -58,6 +61,7 @@ DIST NVIDIA-Linux-x86-364.19.run 50074922 SHA256 9f891d4b22c43c9094b59af5c8474e2
 DIST NVIDIA-Linux-x86-367.18.run 50290002 SHA256 9a5184308a981b1b36dde4466006b7b45ff4c2a2f364374b3835112899a55dbd SHA512 5124a68f757b2c511d1e44eaec7b7368df7c5808d4a1575d58f87ec70bff22ad5ef3d9fb936ec0673a34d58a8fb936c9564e18c04f5e766edaadb7012e2b687f WHIRLPOOL 35298c16b29907c9d13e05671e71befa066aaed805778b5268672c8506ce0293b4c78e941b90050ac1b4f9e4716fa57c7d1fcd7c18233a3c91538654d50651e5
 DIST NVIDIA-Linux-x86-367.27.run 44740794 SHA256 faa7c0f73c04a6d343a3952d264ec56fdf816cc6bf2a1c1bb95726401e99654b SHA512 54302f0de936a859561b756989ff84f73afe41dfb89ed680ee3df3c46b0de9d57eaf2d07876dea0eb1154fbc1a716d4d3e693cb7eaa7ab325b4bbee569ddb709 WHIRLPOOL b46005fa221f0e9b466168530ff08271c63d72a29ef1dea2831215aebd7b4f8dc2947d1f56f1fe490e4d809ed337f7f9116f0263f187dbb7f3d347378367a552
 DIST NVIDIA-Linux-x86-367.35.run 44717708 SHA256 38cb22fa85ef74ea960d3e5d644838cd961984ffc32bb0d052414cc7fa32e315 SHA512 3151995153a3c3857e291df933dbaeaad779544a39a9482980ccb89531ca924d71e6bf0e44767755c484c4b693cfaf01f55e61e3d82cef79f73c0b1964411f39 WHIRLPOOL ff85a42f339c59ceeaef0dc2c6ebc2a52c516fb09f05d16ad91e7c6f7d3368b8af717a2a716a1d606927a2bba689d755ce64b0d1e256ab809040c662cbb2f1da
+DIST NVIDIA-Linux-x86-370.23.run 42185790 SHA256 7a275413a3709ef11649ed65d07bae92368c0a1b754fec5c9f9769e516a19263 SHA512 af944f570736e5c7445b9e4dbdff9cd0566054fdb16140010a986bfe2c30374c26c1487deeb931a78c21de9fd0622627f2f98ceee46d3767432b967bd46542d0 WHIRLPOOL fc77357b6e5d38162138de1d089a64588801c02b1794a923a5bc9001464028a5998054c6f3beef2c36188eb1f4467822b0e9d37e9f813210790a049403ccf2ee
 DIST NVIDIA-Linux-x86-96.43.23-pkg0.run 11504817 SHA256 51e6adf4ba73071622045fc37169f80db3ae3e784dff53b29d35146a04042142 SHA512 bed5726e57637481fe4e3c03a65ec14fe949f00860e729ebde408f4fd861d7bfdc296a78bc2f5d42e8b282db09f4bbde1e0545df7228fa20227080dc4b868ba7 WHIRLPOOL 6d4fd1786c11f4e326cc3101d0bb1a2f8b63c25c3dd59f10188f8355759e2861ce44fd53d60258b513d5a1d6124d0f91ba8edf4d3668b6feabfb3e8d585f14fe
 DIST NVIDIA-Linux-x86_64-173.14.39-pkg2.run 21100833 SHA256 15a953666d5681ba54c97498b578ffd286a1dc96d605f3b02110f3f99813100e SHA512 a65cd496e6ed57f771c3d99f37f616a1242d97844f6faef7a807825ad899c0e536a99fde397020839f0857883b934032f9491024f3047a6b06d3eea1f5d77713 WHIRLPOOL dc5f243b7d1de7e2d1b7f005e018a2940d63335b11a7c83c234b348b7a1839e9131169d2ea928bd8c2f549a4535149b03e16e6c94d59dfa745f7f904ff790a45
 DIST NVIDIA-Linux-x86_64-304.131.run 69415084 SHA256 74b7ec1c31dac03ee7c3e04612cadb9cbaa01ef4c796c27a0a649f7d32dccd0b SHA512 ddfa1f23600821dcae17ddb735b615d67504c4e276d9b41813e0f8d7690fbdf48f79644ee4c9e5449ce22a31460734cf325fc83975e0b48a0379a85cd4ef747d WHIRLPOOL fc08c2337a1b80b0444dbc914f7d17441995e4965c435028194050df9f5ec1606cdfb5bf11e56f79a736e04cf0755b296017fe79629c5ded18a72093b8689bce
@@ -79,6 +83,7 @@ DIST NVIDIA-Linux-x86_64-364.19.run 87961023 SHA256 7b8680a815ac74d5b3a7e3d38113
 DIST NVIDIA-Linux-x86_64-367.18.run 88160263 SHA256 20d0e682ac2be862e574d3de5b3942c499e35c4608e13e85f7106e3d97948e47 SHA512 a2f1cfcfa20222a60a5f8f21b150cb46c938d9a5b2a6ff6f5955064b27749dad4243fe8a147e6892097fa8dabe17e8d9ef1ea37e9170d8feff88118af90460a0 WHIRLPOOL dba8653a0efa830d99a3f830d1db660a0f86c961ebb30a79dfb4b976bda910f16bd260ea08a2d5200127b7b142bdf5503ca2ff6159d708ac8eaa7a37c3c90471
 DIST NVIDIA-Linux-x86_64-367.27.run 76945324 SHA256 7b84583f8ed90b2b97ed4f9bbafac2b054da285fb94b37cfaadc5741cb442571 SHA512 d1aac4eb2e805054463cb974e4a4acf96a0404bf75de37188ccd0bd5a88916d003941b70f695216dee543b12779a38787c9675bbe03803ae15d6a48d1013ee28 WHIRLPOOL 8b71552e91eb37f1a3f6c0a11987471ef366fa97b4c580535ed35c8b650d3cb58ada09c5d1b4cdf803c5bdc3720df2f69c9e44153088861f2c78b55836559b7d
 DIST NVIDIA-Linux-x86_64-367.35.run 75600336 SHA256 d2df3fcb1a145984b9de4f2f38a90e353469e9d12279cf5e2c67c553b112d075 SHA512 18e2b1f342d1fc73c68f3c3ce526ab744fd7dd664cfd857849d497baf94eb057482d88444a792b64d3cd71ac624b9cbaae39b7f1884ca0370521cac0e5650d1b WHIRLPOOL 93612de22e0298383dfb16bf0f8893b55359a634c331b981fafebb1cd1a1dcfa602e1b35d2ff4a128b60753146bc494852410352be9309e531c78f62f708d8c3
+DIST NVIDIA-Linux-x86_64-370.23.run 74533367 SHA256 b5b3c4016a0ee595965066db293c6c9d30e6d64b9f54dd7cd2c9d9eeaf6df581 SHA512 6792281fd8c74dca00cd340f28e052ff164a0137ea78101a574082fc407a425cdfc532d14f823b27506fd1da28af78a9ce83602ac57a3df0d3056875749d029d WHIRLPOOL 7c22044a6c5228d12797c498690b648e788e1975afa83a99ed1dccd150c67a6af4fb7e2a048031e345c4e188d5dabba528aeaa547291581c86a09d0737b08ae7
 DIST NVIDIA-Linux-x86_64-96.43.23-pkg2.run 15962375 SHA256 ce8d8253e7dab7da63fbdac449ebf190cd0c10cbfffea0f8d0165515f851bc64 SHA512 04bec1187a6024a2b9839f008ec829281f1f2602dae2e639030bc385943186506bcaa2b46a230b2ab87f9217190841abc62f9e2d6395ab5559623389c31c6563 WHIRLPOOL 0651c44a51a1a06fcff5bfddbf9c3e408977e03263c7fe806cb6c01f9fe92f716dfe4e5190ffe1048bde72fcffdc8bca8267e74dd43ba5c9dfb22b6201fcc2bb
 DIST nvidia-settings-304.131.tar.bz2 1480447 SHA256 d36d2d1ae7c1bb72cd18e713470546d2aa7057624b1f61319daf559a94054d29 SHA512 9269f54f87581e29e6d7cabeaf989c70cb27aa55f6b8f5f1c71b8a14401326d06ea194710722b41283cca56f5808b90a9b1fb12158d48c6332cce15a701c5796 WHIRLPOOL be8e38a09a0bfa40267b9cdae2800a9ef00a89e28e618b743b7acb0cd9ece4b242b74ced32018d735989592300b49b2ee683caa11a1e161bcecf070a58952dfd
 DIST nvidia-settings-340.96.tar.bz2 1551011 SHA256 af7303b070a4b41e388a7be6dfae17f020a5cc197170d4815b9a291a3a98aaff SHA512 fc6096338e48c347e4e854d06e8f63d8edb6527953996e63f3f70619be59d0436176547b5197ef30d18a82cf5b58dd775dcca4a2624107b63cce1ae589f2b154 WHIRLPOOL e7266ca0395aa1a5666a43bf6e54e258706d4e76bfd15079485e2379b332d2d6ba0c97b32e49f5b041340bb2d3c0e11dace702754ffc952c149557e0ab9d820a
@@ -95,3 +100,4 @@ DIST nvidia-settings-364.19.tar.bz2 1573005 SHA256 fe8e9cc4d0ade9caaf51109e7e528
 DIST nvidia-settings-367.18.tar.bz2 1572077 SHA256 035a45b3deca126596c1ac6088e13a72be62cc60d5b56f71978bb45ae67b6c14 SHA512 582158e12988b1588bcae0f116dbe814f96ebdd25b058be1222e5cecea894bed1b844ec2c4173fdd37a193543fc9f2f29dd7778c0c02ec5eb72d2672c5d774ca WHIRLPOOL ae49db45def98bb062788ec7a5ef0c21f0bc87ca6e7cd61ebeb0ededc0eb28ae83fc5dea2f6a6c90cac395c46c010251f010ff09655155eae0fcd12e1e18c4c9
 DIST nvidia-settings-367.27.tar.bz2 1572210 SHA256 d141d56a2e9b88686a391f97636df4834b5dda132726edf69f329bcfd9db5a4d SHA512 94a29cfff1b56b282be6802deb9d6b1b81a41f254464bf0ece567e6d7d708574ca111df32d82e4af68ac2b6bdfda387bb6113c60834fb084bf15582bff6a2273 WHIRLPOOL 4bd192d2cc316f1bae3af40ec8ae03c679aa128f0d3aaedb4a3dd1240503e6ea56d20248b7f6ec7d82e1ec972719cb9983cbc1af60263159ae9d42ed7b3f971f
 DIST nvidia-settings-367.35.tar.bz2 1572606 SHA256 6b0cf0b63bbf8c3d29538587bad8b639b42f8c9bac754bf5ca629df2054a0239 SHA512 9acba704118a8523ec92d26eb998a33755d334a8c5bbd72954ce9b9afbe2cfa63a5b572199e507bf8142dcda8f02a85517115bf07386e15fafe1915ace736770 WHIRLPOOL 644e950c22f686c00e59acc499f3c7af1578cdd45ddc8e4fe53b64abb8c703062e6f2a2548cf636359d52b294ef7e31589f06b7d3e71043d10554f4226169e17
+DIST nvidia-settings-370.23.tar.bz2 1573513 SHA256 bf27b9f6239515035586b151929fc3d84def68e9171b860f9fbf205e2525d457 SHA512 6fde281d141bd2c6e9802924d3451f7e6d1d6117b6df4282f1ea3420e7c05924da68f78340dce5b03226623a54285715027f8852acdd7fb32ddadfc9142aaca0 WHIRLPOOL 287f3866f757603d67eeb970b766ca83a5bf8aebfb13b2d84cefbeffe84f2ed622bd240896964a67fb72454c7a0db369bccea49b36cc93d9b3eddc4ce4637e62

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-370.23-profiles-rc.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-370.23-profiles-rc.patch
new file mode 100644
index 0000000..244b55d
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-370.23-profiles-rc.patch
@@ -0,0 +1,11 @@
+--- a/nvidia-application-profiles-370.23-rc
++++ b/nvidia-application-profiles-370.23-rc
+@@ -44,7 +44,7 @@
+         {
+           "name" : "NamedVertexAttributesApplyDivisor",
+           "settings" : [ "GL23cd0e", 1 ]
+-        },
++        }
+     ],
+     "rules" : [
+         {

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-370.23.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-370.23.ebuild
new file mode 100644
index 0000000..e4646ef
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-370.23.ebuild
@@ -0,0 +1,552 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \
+	portability toolchain-funcs unpacker user udev
+
+NV_URI="http://us.download.nvidia.com/XFree86/"
+X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
+AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
+ARM_NV_PACKAGE="NVIDIA-Linux-armv7l-gnueabihf-${PV}"
+X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
+AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
+
+DESCRIPTION="NVIDIA Accelerated Graphics Driver"
+HOMEPAGE="http://www.nvidia.com/ http://www.nvidia.com/Download/Find.aspx"
+SRC_URI="
+	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
+	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
+	arm? ( ${NV_URI}Linux-x86-ARM/${PV}/${ARM_NV_PACKAGE}.run )
+	x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
+	x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
+	tools? ( ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2 )
+"
+
+LICENSE="GPL-2 NVIDIA-r2"
+SLOT="0/${PV%.*}"
+KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
+RESTRICT="bindist mirror"
+EMULTILIB_PKG="true"
+
+IUSE="acpi compat +driver gtk3 kernel_FreeBSD kernel_linux +kms multilib pax_kernel static-libs +tools uvm wayland +X"
+REQUIRED_USE="
+	tools? ( X )
+	static-libs? ( tools )
+"
+
+COMMON="
+	app-eselect/eselect-opencl
+	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
+	tools? (
+		dev-libs/atk
+		dev-libs/glib:2
+		dev-libs/jansson
+		gtk3? ( x11-libs/gtk+:3 )
+		x11-libs/cairo
+		x11-libs/gdk-pixbuf[X]
+		x11-libs/gtk+:2
+		x11-libs/libX11
+		x11-libs/libXext
+		x11-libs/libXrandr
+		x11-libs/libXv
+		x11-libs/libXxf86vm
+		x11-libs/pango[X]
+	)
+	X? (
+		>=app-eselect/eselect-opengl-1.0.9
+		app-misc/pax-utils
+	)
+"
+DEPEND="
+	${COMMON}
+	kernel_linux? ( virtual/linux-sources )
+"
+RDEPEND="
+	${COMMON}
+	acpi? ( sys-power/acpid )
+	tools? ( !media-video/nvidia-settings )
+	wayland? ( dev-libs/wayland )
+	X? (
+		<x11-base/xorg-server-1.18.99:=
+		>=x11-libs/libvdpau-1.0
+		multilib? (
+			>=x11-libs/libX11-1.6.2[abi_x86_32]
+			>=x11-libs/libXext-1.3.2[abi_x86_32]
+		)
+	)
+"
+
+QA_PREBUILT="opt/* usr/lib*"
+
+S=${WORKDIR}/
+
+pkg_pretend() {
+	if use amd64 && has_multilib_profile && \
+		[ "${DEFAULT_ABI}" != "amd64" ]; then
+		eerror "This ebuild doesn't currently support changing your default ABI"
+		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
+	fi
+
+	if use kernel_linux && kernel_is ge 4 7; then
+		ewarn "Gentoo supports kernels which are supported by NVIDIA"
+		ewarn "which are limited to the following kernels:"
+		ewarn "<sys-kernel/gentoo-sources-4.7"
+		ewarn "<sys-kernel/vanilla-sources-4.7"
+		ewarn ""
+		ewarn "You are free to utilize epatch_user to provide whatever"
+		ewarn "support you feel is appropriate, but will not receive"
+		ewarn "support as a result of those changes."
+		ewarn ""
+		ewarn "Do not file a bug report about this."
+		ewarn ""
+	fi
+
+	# Since Nvidia ships many different series of drivers, we need to give the user
+	# some kind of guidance as to what version they should install. This tries
+	# to point the user in the right direction but can't be perfect. check
+	# nvidia-driver.eclass
+	nvidia-driver-check-warning
+
+	# Kernel features/options to check for
+	CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
+	use x86 && CONFIG_CHECK+=" ~HIGHMEM"
+
+	# Now do the above checks
+	use kernel_linux && check_extra_config
+}
+
+pkg_setup() {
+	# try to turn off distcc and ccache for people that have a problem with it
+	export DISTCC_DISABLE=1
+	export CCACHE_DISABLE=1
+
+	if use driver && use kernel_linux; then
+		MODULE_NAMES="nvidia(video:${S}/kernel)"
+		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
+		use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel) nvidia-drm(video:${S}/kernel)"
+
+		# This needs to run after MODULE_NAMES (so that the eclass checks
+		# whether the kernel supports loadable modules) but before BUILD_PARAMS
+		# is set (so that KV_DIR is populated).
+		linux-mod_pkg_setup
+
+		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
+		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
+
+		# linux-mod_src_compile calls set_arch_to_kernel, which
+		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
+		# expects x86_64 or i386 and then converts it to x86
+		# later on in the build process
+		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
+	fi
+
+	if use kernel_linux && kernel_is lt 2 6 9; then
+		eerror "You must build this against 2.6.9 or higher kernels."
+	fi
+
+	# set variables to where files are in the package structure
+	if use kernel_FreeBSD; then
+		use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
+		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
+		NV_DOC="${S}/doc"
+		NV_OBJ="${S}/obj"
+		NV_SRC="${S}/src"
+		NV_MAN="${S}/x11/man"
+		NV_X11="${S}/obj"
+		NV_SOVER=1
+	elif use kernel_linux; then
+		NV_DOC="${S}"
+		NV_OBJ="${S}"
+		NV_SRC="${S}/kernel"
+		NV_MAN="${S}"
+		NV_X11="${S}"
+		NV_SOVER=${PV}
+	else
+		die "Could not determine proper NVIDIA package"
+	fi
+}
+
+src_prepare() {
+	epatch "${FILESDIR}"/${PN}-370.23-profiles-rc.patch
+
+	if use pax_kernel; then
+		ewarn "Using PAX patches is not supported. You will be asked to"
+		ewarn "use a standard kernel should you have issues. Should you"
+		ewarn "need support with these patches, contact the PaX team."
+		epatch "${FILESDIR}"/${PN}-364.12-pax.patch
+	fi
+
+	# Allow user patches so they can support RC kernels and whatever else
+	epatch_user
+}
+
+src_compile() {
+	# This is already the default on Linux, as there's no toplevel Makefile, but
+	# on FreeBSD there's one and triggers the kernel module build, as we install
+	# it by itself, pass this.
+
+	cd "${NV_SRC}"
+	if use kernel_FreeBSD; then
+		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
+			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
+	elif use driver && use kernel_linux; then
+		MAKEOPTS=-j1 linux-mod_src_compile
+	fi
+
+	if use tools; then
+		emake -C "${S}"/nvidia-settings-${PV}/src \
+			AR="$(tc-getAR)" \
+			CC="$(tc-getCC)" \
+			LIBDIR="$(get_libdir)" \
+			NV_VERBOSE=1 \
+			RANLIB="$(tc-getRANLIB)" \
+			DO_STRIP= \
+			build-xnvctrl
+
+		emake -C "${S}"/nvidia-settings-${PV}/src \
+			CC="$(tc-getCC)" \
+			GTK3_AVAILABLE=$(usex gtk3 1 0) \
+			LD="$(tc-getCC)" \
+			LIBDIR="$(get_libdir)" \
+			NVML_ENABLED=0 \
+			NV_USE_BUNDLED_LIBJANSSON=0 \
+			NV_VERBOSE=1 \
+			DO_STRIP=
+	fi
+}
+
+# Install nvidia library:
+# the first parameter is the library to install
+# the second parameter is the provided soversion
+# the third parameter is the target directory if it is not /usr/lib
+donvidia() {
+	# Full path to library
+	nv_LIB="${1}"
+
+	# SOVER to use
+	nv_SOVER="$(scanelf -qF'%S#F' ${nv_LIB})"
+
+	# Where to install
+	nv_DEST="${2}"
+
+	# Get just the library name
+	nv_LIBNAME=$(basename "${nv_LIB}")
+
+	if [[ "${nv_DEST}" ]]; then
+		exeinto ${nv_DEST}
+		action="doexe"
+	else
+		nv_DEST="/usr/$(get_libdir)"
+		action="dolib.so"
+	fi
+
+	# Install the library
+	${action} ${nv_LIB} || die "failed to install ${nv_LIBNAME}"
+
+	# If the library has a SONAME and SONAME does not match the library name,
+	# then we need to create a symlink
+	if [[ ${nv_SOVER} ]] && ! [[ "${nv_SOVER}" = "${nv_LIBNAME}" ]]; then
+		dosym ${nv_LIBNAME} ${nv_DEST}/${nv_SOVER} \
+			|| die "failed to create ${nv_DEST}/${nv_SOVER} symlink"
+	fi
+
+	dosym ${nv_LIBNAME} ${nv_DEST}/${nv_LIBNAME/.so*/.so} \
+		|| die "failed to create ${nv_LIBNAME/.so*/.so} symlink"
+}
+
+src_install() {
+	if use driver && use kernel_linux; then
+		linux-mod_src_install
+
+		# Add the aliases
+		# This file is tweaked with the appropriate video group in
+		# pkg_preinst, see bug #491414
+		insinto /etc/modprobe.d
+		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
+		doins "${FILESDIR}"/nvidia-rmmod.conf
+
+		# Ensures that our device nodes are created when not using X
+		exeinto "$(get_udevdir)"
+		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
+		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
+	elif use kernel_FreeBSD; then
+		if use x86-fbsd; then
+			insinto /boot/modules
+			doins "${S}/src/nvidia.kld"
+		fi
+
+		exeinto /boot/modules
+		doexe "${S}/src/nvidia.ko"
+	fi
+
+	# NVIDIA kernel <-> userspace driver config lib
+	donvidia ${NV_OBJ}/libnvidia-cfg.so.${NV_SOVER}
+
+	# NVIDIA framebuffer capture library
+	donvidia ${NV_OBJ}/libnvidia-fbc.so.${NV_SOVER}
+
+	# NVIDIA video encode/decode <-> CUDA
+	if use kernel_linux; then
+		donvidia ${NV_OBJ}/libnvcuvid.so.${NV_SOVER}
+		donvidia ${NV_OBJ}/libnvidia-encode.so.${NV_SOVER}
+	fi
+
+	if use X; then
+		# Xorg DDX driver
+		insinto /usr/$(get_libdir)/xorg/modules/drivers
+		doins ${NV_X11}/nvidia_drv.so
+
+		# Xorg GLX driver
+		donvidia ${NV_X11}/libglx.so.${NV_SOVER} \
+			/usr/$(get_libdir)/opengl/nvidia/extensions
+
+		# Xorg nvidia.conf
+		if has_version '>=x11-base/xorg-server-1.16'; then
+			insinto /usr/share/X11/xorg.conf.d
+			newins {,50-}nvidia-drm-outputclass.conf
+		fi
+	fi
+
+	# OpenCL ICD for NVIDIA
+	if use kernel_linux; then
+		insinto /etc/OpenCL/vendors
+		doins ${NV_OBJ}/nvidia.icd
+	fi
+
+	# Documentation
+	dohtml ${NV_DOC}/html/*
+	if use kernel_FreeBSD; then
+		dodoc "${NV_DOC}/README"
+		use X && doman "${NV_MAN}/nvidia-xconfig.1"
+		use tools && doman "${NV_MAN}/nvidia-settings.1"
+	else
+		# Docs
+		newdoc "${NV_DOC}/README.txt" README
+		dodoc "${NV_DOC}/NVIDIA_Changelog"
+		doman "${NV_MAN}/nvidia-smi.1.gz"
+		use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
+		use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
+		doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
+	fi
+
+	# Helper Apps
+	exeinto /opt/bin/
+
+	if use X; then
+		doexe ${NV_OBJ}/nvidia-xconfig
+	fi
+
+	if use kernel_linux; then
+		doexe ${NV_OBJ}/nvidia-cuda-mps-control
+		doexe ${NV_OBJ}/nvidia-cuda-mps-server
+		doexe ${NV_OBJ}/nvidia-debugdump
+		doexe ${NV_OBJ}/nvidia-persistenced
+		doexe ${NV_OBJ}/nvidia-smi
+
+		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
+		doexe ${NV_OBJ}/nvidia-modprobe
+		fowners root:video /opt/bin/nvidia-modprobe
+		fperms 4710 /opt/bin/nvidia-modprobe
+		dosym /{opt,usr}/bin/nvidia-modprobe
+
+		doman nvidia-cuda-mps-control.1.gz
+		doman nvidia-modprobe.1.gz
+		doman nvidia-persistenced.1.gz
+		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
+		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
+		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
+	fi
+
+	if use tools; then
+		emake -C "${S}"/nvidia-settings-${PV}/src/ \
+			DESTDIR="${D}" \
+			GTK3_AVAILABLE=$(usex gtk3 1 0) \
+			LIBDIR="${D}/usr/$(get_libdir)" \
+			NV_USE_BUNDLED_LIBJANSSON=0 \
+			NV_VERBOSE=1 \
+			PREFIX=/usr \
+			DO_STRIP= \
+			install
+
+		if use static-libs; then
+			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
+
+			insinto /usr/include/NVCtrl
+			doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
+		fi
+
+		insinto /usr/share/nvidia/
+		doins nvidia-application-profiles-${PV}-key-documentation
+
+		insinto /etc/nvidia
+		newins \
+			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
+
+		# There is no icon in the FreeBSD tarball.
+		use kernel_FreeBSD || \
+			doicon ${NV_OBJ}/nvidia-settings.png
+
+		domenu "${FILESDIR}"/nvidia-settings.desktop
+
+		exeinto /etc/X11/xinit/xinitrc.d
+		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
+
+		insinto /etc/vulkan/icd.d
+		doins nvidia_icd.json
+	fi
+
+	dobin ${NV_OBJ}/nvidia-bug-report.sh
+
+	if has_multilib_profile && use multilib; then
+		local OABI=${ABI}
+		for ABI in $(get_install_abis); do
+			src_install-libs
+		done
+		ABI=${OABI}
+		unset OABI
+	else
+		src_install-libs
+	fi
+
+	is_final_abi || die "failed to iterate through all ABIs"
+
+	readme.gentoo_create_doc
+}
+
+src_install-libs() {
+	local inslibdir=$(get_libdir)
+	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
+	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
+	local libdir=${NV_OBJ}
+
+	if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
+		libdir=${NV_OBJ}/32
+	fi
+
+	if use X; then
+		NV_GLX_LIBRARIES=(
+			"libEGL.so.1 ${GL_ROOT}"
+			"libEGL_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGL.so.$(usex compat ${NV_SOVER} 1.0.0) ${GL_ROOT}"
+			"libGLESv1_CM.so.1 ${GL_ROOT}"
+			"libGLESv1_CM_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGLESv2.so.2 ${GL_ROOT}"
+			"libGLESv2_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGLX.so.0 ${GL_ROOT}"
+			"libGLX_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGLdispatch.so.0 ${GL_ROOT}"
+			"libOpenCL.so.1.0.0 ${CL_ROOT}"
+			"libOpenGL.so.0 ${GL_ROOT}"
+			"libcuda.so.${NV_SOVER}"
+			"libnvcuvid.so.${NV_SOVER}"
+			"libnvidia-compiler.so.${NV_SOVER}"
+			"libnvidia-eglcore.so.${NV_SOVER}"
+			"libnvidia-encode.so.${NV_SOVER}"
+			"libnvidia-fatbinaryloader.so.${NV_SOVER}"
+			"libnvidia-fbc.so.${NV_SOVER}"
+			"libnvidia-glcore.so.${NV_SOVER}"
+			"libnvidia-glsi.so.${NV_SOVER}"
+			"libnvidia-ifr.so.${NV_SOVER}"
+			"libnvidia-opencl.so.${NV_SOVER}"
+			"libnvidia-ptxjitcompiler.so.${NV_SOVER}"
+			"libvdpau_nvidia.so.${NV_SOVER}"
+		)
+
+		if use wayland && has_multilib_profile && [[ ${ABI} == "amd64" ]];
+		then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-egl-wayland.so.${NV_SOVER}"
+			)
+		fi
+
+		if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
+		then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-wfb.so.${NV_SOVER}"
+			)
+		fi
+
+		if use kernel_FreeBSD; then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-tls.so.${NV_SOVER}"
+			)
+		fi
+
+		if use kernel_linux; then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-ml.so.${NV_SOVER}"
+				"tls/libnvidia-tls.so.${NV_SOVER}"
+			)
+		fi
+
+		for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
+			donvidia ${libdir}/${NV_LIB}
+		done
+	fi
+}
+
+pkg_preinst() {
+	if use driver && use kernel_linux; then
+		linux-mod_pkg_preinst
+
+		local videogroup="$(egetent group video | cut -d ':' -f 3)"
+		if [ -z "${videogroup}" ]; then
+			eerror "Failed to determine the video group gid"
+			die "Failed to determine the video group gid"
+		else
+			sed -i \
+				-e "s:PACKAGE:${PF}:g" \
+				-e "s:VIDEOGID:${videogroup}:" \
+				"${D}"/etc/modprobe.d/nvidia.conf || die
+		fi
+	fi
+
+	# Clean the dynamic libGL stuff's home to ensure
+	# we dont have stale libs floating around
+	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ]; then
+		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
+	fi
+	# Make sure we nuke the old nvidia-glx's env.d file
+	if [ -e "${ROOT}"/etc/env.d/09nvidia ]; then
+		rm -f "${ROOT}"/etc/env.d/09nvidia
+	fi
+}
+
+pkg_postinst() {
+	use driver && use kernel_linux && linux-mod_pkg_postinst
+
+	# Switch to the nvidia implementation
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
+	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
+
+	readme.gentoo_print_elog
+
+	if ! use X; then
+		elog "You have elected to not install the X.org driver. Along with"
+		elog "this the OpenGL libraries and VDPAU libraries were not"
+		elog "installed. Additionally, once the driver is loaded your card"
+		elog "and fan will run at max speed which may not be desirable."
+		elog "Use the 'nvidia-smi' init script to have your card and fan"
+		elog "speed scale appropriately."
+		elog
+	fi
+	if ! use tools; then
+		elog "USE=tools controls whether the nvidia-settings application"
+		elog "is installed. If you would like to use it, enable that"
+		elog "flag and re-emerge this ebuild. Optionally you can install"
+		elog "media-video/nvidia-settings"
+		elog
+	fi
+}
+
+pkg_prerm() {
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+	use driver && use kernel_linux && linux-mod_pkg_postrm
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: x11-drivers/nvidia-drivers/, x11-drivers/nvidia-drivers/files/
@ 2016-11-02  7:53 Jeroen Roovers
  0 siblings, 0 replies; 33+ messages in thread
From: Jeroen Roovers @ 2016-11-02  7:53 UTC (permalink / raw
  To: gentoo-commits

commit:     853ed85d4ff22ecc6b1cb3cfaa581ba89e3ca068
Author:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
AuthorDate: Wed Nov  2 07:47:47 2016 +0000
Commit:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
CommitDate: Wed Nov  2 07:52:50 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=853ed85d

x11-drivers/nvidia-drivers: Version bump (bug #597998).

Package-Manager: portage-2.3.2

 x11-drivers/nvidia-drivers/Manifest                |   7 +
 .../files/nvidia-drivers-375.10-profiles-rc.patch  |  11 +
 .../nvidia-drivers/nvidia-drivers-375.10.ebuild    | 560 +++++++++++++++++++++
 3 files changed, 578 insertions(+)

diff --git a/x11-drivers/nvidia-drivers/Manifest b/x11-drivers/nvidia-drivers/Manifest
index fcd1fa8..ed9b6b2 100644
--- a/x11-drivers/nvidia-drivers/Manifest
+++ b/x11-drivers/nvidia-drivers/Manifest
@@ -22,6 +22,7 @@ DIST NVIDIA-FreeBSD-x86-367.35.tar.gz 62636433 SHA256 2edf78801213dea72ddd6c40ac
 DIST NVIDIA-FreeBSD-x86-367.44.tar.gz 62815733 SHA256 687a178cc0e63f79f38f6e71da904363579b833ab3dadac424bcb2264889d4ec SHA512 2dccfe2b1b86d972b3a8961d8eb114911784cd7fab6d8cfe667a0e2853234fe3e4b2661bd5d0064677155f9631315d1000f23c11feea035292c55dbe73f4baaa WHIRLPOOL 4b243c3c053a11d723fd4fce927e15b36524cf6c4795763a5c728de8952c80e01a72f7e023456637917253dd1298bf6a732cd76da3f0648c26d48088d937fb27
 DIST NVIDIA-FreeBSD-x86-367.57.tar.gz 62859799 SHA256 64a0bde687aac1ec2aad859d5bea47d0691b916a851c64992bd460a05ad7c162 SHA512 13269f76d53a1818690ba8fd7aa604783e80059a031e3668c21a70158eeaa97251adda9ac058a712342e95780db86be5b893eebe0422cfce7f1073d88ea9293d WHIRLPOOL 303bebf3d73d8bc232a188c9e3a23164a70fafdd44974e5f5b1873488f682979702e2f18d838d85072a22520d959ded6bb3a4b79cb3d7cafc5de0feca6241061
 DIST NVIDIA-FreeBSD-x86-370.28.tar.gz 58718517 SHA256 52193b15b4ca822b029f860eed4d00270c925f5d24f7bb511a5b7bbea696d58c SHA512 83ffb19069cc240f8836d808a5eb02c142e7ad923fc2e3049a3b316acc12df070d42dfdc5a8a8e1411ccc9fba0bfa4ed84f457435e985434cd86ae966a63a3f4 WHIRLPOOL b1bec4d5e34ea39c3b1b44adcf85b7392cef39517979d32bc800e48a79a57cfb5f1ca5ff82bc302aa67ed12094782e09ab146f021a9c04e18430034a5ab341a9
+DIST NVIDIA-FreeBSD-x86-375.10.tar.gz 59040273 SHA256 094aae538150240d00acf3b6650137e5b6cdf41cd1b8c6b512f4d6fc22790a7d SHA512 a5786e747480559d459339ed088dc20d249bc9878e5c46a4e310448409642856895cde4bae0ebbdfd397da7af68d4545bbe33cabd1758a0f778d4f85843d2067 WHIRLPOOL 19ee13fa18bfc61e54da8b221a57308979871c44924f5e3611ffbfb9d65a3957d33c0909257fa5b487a2e9f99cb99f8e855486133569a4dba5f2c38ca32fc7dc
 DIST NVIDIA-FreeBSD-x86-96.43.23.tar.gz 15463464 SHA256 18d855db8381eda1a6cf548c9e5095fc5bb8694bf1d6e24fc1072fba4e54cd78 SHA512 42d7b1b76cdb3b23680363e565614a22112162a5dd3639cb804fe670c0c3f3f23595bbefa3f78afdc6a8ca848446dee853c7a355f2c96a0d01b354753ba2785c WHIRLPOOL f8e59ce521990cd9edee441e73f973f074db492952807a0931e362102874cddbb47604ff5c5eb20a0cbde27f9b6d4e440dd12cc2e5a20c9cb65bf3c0b3e62511
 DIST NVIDIA-FreeBSD-x86_64-304.131.tar.gz 35812363 SHA256 e10aa34f4aeb6981c0bc6762f37e6ad57de52b45c7322d0caef9781c1a43858a SHA512 0df69d11c79cfd66f40f5adf091f9c3ad494b89fbe9200a1a01fef8cb2d2591ffdeb703d82a263e050384d39ef81af3a717ac24716f96b1fd8386d1758bcf45b WHIRLPOOL a7e01ac4646d52229efb1d22df9b4db98bfd6bc30c79fc4c65273001b1cd09c4db823a0141a060f8c53926ae23a33fe66e27aec805879228d64bf3f45aa66bcd
 DIST NVIDIA-FreeBSD-x86_64-304.132.tar.gz 35810728 SHA256 baedb1901f679b1d2449c49302f3abdb90ac9a85935e3ff3b0968a32089b719c SHA512 4ee6c66efc3b77d7421904ab04c621ed7374d657d0406988a3a1c4b352c092f42ed6394951247d58cbfb54b07e67ed7d02040d6eff136ab57749db813167904c WHIRLPOOL b9f5ef7d63847f76212dfc3d0dba738cb9ea9f42881becaf9c41de31858c95b4c90911eed296c5c266a4cff7dba33f09dbdbdf9e6e731e9b3f13dce7e4346d33
@@ -46,11 +47,13 @@ DIST NVIDIA-FreeBSD-x86_64-367.35.tar.gz 59393955 SHA256 b33057ce23ce1ae44ddd246
 DIST NVIDIA-FreeBSD-x86_64-367.44.tar.gz 59577943 SHA256 e07d21b0ad39a0a24cdc4840094fb2f2de2f52b704538f7ac60c019465de7137 SHA512 98433879d9093f67a1b794e4c171479871cd489d5577a58084c3165c26d9f733117cf9043d33f5674f51d81dc509ab545b65d538a261f9dd6db4fcf2855f3655 WHIRLPOOL 0320b14e56f800b6fae313b61665fb2390e8f2ed1df63126fb12fdc08dae67ad4e4e9fb9a58950ad26c8e62ad4ee0b3ab96aafcf53a525687e240a77b58c5291
 DIST NVIDIA-FreeBSD-x86_64-367.57.tar.gz 59604884 SHA256 6f2986941a9f4cdcb3692c39919e5eeec09f2799b7797d3c0be0d4c61f7eed5b SHA512 06e4fd656efc88260c10b2a86308461754302dc9bad88285efe8b864012806f2d7147173ded9ee7b4ef2518ddbd6f02c5d36b184f913176732dd90cce0df006c WHIRLPOOL 9c33dd392ba0335b08c7710aaf97564d7cc0fdcc2fe87ec67ae1932848dbd6e6ad0437f6b44409b11cefc7ec33be7656199dcb2a34ab296f969fd65243bd114e
 DIST NVIDIA-FreeBSD-x86_64-370.28.tar.gz 57905860 SHA256 5087a93af8aaab6cff35ba60c9d67b4249827f6b7681abaaa571a20784a54552 SHA512 40637d64a0ee5029bb1c5ad7a590c5be61253ef6283c4217666768ad8601d7f51ef0d8705c8711f65c3d0a5a5721490813220c5f9186c6d2d12baf5d9c11122e WHIRLPOOL 361648788b7efb9e550b3e67d2e6022e31dab29f5660c42a1b6c961fe4638216fb8785814ee9fa1636fc39c39afce7caffbdc24fcf8bbd14e4eec5b5eeaeb1eb
+DIST NVIDIA-FreeBSD-x86_64-375.10.tar.gz 58235753 SHA256 50ccd0e9622a0d24ecd70cdb7bb30a02f45adb1ae3da340d0e73de755b5ffd04 SHA512 0f64cdd1a835e23b8a4337a841a4ae09b89c873a6e8bbfc3bfe945df721b640cd8985faba6cc1c32041dfeda456370eb80d57ad1ee0957cc79417ad7ef3e1f7e WHIRLPOOL 99477fb741d864f270e44f3bc5226a4cfd5c6d1c3024b080f898de089c2e0bfa649cfb18a7ff5dfdc099c6c61aa407bd8e4e4930d181e211d1e22d1b811a4b26
 DIST NVIDIA-Linux-armv7l-gnueabihf-367.27.run 25585174 SHA256 ae0855b247d5a5474561c76a79536fe82c44bd10e6154792978c5572d11c47f9 SHA512 dd60292f262e1d7d6cca09a35c3f8b65820d216d46f2b94feb208554496b30a983a73ffb8b2a1473cef0b7e08a3cda901eeca855e1db77f4f6dd23779772580b WHIRLPOOL c55d4102a6717f81d8bde7e66d1772c7b1f370d4d610ef61561c94f5ea6cc4797b5f15b9cbc31216b2ef9ef9132a66682b280d9ef5b74c4a57ee2ee8da6c1122
 DIST NVIDIA-Linux-armv7l-gnueabihf-367.35.run 25628654 SHA256 6087bd2cc594f860d27d26e30acd3593310ce00938c10e5729175f037efa222e SHA512 3157c3dc9d07dd0eb8aaa0bf21edf62aa1338f10c1431981494d2a7b1f0be8a1eee8b5bc41914cfca9b4c76773b0056e7ad5c80a4c7acadfadb52a7647baabbe WHIRLPOOL 49c8896d1a40e1f634224227100b303c3d2ebc66ee93f31aa18bc39c898585eba49400d148f47476e4253d35d7379047dbcf7f43cf027df0b16179bfc8912db0
 DIST NVIDIA-Linux-armv7l-gnueabihf-367.44.run 25674978 SHA256 b42af2009460614c6d4b6585535dc2f0c1e98244f00bf75ece37dc31d2cc45c3 SHA512 0fd72fe7afa1415eb961a5308c142316cb5311195486b331c406f4cbcc7d30dd5f0e85e5b179ffb8f38ce5ee1b5abac671d89f62b7dc7e1b1d738212af6acd91 WHIRLPOOL ce2b0fa6b8c545af63292da214cfeb564f765179f531907ac7750c7a9d890816ce869dd7e6898ea0a0a6f446d20868d55c235a5ee2e88105731e8812b5f67c79
 DIST NVIDIA-Linux-armv7l-gnueabihf-367.57.run 25701866 SHA256 e856debfabffe0e4ed2900e4acbc8e68340c4773651ec7a0000659588431ef7d SHA512 2d1221b8c6f01148412790c24f88a74104da4dc40f30ebe57a47468818c811119ed629ffa565f3ed58ce0b12b292b4304a2b364a83faff41ba14ea747f4e1c88 WHIRLPOOL bf7011f50360516f76ea5e176aea7d761193de877a5357a54704c60d512faf1af8e8e2450c547b5181fba98ee627a297b1c573e147c4db623324c1c35396330d
 DIST NVIDIA-Linux-armv7l-gnueabihf-370.28.run 26117701 SHA256 efb60a23aa22b46e94e91d5f5a5fc0c17b47bcf50471e4371653ced5a5350dce SHA512 04699849441bccfb9214fda4c7ff8ecefa11249d1fbfe470e37fefdd132becc225a1bcc16bc976c3fb145a427961f5402c95ecc84b613adb71caef9c96fe7d90 WHIRLPOOL 675a495594c46666ec11c83a76cdc8821e9b57079ee53cd7adcf00e783d121e163b7c5b10598aa55a1fee72eee47defc514fba986685af41c90ab2c5d890abbd
+DIST NVIDIA-Linux-armv7l-gnueabihf-375.10.run 26701426 SHA256 ba2d6ac96a498b5db08942564598e8f228ed5ca2c329ba601b3f94aa6444b328 SHA512 677b7b0d769ba00010b58fb5ad0b6334e1e7d0bb390e7d07d36f922b83fd3c66bd70f4431e0d0c0b35a8644fc9d5014421fb44009cedd20839310b3090efb414 WHIRLPOOL b7c23ebb17da16e9dc69d3de387129842b71c10fed24759e725c0e0420a2124a33ce19a578f86c9986d2ba36c35fe577b4d260b7d384ce14fc94a62dac95f2b5
 DIST NVIDIA-Linux-x86-173.14.39-pkg0.run 15134997 SHA256 a09935f37121ed3db8ae3da63a0d8e9d4348a19c859811c9fe44d6ce8e3eab23 SHA512 e24e15ccec725d3cbca502c2b77061776a81ef92917a950adec4ff6bdc34f10903aa654433177ea74be0dade4af81c5380d5710d375a5ea445940d06154bde93 WHIRLPOOL fce3d8e4f6cdf698f5a057514b6fe220bb1011025bdce5bd4cf0e424fb4d306d38251b6726bda03f290ea8137d5a95ed418cf8751722879f9042462abd9181b6
 DIST NVIDIA-Linux-x86-304.131.run 40893199 SHA256 d2554bb6f7867e7762d0ecedcac5bde7de0634e43b952bf466323ea8b4032da8 SHA512 3e67c40648554dc49472081eee88ae982c3b235b3346e4d9e7fb5ae33ec5f10ed088da804ac7d8bd1565995df3861f12b3560030cd3a19339a2d35768b0a943e WHIRLPOOL 88e9cc0270a4fc64ed8475a217c7c8c50e6ea21fe14b5b5beb16f494bd62bf5ada2f47e26e5380dd3d0bc678091e29f0e26937eef1ee3c7bdc5805153201bae3
 DIST NVIDIA-Linux-x86-304.132.run 40910791 SHA256 d460f6ab63cc8c1f9fb89a344ad0f3ee1a90e7078b4edba78d86433e66bfd927 SHA512 70a6ed74a93ac2a1acec5eab5078dfe05fab66c6264d67f3238a6b28af7b39f7205e237214bac4ee5d2366e8c6a4a63dfc8dc113e9e977ee2387c5c8c63ccc8f WHIRLPOOL 69b24a57d906b37cc87f081209712f92eb2e7df27a2a030c51a1ef7bda607dd404b57d1fc008ee3d1ad3b81c176da1806e7b591d00a0894f2a0273ebd494e4dd
@@ -76,6 +79,7 @@ DIST NVIDIA-Linux-x86-367.35.run 44717708 SHA256 38cb22fa85ef74ea960d3e5d644838c
 DIST NVIDIA-Linux-x86-367.44.run 44079774 SHA256 b2ad4d0d4a2e98528e877ae0d98c38039c2400b09cfb5928cd21899f3a991291 SHA512 5dbeda283b277697eb161b01a6d361a68fcc5e982fcbb9f6c9d08705c9af8b0bf3d78cf68feddce9d72407eea3ccabf955d404975fce5e56d1690bc5008577da WHIRLPOOL ea5f4f9c43cfb6db33906e715fa6b4d5a298e4bbf76959c18589753bcce5b2faa91c38e0aad10e3bcd89b28ee2ee8b73da3deee6c048bebc08fe93e32e214b7e
 DIST NVIDIA-Linux-x86-367.57.run 44731570 SHA256 43d4e926f71ac6c581018badf467458709822e97a7564ed9f1b521b7b63d88bb SHA512 6316cdd94131057a584b3a893cfbca5e8b0f5e79060cb5bfe2c149b5a76bdcdc21d20338febb54f7201985c5b05545c3f6b63b26c32699717057cfb047993972 WHIRLPOOL 443ca9b389f78c13ae5344cb3cce67035a2b5a605b94518d91c253965263d37a84dff9ca29d47509a2d43017afde4786a55bfd45613882b5d4889dc27b67622f
 DIST NVIDIA-Linux-x86-370.28.run 44189522 SHA256 6323254ccf2a75d7ced1374a76ca56778689d0d8a9819e4ee5378ea3347b9835 SHA512 2df8b3d1064073c8b793287994fe0648625d095f3434b7b67531e19632cbad318994df90b55de18aa457d55a1374b35d64a646564259995d3f2197c48737921c WHIRLPOOL 85a089c833311abdc06bbc1fc68cd5ff8ed43dd5e5887d340dc854f905ae741de0ae4343d024259f493dd668075096c460bc1f93c1795d2befb81dd3c4a4983a
+DIST NVIDIA-Linux-x86-375.10.run 44518154 SHA256 77c06d9c6831d6d1b53276d0741eddac4aab2f2f02b7c1fe14b86aa982aacd69 SHA512 b68af4b00a98f9f22ae2a41fdde7d823d22a7b3587b80860b206b96b6121adec203b81c258ee5ba3e20dfd0ba60337f95de268d96d417cc0b39a2822b7021017 WHIRLPOOL 7e3c05595f6cb3d654f708b7bc31c11beb3631f67c75490c09acbee2da4d90de8799890cf108babe3870e21590e8bd675c09b47fc5afd24e119f3630e7d07831
 DIST NVIDIA-Linux-x86-96.43.23-pkg0.run 11504817 SHA256 51e6adf4ba73071622045fc37169f80db3ae3e784dff53b29d35146a04042142 SHA512 bed5726e57637481fe4e3c03a65ec14fe949f00860e729ebde408f4fd861d7bfdc296a78bc2f5d42e8b282db09f4bbde1e0545df7228fa20227080dc4b868ba7 WHIRLPOOL 6d4fd1786c11f4e326cc3101d0bb1a2f8b63c25c3dd59f10188f8355759e2861ce44fd53d60258b513d5a1d6124d0f91ba8edf4d3668b6feabfb3e8d585f14fe
 DIST NVIDIA-Linux-x86_64-173.14.39-pkg2.run 21100833 SHA256 15a953666d5681ba54c97498b578ffd286a1dc96d605f3b02110f3f99813100e SHA512 a65cd496e6ed57f771c3d99f37f616a1242d97844f6faef7a807825ad899c0e536a99fde397020839f0857883b934032f9491024f3047a6b06d3eea1f5d77713 WHIRLPOOL dc5f243b7d1de7e2d1b7f005e018a2940d63335b11a7c83c234b348b7a1839e9131169d2ea928bd8c2f549a4535149b03e16e6c94d59dfa745f7f904ff790a45
 DIST NVIDIA-Linux-x86_64-304.131.run 69415084 SHA256 74b7ec1c31dac03ee7c3e04612cadb9cbaa01ef4c796c27a0a649f7d32dccd0b SHA512 ddfa1f23600821dcae17ddb735b615d67504c4e276d9b41813e0f8d7690fbdf48f79644ee4c9e5449ce22a31460734cf325fc83975e0b48a0379a85cd4ef747d WHIRLPOOL fc08c2337a1b80b0444dbc914f7d17441995e4965c435028194050df9f5ec1606cdfb5bf11e56f79a736e04cf0755b296017fe79629c5ded18a72093b8689bce
@@ -102,6 +106,7 @@ DIST NVIDIA-Linux-x86_64-367.35.run 75600336 SHA256 d2df3fcb1a145984b9de4f2f38a9
 DIST NVIDIA-Linux-x86_64-367.44.run 75032664 SHA256 09a4e67afa79c159f96071215bac3e027b553117b91ee35a4ff134a98d8fe7cc SHA512 efb97ee084f68a0d4ad658f8700fec14a3b3f5ec585a14efa88be791f951445d8b6b944103bfb95408aeb43618f1a1f6fda5ab4ad7f7d2de82f1a7e92f354fa1 WHIRLPOOL 54c642a3c6b9065980569fb45cd358296205c6aa483cb1c402bc75a26f00c95783786b7f0414b11a19f0c7233c77f802c0d40494d5c859ae5c4c8da5f4eeaf33
 DIST NVIDIA-Linux-x86_64-367.57.run 77127324 SHA256 a1615db29f1377817b610cca997e0339753ee9d58b28e1618b892691df3a8851 SHA512 fc94f5df7eb2ef243db381bc4458f911a6d76bff949701bedb249a3ebf369ff3da8dc5a7d52ab6ae3f23e947c419923f303cd57429a266a0f8e96df1039b1f5d WHIRLPOOL 5580b7839652c250ba134ecc97438d1810453d5bd5d8cffd44f01379d7509bca6f0c58318a150a5b4786f955d4de708ce9be618572212eca2c7098a36eab24d5
 DIST NVIDIA-Linux-x86_64-370.28.run 76690360 SHA256 90aa3c186e45b39e6fc0064ab8dbda8bcc897cb61d2e7b7cb30b4ec9a4b39239 SHA512 931476f92a63d142478b2d6b3da4031769fd3b93aee2387800a78b1354b59a5fb5e4e293436b6b4c246627d51c0f55d140ab230de385cb1567bc8b25518eb741 WHIRLPOOL ce866c38291d2ab4aeeff05654a0e61196129f77baea5af93ddbc22fab9574ba39cc05d58020ea2407cc7342f0bcf5c2702d42290f4cc3b53c9e04fb7c617413
+DIST NVIDIA-Linux-x86_64-375.10.run 77354052 SHA256 62ebba84f30e58b618843d8d0d630693808cd75154945e46850c10d797746af1 SHA512 b689c5f3e3b2537c70ebe658f133771c31acee5818dde19adbe97b8f2194d33cffcfea29a1727a5658e8ca667fd89d077177eed163ff3cfb0abe7b8a892d73fa WHIRLPOOL 6b6dd1a2290fd1df65912f5fdf5a47a1c208b86b2014116d1199b3b45c2413c894badf9867ac9d09e0e0bb532ce8593720f2123b8466a3fd416a84bff3ce237e
 DIST NVIDIA-Linux-x86_64-96.43.23-pkg2.run 15962375 SHA256 ce8d8253e7dab7da63fbdac449ebf190cd0c10cbfffea0f8d0165515f851bc64 SHA512 04bec1187a6024a2b9839f008ec829281f1f2602dae2e639030bc385943186506bcaa2b46a230b2ab87f9217190841abc62f9e2d6395ab5559623389c31c6563 WHIRLPOOL 0651c44a51a1a06fcff5bfddbf9c3e408977e03263c7fe806cb6c01f9fe92f716dfe4e5190ffe1048bde72fcffdc8bca8267e74dd43ba5c9dfb22b6201fcc2bb
 DIST nvidia-settings-304.131.tar.bz2 1480447 SHA256 d36d2d1ae7c1bb72cd18e713470546d2aa7057624b1f61319daf559a94054d29 SHA512 9269f54f87581e29e6d7cabeaf989c70cb27aa55f6b8f5f1c71b8a14401326d06ea194710722b41283cca56f5808b90a9b1fb12158d48c6332cce15a701c5796 WHIRLPOOL be8e38a09a0bfa40267b9cdae2800a9ef00a89e28e618b743b7acb0cd9ece4b242b74ced32018d735989592300b49b2ee683caa11a1e161bcecf070a58952dfd
 DIST nvidia-settings-304.132.tar.bz2 1480097 SHA256 53b86952ec29b32bdcc838199c3db802a5affd58e348f68ac9f4931ae0e2021f SHA512 512db744830b31ded109047e0c736dd18ae01cdea2b94099d06b7f30a31274fa4fd689b286a1e12768ac618fc4d38be9eb7c0d58b1f0a3e2b67ae4a133cec97d WHIRLPOOL adce5fce462119dfa1569c4b2241f1129ae2659ae8964a9556d730bcda246c7db08b6e6b14ae644df8e3fcc990f84c9585b4ecb9617e26833fb70babd447c606
@@ -123,3 +128,5 @@ DIST nvidia-settings-367.35.tar.bz2 1572606 SHA256 6b0cf0b63bbf8c3d29538587bad8b
 DIST nvidia-settings-367.44.tar.bz2 1571750 SHA256 74ca3c7ac3e75c13b6aaef92739e2bdb6c9c83e4d860cbe0f1474746c6123fc4 SHA512 d021b162f1cb027da4c4f87e68608fb2efa01f82e2fb739c76b7acd2a2468aca17e9b0b56a61e2a5e2b9f34e3232f373a268eabbfa6ee49f9e9548d53affde0c WHIRLPOOL 36f8d2ab83ca12f02adab1ccd9d62cf763de916c0cf1cc5f18a14bc8428df2ee91fd270d481d225766919fc2b14361da33c5baaf83fc14e82bdc624c88a7ea3f
 DIST nvidia-settings-367.57.tar.bz2 1571905 SHA256 aacb66b130e4adc034e10afb518c919a96029b31b14da8975b08d250d8750140 SHA512 57bf414f4aefacd994e73ea3b31de8cf9f5d6ddc9a95ea1456c21905510c4ba9219e690a1b1bb1346b57a80caf9856c5fede80734163392f0788b995d1bd4cea WHIRLPOOL 7294f84afe8a00f59e2073773d12dc0b31273ab49fe318558eee84a72b7df1233fa004949c0512bff1974c5edbc4749eed68e172336241ea9cb24d6c585a8979
 DIST nvidia-settings-370.28.tar.bz2 1573509 SHA256 59d7818a4837144e373ce958233db059fde59e279477001e187579770ebf0c5f SHA512 c4da6ae54839a8f91d3557153a648f69095e9a486dbaaf73e453d625660f1adcada12ee5c4bccc1afe2cfd454ead13c1df0e59d5d6aa70f6065823d53f7bb461 WHIRLPOOL e5f0a9fd67e50aee42598d6a0ce9a69a162405a6121518c7aaf9ede409e9bdeb44e3102a123eb6f8c963e0fdaca429a8b693f6af2f0467e746c42f57a496d45f
+DIST nvidia-settings-375.10.tar.bz2 1586956 SHA256 ebd94c777d2ea1107a116f16e2adddd2f482dff28bfceec0feeab62d09f1b600 SHA512 6aee82c3efc79af1c4c5b7e00505d5f8996925d2c909c7c7bbbfb7c56919a0e6d4f871146dc6ad33ff703bb700f8f82451bf7947e34e80eeb9370abb769e2c7b WHIRLPOOL 77733ae4cefccb05a9c582248307be0b17ef66ee128309603e975e99e19ca3803873ef720d248199601ff1f681f40a3134ef7703bfd3cdc756f0b3ea4b355042
+DIST nvml.h-375.10 225272 SHA256 44feb6022fdbd27b486d74fc8473d8bc46caeec59963514e53d5cc7bc2bc9f15 SHA512 ebd6b5551a58e5cad17b7cae472a32fa2cfdf79ead62804ca3ecf204b0bc7a215f799666950b62d4938eb983edbf554bc65a7a6200e61639a5da57f884af55b9 WHIRLPOOL 0ee6c64caea1ece104fd67a5c40c9c4dfe785b1effa0da7260887e9b471b2a9e8848f4a06ce8a264606c96c0ba06eb49c053f1d1405b5eb9c030c80bce2071b2

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-375.10-profiles-rc.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-375.10-profiles-rc.patch
new file mode 100644
index 00000000..0b717dd
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-375.10-profiles-rc.patch
@@ -0,0 +1,11 @@
+--- a/nvidia-application-profiles-375.10-rc
++++ b/nvidia-application-profiles-375.10-rc
+@@ -44,7 +44,7 @@
+         {
+           "name" : "NamedVertexAttributesApplyDivisor",
+           "settings" : [ "GL23cd0e", 1 ]
+-        },
++        }
+     ],
+     "rules" : [
+         {

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-375.10.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-375.10.ebuild
new file mode 100644
index 00000000..0713f00
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-375.10.ebuild
@@ -0,0 +1,560 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \
+	portability toolchain-funcs unpacker user udev
+
+NV_URI="http://us.download.nvidia.com/XFree86/"
+X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
+AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
+ARM_NV_PACKAGE="NVIDIA-Linux-armv7l-gnueabihf-${PV}"
+X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
+AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
+
+DESCRIPTION="NVIDIA Accelerated Graphics Driver"
+HOMEPAGE="http://www.nvidia.com/ http://www.nvidia.com/Download/Find.aspx"
+SRC_URI="
+	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
+	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
+	arm? ( ${NV_URI}Linux-x86-ARM/${PV}/${ARM_NV_PACKAGE}.run )
+	x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
+	x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
+	tools? (
+		ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2
+		https://raw.githubusercontent.com/NVIDIA/nvidia-settings/168e17f53098254b4a5ab93eeb2f23c80ca1d97f/src/nvml.h -> nvml.h-${PV}
+	)
+"
+
+LICENSE="GPL-2 NVIDIA-r2"
+SLOT="0/${PV%.*}"
+KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
+RESTRICT="bindist mirror"
+EMULTILIB_PKG="true"
+
+IUSE="acpi compat +driver gtk3 kernel_FreeBSD kernel_linux +kms multilib pax_kernel static-libs +tools uvm wayland +X"
+REQUIRED_USE="
+	tools? ( X )
+	static-libs? ( tools )
+"
+
+COMMON="
+	app-eselect/eselect-opencl
+	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
+	tools? (
+		dev-libs/atk
+		dev-libs/glib:2
+		dev-libs/jansson
+		gtk3? ( x11-libs/gtk+:3 )
+		x11-libs/cairo
+		x11-libs/gdk-pixbuf[X]
+		x11-libs/gtk+:2
+		x11-libs/libX11
+		x11-libs/libXext
+		x11-libs/libXrandr
+		x11-libs/libXv
+		x11-libs/libXxf86vm
+		x11-libs/pango[X]
+	)
+	X? (
+		>=app-eselect/eselect-opengl-1.0.9
+		app-misc/pax-utils
+	)
+"
+DEPEND="
+	${COMMON}
+	kernel_linux? ( virtual/linux-sources )
+"
+RDEPEND="
+	${COMMON}
+	acpi? ( sys-power/acpid )
+	tools? ( !media-video/nvidia-settings )
+	wayland? ( dev-libs/wayland )
+	X? (
+		<x11-base/xorg-server-1.18.99:=
+		>=x11-libs/libvdpau-1.0
+		multilib? (
+			>=x11-libs/libX11-1.6.2[abi_x86_32]
+			>=x11-libs/libXext-1.3.2[abi_x86_32]
+		)
+	)
+"
+
+QA_PREBUILT="opt/* usr/lib*"
+
+S=${WORKDIR}/
+
+pkg_pretend() {
+	if use amd64 && has_multilib_profile && \
+		[ "${DEFAULT_ABI}" != "amd64" ]; then
+		eerror "This ebuild doesn't currently support changing your default ABI"
+		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
+	fi
+
+	if use kernel_linux && kernel_is ge 4 8; then
+		ewarn "Gentoo supports kernels which are supported by NVIDIA"
+		ewarn "which are limited to the following kernels:"
+		ewarn "<sys-kernel/gentoo-sources-4.8"
+		ewarn "<sys-kernel/vanilla-sources-4.8"
+		ewarn ""
+		ewarn "You are free to utilize epatch_user to provide whatever"
+		ewarn "support you feel is appropriate, but will not receive"
+		ewarn "support as a result of those changes."
+		ewarn ""
+		ewarn "Do not file a bug report about this."
+		ewarn ""
+	fi
+
+	# Since Nvidia ships many different series of drivers, we need to give the user
+	# some kind of guidance as to what version they should install. This tries
+	# to point the user in the right direction but can't be perfect. check
+	# nvidia-driver.eclass
+	nvidia-driver-check-warning
+
+	# Kernel features/options to check for
+	CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
+	use x86 && CONFIG_CHECK+=" ~HIGHMEM"
+
+	# Now do the above checks
+	use kernel_linux && check_extra_config
+}
+
+pkg_setup() {
+	# try to turn off distcc and ccache for people that have a problem with it
+	export DISTCC_DISABLE=1
+	export CCACHE_DISABLE=1
+
+	if use driver && use kernel_linux; then
+		MODULE_NAMES="nvidia(video:${S}/kernel)"
+		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
+		use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel) nvidia-drm(video:${S}/kernel)"
+
+		# This needs to run after MODULE_NAMES (so that the eclass checks
+		# whether the kernel supports loadable modules) but before BUILD_PARAMS
+		# is set (so that KV_DIR is populated).
+		linux-mod_pkg_setup
+
+		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
+		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
+
+		# linux-mod_src_compile calls set_arch_to_kernel, which
+		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
+		# expects x86_64 or i386 and then converts it to x86
+		# later on in the build process
+		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
+	fi
+
+	if use kernel_linux && kernel_is lt 2 6 9; then
+		eerror "You must build this against 2.6.9 or higher kernels."
+	fi
+
+	# set variables to where files are in the package structure
+	if use kernel_FreeBSD; then
+		use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
+		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
+		NV_DOC="${S}/doc"
+		NV_OBJ="${S}/obj"
+		NV_SRC="${S}/src"
+		NV_MAN="${S}/x11/man"
+		NV_X11="${S}/obj"
+		NV_SOVER=1
+	elif use kernel_linux; then
+		NV_DOC="${S}"
+		NV_OBJ="${S}"
+		NV_SRC="${S}/kernel"
+		NV_MAN="${S}"
+		NV_X11="${S}"
+		NV_SOVER=${PV}
+	else
+		die "Could not determine proper NVIDIA package"
+	fi
+}
+
+src_prepare() {
+	if use tools; then
+		cp "${DISTDIR}"/nvml.h-${PV} "${S}"/nvidia-settings-${PV}/src/ || die
+		sed -i -e 's|-lnvidia-ml|-L../../ &|g' nvidia-settings-${PV}/src/Makefile || die
+	fi
+
+	eapply "${FILESDIR}"/${P}-profiles-rc.patch
+
+	if use pax_kernel; then
+		ewarn "Using PAX patches is not supported. You will be asked to"
+		ewarn "use a standard kernel should you have issues. Should you"
+		ewarn "need support with these patches, contact the PaX team."
+		eapply "${FILESDIR}"/${PN}-364.12-pax.patch
+	fi
+
+	# Allow user patches so they can support RC kernels and whatever else
+	eapply_user
+}
+
+src_compile() {
+	# This is already the default on Linux, as there's no toplevel Makefile, but
+	# on FreeBSD there's one and triggers the kernel module build, as we install
+	# it by itself, pass this.
+
+	cd "${NV_SRC}"
+	if use kernel_FreeBSD; then
+		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
+			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
+	elif use driver && use kernel_linux; then
+		MAKEOPTS=-j1 linux-mod_src_compile
+	fi
+
+	if use tools; then
+		emake -C "${S}"/nvidia-settings-${PV}/src \
+			AR="$(tc-getAR)" \
+			CC="$(tc-getCC)" \
+			LIBDIR="$(get_libdir)" \
+			NV_VERBOSE=1 \
+			RANLIB="$(tc-getRANLIB)" \
+			DO_STRIP= \
+			build-xnvctrl
+
+		emake -C "${S}"/nvidia-settings-${PV}/src \
+			CC="$(tc-getCC)" \
+			GTK3_AVAILABLE=$(usex gtk3 1 0) \
+			LD="$(tc-getCC)" \
+			LIBDIR="$(get_libdir)" \
+			NVML_ENABLED=0 \
+			NV_USE_BUNDLED_LIBJANSSON=0 \
+			NV_VERBOSE=1 \
+			DO_STRIP=
+	fi
+}
+
+# Install nvidia library:
+# the first parameter is the library to install
+# the second parameter is the provided soversion
+# the third parameter is the target directory if it is not /usr/lib
+donvidia() {
+	# Full path to library
+	nv_LIB="${1}"
+
+	# SOVER to use
+	nv_SOVER="$(scanelf -qF'%S#F' ${nv_LIB})"
+
+	# Where to install
+	nv_DEST="${2}"
+
+	# Get just the library name
+	nv_LIBNAME=$(basename "${nv_LIB}")
+
+	if [[ "${nv_DEST}" ]]; then
+		exeinto ${nv_DEST}
+		action="doexe"
+	else
+		nv_DEST="/usr/$(get_libdir)"
+		action="dolib.so"
+	fi
+
+	# Install the library
+	${action} ${nv_LIB} || die "failed to install ${nv_LIBNAME}"
+
+	# If the library has a SONAME and SONAME does not match the library name,
+	# then we need to create a symlink
+	if [[ ${nv_SOVER} ]] && ! [[ "${nv_SOVER}" = "${nv_LIBNAME}" ]]; then
+		dosym ${nv_LIBNAME} ${nv_DEST}/${nv_SOVER} \
+			|| die "failed to create ${nv_DEST}/${nv_SOVER} symlink"
+	fi
+
+	dosym ${nv_LIBNAME} ${nv_DEST}/${nv_LIBNAME/.so*/.so} \
+		|| die "failed to create ${nv_LIBNAME/.so*/.so} symlink"
+}
+
+src_install() {
+	if use driver && use kernel_linux; then
+		linux-mod_src_install
+
+		# Add the aliases
+		# This file is tweaked with the appropriate video group in
+		# pkg_preinst, see bug #491414
+		insinto /etc/modprobe.d
+		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
+		doins "${FILESDIR}"/nvidia-rmmod.conf
+
+		# Ensures that our device nodes are created when not using X
+		exeinto "$(get_udevdir)"
+		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
+		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
+	elif use kernel_FreeBSD; then
+		if use x86-fbsd; then
+			insinto /boot/modules
+			doins "${S}/src/nvidia.kld"
+		fi
+
+		exeinto /boot/modules
+		doexe "${S}/src/nvidia.ko"
+	fi
+
+	# NVIDIA kernel <-> userspace driver config lib
+	donvidia ${NV_OBJ}/libnvidia-cfg.so.${NV_SOVER}
+
+	# NVIDIA framebuffer capture library
+	donvidia ${NV_OBJ}/libnvidia-fbc.so.${NV_SOVER}
+
+	# NVIDIA video encode/decode <-> CUDA
+	if use kernel_linux; then
+		donvidia ${NV_OBJ}/libnvcuvid.so.${NV_SOVER}
+		donvidia ${NV_OBJ}/libnvidia-encode.so.${NV_SOVER}
+	fi
+
+	if use X; then
+		# Xorg DDX driver
+		insinto /usr/$(get_libdir)/xorg/modules/drivers
+		doins ${NV_X11}/nvidia_drv.so
+
+		# Xorg GLX driver
+		donvidia ${NV_X11}/libglx.so.${NV_SOVER} \
+			/usr/$(get_libdir)/opengl/nvidia/extensions
+
+		# Xorg nvidia.conf
+		if has_version '>=x11-base/xorg-server-1.16'; then
+			insinto /usr/share/X11/xorg.conf.d
+			newins {,50-}nvidia-drm-outputclass.conf
+		fi
+	fi
+
+	# OpenCL ICD for NVIDIA
+	if use kernel_linux; then
+		insinto /etc/OpenCL/vendors
+		doins ${NV_OBJ}/nvidia.icd
+	fi
+
+	# Documentation
+	dohtml ${NV_DOC}/html/*
+	if use kernel_FreeBSD; then
+		dodoc "${NV_DOC}/README"
+		use X && doman "${NV_MAN}/nvidia-xconfig.1"
+		use tools && doman "${NV_MAN}/nvidia-settings.1"
+	else
+		# Docs
+		newdoc "${NV_DOC}/README.txt" README
+		dodoc "${NV_DOC}/NVIDIA_Changelog"
+		doman "${NV_MAN}/nvidia-smi.1.gz"
+		use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
+		use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
+		doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
+	fi
+
+	# Helper Apps
+	exeinto /opt/bin/
+
+	if use X; then
+		doexe ${NV_OBJ}/nvidia-xconfig
+	fi
+
+	if use kernel_linux; then
+		doexe ${NV_OBJ}/nvidia-cuda-mps-control
+		doexe ${NV_OBJ}/nvidia-cuda-mps-server
+		doexe ${NV_OBJ}/nvidia-debugdump
+		doexe ${NV_OBJ}/nvidia-persistenced
+		doexe ${NV_OBJ}/nvidia-smi
+
+		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
+		doexe ${NV_OBJ}/nvidia-modprobe
+		fowners root:video /opt/bin/nvidia-modprobe
+		fperms 4710 /opt/bin/nvidia-modprobe
+		dosym /{opt,usr}/bin/nvidia-modprobe
+
+		doman nvidia-cuda-mps-control.1.gz
+		doman nvidia-modprobe.1.gz
+		doman nvidia-persistenced.1.gz
+		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
+		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
+		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
+	fi
+
+	if use tools; then
+		emake -C "${S}"/nvidia-settings-${PV}/src/ \
+			DESTDIR="${D}" \
+			GTK3_AVAILABLE=$(usex gtk3 1 0) \
+			LIBDIR="${D}/usr/$(get_libdir)" \
+			NV_USE_BUNDLED_LIBJANSSON=0 \
+			NV_VERBOSE=1 \
+			PREFIX=/usr \
+			DO_STRIP= \
+			install
+
+		if use static-libs; then
+			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
+
+			insinto /usr/include/NVCtrl
+			doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
+		fi
+
+		insinto /usr/share/nvidia/
+		doins nvidia-application-profiles-${PV}-key-documentation
+
+		insinto /etc/nvidia
+		newins \
+			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
+
+		# There is no icon in the FreeBSD tarball.
+		use kernel_FreeBSD || \
+			doicon ${NV_OBJ}/nvidia-settings.png
+
+		domenu "${FILESDIR}"/nvidia-settings.desktop
+
+		exeinto /etc/X11/xinit/xinitrc.d
+		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
+
+		insinto /etc/vulkan/icd.d
+		doins nvidia_icd.json
+	fi
+
+	dobin ${NV_OBJ}/nvidia-bug-report.sh
+
+	if has_multilib_profile && use multilib; then
+		local OABI=${ABI}
+		for ABI in $(get_install_abis); do
+			src_install-libs
+		done
+		ABI=${OABI}
+		unset OABI
+	else
+		src_install-libs
+	fi
+
+	is_final_abi || die "failed to iterate through all ABIs"
+
+	readme.gentoo_create_doc
+}
+
+src_install-libs() {
+	local inslibdir=$(get_libdir)
+	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
+	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
+	local libdir=${NV_OBJ}
+
+	if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
+		libdir=${NV_OBJ}/32
+	fi
+
+	if use X; then
+		NV_GLX_LIBRARIES=(
+			"libEGL.so.1 ${GL_ROOT}"
+			"libEGL_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGL.so.$(usex compat ${NV_SOVER} 1.0.0) ${GL_ROOT}"
+			"libGLESv1_CM.so.1 ${GL_ROOT}"
+			"libGLESv1_CM_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGLESv2.so.2 ${GL_ROOT}"
+			"libGLESv2_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGLX.so.0 ${GL_ROOT}"
+			"libGLX_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGLdispatch.so.0 ${GL_ROOT}"
+			"libOpenCL.so.1.0.0 ${CL_ROOT}"
+			"libOpenGL.so.0 ${GL_ROOT}"
+			"libcuda.so.${NV_SOVER}"
+			"libnvcuvid.so.${NV_SOVER}"
+			"libnvidia-compiler.so.${NV_SOVER}"
+			"libnvidia-eglcore.so.${NV_SOVER}"
+			"libnvidia-encode.so.${NV_SOVER}"
+			"libnvidia-fatbinaryloader.so.${NV_SOVER}"
+			"libnvidia-fbc.so.${NV_SOVER}"
+			"libnvidia-glcore.so.${NV_SOVER}"
+			"libnvidia-glsi.so.${NV_SOVER}"
+			"libnvidia-ifr.so.${NV_SOVER}"
+			"libnvidia-opencl.so.${NV_SOVER}"
+			"libnvidia-ptxjitcompiler.so.${NV_SOVER}"
+			"libvdpau_nvidia.so.${NV_SOVER}"
+		)
+
+		if use wayland && has_multilib_profile && [[ ${ABI} == "amd64" ]];
+		then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-egl-wayland.so.${NV_SOVER}"
+			)
+		fi
+
+		if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
+		then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-wfb.so.${NV_SOVER}"
+			)
+		fi
+
+		if use kernel_FreeBSD; then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-tls.so.${NV_SOVER}"
+			)
+		fi
+
+		if use kernel_linux; then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-ml.so.${NV_SOVER}"
+				"tls/libnvidia-tls.so.${NV_SOVER}"
+			)
+		fi
+
+		for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
+			donvidia ${libdir}/${NV_LIB}
+		done
+	fi
+}
+
+pkg_preinst() {
+	if use driver && use kernel_linux; then
+		linux-mod_pkg_preinst
+
+		local videogroup="$(egetent group video | cut -d ':' -f 3)"
+		if [ -z "${videogroup}" ]; then
+			eerror "Failed to determine the video group gid"
+			die "Failed to determine the video group gid"
+		else
+			sed -i \
+				-e "s:PACKAGE:${PF}:g" \
+				-e "s:VIDEOGID:${videogroup}:" \
+				"${D}"/etc/modprobe.d/nvidia.conf || die
+		fi
+	fi
+
+	# Clean the dynamic libGL stuff's home to ensure
+	# we dont have stale libs floating around
+	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ]; then
+		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
+	fi
+	# Make sure we nuke the old nvidia-glx's env.d file
+	if [ -e "${ROOT}"/etc/env.d/09nvidia ]; then
+		rm -f "${ROOT}"/etc/env.d/09nvidia
+	fi
+}
+
+pkg_postinst() {
+	use driver && use kernel_linux && linux-mod_pkg_postinst
+
+	# Switch to the nvidia implementation
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
+	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
+
+	readme.gentoo_print_elog
+
+	if ! use X; then
+		elog "You have elected to not install the X.org driver. Along with"
+		elog "this the OpenGL libraries and VDPAU libraries were not"
+		elog "installed. Additionally, once the driver is loaded your card"
+		elog "and fan will run at max speed which may not be desirable."
+		elog "Use the 'nvidia-smi' init script to have your card and fan"
+		elog "speed scale appropriately."
+		elog
+	fi
+	if ! use tools; then
+		elog "USE=tools controls whether the nvidia-settings application"
+		elog "is installed. If you would like to use it, enable that"
+		elog "flag and re-emerge this ebuild. Optionally you can install"
+		elog "media-video/nvidia-settings"
+		elog
+	fi
+}
+
+pkg_prerm() {
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+	use driver && use kernel_linux && linux-mod_pkg_postrm
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: x11-drivers/nvidia-drivers/, x11-drivers/nvidia-drivers/files/
@ 2016-11-27 10:46 Jeroen Roovers
  0 siblings, 0 replies; 33+ messages in thread
From: Jeroen Roovers @ 2016-11-27 10:46 UTC (permalink / raw
  To: gentoo-commits

commit:     912a8968edc4150cf9488001346ef49a4735826a
Author:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 27 10:45:59 2016 +0000
Commit:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
CommitDate: Sun Nov 27 10:46:16 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=912a8968

x11-drivers/nvidia-drivers: Old.

Package-Manager: portage-2.3.2

 x11-drivers/nvidia-drivers/Manifest                |   7 -
 .../files/nvidia-drivers-375.10-profiles-rc.patch  |  11 -
 .../nvidia-drivers/nvidia-drivers-375.10-r1.ebuild | 568 ---------------------
 .../nvidia-drivers/nvidia-drivers-375.10.ebuild    | 560 --------------------
 4 files changed, 1146 deletions(-)

diff --git a/x11-drivers/nvidia-drivers/Manifest b/x11-drivers/nvidia-drivers/Manifest
index e072157..c815bac 100644
--- a/x11-drivers/nvidia-drivers/Manifest
+++ b/x11-drivers/nvidia-drivers/Manifest
@@ -22,7 +22,6 @@ DIST NVIDIA-FreeBSD-x86-367.35.tar.gz 62636433 SHA256 2edf78801213dea72ddd6c40ac
 DIST NVIDIA-FreeBSD-x86-367.44.tar.gz 62815733 SHA256 687a178cc0e63f79f38f6e71da904363579b833ab3dadac424bcb2264889d4ec SHA512 2dccfe2b1b86d972b3a8961d8eb114911784cd7fab6d8cfe667a0e2853234fe3e4b2661bd5d0064677155f9631315d1000f23c11feea035292c55dbe73f4baaa WHIRLPOOL 4b243c3c053a11d723fd4fce927e15b36524cf6c4795763a5c728de8952c80e01a72f7e023456637917253dd1298bf6a732cd76da3f0648c26d48088d937fb27
 DIST NVIDIA-FreeBSD-x86-367.57.tar.gz 62859799 SHA256 64a0bde687aac1ec2aad859d5bea47d0691b916a851c64992bd460a05ad7c162 SHA512 13269f76d53a1818690ba8fd7aa604783e80059a031e3668c21a70158eeaa97251adda9ac058a712342e95780db86be5b893eebe0422cfce7f1073d88ea9293d WHIRLPOOL 303bebf3d73d8bc232a188c9e3a23164a70fafdd44974e5f5b1873488f682979702e2f18d838d85072a22520d959ded6bb3a4b79cb3d7cafc5de0feca6241061
 DIST NVIDIA-FreeBSD-x86-370.28.tar.gz 58718517 SHA256 52193b15b4ca822b029f860eed4d00270c925f5d24f7bb511a5b7bbea696d58c SHA512 83ffb19069cc240f8836d808a5eb02c142e7ad923fc2e3049a3b316acc12df070d42dfdc5a8a8e1411ccc9fba0bfa4ed84f457435e985434cd86ae966a63a3f4 WHIRLPOOL b1bec4d5e34ea39c3b1b44adcf85b7392cef39517979d32bc800e48a79a57cfb5f1ca5ff82bc302aa67ed12094782e09ab146f021a9c04e18430034a5ab341a9
-DIST NVIDIA-FreeBSD-x86-375.10.tar.gz 59040273 SHA256 094aae538150240d00acf3b6650137e5b6cdf41cd1b8c6b512f4d6fc22790a7d SHA512 a5786e747480559d459339ed088dc20d249bc9878e5c46a4e310448409642856895cde4bae0ebbdfd397da7af68d4545bbe33cabd1758a0f778d4f85843d2067 WHIRLPOOL 19ee13fa18bfc61e54da8b221a57308979871c44924f5e3611ffbfb9d65a3957d33c0909257fa5b487a2e9f99cb99f8e855486133569a4dba5f2c38ca32fc7dc
 DIST NVIDIA-FreeBSD-x86-375.20.tar.gz 59078892 SHA256 acf64b8b566046475095f823bee39ba5b4897a54cc8f2e52e33a0a766358f859 SHA512 154c4a04387805a2a9d3ebba19c7ca6d4894d4145bfd2108e10b3809c8022e22a79a387533fa356cd69ce8137498b36f059d00ed26c44c5ef12b99b4e23517b4 WHIRLPOOL f6de00f0ee7027d3db653724ed2271cc847358fd1292d6c9cd6fb73aa7d784d1e2fdae467cdd0fce5140c3996e3a6d09ac1ac822b6b9b6b99bba4a39cc38bfa8
 DIST NVIDIA-FreeBSD-x86-96.43.23.tar.gz 15463464 SHA256 18d855db8381eda1a6cf548c9e5095fc5bb8694bf1d6e24fc1072fba4e54cd78 SHA512 42d7b1b76cdb3b23680363e565614a22112162a5dd3639cb804fe670c0c3f3f23595bbefa3f78afdc6a8ca848446dee853c7a355f2c96a0d01b354753ba2785c WHIRLPOOL f8e59ce521990cd9edee441e73f973f074db492952807a0931e362102874cddbb47604ff5c5eb20a0cbde27f9b6d4e440dd12cc2e5a20c9cb65bf3c0b3e62511
 DIST NVIDIA-FreeBSD-x86_64-304.131.tar.gz 35812363 SHA256 e10aa34f4aeb6981c0bc6762f37e6ad57de52b45c7322d0caef9781c1a43858a SHA512 0df69d11c79cfd66f40f5adf091f9c3ad494b89fbe9200a1a01fef8cb2d2591ffdeb703d82a263e050384d39ef81af3a717ac24716f96b1fd8386d1758bcf45b WHIRLPOOL a7e01ac4646d52229efb1d22df9b4db98bfd6bc30c79fc4c65273001b1cd09c4db823a0141a060f8c53926ae23a33fe66e27aec805879228d64bf3f45aa66bcd
@@ -48,14 +47,12 @@ DIST NVIDIA-FreeBSD-x86_64-367.35.tar.gz 59393955 SHA256 b33057ce23ce1ae44ddd246
 DIST NVIDIA-FreeBSD-x86_64-367.44.tar.gz 59577943 SHA256 e07d21b0ad39a0a24cdc4840094fb2f2de2f52b704538f7ac60c019465de7137 SHA512 98433879d9093f67a1b794e4c171479871cd489d5577a58084c3165c26d9f733117cf9043d33f5674f51d81dc509ab545b65d538a261f9dd6db4fcf2855f3655 WHIRLPOOL 0320b14e56f800b6fae313b61665fb2390e8f2ed1df63126fb12fdc08dae67ad4e4e9fb9a58950ad26c8e62ad4ee0b3ab96aafcf53a525687e240a77b58c5291
 DIST NVIDIA-FreeBSD-x86_64-367.57.tar.gz 59604884 SHA256 6f2986941a9f4cdcb3692c39919e5eeec09f2799b7797d3c0be0d4c61f7eed5b SHA512 06e4fd656efc88260c10b2a86308461754302dc9bad88285efe8b864012806f2d7147173ded9ee7b4ef2518ddbd6f02c5d36b184f913176732dd90cce0df006c WHIRLPOOL 9c33dd392ba0335b08c7710aaf97564d7cc0fdcc2fe87ec67ae1932848dbd6e6ad0437f6b44409b11cefc7ec33be7656199dcb2a34ab296f969fd65243bd114e
 DIST NVIDIA-FreeBSD-x86_64-370.28.tar.gz 57905860 SHA256 5087a93af8aaab6cff35ba60c9d67b4249827f6b7681abaaa571a20784a54552 SHA512 40637d64a0ee5029bb1c5ad7a590c5be61253ef6283c4217666768ad8601d7f51ef0d8705c8711f65c3d0a5a5721490813220c5f9186c6d2d12baf5d9c11122e WHIRLPOOL 361648788b7efb9e550b3e67d2e6022e31dab29f5660c42a1b6c961fe4638216fb8785814ee9fa1636fc39c39afce7caffbdc24fcf8bbd14e4eec5b5eeaeb1eb
-DIST NVIDIA-FreeBSD-x86_64-375.10.tar.gz 58235753 SHA256 50ccd0e9622a0d24ecd70cdb7bb30a02f45adb1ae3da340d0e73de755b5ffd04 SHA512 0f64cdd1a835e23b8a4337a841a4ae09b89c873a6e8bbfc3bfe945df721b640cd8985faba6cc1c32041dfeda456370eb80d57ad1ee0957cc79417ad7ef3e1f7e WHIRLPOOL 99477fb741d864f270e44f3bc5226a4cfd5c6d1c3024b080f898de089c2e0bfa649cfb18a7ff5dfdc099c6c61aa407bd8e4e4930d181e211d1e22d1b811a4b26
 DIST NVIDIA-FreeBSD-x86_64-375.20.tar.gz 58259944 SHA256 f4678d671c9dcb7f127173ea1de7614593559658d1876789c37c5f7c62cad563 SHA512 0e039a64095f5385b5acc359206c598e141e18366252a9bbe91933427b372d61740d9fd6c11f1682b78f7e93f9f65915b8f2f05f65e666d0c0d867a29ed98071 WHIRLPOOL 85696e1c21132d18a1ee81f9e1c7ab05ae2fdc839c1d8877e67fac7fb39428ab6e7dcd4d2806dd56ba9ef93fc8648c7ce77c19145652252df3fa247be5db9737
 DIST NVIDIA-Linux-armv7l-gnueabihf-367.27.run 25585174 SHA256 ae0855b247d5a5474561c76a79536fe82c44bd10e6154792978c5572d11c47f9 SHA512 dd60292f262e1d7d6cca09a35c3f8b65820d216d46f2b94feb208554496b30a983a73ffb8b2a1473cef0b7e08a3cda901eeca855e1db77f4f6dd23779772580b WHIRLPOOL c55d4102a6717f81d8bde7e66d1772c7b1f370d4d610ef61561c94f5ea6cc4797b5f15b9cbc31216b2ef9ef9132a66682b280d9ef5b74c4a57ee2ee8da6c1122
 DIST NVIDIA-Linux-armv7l-gnueabihf-367.35.run 25628654 SHA256 6087bd2cc594f860d27d26e30acd3593310ce00938c10e5729175f037efa222e SHA512 3157c3dc9d07dd0eb8aaa0bf21edf62aa1338f10c1431981494d2a7b1f0be8a1eee8b5bc41914cfca9b4c76773b0056e7ad5c80a4c7acadfadb52a7647baabbe WHIRLPOOL 49c8896d1a40e1f634224227100b303c3d2ebc66ee93f31aa18bc39c898585eba49400d148f47476e4253d35d7379047dbcf7f43cf027df0b16179bfc8912db0
 DIST NVIDIA-Linux-armv7l-gnueabihf-367.44.run 25674978 SHA256 b42af2009460614c6d4b6585535dc2f0c1e98244f00bf75ece37dc31d2cc45c3 SHA512 0fd72fe7afa1415eb961a5308c142316cb5311195486b331c406f4cbcc7d30dd5f0e85e5b179ffb8f38ce5ee1b5abac671d89f62b7dc7e1b1d738212af6acd91 WHIRLPOOL ce2b0fa6b8c545af63292da214cfeb564f765179f531907ac7750c7a9d890816ce869dd7e6898ea0a0a6f446d20868d55c235a5ee2e88105731e8812b5f67c79
 DIST NVIDIA-Linux-armv7l-gnueabihf-367.57.run 25701866 SHA256 e856debfabffe0e4ed2900e4acbc8e68340c4773651ec7a0000659588431ef7d SHA512 2d1221b8c6f01148412790c24f88a74104da4dc40f30ebe57a47468818c811119ed629ffa565f3ed58ce0b12b292b4304a2b364a83faff41ba14ea747f4e1c88 WHIRLPOOL bf7011f50360516f76ea5e176aea7d761193de877a5357a54704c60d512faf1af8e8e2450c547b5181fba98ee627a297b1c573e147c4db623324c1c35396330d
 DIST NVIDIA-Linux-armv7l-gnueabihf-370.28.run 26117701 SHA256 efb60a23aa22b46e94e91d5f5a5fc0c17b47bcf50471e4371653ced5a5350dce SHA512 04699849441bccfb9214fda4c7ff8ecefa11249d1fbfe470e37fefdd132becc225a1bcc16bc976c3fb145a427961f5402c95ecc84b613adb71caef9c96fe7d90 WHIRLPOOL 675a495594c46666ec11c83a76cdc8821e9b57079ee53cd7adcf00e783d121e163b7c5b10598aa55a1fee72eee47defc514fba986685af41c90ab2c5d890abbd
-DIST NVIDIA-Linux-armv7l-gnueabihf-375.10.run 26701426 SHA256 ba2d6ac96a498b5db08942564598e8f228ed5ca2c329ba601b3f94aa6444b328 SHA512 677b7b0d769ba00010b58fb5ad0b6334e1e7d0bb390e7d07d36f922b83fd3c66bd70f4431e0d0c0b35a8644fc9d5014421fb44009cedd20839310b3090efb414 WHIRLPOOL b7c23ebb17da16e9dc69d3de387129842b71c10fed24759e725c0e0420a2124a33ce19a578f86c9986d2ba36c35fe577b4d260b7d384ce14fc94a62dac95f2b5
 DIST NVIDIA-Linux-armv7l-gnueabihf-375.20.run 26238901 SHA256 dd28db61f89311240a76c0a82d1324f352879bfcb0c58fd6403fd9f783e43f0e SHA512 f52d66928bb5370bdfe7d7a119b8a8e73c4832b32bb372f24856bbd35c4f338fcb170b05f92f579c9d0849a84c4fa0e3d6b0e8de6b23aac564dfb9f3fabf725a WHIRLPOOL 0383789b871e50a532deeaf27414d0a518dbba93d6eb4fcd08e6fcc47260d67f48852458c6302d7dee0addc89e3dbdd7ce074cdfdee5b0bbeecb70c0c44892b2
 DIST NVIDIA-Linux-x86-173.14.39-pkg0.run 15134997 SHA256 a09935f37121ed3db8ae3da63a0d8e9d4348a19c859811c9fe44d6ce8e3eab23 SHA512 e24e15ccec725d3cbca502c2b77061776a81ef92917a950adec4ff6bdc34f10903aa654433177ea74be0dade4af81c5380d5710d375a5ea445940d06154bde93 WHIRLPOOL fce3d8e4f6cdf698f5a057514b6fe220bb1011025bdce5bd4cf0e424fb4d306d38251b6726bda03f290ea8137d5a95ed418cf8751722879f9042462abd9181b6
 DIST NVIDIA-Linux-x86-304.131.run 40893199 SHA256 d2554bb6f7867e7762d0ecedcac5bde7de0634e43b952bf466323ea8b4032da8 SHA512 3e67c40648554dc49472081eee88ae982c3b235b3346e4d9e7fb5ae33ec5f10ed088da804ac7d8bd1565995df3861f12b3560030cd3a19339a2d35768b0a943e WHIRLPOOL 88e9cc0270a4fc64ed8475a217c7c8c50e6ea21fe14b5b5beb16f494bd62bf5ada2f47e26e5380dd3d0bc678091e29f0e26937eef1ee3c7bdc5805153201bae3
@@ -81,7 +78,6 @@ DIST NVIDIA-Linux-x86-367.35.run 44717708 SHA256 38cb22fa85ef74ea960d3e5d644838c
 DIST NVIDIA-Linux-x86-367.44.run 44079774 SHA256 b2ad4d0d4a2e98528e877ae0d98c38039c2400b09cfb5928cd21899f3a991291 SHA512 5dbeda283b277697eb161b01a6d361a68fcc5e982fcbb9f6c9d08705c9af8b0bf3d78cf68feddce9d72407eea3ccabf955d404975fce5e56d1690bc5008577da WHIRLPOOL ea5f4f9c43cfb6db33906e715fa6b4d5a298e4bbf76959c18589753bcce5b2faa91c38e0aad10e3bcd89b28ee2ee8b73da3deee6c048bebc08fe93e32e214b7e
 DIST NVIDIA-Linux-x86-367.57.run 44731570 SHA256 43d4e926f71ac6c581018badf467458709822e97a7564ed9f1b521b7b63d88bb SHA512 6316cdd94131057a584b3a893cfbca5e8b0f5e79060cb5bfe2c149b5a76bdcdc21d20338febb54f7201985c5b05545c3f6b63b26c32699717057cfb047993972 WHIRLPOOL 443ca9b389f78c13ae5344cb3cce67035a2b5a605b94518d91c253965263d37a84dff9ca29d47509a2d43017afde4786a55bfd45613882b5d4889dc27b67622f
 DIST NVIDIA-Linux-x86-370.28.run 44189522 SHA256 6323254ccf2a75d7ced1374a76ca56778689d0d8a9819e4ee5378ea3347b9835 SHA512 2df8b3d1064073c8b793287994fe0648625d095f3434b7b67531e19632cbad318994df90b55de18aa457d55a1374b35d64a646564259995d3f2197c48737921c WHIRLPOOL 85a089c833311abdc06bbc1fc68cd5ff8ed43dd5e5887d340dc854f905ae741de0ae4343d024259f493dd668075096c460bc1f93c1795d2befb81dd3c4a4983a
-DIST NVIDIA-Linux-x86-375.10.run 44518154 SHA256 77c06d9c6831d6d1b53276d0741eddac4aab2f2f02b7c1fe14b86aa982aacd69 SHA512 b68af4b00a98f9f22ae2a41fdde7d823d22a7b3587b80860b206b96b6121adec203b81c258ee5ba3e20dfd0ba60337f95de268d96d417cc0b39a2822b7021017 WHIRLPOOL 7e3c05595f6cb3d654f708b7bc31c11beb3631f67c75490c09acbee2da4d90de8799890cf108babe3870e21590e8bd675c09b47fc5afd24e119f3630e7d07831
 DIST NVIDIA-Linux-x86-375.20.run 44542058 SHA256 cc79d3ac2b688009ed2e47a1cf27557aea5dd745b3b6e9b83945c359ddab4335 SHA512 8f922b3cde613dbc5933f38fa3d57e37afe4ac68e3cd37894d7f8d42258290ddbab0fb5f51623c06fa3474718f6a55ee0187e23aa51e3131e050446986b96420 WHIRLPOOL 87faa367cd0833cb4a4b4d5d825676963a1c7fa985539c67c048a25fcc30bc7b88390acfca4f407bdcde252f63cdf081de22eb6fac9b4c09a5cdd9b5662dbef5
 DIST NVIDIA-Linux-x86-96.43.23-pkg0.run 11504817 SHA256 51e6adf4ba73071622045fc37169f80db3ae3e784dff53b29d35146a04042142 SHA512 bed5726e57637481fe4e3c03a65ec14fe949f00860e729ebde408f4fd861d7bfdc296a78bc2f5d42e8b282db09f4bbde1e0545df7228fa20227080dc4b868ba7 WHIRLPOOL 6d4fd1786c11f4e326cc3101d0bb1a2f8b63c25c3dd59f10188f8355759e2861ce44fd53d60258b513d5a1d6124d0f91ba8edf4d3668b6feabfb3e8d585f14fe
 DIST NVIDIA-Linux-x86_64-173.14.39-pkg2.run 21100833 SHA256 15a953666d5681ba54c97498b578ffd286a1dc96d605f3b02110f3f99813100e SHA512 a65cd496e6ed57f771c3d99f37f616a1242d97844f6faef7a807825ad899c0e536a99fde397020839f0857883b934032f9491024f3047a6b06d3eea1f5d77713 WHIRLPOOL dc5f243b7d1de7e2d1b7f005e018a2940d63335b11a7c83c234b348b7a1839e9131169d2ea928bd8c2f549a4535149b03e16e6c94d59dfa745f7f904ff790a45
@@ -108,7 +104,6 @@ DIST NVIDIA-Linux-x86_64-367.35.run 75600336 SHA256 d2df3fcb1a145984b9de4f2f38a9
 DIST NVIDIA-Linux-x86_64-367.44.run 75032664 SHA256 09a4e67afa79c159f96071215bac3e027b553117b91ee35a4ff134a98d8fe7cc SHA512 efb97ee084f68a0d4ad658f8700fec14a3b3f5ec585a14efa88be791f951445d8b6b944103bfb95408aeb43618f1a1f6fda5ab4ad7f7d2de82f1a7e92f354fa1 WHIRLPOOL 54c642a3c6b9065980569fb45cd358296205c6aa483cb1c402bc75a26f00c95783786b7f0414b11a19f0c7233c77f802c0d40494d5c859ae5c4c8da5f4eeaf33
 DIST NVIDIA-Linux-x86_64-367.57.run 77127324 SHA256 a1615db29f1377817b610cca997e0339753ee9d58b28e1618b892691df3a8851 SHA512 fc94f5df7eb2ef243db381bc4458f911a6d76bff949701bedb249a3ebf369ff3da8dc5a7d52ab6ae3f23e947c419923f303cd57429a266a0f8e96df1039b1f5d WHIRLPOOL 5580b7839652c250ba134ecc97438d1810453d5bd5d8cffd44f01379d7509bca6f0c58318a150a5b4786f955d4de708ce9be618572212eca2c7098a36eab24d5
 DIST NVIDIA-Linux-x86_64-370.28.run 76690360 SHA256 90aa3c186e45b39e6fc0064ab8dbda8bcc897cb61d2e7b7cb30b4ec9a4b39239 SHA512 931476f92a63d142478b2d6b3da4031769fd3b93aee2387800a78b1354b59a5fb5e4e293436b6b4c246627d51c0f55d140ab230de385cb1567bc8b25518eb741 WHIRLPOOL ce866c38291d2ab4aeeff05654a0e61196129f77baea5af93ddbc22fab9574ba39cc05d58020ea2407cc7342f0bcf5c2702d42290f4cc3b53c9e04fb7c617413
-DIST NVIDIA-Linux-x86_64-375.10.run 77354052 SHA256 62ebba84f30e58b618843d8d0d630693808cd75154945e46850c10d797746af1 SHA512 b689c5f3e3b2537c70ebe658f133771c31acee5818dde19adbe97b8f2194d33cffcfea29a1727a5658e8ca667fd89d077177eed163ff3cfb0abe7b8a892d73fa WHIRLPOOL 6b6dd1a2290fd1df65912f5fdf5a47a1c208b86b2014116d1199b3b45c2413c894badf9867ac9d09e0e0bb532ce8593720f2123b8466a3fd416a84bff3ce237e
 DIST NVIDIA-Linux-x86_64-375.20.run 75886564 SHA256 d10e40a19dc57ac958567a2b247c2b113e5f1e4186ad48e9a58e70a46d07620b SHA512 96daf0d9e3d8e42f7dd46d759a09d95b6745c719960cefd590abf927034ce2ab369422a0cc8e5ebe76de3c92068ea2b0e1c89106f7285c589bff166b2c3e9c1e WHIRLPOOL 72e0db9b94bf8a81af2562b6405ff6b7928283641e3013e2389314529120024426a125f189901753db858e10a20cf622fa8d06d3dbd262b65bf539cf3b0d7978
 DIST NVIDIA-Linux-x86_64-96.43.23-pkg2.run 15962375 SHA256 ce8d8253e7dab7da63fbdac449ebf190cd0c10cbfffea0f8d0165515f851bc64 SHA512 04bec1187a6024a2b9839f008ec829281f1f2602dae2e639030bc385943186506bcaa2b46a230b2ab87f9217190841abc62f9e2d6395ab5559623389c31c6563 WHIRLPOOL 0651c44a51a1a06fcff5bfddbf9c3e408977e03263c7fe806cb6c01f9fe92f716dfe4e5190ffe1048bde72fcffdc8bca8267e74dd43ba5c9dfb22b6201fcc2bb
 DIST nvidia-settings-304.131.tar.bz2 1480447 SHA256 d36d2d1ae7c1bb72cd18e713470546d2aa7057624b1f61319daf559a94054d29 SHA512 9269f54f87581e29e6d7cabeaf989c70cb27aa55f6b8f5f1c71b8a14401326d06ea194710722b41283cca56f5808b90a9b1fb12158d48c6332cce15a701c5796 WHIRLPOOL be8e38a09a0bfa40267b9cdae2800a9ef00a89e28e618b743b7acb0cd9ece4b242b74ced32018d735989592300b49b2ee683caa11a1e161bcecf070a58952dfd
@@ -131,6 +126,4 @@ DIST nvidia-settings-367.35.tar.bz2 1572606 SHA256 6b0cf0b63bbf8c3d29538587bad8b
 DIST nvidia-settings-367.44.tar.bz2 1571750 SHA256 74ca3c7ac3e75c13b6aaef92739e2bdb6c9c83e4d860cbe0f1474746c6123fc4 SHA512 d021b162f1cb027da4c4f87e68608fb2efa01f82e2fb739c76b7acd2a2468aca17e9b0b56a61e2a5e2b9f34e3232f373a268eabbfa6ee49f9e9548d53affde0c WHIRLPOOL 36f8d2ab83ca12f02adab1ccd9d62cf763de916c0cf1cc5f18a14bc8428df2ee91fd270d481d225766919fc2b14361da33c5baaf83fc14e82bdc624c88a7ea3f
 DIST nvidia-settings-367.57.tar.bz2 1571905 SHA256 aacb66b130e4adc034e10afb518c919a96029b31b14da8975b08d250d8750140 SHA512 57bf414f4aefacd994e73ea3b31de8cf9f5d6ddc9a95ea1456c21905510c4ba9219e690a1b1bb1346b57a80caf9856c5fede80734163392f0788b995d1bd4cea WHIRLPOOL 7294f84afe8a00f59e2073773d12dc0b31273ab49fe318558eee84a72b7df1233fa004949c0512bff1974c5edbc4749eed68e172336241ea9cb24d6c585a8979
 DIST nvidia-settings-370.28.tar.bz2 1573509 SHA256 59d7818a4837144e373ce958233db059fde59e279477001e187579770ebf0c5f SHA512 c4da6ae54839a8f91d3557153a648f69095e9a486dbaaf73e453d625660f1adcada12ee5c4bccc1afe2cfd454ead13c1df0e59d5d6aa70f6065823d53f7bb461 WHIRLPOOL e5f0a9fd67e50aee42598d6a0ce9a69a162405a6121518c7aaf9ede409e9bdeb44e3102a123eb6f8c963e0fdaca429a8b693f6af2f0467e746c42f57a496d45f
-DIST nvidia-settings-375.10.tar.bz2 1586956 SHA256 ebd94c777d2ea1107a116f16e2adddd2f482dff28bfceec0feeab62d09f1b600 SHA512 6aee82c3efc79af1c4c5b7e00505d5f8996925d2c909c7c7bbbfb7c56919a0e6d4f871146dc6ad33ff703bb700f8f82451bf7947e34e80eeb9370abb769e2c7b WHIRLPOOL 77733ae4cefccb05a9c582248307be0b17ef66ee128309603e975e99e19ca3803873ef720d248199601ff1f681f40a3134ef7703bfd3cdc756f0b3ea4b355042
 DIST nvidia-settings-375.20.tar.bz2 1614521 SHA256 40cd293e79bda131147187f281578e2b1f887c05bee78f671bde329af4956ada SHA512 e47d482a4c844ae8ef3c29f249333f6176a39f1a6e1dbcb87497a9117f5158fe68136a74739aae071ceac14bf779362c0484382e10b803503a605e7867ab4cbd WHIRLPOOL 9969d420f14f1bf3e7ed5dabd86438678d997089aef9ac1025f0585ddc87201d3558833dc3b9ce6d13415a2f484610b9a0d923b4cbeaae79d889a880d9475126
-DIST nvml.h-375.10 225272 SHA256 44feb6022fdbd27b486d74fc8473d8bc46caeec59963514e53d5cc7bc2bc9f15 SHA512 ebd6b5551a58e5cad17b7cae472a32fa2cfdf79ead62804ca3ecf204b0bc7a215f799666950b62d4938eb983edbf554bc65a7a6200e61639a5da57f884af55b9 WHIRLPOOL 0ee6c64caea1ece104fd67a5c40c9c4dfe785b1effa0da7260887e9b471b2a9e8848f4a06ce8a264606c96c0ba06eb49c053f1d1405b5eb9c030c80bce2071b2

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-375.10-profiles-rc.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-375.10-profiles-rc.patch
deleted file mode 100644
index 0b717dd..00000000
--- a/x11-drivers/nvidia-drivers/files/nvidia-drivers-375.10-profiles-rc.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/nvidia-application-profiles-375.10-rc
-+++ b/nvidia-application-profiles-375.10-rc
-@@ -44,7 +44,7 @@
-         {
-           "name" : "NamedVertexAttributesApplyDivisor",
-           "settings" : [ "GL23cd0e", 1 ]
--        },
-+        }
-     ],
-     "rules" : [
-         {

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-375.10-r1.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-375.10-r1.ebuild
deleted file mode 100644
index 7dbd015..00000000
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-375.10-r1.ebuild
+++ /dev/null
@@ -1,568 +0,0 @@
-# Copyright 1999-2016 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=6
-
-inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \
-	portability toolchain-funcs unpacker user udev
-
-NV_URI="http://us.download.nvidia.com/XFree86/"
-X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
-AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
-ARM_NV_PACKAGE="NVIDIA-Linux-armv7l-gnueabihf-${PV}"
-X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
-AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
-
-DESCRIPTION="NVIDIA Accelerated Graphics Driver"
-HOMEPAGE="http://www.nvidia.com/ http://www.nvidia.com/Download/Find.aspx"
-SRC_URI="
-	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
-	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
-	arm? ( ${NV_URI}Linux-x86-ARM/${PV}/${ARM_NV_PACKAGE}.run )
-	x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
-	x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
-	tools? (
-		ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2
-		https://raw.githubusercontent.com/NVIDIA/nvidia-settings/168e17f53098254b4a5ab93eeb2f23c80ca1d97f/src/nvml.h -> nvml.h-${PV}
-	)
-"
-
-LICENSE="GPL-2 NVIDIA-r2"
-SLOT="0/${PV%.*}"
-KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
-RESTRICT="bindist mirror"
-EMULTILIB_PKG="true"
-
-IUSE="acpi compat +driver gtk3 kernel_FreeBSD kernel_linux +kms multilib pax_kernel static-libs +tools uvm wayland +X"
-REQUIRED_USE="
-	tools? ( X )
-	static-libs? ( tools )
-"
-
-COMMON="
-	app-eselect/eselect-opencl
-	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
-	tools? (
-		dev-libs/atk
-		dev-libs/glib:2
-		dev-libs/jansson
-		gtk3? ( x11-libs/gtk+:3 )
-		x11-libs/cairo
-		x11-libs/gdk-pixbuf[X]
-		x11-libs/gtk+:2
-		x11-libs/libX11
-		x11-libs/libXext
-		x11-libs/libXrandr
-		x11-libs/libXv
-		x11-libs/libXxf86vm
-		x11-libs/pango[X]
-	)
-	X? (
-		>=app-eselect/eselect-opengl-1.0.9
-		app-misc/pax-utils
-	)
-"
-DEPEND="
-	${COMMON}
-	kernel_linux? ( virtual/linux-sources )
-"
-RDEPEND="
-	${COMMON}
-	acpi? ( sys-power/acpid )
-	tools? ( !media-video/nvidia-settings )
-	wayland? ( dev-libs/wayland )
-	X? (
-		<x11-base/xorg-server-1.18.99:=
-		>=x11-libs/libvdpau-1.0
-		multilib? (
-			>=x11-libs/libX11-1.6.2[abi_x86_32]
-			>=x11-libs/libXext-1.3.2[abi_x86_32]
-		)
-	)
-"
-
-QA_PREBUILT="opt/* usr/lib*"
-
-S=${WORKDIR}/
-
-pkg_pretend() {
-	if use amd64 && has_multilib_profile && \
-		[ "${DEFAULT_ABI}" != "amd64" ]; then
-		eerror "This ebuild doesn't currently support changing your default ABI"
-		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
-	fi
-
-	if use kernel_linux && kernel_is ge 4 8; then
-		ewarn "Gentoo supports kernels which are supported by NVIDIA"
-		ewarn "which are limited to the following kernels:"
-		ewarn "<sys-kernel/gentoo-sources-4.8"
-		ewarn "<sys-kernel/vanilla-sources-4.8"
-		ewarn ""
-		ewarn "You are free to utilize epatch_user to provide whatever"
-		ewarn "support you feel is appropriate, but will not receive"
-		ewarn "support as a result of those changes."
-		ewarn ""
-		ewarn "Do not file a bug report about this."
-		ewarn ""
-	fi
-
-	# Since Nvidia ships many different series of drivers, we need to give the user
-	# some kind of guidance as to what version they should install. This tries
-	# to point the user in the right direction but can't be perfect. check
-	# nvidia-driver.eclass
-	nvidia-driver-check-warning
-
-	# Kernel features/options to check for
-	CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
-	use x86 && CONFIG_CHECK+=" ~HIGHMEM"
-
-	# Now do the above checks
-	use kernel_linux && check_extra_config
-}
-
-pkg_setup() {
-	# try to turn off distcc and ccache for people that have a problem with it
-	export DISTCC_DISABLE=1
-	export CCACHE_DISABLE=1
-
-	if use driver && use kernel_linux; then
-		MODULE_NAMES="nvidia(video:${S}/kernel)"
-		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
-		use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel) nvidia-drm(video:${S}/kernel)"
-
-		# This needs to run after MODULE_NAMES (so that the eclass checks
-		# whether the kernel supports loadable modules) but before BUILD_PARAMS
-		# is set (so that KV_DIR is populated).
-		linux-mod_pkg_setup
-
-		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
-		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
-
-		# linux-mod_src_compile calls set_arch_to_kernel, which
-		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
-		# expects x86_64 or i386 and then converts it to x86
-		# later on in the build process
-		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
-	fi
-
-	if use kernel_linux && kernel_is lt 2 6 9; then
-		eerror "You must build this against 2.6.9 or higher kernels."
-	fi
-
-	# set variables to where files are in the package structure
-	if use kernel_FreeBSD; then
-		use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
-		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
-		NV_DOC="${S}/doc"
-		NV_OBJ="${S}/obj"
-		NV_SRC="${S}/src"
-		NV_MAN="${S}/x11/man"
-		NV_X11="${S}/obj"
-		NV_SOVER=1
-	elif use kernel_linux; then
-		NV_DOC="${S}"
-		NV_OBJ="${S}"
-		NV_SRC="${S}/kernel"
-		NV_MAN="${S}"
-		NV_X11="${S}"
-		NV_SOVER=${PV}
-	else
-		die "Could not determine proper NVIDIA package"
-	fi
-}
-
-src_prepare() {
-	if use tools; then
-		cp "${DISTDIR}"/nvml.h-${PV} "${S}"/nvidia-settings-${PV}/src/nvml.h || die
-
-		ln -s libnvidia-ml.so.${PV} libnvidia-ml.so || die
-		if use multilib; then
-			pushd 32/ 2>/dev/null || die
-			ln -s libnvidia-ml.so.${PV} libnvidia-ml.so || die
-			popd 2>/dev/null || die
-		fi
-
-		sed -i -e "s|-lnvidia-ml|-L../../ &|g" nvidia-settings-${PV}/src/Makefile || die
-	fi
-
-	eapply "${FILESDIR}"/${P}-profiles-rc.patch
-
-	if use pax_kernel; then
-		ewarn "Using PAX patches is not supported. You will be asked to"
-		ewarn "use a standard kernel should you have issues. Should you"
-		ewarn "need support with these patches, contact the PaX team."
-		eapply "${FILESDIR}"/${PN}-364.12-pax.patch
-	fi
-
-	# Allow user patches so they can support RC kernels and whatever else
-	eapply_user
-}
-
-src_compile() {
-	# This is already the default on Linux, as there's no toplevel Makefile, but
-	# on FreeBSD there's one and triggers the kernel module build, as we install
-	# it by itself, pass this.
-
-	cd "${NV_SRC}"
-	if use kernel_FreeBSD; then
-		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
-			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
-	elif use driver && use kernel_linux; then
-		MAKEOPTS=-j1 linux-mod_src_compile
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			AR="$(tc-getAR)" \
-			CC="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			NV_VERBOSE=1 \
-			RANLIB="$(tc-getRANLIB)" \
-			DO_STRIP= \
-			build-xnvctrl
-
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			CC="$(tc-getCC)" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LD="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			NVML_ENABLED=0 \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			NV_VERBOSE=1 \
-			DO_STRIP=
-	fi
-}
-
-# Install nvidia library:
-# the first parameter is the library to install
-# the second parameter is the provided soversion
-# the third parameter is the target directory if it is not /usr/lib
-donvidia() {
-	# Full path to library
-	nv_LIB="${1}"
-
-	# SOVER to use
-	nv_SOVER="$(scanelf -qF'%S#F' ${nv_LIB})"
-
-	# Where to install
-	nv_DEST="${2}"
-
-	# Get just the library name
-	nv_LIBNAME=$(basename "${nv_LIB}")
-
-	if [[ "${nv_DEST}" ]]; then
-		exeinto ${nv_DEST}
-		action="doexe"
-	else
-		nv_DEST="/usr/$(get_libdir)"
-		action="dolib.so"
-	fi
-
-	# Install the library
-	${action} ${nv_LIB} || die "failed to install ${nv_LIBNAME}"
-
-	# If the library has a SONAME and SONAME does not match the library name,
-	# then we need to create a symlink
-	if [[ ${nv_SOVER} ]] && ! [[ "${nv_SOVER}" = "${nv_LIBNAME}" ]]; then
-		dosym ${nv_LIBNAME} ${nv_DEST}/${nv_SOVER} \
-			|| die "failed to create ${nv_DEST}/${nv_SOVER} symlink"
-	fi
-
-	dosym ${nv_LIBNAME} ${nv_DEST}/${nv_LIBNAME/.so*/.so} \
-		|| die "failed to create ${nv_LIBNAME/.so*/.so} symlink"
-}
-
-src_install() {
-	if use driver && use kernel_linux; then
-		linux-mod_src_install
-
-		# Add the aliases
-		# This file is tweaked with the appropriate video group in
-		# pkg_preinst, see bug #491414
-		insinto /etc/modprobe.d
-		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
-		doins "${FILESDIR}"/nvidia-rmmod.conf
-
-		# Ensures that our device nodes are created when not using X
-		exeinto "$(get_udevdir)"
-		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
-		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
-	elif use kernel_FreeBSD; then
-		if use x86-fbsd; then
-			insinto /boot/modules
-			doins "${S}/src/nvidia.kld"
-		fi
-
-		exeinto /boot/modules
-		doexe "${S}/src/nvidia.ko"
-	fi
-
-	# NVIDIA kernel <-> userspace driver config lib
-	donvidia ${NV_OBJ}/libnvidia-cfg.so.${NV_SOVER}
-
-	# NVIDIA framebuffer capture library
-	donvidia ${NV_OBJ}/libnvidia-fbc.so.${NV_SOVER}
-
-	# NVIDIA video encode/decode <-> CUDA
-	if use kernel_linux; then
-		donvidia ${NV_OBJ}/libnvcuvid.so.${NV_SOVER}
-		donvidia ${NV_OBJ}/libnvidia-encode.so.${NV_SOVER}
-	fi
-
-	if use X; then
-		# Xorg DDX driver
-		insinto /usr/$(get_libdir)/xorg/modules/drivers
-		doins ${NV_X11}/nvidia_drv.so
-
-		# Xorg GLX driver
-		donvidia ${NV_X11}/libglx.so.${NV_SOVER} \
-			/usr/$(get_libdir)/opengl/nvidia/extensions
-
-		# Xorg nvidia.conf
-		if has_version '>=x11-base/xorg-server-1.16'; then
-			insinto /usr/share/X11/xorg.conf.d
-			newins {,50-}nvidia-drm-outputclass.conf
-		fi
-	fi
-
-	# OpenCL ICD for NVIDIA
-	if use kernel_linux; then
-		insinto /etc/OpenCL/vendors
-		doins ${NV_OBJ}/nvidia.icd
-	fi
-
-	# Documentation
-	dohtml ${NV_DOC}/html/*
-	if use kernel_FreeBSD; then
-		dodoc "${NV_DOC}/README"
-		use X && doman "${NV_MAN}/nvidia-xconfig.1"
-		use tools && doman "${NV_MAN}/nvidia-settings.1"
-	else
-		# Docs
-		newdoc "${NV_DOC}/README.txt" README
-		dodoc "${NV_DOC}/NVIDIA_Changelog"
-		doman "${NV_MAN}/nvidia-smi.1.gz"
-		use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
-		use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
-		doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
-	fi
-
-	# Helper Apps
-	exeinto /opt/bin/
-
-	if use X; then
-		doexe ${NV_OBJ}/nvidia-xconfig
-
-		insinto /etc/vulkan/icd.d
-		doins nvidia_icd.json
-	fi
-
-	if use kernel_linux; then
-		doexe ${NV_OBJ}/nvidia-cuda-mps-control
-		doexe ${NV_OBJ}/nvidia-cuda-mps-server
-		doexe ${NV_OBJ}/nvidia-debugdump
-		doexe ${NV_OBJ}/nvidia-persistenced
-		doexe ${NV_OBJ}/nvidia-smi
-
-		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
-		doexe ${NV_OBJ}/nvidia-modprobe
-		fowners root:video /opt/bin/nvidia-modprobe
-		fperms 4710 /opt/bin/nvidia-modprobe
-		dosym /{opt,usr}/bin/nvidia-modprobe
-
-		doman nvidia-cuda-mps-control.1.gz
-		doman nvidia-modprobe.1.gz
-		doman nvidia-persistenced.1.gz
-		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
-		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
-		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src/ \
-			DESTDIR="${D}" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LIBDIR="${D}/usr/$(get_libdir)" \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			NV_VERBOSE=1 \
-			PREFIX=/usr \
-			DO_STRIP= \
-			install
-
-		if use static-libs; then
-			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
-
-			insinto /usr/include/NVCtrl
-			doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
-		fi
-
-		insinto /usr/share/nvidia/
-		doins nvidia-application-profiles-${PV}-key-documentation
-
-		insinto /etc/nvidia
-		newins \
-			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
-
-		# There is no icon in the FreeBSD tarball.
-		use kernel_FreeBSD || \
-			doicon ${NV_OBJ}/nvidia-settings.png
-
-		domenu "${FILESDIR}"/nvidia-settings.desktop
-
-		exeinto /etc/X11/xinit/xinitrc.d
-		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
-	fi
-
-	dobin ${NV_OBJ}/nvidia-bug-report.sh
-
-	if has_multilib_profile && use multilib; then
-		local OABI=${ABI}
-		for ABI in $(get_install_abis); do
-			src_install-libs
-		done
-		ABI=${OABI}
-		unset OABI
-	else
-		src_install-libs
-	fi
-
-	is_final_abi || die "failed to iterate through all ABIs"
-
-	readme.gentoo_create_doc
-}
-
-src_install-libs() {
-	local inslibdir=$(get_libdir)
-	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
-	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
-	local libdir=${NV_OBJ}
-
-	if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
-		libdir=${NV_OBJ}/32
-	fi
-
-	if use X; then
-		NV_GLX_LIBRARIES=(
-			"libEGL.so.1 ${GL_ROOT}"
-			"libEGL_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGL.so.$(usex compat ${NV_SOVER} 1.0.0) ${GL_ROOT}"
-			"libGLESv1_CM.so.1 ${GL_ROOT}"
-			"libGLESv1_CM_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLESv2.so.2 ${GL_ROOT}"
-			"libGLESv2_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLX.so.0 ${GL_ROOT}"
-			"libGLX_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLdispatch.so.0 ${GL_ROOT}"
-			"libOpenCL.so.1.0.0 ${CL_ROOT}"
-			"libOpenGL.so.0 ${GL_ROOT}"
-			"libcuda.so.${NV_SOVER}"
-			"libnvcuvid.so.${NV_SOVER}"
-			"libnvidia-compiler.so.${NV_SOVER}"
-			"libnvidia-eglcore.so.${NV_SOVER}"
-			"libnvidia-encode.so.${NV_SOVER}"
-			"libnvidia-fatbinaryloader.so.${NV_SOVER}"
-			"libnvidia-fbc.so.${NV_SOVER}"
-			"libnvidia-glcore.so.${NV_SOVER}"
-			"libnvidia-glsi.so.${NV_SOVER}"
-			"libnvidia-ifr.so.${NV_SOVER}"
-			"libnvidia-opencl.so.${NV_SOVER}"
-			"libnvidia-ptxjitcompiler.so.${NV_SOVER}"
-			"libvdpau_nvidia.so.${NV_SOVER}"
-		)
-
-		if use wayland && has_multilib_profile && [[ ${ABI} == "amd64" ]];
-		then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-egl-wayland.so.${NV_SOVER}"
-			)
-		fi
-
-		if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
-		then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-wfb.so.${NV_SOVER}"
-			)
-		fi
-
-		if use kernel_FreeBSD; then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-tls.so.${NV_SOVER}"
-			)
-		fi
-
-		if use kernel_linux; then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-ml.so.${NV_SOVER}"
-				"tls/libnvidia-tls.so.${NV_SOVER}"
-			)
-		fi
-
-		for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
-			donvidia ${libdir}/${NV_LIB}
-		done
-	fi
-}
-
-pkg_preinst() {
-	if use driver && use kernel_linux; then
-		linux-mod_pkg_preinst
-
-		local videogroup="$(egetent group video | cut -d ':' -f 3)"
-		if [ -z "${videogroup}" ]; then
-			eerror "Failed to determine the video group gid"
-			die "Failed to determine the video group gid"
-		else
-			sed -i \
-				-e "s:PACKAGE:${PF}:g" \
-				-e "s:VIDEOGID:${videogroup}:" \
-				"${D}"/etc/modprobe.d/nvidia.conf || die
-		fi
-	fi
-
-	# Clean the dynamic libGL stuff's home to ensure
-	# we dont have stale libs floating around
-	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ]; then
-		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
-	fi
-	# Make sure we nuke the old nvidia-glx's env.d file
-	if [ -e "${ROOT}"/etc/env.d/09nvidia ]; then
-		rm -f "${ROOT}"/etc/env.d/09nvidia
-	fi
-}
-
-pkg_postinst() {
-	use driver && use kernel_linux && linux-mod_pkg_postinst
-
-	# Switch to the nvidia implementation
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
-	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
-
-	readme.gentoo_print_elog
-
-	if ! use X; then
-		elog "You have elected to not install the X.org driver. Along with"
-		elog "this the OpenGL libraries and VDPAU libraries were not"
-		elog "installed. Additionally, once the driver is loaded your card"
-		elog "and fan will run at max speed which may not be desirable."
-		elog "Use the 'nvidia-smi' init script to have your card and fan"
-		elog "speed scale appropriately."
-		elog
-	fi
-	if ! use tools; then
-		elog "USE=tools controls whether the nvidia-settings application"
-		elog "is installed. If you would like to use it, enable that"
-		elog "flag and re-emerge this ebuild. Optionally you can install"
-		elog "media-video/nvidia-settings"
-		elog
-	fi
-}
-
-pkg_prerm() {
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}
-
-pkg_postrm() {
-	use driver && use kernel_linux && linux-mod_pkg_postrm
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-375.10.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-375.10.ebuild
deleted file mode 100644
index 19a45e7..00000000
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-375.10.ebuild
+++ /dev/null
@@ -1,560 +0,0 @@
-# Copyright 1999-2016 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=6
-
-inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \
-	portability toolchain-funcs unpacker user udev
-
-NV_URI="http://us.download.nvidia.com/XFree86/"
-X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
-AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
-ARM_NV_PACKAGE="NVIDIA-Linux-armv7l-gnueabihf-${PV}"
-X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
-AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
-
-DESCRIPTION="NVIDIA Accelerated Graphics Driver"
-HOMEPAGE="http://www.nvidia.com/ http://www.nvidia.com/Download/Find.aspx"
-SRC_URI="
-	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
-	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
-	arm? ( ${NV_URI}Linux-x86-ARM/${PV}/${ARM_NV_PACKAGE}.run )
-	x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
-	x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
-	tools? (
-		ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2
-		https://raw.githubusercontent.com/NVIDIA/nvidia-settings/168e17f53098254b4a5ab93eeb2f23c80ca1d97f/src/nvml.h -> nvml.h-${PV}
-	)
-"
-
-LICENSE="GPL-2 NVIDIA-r2"
-SLOT="0/${PV%.*}"
-KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
-RESTRICT="bindist mirror"
-EMULTILIB_PKG="true"
-
-IUSE="acpi compat +driver gtk3 kernel_FreeBSD kernel_linux +kms multilib pax_kernel static-libs +tools uvm wayland +X"
-REQUIRED_USE="
-	tools? ( X )
-	static-libs? ( tools )
-"
-
-COMMON="
-	app-eselect/eselect-opencl
-	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
-	tools? (
-		dev-libs/atk
-		dev-libs/glib:2
-		dev-libs/jansson
-		gtk3? ( x11-libs/gtk+:3 )
-		x11-libs/cairo
-		x11-libs/gdk-pixbuf[X]
-		x11-libs/gtk+:2
-		x11-libs/libX11
-		x11-libs/libXext
-		x11-libs/libXrandr
-		x11-libs/libXv
-		x11-libs/libXxf86vm
-		x11-libs/pango[X]
-	)
-	X? (
-		>=app-eselect/eselect-opengl-1.0.9
-		app-misc/pax-utils
-	)
-"
-DEPEND="
-	${COMMON}
-	kernel_linux? ( virtual/linux-sources )
-"
-RDEPEND="
-	${COMMON}
-	acpi? ( sys-power/acpid )
-	tools? ( !media-video/nvidia-settings )
-	wayland? ( dev-libs/wayland )
-	X? (
-		<x11-base/xorg-server-1.18.99:=
-		>=x11-libs/libvdpau-1.0
-		multilib? (
-			>=x11-libs/libX11-1.6.2[abi_x86_32]
-			>=x11-libs/libXext-1.3.2[abi_x86_32]
-		)
-	)
-"
-
-QA_PREBUILT="opt/* usr/lib*"
-
-S=${WORKDIR}/
-
-pkg_pretend() {
-	if use amd64 && has_multilib_profile && \
-		[ "${DEFAULT_ABI}" != "amd64" ]; then
-		eerror "This ebuild doesn't currently support changing your default ABI"
-		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
-	fi
-
-	if use kernel_linux && kernel_is ge 4 8; then
-		ewarn "Gentoo supports kernels which are supported by NVIDIA"
-		ewarn "which are limited to the following kernels:"
-		ewarn "<sys-kernel/gentoo-sources-4.8"
-		ewarn "<sys-kernel/vanilla-sources-4.8"
-		ewarn ""
-		ewarn "You are free to utilize epatch_user to provide whatever"
-		ewarn "support you feel is appropriate, but will not receive"
-		ewarn "support as a result of those changes."
-		ewarn ""
-		ewarn "Do not file a bug report about this."
-		ewarn ""
-	fi
-
-	# Since Nvidia ships many different series of drivers, we need to give the user
-	# some kind of guidance as to what version they should install. This tries
-	# to point the user in the right direction but can't be perfect. check
-	# nvidia-driver.eclass
-	nvidia-driver-check-warning
-
-	# Kernel features/options to check for
-	CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
-	use x86 && CONFIG_CHECK+=" ~HIGHMEM"
-
-	# Now do the above checks
-	use kernel_linux && check_extra_config
-}
-
-pkg_setup() {
-	# try to turn off distcc and ccache for people that have a problem with it
-	export DISTCC_DISABLE=1
-	export CCACHE_DISABLE=1
-
-	if use driver && use kernel_linux; then
-		MODULE_NAMES="nvidia(video:${S}/kernel)"
-		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
-		use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel) nvidia-drm(video:${S}/kernel)"
-
-		# This needs to run after MODULE_NAMES (so that the eclass checks
-		# whether the kernel supports loadable modules) but before BUILD_PARAMS
-		# is set (so that KV_DIR is populated).
-		linux-mod_pkg_setup
-
-		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
-		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
-
-		# linux-mod_src_compile calls set_arch_to_kernel, which
-		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
-		# expects x86_64 or i386 and then converts it to x86
-		# later on in the build process
-		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
-	fi
-
-	if use kernel_linux && kernel_is lt 2 6 9; then
-		eerror "You must build this against 2.6.9 or higher kernels."
-	fi
-
-	# set variables to where files are in the package structure
-	if use kernel_FreeBSD; then
-		use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
-		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
-		NV_DOC="${S}/doc"
-		NV_OBJ="${S}/obj"
-		NV_SRC="${S}/src"
-		NV_MAN="${S}/x11/man"
-		NV_X11="${S}/obj"
-		NV_SOVER=1
-	elif use kernel_linux; then
-		NV_DOC="${S}"
-		NV_OBJ="${S}"
-		NV_SRC="${S}/kernel"
-		NV_MAN="${S}"
-		NV_X11="${S}"
-		NV_SOVER=${PV}
-	else
-		die "Could not determine proper NVIDIA package"
-	fi
-}
-
-src_prepare() {
-	if use tools; then
-		cp "${DISTDIR}"/nvml.h-${PV} "${S}"/nvidia-settings-${PV}/src/nvml.h || die
-		sed -i -e 's|-lnvidia-ml|-L../../ &|g' nvidia-settings-${PV}/src/Makefile || die
-	fi
-
-	eapply "${FILESDIR}"/${P}-profiles-rc.patch
-
-	if use pax_kernel; then
-		ewarn "Using PAX patches is not supported. You will be asked to"
-		ewarn "use a standard kernel should you have issues. Should you"
-		ewarn "need support with these patches, contact the PaX team."
-		eapply "${FILESDIR}"/${PN}-364.12-pax.patch
-	fi
-
-	# Allow user patches so they can support RC kernels and whatever else
-	eapply_user
-}
-
-src_compile() {
-	# This is already the default on Linux, as there's no toplevel Makefile, but
-	# on FreeBSD there's one and triggers the kernel module build, as we install
-	# it by itself, pass this.
-
-	cd "${NV_SRC}"
-	if use kernel_FreeBSD; then
-		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
-			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
-	elif use driver && use kernel_linux; then
-		MAKEOPTS=-j1 linux-mod_src_compile
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			AR="$(tc-getAR)" \
-			CC="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			NV_VERBOSE=1 \
-			RANLIB="$(tc-getRANLIB)" \
-			DO_STRIP= \
-			build-xnvctrl
-
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			CC="$(tc-getCC)" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LD="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			NVML_ENABLED=0 \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			NV_VERBOSE=1 \
-			DO_STRIP=
-	fi
-}
-
-# Install nvidia library:
-# the first parameter is the library to install
-# the second parameter is the provided soversion
-# the third parameter is the target directory if it is not /usr/lib
-donvidia() {
-	# Full path to library
-	nv_LIB="${1}"
-
-	# SOVER to use
-	nv_SOVER="$(scanelf -qF'%S#F' ${nv_LIB})"
-
-	# Where to install
-	nv_DEST="${2}"
-
-	# Get just the library name
-	nv_LIBNAME=$(basename "${nv_LIB}")
-
-	if [[ "${nv_DEST}" ]]; then
-		exeinto ${nv_DEST}
-		action="doexe"
-	else
-		nv_DEST="/usr/$(get_libdir)"
-		action="dolib.so"
-	fi
-
-	# Install the library
-	${action} ${nv_LIB} || die "failed to install ${nv_LIBNAME}"
-
-	# If the library has a SONAME and SONAME does not match the library name,
-	# then we need to create a symlink
-	if [[ ${nv_SOVER} ]] && ! [[ "${nv_SOVER}" = "${nv_LIBNAME}" ]]; then
-		dosym ${nv_LIBNAME} ${nv_DEST}/${nv_SOVER} \
-			|| die "failed to create ${nv_DEST}/${nv_SOVER} symlink"
-	fi
-
-	dosym ${nv_LIBNAME} ${nv_DEST}/${nv_LIBNAME/.so*/.so} \
-		|| die "failed to create ${nv_LIBNAME/.so*/.so} symlink"
-}
-
-src_install() {
-	if use driver && use kernel_linux; then
-		linux-mod_src_install
-
-		# Add the aliases
-		# This file is tweaked with the appropriate video group in
-		# pkg_preinst, see bug #491414
-		insinto /etc/modprobe.d
-		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
-		doins "${FILESDIR}"/nvidia-rmmod.conf
-
-		# Ensures that our device nodes are created when not using X
-		exeinto "$(get_udevdir)"
-		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
-		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
-	elif use kernel_FreeBSD; then
-		if use x86-fbsd; then
-			insinto /boot/modules
-			doins "${S}/src/nvidia.kld"
-		fi
-
-		exeinto /boot/modules
-		doexe "${S}/src/nvidia.ko"
-	fi
-
-	# NVIDIA kernel <-> userspace driver config lib
-	donvidia ${NV_OBJ}/libnvidia-cfg.so.${NV_SOVER}
-
-	# NVIDIA framebuffer capture library
-	donvidia ${NV_OBJ}/libnvidia-fbc.so.${NV_SOVER}
-
-	# NVIDIA video encode/decode <-> CUDA
-	if use kernel_linux; then
-		donvidia ${NV_OBJ}/libnvcuvid.so.${NV_SOVER}
-		donvidia ${NV_OBJ}/libnvidia-encode.so.${NV_SOVER}
-	fi
-
-	if use X; then
-		# Xorg DDX driver
-		insinto /usr/$(get_libdir)/xorg/modules/drivers
-		doins ${NV_X11}/nvidia_drv.so
-
-		# Xorg GLX driver
-		donvidia ${NV_X11}/libglx.so.${NV_SOVER} \
-			/usr/$(get_libdir)/opengl/nvidia/extensions
-
-		# Xorg nvidia.conf
-		if has_version '>=x11-base/xorg-server-1.16'; then
-			insinto /usr/share/X11/xorg.conf.d
-			newins {,50-}nvidia-drm-outputclass.conf
-		fi
-	fi
-
-	# OpenCL ICD for NVIDIA
-	if use kernel_linux; then
-		insinto /etc/OpenCL/vendors
-		doins ${NV_OBJ}/nvidia.icd
-	fi
-
-	# Documentation
-	dohtml ${NV_DOC}/html/*
-	if use kernel_FreeBSD; then
-		dodoc "${NV_DOC}/README"
-		use X && doman "${NV_MAN}/nvidia-xconfig.1"
-		use tools && doman "${NV_MAN}/nvidia-settings.1"
-	else
-		# Docs
-		newdoc "${NV_DOC}/README.txt" README
-		dodoc "${NV_DOC}/NVIDIA_Changelog"
-		doman "${NV_MAN}/nvidia-smi.1.gz"
-		use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
-		use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
-		doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
-	fi
-
-	# Helper Apps
-	exeinto /opt/bin/
-
-	if use X; then
-		doexe ${NV_OBJ}/nvidia-xconfig
-	fi
-
-	if use kernel_linux; then
-		doexe ${NV_OBJ}/nvidia-cuda-mps-control
-		doexe ${NV_OBJ}/nvidia-cuda-mps-server
-		doexe ${NV_OBJ}/nvidia-debugdump
-		doexe ${NV_OBJ}/nvidia-persistenced
-		doexe ${NV_OBJ}/nvidia-smi
-
-		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
-		doexe ${NV_OBJ}/nvidia-modprobe
-		fowners root:video /opt/bin/nvidia-modprobe
-		fperms 4710 /opt/bin/nvidia-modprobe
-		dosym /{opt,usr}/bin/nvidia-modprobe
-
-		doman nvidia-cuda-mps-control.1.gz
-		doman nvidia-modprobe.1.gz
-		doman nvidia-persistenced.1.gz
-		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
-		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
-		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src/ \
-			DESTDIR="${D}" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LIBDIR="${D}/usr/$(get_libdir)" \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			NV_VERBOSE=1 \
-			PREFIX=/usr \
-			DO_STRIP= \
-			install
-
-		if use static-libs; then
-			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
-
-			insinto /usr/include/NVCtrl
-			doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
-		fi
-
-		insinto /usr/share/nvidia/
-		doins nvidia-application-profiles-${PV}-key-documentation
-
-		insinto /etc/nvidia
-		newins \
-			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
-
-		# There is no icon in the FreeBSD tarball.
-		use kernel_FreeBSD || \
-			doicon ${NV_OBJ}/nvidia-settings.png
-
-		domenu "${FILESDIR}"/nvidia-settings.desktop
-
-		exeinto /etc/X11/xinit/xinitrc.d
-		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
-
-		insinto /etc/vulkan/icd.d
-		doins nvidia_icd.json
-	fi
-
-	dobin ${NV_OBJ}/nvidia-bug-report.sh
-
-	if has_multilib_profile && use multilib; then
-		local OABI=${ABI}
-		for ABI in $(get_install_abis); do
-			src_install-libs
-		done
-		ABI=${OABI}
-		unset OABI
-	else
-		src_install-libs
-	fi
-
-	is_final_abi || die "failed to iterate through all ABIs"
-
-	readme.gentoo_create_doc
-}
-
-src_install-libs() {
-	local inslibdir=$(get_libdir)
-	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
-	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
-	local libdir=${NV_OBJ}
-
-	if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
-		libdir=${NV_OBJ}/32
-	fi
-
-	if use X; then
-		NV_GLX_LIBRARIES=(
-			"libEGL.so.1 ${GL_ROOT}"
-			"libEGL_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGL.so.$(usex compat ${NV_SOVER} 1.0.0) ${GL_ROOT}"
-			"libGLESv1_CM.so.1 ${GL_ROOT}"
-			"libGLESv1_CM_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLESv2.so.2 ${GL_ROOT}"
-			"libGLESv2_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLX.so.0 ${GL_ROOT}"
-			"libGLX_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLdispatch.so.0 ${GL_ROOT}"
-			"libOpenCL.so.1.0.0 ${CL_ROOT}"
-			"libOpenGL.so.0 ${GL_ROOT}"
-			"libcuda.so.${NV_SOVER}"
-			"libnvcuvid.so.${NV_SOVER}"
-			"libnvidia-compiler.so.${NV_SOVER}"
-			"libnvidia-eglcore.so.${NV_SOVER}"
-			"libnvidia-encode.so.${NV_SOVER}"
-			"libnvidia-fatbinaryloader.so.${NV_SOVER}"
-			"libnvidia-fbc.so.${NV_SOVER}"
-			"libnvidia-glcore.so.${NV_SOVER}"
-			"libnvidia-glsi.so.${NV_SOVER}"
-			"libnvidia-ifr.so.${NV_SOVER}"
-			"libnvidia-opencl.so.${NV_SOVER}"
-			"libnvidia-ptxjitcompiler.so.${NV_SOVER}"
-			"libvdpau_nvidia.so.${NV_SOVER}"
-		)
-
-		if use wayland && has_multilib_profile && [[ ${ABI} == "amd64" ]];
-		then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-egl-wayland.so.${NV_SOVER}"
-			)
-		fi
-
-		if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
-		then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-wfb.so.${NV_SOVER}"
-			)
-		fi
-
-		if use kernel_FreeBSD; then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-tls.so.${NV_SOVER}"
-			)
-		fi
-
-		if use kernel_linux; then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-ml.so.${NV_SOVER}"
-				"tls/libnvidia-tls.so.${NV_SOVER}"
-			)
-		fi
-
-		for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
-			donvidia ${libdir}/${NV_LIB}
-		done
-	fi
-}
-
-pkg_preinst() {
-	if use driver && use kernel_linux; then
-		linux-mod_pkg_preinst
-
-		local videogroup="$(egetent group video | cut -d ':' -f 3)"
-		if [ -z "${videogroup}" ]; then
-			eerror "Failed to determine the video group gid"
-			die "Failed to determine the video group gid"
-		else
-			sed -i \
-				-e "s:PACKAGE:${PF}:g" \
-				-e "s:VIDEOGID:${videogroup}:" \
-				"${D}"/etc/modprobe.d/nvidia.conf || die
-		fi
-	fi
-
-	# Clean the dynamic libGL stuff's home to ensure
-	# we dont have stale libs floating around
-	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ]; then
-		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
-	fi
-	# Make sure we nuke the old nvidia-glx's env.d file
-	if [ -e "${ROOT}"/etc/env.d/09nvidia ]; then
-		rm -f "${ROOT}"/etc/env.d/09nvidia
-	fi
-}
-
-pkg_postinst() {
-	use driver && use kernel_linux && linux-mod_pkg_postinst
-
-	# Switch to the nvidia implementation
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
-	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
-
-	readme.gentoo_print_elog
-
-	if ! use X; then
-		elog "You have elected to not install the X.org driver. Along with"
-		elog "this the OpenGL libraries and VDPAU libraries were not"
-		elog "installed. Additionally, once the driver is loaded your card"
-		elog "and fan will run at max speed which may not be desirable."
-		elog "Use the 'nvidia-smi' init script to have your card and fan"
-		elog "speed scale appropriately."
-		elog
-	fi
-	if ! use tools; then
-		elog "USE=tools controls whether the nvidia-settings application"
-		elog "is installed. If you would like to use it, enable that"
-		elog "flag and re-emerge this ebuild. Optionally you can install"
-		elog "media-video/nvidia-settings"
-		elog
-	fi
-}
-
-pkg_prerm() {
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}
-
-pkg_postrm() {
-	use driver && use kernel_linux && linux-mod_pkg_postrm
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: x11-drivers/nvidia-drivers/, x11-drivers/nvidia-drivers/files/
@ 2017-02-15  6:53 Jeroen Roovers
  0 siblings, 0 replies; 33+ messages in thread
From: Jeroen Roovers @ 2017-02-15  6:53 UTC (permalink / raw
  To: gentoo-commits

commit:     470897d5ee740f4210c9be3aa6cedaa0aeba429d
Author:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 15 06:51:20 2017 +0000
Commit:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
CommitDate: Wed Feb 15 06:51:20 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=470897d5

x11-drivers/nvidia-drivers: Version bump.

Package-Manager: Portage-2.3.3, Repoman-2.3.1

 x11-drivers/nvidia-drivers/Manifest                |  17 +
 .../files/nvidia-drivers-375.39-profiles-rc.patch  |  11 +
 .../nvidia-drivers/nvidia-drivers-340.102.ebuild   | 519 +++++++++++++++++++
 .../nvidia-drivers/nvidia-drivers-375.39.ebuild    | 557 ++++++++++++++++++++
 .../nvidia-drivers/nvidia-drivers-378.13.ebuild    | 560 +++++++++++++++++++++
 5 files changed, 1664 insertions(+)

diff --git a/x11-drivers/nvidia-drivers/Manifest b/x11-drivers/nvidia-drivers/Manifest
index cf35f14932..28a9af05ee 100644
--- a/x11-drivers/nvidia-drivers/Manifest
+++ b/x11-drivers/nvidia-drivers/Manifest
@@ -1,6 +1,7 @@
 DIST NVIDIA-FreeBSD-x86-173.14.39.tar.gz 20038266 SHA256 63a922ce4c5b676b4cb1ace98094dace4cc5408f2553e183df7b2127777a238b SHA512 96982fe7e0751c52fbef534193de09d187b99c1984c05e791223eb804719d8b3ba72efd983f227661ded4b71569bdbb914f1f629ab73a8bc9b8172832ccf3ec6 WHIRLPOOL 21f5906f42adf0064c7a7f81ac8e323de488e6d36356ee42c31a15c31ebb64335d5e2cff0ff022d41de480f9e0a57b3b96387f17151c7b59eceba2c61a7a102b
 DIST NVIDIA-FreeBSD-x86-304.134.tar.gz 35095790 SHA256 e7a164807c83ab0f1be98eb241e76db0ca481d24cd64563c44dfbd73b9067b0f SHA512 99549785683771d19c3877b6778f37622c9b7b3332bced2850f26476e21a258ead69535e199616940f40d4874aee2e8f6007b08c232b3ae17c5667a21c917343 WHIRLPOOL 85909e79083f1e9a87aa88801ab0ee855bd409bf667997037190b14923caee1e0bd53e8b180e54392e3f81b0cdef714318d699757a174c74d3ad0a0cfe70ccb8
 DIST NVIDIA-FreeBSD-x86-340.101.tar.gz 59992166 SHA256 f62038819eb4ba074e92ce8d26b6330ed3bc32d1c07bcc95f4e2964fa667e03b SHA512 b0d3e04acd60c1699850ecebbbdc2677f9691d3acf700effa369daedf3a45d7068c365a3298214acf396d7bcd531cfec26e9ef02e02c0896f01240219b338beb WHIRLPOOL 955e8ad5152137641fcf2d5515e8c3b0a7ed9cac5ab646c2551fb4b1b0c0295ef3e3007905d5b5f2c50daaab1b74b7d6ffeb3f96f617b464c2db745ca4b33473
+DIST NVIDIA-FreeBSD-x86-340.102.tar.gz 12057262 SHA256 d3edf43d6fc518869c35ae8d98ab5d55b86ade71127956ef66b201f60bc5dfe8 SHA512 bf15e68b1eee85e83474aaa480096991eac7506481f1192b53e0e10ff891f177c50c1492c51fb68ce0af3c5ccc54dad60edc90ec42b156e8338e51b9f9542520 WHIRLPOOL 6eb5df57b709ea2c3ab1c81d7a186fd106ff019400d66bc68c91da12d27b0b365e2f1b44c6d41cd45f605a813be1b88d587fcd7b3513c251e3248dc2f243d529
 DIST NVIDIA-FreeBSD-x86-346.96.tar.gz 58010757 SHA256 a27d7b79c053702bf6524b2c4725321fa557be18a585735e0b8122d884348c3e SHA512 f05ff7f98ae56ef992c21440e94dc12537f91353c9ba6fbe74b5928744823cb0cce38e7aa2da6c88569dda52f9ae0f6674c29255db155a2fada9b78f024dda8d WHIRLPOOL d21cfd27971847dac0118429b58b34be24f19fefc9ee05f70454e7c350d4a8678e2d01f7db72e05bd1026c45fa9373783b9817efcf76f70b70f6a5ecd8a5bc7c
 DIST NVIDIA-FreeBSD-x86-352.79.tar.gz 55381403 SHA256 baf99225383aa1b114c14504d00a400b4e2c72b521941210287d5a2f848a6189 SHA512 14dd0f52ae9fbc88b441392e32df6610121baeb5b08337d7a341d110f2735591c91a789c7825ca95fb542693f6971053a00b3dc4d7d224362d7b12a07cb315d5 WHIRLPOOL 7d5ac1efa1afb5a4cf5ef714b27fbc02190775bd11ae281df5552b836a22bc5377572a310c683d54910cbcbf5a4d57702309e5b3e61c295fb767568f8d8746bf
 DIST NVIDIA-FreeBSD-x86-355.11.tar.gz 56832647 SHA256 3d4d5d8fcf558a8f5f1a88846161b1a89bd7fc66c0268b40613c7e3457f5ce7b SHA512 744d9b8c48b82bac0bfeea5e8b2b2bbaa0e6a183cbd1f5d4f782fa7b21a6f6c5b252e556a8b2161c3b5d43938ef8fabf6cb36f995ee823fbf792f3c9a92b87e1 WHIRLPOOL 43bceb8e8d3b00789cf2c8163a055b1d2405ef93e471fda4c4e2146093289891557f4ec8debfe6bca89ad6ed6dc2e389f1d3060759a71e8949df343bc31b85b9
@@ -11,10 +12,13 @@ DIST NVIDIA-FreeBSD-x86-364.19.tar.gz 65807198 SHA256 5096640e9ad8a774fa76d0b64d
 DIST NVIDIA-FreeBSD-x86-367.57.tar.gz 62859799 SHA256 64a0bde687aac1ec2aad859d5bea47d0691b916a851c64992bd460a05ad7c162 SHA512 13269f76d53a1818690ba8fd7aa604783e80059a031e3668c21a70158eeaa97251adda9ac058a712342e95780db86be5b893eebe0422cfce7f1073d88ea9293d WHIRLPOOL 303bebf3d73d8bc232a188c9e3a23164a70fafdd44974e5f5b1873488f682979702e2f18d838d85072a22520d959ded6bb3a4b79cb3d7cafc5de0feca6241061
 DIST NVIDIA-FreeBSD-x86-370.28.tar.gz 58718517 SHA256 52193b15b4ca822b029f860eed4d00270c925f5d24f7bb511a5b7bbea696d58c SHA512 83ffb19069cc240f8836d808a5eb02c142e7ad923fc2e3049a3b316acc12df070d42dfdc5a8a8e1411ccc9fba0bfa4ed84f457435e985434cd86ae966a63a3f4 WHIRLPOOL b1bec4d5e34ea39c3b1b44adcf85b7392cef39517979d32bc800e48a79a57cfb5f1ca5ff82bc302aa67ed12094782e09ab146f021a9c04e18430034a5ab341a9
 DIST NVIDIA-FreeBSD-x86-375.26.tar.gz 59091851 SHA256 5249d01a21bb846a08975c4f3a90935b6dc8fd33ec8e5faa0d624ef15bcf2b88 SHA512 281f41f341ccf7f7c1e0de9a6519813c7fd2d13ef59001c0a6f126cd5b8f2b67848c780ddaf6647e0c8b9a79c12ff77493c07203510084e741746834b26f5fdb WHIRLPOOL 48e5f810f41337f6b8f5db419288ae5050c3efd71d0b4b7f7b64251612860d5c7e83cb78885a73f6752160ca8dce852560db7d95ce93d5d86dba21e59bae5e77
+DIST NVIDIA-FreeBSD-x86-375.39.tar.gz 59111267 SHA256 ca39ab55716516bbca62fc888ec786745a8df7f346e68703f54e1a42afad733e SHA512 8f5bf9ffc731ca90a2604b80c3974ee123a12d7db9ee9be1811f5e78711798d7a29737a3651406c1c5e24a197d50f2f2fc39d94c8d11f9700900ef13266a5bf7 WHIRLPOOL e6ce83478238b2f6497ed48688531a6ba4bf78baa2d376e6c8a0f04b35039ed1532a4618f8a53c60ab0778330313ca1e9eecb836a4ade4c5b006844386d4b23f
 DIST NVIDIA-FreeBSD-x86-378.09.tar.gz 59627824 SHA256 258c7a7bfb1ef5e13ca2049fa0bea801cee042a513f703441257680d9951939d SHA512 66882d42a8907271897486cb0087b8a97b84d60aaeb9b85fb60874823e23d9823771ce277ba1fbd04685779e86873a02ceb6699a3c208e82dfd81465b0f9e640 WHIRLPOOL 7c838e8c8a129b2e3167076817774a41b57254cbd4686f57e230e7898b513603e71f0bfd330386baf0cce6901fbd3031a6f73ac47433b2ed5c764ac3fda9ea6a
+DIST NVIDIA-FreeBSD-x86-378.13.tar.gz 59610253 SHA256 aca461f050950f1a3a81137ec8adf2057deaa20ad166bdd4ce8f3e34616e7a98 SHA512 a0101201089df2bbf5bdc4ded2228dd989da6a47da31c3ec8d55916b1ff3457924555f82c7381934745fdc1b1f8f78e3fc10e5089279eb13423628dbfe560c6b WHIRLPOOL ac67d07d3ffb0959f685b7d59de152ba8fc97e11c30ed3f1a200511bcaf3de1cd1879147f37fde66a1c8d13dd327aac8a9ac78d42cc9656ef79e3180897aaef1
 DIST NVIDIA-FreeBSD-x86-96.43.23.tar.gz 15463464 SHA256 18d855db8381eda1a6cf548c9e5095fc5bb8694bf1d6e24fc1072fba4e54cd78 SHA512 42d7b1b76cdb3b23680363e565614a22112162a5dd3639cb804fe670c0c3f3f23595bbefa3f78afdc6a8ca848446dee853c7a355f2c96a0d01b354753ba2785c WHIRLPOOL f8e59ce521990cd9edee441e73f973f074db492952807a0931e362102874cddbb47604ff5c5eb20a0cbde27f9b6d4e440dd12cc2e5a20c9cb65bf3c0b3e62511
 DIST NVIDIA-FreeBSD-x86_64-304.134.tar.gz 36148973 SHA256 3eafced8f8095c7f1135feaadbfcc709bd7ab96bf755da52ed5ca05a473604f8 SHA512 35b2d74b9fa16a3e826552ddc56cf3d91cfd936ff60c6deb16ed39c110e3d1341e916e9b576c8cba8114896adada4dc44b2e70024cec6ebda6667a405533cf46 WHIRLPOOL 0a40b865675b8d77db0774683696185b3aa0c1586b2cb76ed816fe172ddc276d959ec83f0ccd053781f0721707226b62a65887223549effc638b0375f9d557e3
 DIST NVIDIA-FreeBSD-x86_64-340.101.tar.gz 60860185 SHA256 aa75da2de6656bf8c4b8cf73b9e330b21ebc5da6de509cf90aed8a571716b111 SHA512 0a69e90c2ddd574736ae666fb0216afe639423c8bf73c69e7403bbd5e2aca640f130196402d81924137b34d30befeaaf8174a3fe3ca7efc16a2c5e650e87ab99 WHIRLPOOL b7652dcfc6116f865876cbb43807b1573ee6506e8f626a0da9123efe6fd6987d6bdd3c78dc833a38f0bff78ea290c34ecd69a65f7870248ac2c1bdff6cdb87b5
+DIST NVIDIA-FreeBSD-x86_64-340.102.tar.gz 60862932 SHA256 6d1108c2e8d1b25eb16cd8dc4eb221f2a20d2e4c39a515c0b5809fb407991f94 SHA512 fddef644937093550f9e5dfc25dc5cb81280785735c2d11f644b5eece8144b23bc88a353534ca95e925f54da9131ed5dd7460b72e554b6625df33e243476588f WHIRLPOOL 0b19ef96124768b8cafb0211a79f8ba6e3d04d9289d5194a59fdaa4eb15ab898c103346892007d9fd6eac75d6d503cd9724ab8f60bd7cf28fee2f9307b03d70b
 DIST NVIDIA-FreeBSD-x86_64-346.96.tar.gz 58774970 SHA256 89daaff29afe92d825ec8c00149a703b4eb234e4f16bbfb98673f077521bcff9 SHA512 99fd84f1b2177b4af2fd83088c4f8a9a6259f059c002a771ff9c3993953787dd96f83322e4ce611234674a00792a83fa439af915d6ad6886af6de2d88de94edb WHIRLPOOL 5bca7c540c713b8e070b7d8412bcc2547335b9379429dc3a04ab50eae22c03eaa922486a900b2ab3cf147e0c4f2e8d3b60e81aa329b6b2956c28d2b32900082c
 DIST NVIDIA-FreeBSD-x86_64-352.79.tar.gz 57044396 SHA256 d2a406c4a7502096964b6fd19e99a046a0106a60ffb9e45865156c62718bf49a SHA512 7fe8564744e522b0f8ddb2fb3bc44235e5189d87acff1f894f271404315bbd17ea41f469c6cdbaf51a27f85e8103ed3cec574ed29323deeb56869746691e977c WHIRLPOOL 677b670218510228d9a03dc0f259e36a5896124ead204fff2d294135c1b7d79dd10c0b2e144e79a68d27b282e12097adf76f8694ecb5daa53f4b689935130c6f
 DIST NVIDIA-FreeBSD-x86_64-355.11.tar.gz 54031364 SHA256 3637a879905bb541bf02f9bcdfe37c242a52ec6071671a0ba33581efdce1504e SHA512 84add7d90c7f45d19d736ee70c1c4a6434be1c512bafa29cbbf9221e99a31fc383971696dce99da5a77a171eb3537c98cfec7005ff061411ac9c310fa219c906 WHIRLPOOL d8ade5d63c3ef78fa92f9dc07934eed8fdd4ead1e40f1820ad95feb166264a95a800879e1fc6374bf2deef419b0838b4864796d9f81a81110d06ccd9b65c459d
@@ -25,14 +29,19 @@ DIST NVIDIA-FreeBSD-x86_64-364.19.tar.gz 62553892 SHA256 3b691c259b2a85da49d16ce
 DIST NVIDIA-FreeBSD-x86_64-367.57.tar.gz 59604884 SHA256 6f2986941a9f4cdcb3692c39919e5eeec09f2799b7797d3c0be0d4c61f7eed5b SHA512 06e4fd656efc88260c10b2a86308461754302dc9bad88285efe8b864012806f2d7147173ded9ee7b4ef2518ddbd6f02c5d36b184f913176732dd90cce0df006c WHIRLPOOL 9c33dd392ba0335b08c7710aaf97564d7cc0fdcc2fe87ec67ae1932848dbd6e6ad0437f6b44409b11cefc7ec33be7656199dcb2a34ab296f969fd65243bd114e
 DIST NVIDIA-FreeBSD-x86_64-370.28.tar.gz 57905860 SHA256 5087a93af8aaab6cff35ba60c9d67b4249827f6b7681abaaa571a20784a54552 SHA512 40637d64a0ee5029bb1c5ad7a590c5be61253ef6283c4217666768ad8601d7f51ef0d8705c8711f65c3d0a5a5721490813220c5f9186c6d2d12baf5d9c11122e WHIRLPOOL 361648788b7efb9e550b3e67d2e6022e31dab29f5660c42a1b6c961fe4638216fb8785814ee9fa1636fc39c39afce7caffbdc24fcf8bbd14e4eec5b5eeaeb1eb
 DIST NVIDIA-FreeBSD-x86_64-375.26.tar.gz 58287080 SHA256 c7d32cb434f9a7e84903a1305d7577705f991fdb6eb4ab3ff79d41b2df82265d SHA512 514c92636eeffa68cea5140819a9ad14888c18c1c60b0865e5cc9f9896b503f22c1236f76e65ed5e11cf3685ceb483c78d2a442b4e9bf274ae3ab399cf40ed9e WHIRLPOOL aa4eb254a6f3c5b0a9b2aaab12a011a92763e7a966b31840a595c18e24d82935dbe0ab3faa4c9aeb7ae24ec7505cb60c20c1e117396cf0527161a2aa1face296
+DIST NVIDIA-FreeBSD-x86_64-375.39.tar.gz 58308585 SHA256 0d58c450b3391cf28655f15505aaca8d011590efe5dd3ebc6a3212a9d7597b17 SHA512 2b9e4fe4c850c59050d6f586be743e6e9511d12ee3e5f760b6c6ef5ff2084b7bc147267a7844191db1bfab842806a47054ce8f7534d5fee614efbf08e1faaca4 WHIRLPOOL fe195242a1a3657609eb9ea0eda27daa22fcc40beaa35e3cfcda575978361f68da27a46411ad38a93bef333bba91c06b911545d4d14f19b3dd2d085ae7012408
 DIST NVIDIA-FreeBSD-x86_64-378.09.tar.gz 58799263 SHA256 f89983be152c85f06ab278626e1404b4b00ce9b93e02ef70cd5851f1cfdb8a16 SHA512 e1acfcd85a73244e95ee0e041e16a2819f9d9dba6474c54498b486124e1b43f32d2d7204c56d57ca3da184156f9b3ac223e24e765caf66a7bc082e6b7773d5e7 WHIRLPOOL 526f29a9eabeb65bed675bbdab0ae0a62d5babc51669423743b8ce9581dfffeb9ebff192a753a56993ff7578f24123463a6da0e625f7c7532841c41566f9a87a
+DIST NVIDIA-FreeBSD-x86_64-378.13.tar.gz 58779963 SHA256 451b9e4b2da86609c760a9a133efa8d37d844ad036299689f007c90463a7ca39 SHA512 34cfc383ba196ecec2cd27fc12bf30dd58f8782b73414e7b4c182e832ae0dce1f8c017afbb2101d7525d4e321f80cac49d3b578a8fc0cf88be9310f4deb77057 WHIRLPOOL 23929abd50467f267cf6b7d58a49fc6f667036b7e92363cc05b021790d0d5ebc61e181c3b2e7c32a6338328cfcc05311d74112b005d638c0295b2c6189dfa3b8
 DIST NVIDIA-Linux-armv7l-gnueabihf-367.57.run 25701866 SHA256 e856debfabffe0e4ed2900e4acbc8e68340c4773651ec7a0000659588431ef7d SHA512 2d1221b8c6f01148412790c24f88a74104da4dc40f30ebe57a47468818c811119ed629ffa565f3ed58ce0b12b292b4304a2b364a83faff41ba14ea747f4e1c88 WHIRLPOOL bf7011f50360516f76ea5e176aea7d761193de877a5357a54704c60d512faf1af8e8e2450c547b5181fba98ee627a297b1c573e147c4db623324c1c35396330d
 DIST NVIDIA-Linux-armv7l-gnueabihf-370.28.run 26117701 SHA256 efb60a23aa22b46e94e91d5f5a5fc0c17b47bcf50471e4371653ced5a5350dce SHA512 04699849441bccfb9214fda4c7ff8ecefa11249d1fbfe470e37fefdd132becc225a1bcc16bc976c3fb145a427961f5402c95ecc84b613adb71caef9c96fe7d90 WHIRLPOOL 675a495594c46666ec11c83a76cdc8821e9b57079ee53cd7adcf00e783d121e163b7c5b10598aa55a1fee72eee47defc514fba986685af41c90ab2c5d890abbd
 DIST NVIDIA-Linux-armv7l-gnueabihf-375.26.run 26735389 SHA256 8d2b7b36e74ceb1c439b2a5f8d2cdf009fda4f668509bb5d45171455abc774b9 SHA512 f18031c9b9ca6825f93f433d3f59b76a380a12b55e2f4556c2a1725fcdbea58176f22dcdb322f20e27d524f3fda75dd4f5a2a9263268411e0f5e361c580d865d WHIRLPOOL 4ecd41bebae3df91a39612849eb6f7e926398e906d2cb878aa788571976fb1cdfeabd47ac0cd3db26c4a0408608b8dfbc3815d10cdd1acd8eeaba6ed5824bb73
+DIST NVIDIA-Linux-armv7l-gnueabihf-375.39.run 25350238 SHA256 52f512bbb3e2d5747df9b294667df9975564408c5ce4f3124aca7dba4355a3a9 SHA512 d888ab0c81c53138eec06e25be683798b5459a6862affa92429feb1e63fcd4cd7ac76bd78eff8c1bef245a25a6a7eb77994ad99c15ed65e8be1a64b3e4c45030 WHIRLPOOL 5714fdcd9e226a336e0abd46bd8a91eef486fc14de543a98d284b3ae3955e924dbde10a08144309b6c0b4e19fcb011bffb8c046a05cbe05f6123b22d270e2939
 DIST NVIDIA-Linux-armv7l-gnueabihf-378.09.run 25571959 SHA256 aa5a76b5d59c405cad89ea9fbde62c59f07bc191b7f36bf77ba015e551fd555e SHA512 16aea583fb6d5ee07596b69acbb50c01368306431ae6ed226d723ca0f544355ecfc3e1cf35a246489df482a4d931af13cc479283d90c541f32df06e37efa032c WHIRLPOOL 0dff3cb2d24ad110c1bc40226bbdb31f4f39efa16e743189ac4cdfb5f6ed3179603839c3b1373a0a34ba088537c8f9ab3874eb71c6ea05e25431c4abaa73b2be
+DIST NVIDIA-Linux-armv7l-gnueabihf-378.13.run 26514235 SHA256 399abf527d84e4b4d01ea66e0de4a1f9b1b39871b180ef3bf99c4718ebe3db91 SHA512 253786a821df85fa926ae842114321b3c70502f887ea7c2b6790dfe3836039ee5d390e6722ca8785904ec6487e465916923d3042dc6191b3b4522c3161b80cb0 WHIRLPOOL 154b13ecb368716980ab779894942831c13e4b2d47c1d5765ab14590663b34be1571df7934e1277c9a29cdfe93e209a04e2a9fed2830c407a42547433fd9e721
 DIST NVIDIA-Linux-x86-173.14.39-pkg0.run 15134997 SHA256 a09935f37121ed3db8ae3da63a0d8e9d4348a19c859811c9fe44d6ce8e3eab23 SHA512 e24e15ccec725d3cbca502c2b77061776a81ef92917a950adec4ff6bdc34f10903aa654433177ea74be0dade4af81c5380d5710d375a5ea445940d06154bde93 WHIRLPOOL fce3d8e4f6cdf698f5a057514b6fe220bb1011025bdce5bd4cf0e424fb4d306d38251b6726bda03f290ea8137d5a95ed418cf8751722879f9042462abd9181b6
 DIST NVIDIA-Linux-x86-304.134.run 41201159 SHA256 84f7891af131bb9f9a8a34401dfef4288218019406dfa4ae57b6d52b14e81c9d SHA512 e047c62b33b092225ead42134acd596e3ae43d9bb8324188308dd7d497f33e790e7366d7a1c5ef5de66f484219d99de4c6e6206d390122d3fab4d30397ab463c WHIRLPOOL 63b6b01f781cfb7ed516ba18920c4852f099189053f3eb119976bcbcb64f00136c1bed6ba2871c52b6cab5aa5cc8764d8b10338c9e43234da1b07d1a74ed23ba
 DIST NVIDIA-Linux-x86-340.101.run 38932143 SHA256 5f5eda9c3d9bf53b56ef4f546dd1be5317eed46df425edbdd2c34023fb9eb062 SHA512 5866f2b4e6e22863c54d9fc08c9c88c9c911df2396d0ceaca653ded04589ea3a9e4550ed58f4b182b0a42cfe205ef643fe43ea709478e5df5360a7f74fa87f41 WHIRLPOOL d44d6075dd64804cfc3fbdc28510defc7796a2f22ac24625aab8552bd8bd6b16f51dea15f04d56f7b53ed3df514a92582171d27ec4e9aa099bef2d3e940a62be
+DIST NVIDIA-Linux-x86-340.102.run 38779756 SHA256 61b13d5dae0f6f5d788a4d8c4c98e8d971d19cb90b606058060d007946248828 SHA512 bea700c925a6044fcded40324bb389c5fa1aadc40831f685a76e7b0ded11161f492960950c201467e564d157dcbe0c330d13a2014f51d0073002c5a262a6f0ca WHIRLPOOL f7a3e3c5f8bb9eedf0a93104564d3d9c3eabc39a807c47e87f84373f89513afcafecb94e602b12fd24f872971f2d16a5f945326c670a6eebcd9ffcdcb70cb99e
 DIST NVIDIA-Linux-x86-346.96.run 40751579 SHA256 8a299ddce7d34389206599a306a41d30754bb9bddda1be1a7fd85012f9aedf39 SHA512 9d413dd0559a4035a842527371cb1a27030c9eaeff510e529d2a205ea3eddc6e5666989418a6172aead4f5b2a924cf4cbf05269cb435dc2516af37eb35ba5d4d WHIRLPOOL 055127105804f2a6dc5067b20e771b4c12ad9dad62f4e874719385c7115e8394a8618eed3d6b330c8b5d90cbd3ae7fd09998e2a0017e35b4adca0f626110f238
 DIST NVIDIA-Linux-x86-352.79.run 42378162 SHA256 2929d6e509ed4502312c1b7384f6d12cb63bd4af03fc847a281d3ccdd4db4f69 SHA512 d2b50e55110f84412fd5c456849ceac0537ede643d12d1228cdda9dcca52f1f9d0a6e5a02eb4ee32cb68bbfa5adeacb8e4fc4e299848f70954d032daa989c122 WHIRLPOOL 19153e166b561dcc04730b6439999e625b5c4358f69d18127cf347cb86d39cb22f87b75d2623916021e9e774d234d6b41c3dc91f0524cebdf44f2a3007d4b8ee
 DIST NVIDIA-Linux-x86-355.11.run 43569515 SHA256 94ce6b879581b931b84d83a9111040b9a5aa9306b012b4380cd93f6ffede3066 SHA512 450caea472c5e1b3d7098adba28d18c1221cf809c6bd0071466ff2a946dd0eca6555475f5f6bc044fb19a21c8939b1020357d4aeb0ce47d0edfcda071a66fd46 WHIRLPOOL 3a95e83ab3f46e64150caf1489aa3173aae69919bf432eabcdd0501de8bcdee5402cdb33e149a4d5d429ccb85e4b4af9b30bec5516ad7b7f091ae42f6093d26f
@@ -43,11 +52,14 @@ DIST NVIDIA-Linux-x86-364.19.run 50074922 SHA256 9f891d4b22c43c9094b59af5c8474e2
 DIST NVIDIA-Linux-x86-367.57.run 44731570 SHA256 43d4e926f71ac6c581018badf467458709822e97a7564ed9f1b521b7b63d88bb SHA512 6316cdd94131057a584b3a893cfbca5e8b0f5e79060cb5bfe2c149b5a76bdcdc21d20338febb54f7201985c5b05545c3f6b63b26c32699717057cfb047993972 WHIRLPOOL 443ca9b389f78c13ae5344cb3cce67035a2b5a605b94518d91c253965263d37a84dff9ca29d47509a2d43017afde4786a55bfd45613882b5d4889dc27b67622f
 DIST NVIDIA-Linux-x86-370.28.run 44189522 SHA256 6323254ccf2a75d7ced1374a76ca56778689d0d8a9819e4ee5378ea3347b9835 SHA512 2df8b3d1064073c8b793287994fe0648625d095f3434b7b67531e19632cbad318994df90b55de18aa457d55a1374b35d64a646564259995d3f2197c48737921c WHIRLPOOL 85a089c833311abdc06bbc1fc68cd5ff8ed43dd5e5887d340dc854f905ae741de0ae4343d024259f493dd668075096c460bc1f93c1795d2befb81dd3c4a4983a
 DIST NVIDIA-Linux-x86-375.26.run 44541069 SHA256 7c79cfaae5512f34ff14cf0fe76632c7c720600d4bbae71d90ff73f1674e617b SHA512 3bc859a95469a45f3c627018248d83e178d160385c3d17d9f890b0d142ecd1220fb21c442e4fe7755b831227a9c820736f447b162acd9699819c6e8145d6d841 WHIRLPOOL 33ad62f7021f38fd9dfa6b0fcfbc0b69a263409bd5b3b8da8eea6aa9af84299f0d5318bbc8b54139b1744b96fa08114029f8cc70b4f80b0fbd2d76efc47d0462
+DIST NVIDIA-Linux-x86-375.39.run 44434734 SHA256 7f33f6572c5c5c57df71531749c7339309a2097918375685ea8018826cf19456 SHA512 0f4e784f69f7b4c4696b62779892d8e77aef0adb701dcf5e844027e3a1870aa56bb913bc05f30b079c2519bdda87fa0096d612e9d74ea35b97882fc54fa5d2ca WHIRLPOOL 1d1e6a49d86a72f38d3c84a0b75735c9b64b0bbc75bc54e91318b316298609dd34ab3affff5795fedba44133536e22bf287a76d8271bf0cee990204a383e8a93
 DIST NVIDIA-Linux-x86-378.09.run 43566287 SHA256 feaaa52b96f82ed27fa7286b645c6f220984fb2831aac492b037a188f5e63b28 SHA512 6e7900c243a49bc22164f1a111078641c4ee02b68ca18ccb4f2d920a39e9a1e3d58a0e8bb5dac28ce09a78bb1fc77abaa76cbcdc8f6bbd335a610d629b3018a3 WHIRLPOOL ed8115e345842d9d8746277d001ab183bc0a4fb2a2fa5717ad345aa06343cd677b00bf2ff5fae226b1d08503560a72fb043906997139d46aa7dd6fbff18d7859
+DIST NVIDIA-Linux-x86-378.13.run 44397547 SHA256 05e62a6098aac7373438ee381072253a861d56522f74948c2b714e20e69a46b1 SHA512 b96d2558a1003a3c66cade3a1e16abd34d855c0e27cdebacdc0495e0ba3cd5c68bb84cc5f81bff1b9ddce36ac52e0dc125c56d868b77d7c8e2f606d559b13b4a WHIRLPOOL e8231978664cec766813821c0f363ef437ba627debc2d2664164fe44c344c480c50799710dbeeee782fdacdb66b16317d69a9dec4f21d347dc40e471201b3ed1
 DIST NVIDIA-Linux-x86-96.43.23-pkg0.run 11504817 SHA256 51e6adf4ba73071622045fc37169f80db3ae3e784dff53b29d35146a04042142 SHA512 bed5726e57637481fe4e3c03a65ec14fe949f00860e729ebde408f4fd861d7bfdc296a78bc2f5d42e8b282db09f4bbde1e0545df7228fa20227080dc4b868ba7 WHIRLPOOL 6d4fd1786c11f4e326cc3101d0bb1a2f8b63c25c3dd59f10188f8355759e2861ce44fd53d60258b513d5a1d6124d0f91ba8edf4d3668b6feabfb3e8d585f14fe
 DIST NVIDIA-Linux-x86_64-173.14.39-pkg2.run 21100833 SHA256 15a953666d5681ba54c97498b578ffd286a1dc96d605f3b02110f3f99813100e SHA512 a65cd496e6ed57f771c3d99f37f616a1242d97844f6faef7a807825ad899c0e536a99fde397020839f0857883b934032f9491024f3047a6b06d3eea1f5d77713 WHIRLPOOL dc5f243b7d1de7e2d1b7f005e018a2940d63335b11a7c83c234b348b7a1839e9131169d2ea928bd8c2f549a4535149b03e16e6c94d59dfa745f7f904ff790a45
 DIST NVIDIA-Linux-x86_64-304.134.run 69761152 SHA256 a014261a28a0a9829d255a5580c55d342e0ddf929b4f343cbd4d3492ede1cd5f SHA512 65f6c324793e3ce713ea993fc709f1d1c413af2252765167cfdeb49fb6557f375018a5efa0402effc7443cc0fb860a7856736dad47a50513fe903c9109ff2348 WHIRLPOOL fb1d05946ba672e44825d6e852157314020677c92f5817770e21decb81a1388db6b6e4976c8919217f2bf732283fe5942f982d31f3e5c39d5ea0e009d788906d
 DIST NVIDIA-Linux-x86_64-340.101.run 70042051 SHA256 d2cf81b5994a1728dc4851cdf0480cde0a34b040c94de0d5265edcfe3b90680a SHA512 64e3acee913864296421f0fcc44ffef0d89d20fc9f422e61f9a30a0c867ddedd2e88ead4a9607842a639ef593a19e725b70cf4ee051651d1d2ad48f3c5a189f3 WHIRLPOOL 59a7c3b40ae75e0fb3b7ae2c1125fd73071882347cfee6b6c0b76e9a117dfaa93bf6b391459f2ca96c50df24b220e5b8941e02f4cf48e7ae0833af67e180b195
+DIST NVIDIA-Linux-x86_64-340.102.run 69960567 SHA256 2b96d2f26c00405471e0ce10dca0b6639e91aeb43f7c5aadbdae28445a28df5a SHA512 eead5b6f18afd5384f30f36a9ef569dea7d6ca1dbc590f63d603694bcc6a8bf251942b36ca606cfd5e6775ef180cd564f3cf226a3f4c04d7ed354204fec15577 WHIRLPOOL 6596a178aa35ac841bf287fa1372f6748cda0430c6b4bcd18fa63d63030331df59e75d4a3dde63f28a6fa15cdfaa90d27136c96e9abe81fb05202f00430ecaa9
 DIST NVIDIA-Linux-x86_64-346.96.run 73538317 SHA256 229b28a6b65965a248d07223d941de7d79b54cee7c6574f1037293e8a8026727 SHA512 188f8aac88085c3cac9637e87f4d9259d0c508075bbbf684775650a12f4760f47ba9e92f79e8bbe96d33ee014092edd38efce7dd730f67e0f11c2079eca938c5 WHIRLPOOL c9f4a5163018dc0b53aeff84b410cb34720d06ca7bdd17ce166ad3a2b057ffe94e6773594cd617fce79d9d0a02e5e1cd0525ca30dade7247ad5b7b20ff661a64
 DIST NVIDIA-Linux-x86_64-352.79.run 77140528 SHA256 e05a825a5e0027f062b1a1344ff3484286f50df990d66d567348b80101a0c4e3 SHA512 b54257e9aa6f6353d4f149d4dfab5ea12bf1907260ad98fd9102da1b458c1cf32e28707c8c5136efdaeccd0f60e6e013736b349a59ea50044dceddf265afa38b WHIRLPOOL 25be659c5784558c42c4f2fb0b50d5d56c0419f175ad8c019e00bdc033707297668705e051e4f176fff67340ec68054848a8b3aa5a9922ee0c9f9a270787a6d6
 DIST NVIDIA-Linux-x86_64-355.11.run 76490009 SHA256 a59b425381add9d9058dc2d987bf3087ab59c43224b5eb04c3f273f5886451ed SHA512 bfc7ab7741183408aa0226dc29176c8ffe08566fbea7cebf78f4aa30627dc27ddf90bb82951c99006b34bc481be15712b4f5867ef543a32bfe3fe81a8e6ddeae WHIRLPOOL bb5d3397a855a53c2cd7e48056564085b906550f856207932e4670fef995030a3a7bcc0a9b97fee2e60aaff9b41c4a954afc57585441f5dec92c795358da810a
@@ -58,10 +70,13 @@ DIST NVIDIA-Linux-x86_64-364.19.run 87961023 SHA256 7b8680a815ac74d5b3a7e3d38113
 DIST NVIDIA-Linux-x86_64-367.57.run 77127324 SHA256 a1615db29f1377817b610cca997e0339753ee9d58b28e1618b892691df3a8851 SHA512 fc94f5df7eb2ef243db381bc4458f911a6d76bff949701bedb249a3ebf369ff3da8dc5a7d52ab6ae3f23e947c419923f303cd57429a266a0f8e96df1039b1f5d WHIRLPOOL 5580b7839652c250ba134ecc97438d1810453d5bd5d8cffd44f01379d7509bca6f0c58318a150a5b4786f955d4de708ce9be618572212eca2c7098a36eab24d5
 DIST NVIDIA-Linux-x86_64-370.28.run 76690360 SHA256 90aa3c186e45b39e6fc0064ab8dbda8bcc897cb61d2e7b7cb30b4ec9a4b39239 SHA512 931476f92a63d142478b2d6b3da4031769fd3b93aee2387800a78b1354b59a5fb5e4e293436b6b4c246627d51c0f55d140ab230de385cb1567bc8b25518eb741 WHIRLPOOL ce866c38291d2ab4aeeff05654a0e61196129f77baea5af93ddbc22fab9574ba39cc05d58020ea2407cc7342f0bcf5c2702d42290f4cc3b53c9e04fb7c617413
 DIST NVIDIA-Linux-x86_64-375.26.run 75869960 SHA256 4f42b2c3709dc2f11a1deca89628582062f4e9bca87f28a4fde50d25bd4a1ecf SHA512 0990ac2e7b045bf62a8c58eb7acf91458756de91887d43486d9754bfc1493b28193072a9687d2d892cc98aaa4e584a8b2a8471756d4f19965da904d51e437dd1 WHIRLPOOL b9890e705dbc3e967a978c5f823f71a418b03aa1b36669c1763559ed81a6a103e9d011246ffe049eda899425e254e8955b921ea9132a8d36530dc4a230cb4832
+DIST NVIDIA-Linux-x86_64-375.39.run 77264092 SHA256 91be5a20841678d671f32074e2901791fe12c00ce1f3b6b3c4199ce302da85a7 SHA512 9a7e865db44f8e65be257b26250adcdf6f3dfac4e164f14a42b8e03c576016dfedf152d6a6cb84fb3ae9930d2b4ba472a63cf32d557395ff7fa429d9b8c9ccd0 WHIRLPOOL 03a27813464847958d9d2adb0bc260e31c6458df18e567c4c36e1eac5f7288108f88147cf1115f360b159a6d0ab459692abb35a79879e19fec2db30709802df1
 DIST NVIDIA-Linux-x86_64-378.09.run 76223409 SHA256 086e76499f39f6da102c061fbd3cce33679b51b06ba7d414138d5ffad3c31805 SHA512 6a7a20bbcfb29b648a8a4fd464856b9e0167e63dd5159a73df1832b25ca29d0b04ff9ec90cbc778c61c3ad3733101353729ca32b5fb24e4255c38d9621007a86 WHIRLPOOL a89699f8b87940d26d89922e6008d0abc3b496a17784dad986f8397a6012ca67199611aa14a19ec63876a5b203b9c5d12e0a2146aa538c015227182f01cea17e
+DIST NVIDIA-Linux-x86_64-378.13.run 76239469 SHA256 3de379249ef25a8c10a24be2718bf1cb2e338da204e37874c4a0c66dbcdf42ee SHA512 2f6789aa0a400c035c0a074631dc5c26abb4f8a62efe928ca3a2865b89d29acfc09c27f23a664e438275e4bfd25c261745d4d495f9aca5f54ee6c53a389059d2 WHIRLPOOL 6e8dcc7be0981591f377babbd9e1430fddeac9a42291f36a95243d418882bc8b38a1e692e2fd62d4b785feca93165e54a64c015bd99193c699831465f512b180
 DIST NVIDIA-Linux-x86_64-96.43.23-pkg2.run 15962375 SHA256 ce8d8253e7dab7da63fbdac449ebf190cd0c10cbfffea0f8d0165515f851bc64 SHA512 04bec1187a6024a2b9839f008ec829281f1f2602dae2e639030bc385943186506bcaa2b46a230b2ab87f9217190841abc62f9e2d6395ab5559623389c31c6563 WHIRLPOOL 0651c44a51a1a06fcff5bfddbf9c3e408977e03263c7fe806cb6c01f9fe92f716dfe4e5190ffe1048bde72fcffdc8bca8267e74dd43ba5c9dfb22b6201fcc2bb
 DIST nvidia-settings-304.134.tar.bz2 1480967 SHA256 8e562823fe9a7b1d33775db5605040488c064ab59ede20e1b2e5a6ec08ef2261 SHA512 c15b9c3eff470e47dca9d695029fb5f7c3d7a91bdcceea7c114c305254ef341ece2fa8b727446ebe704f21b4c39b7872b1b2d9a740cf9cb5257f6aaaf2313208 WHIRLPOOL 0e8a1137cd71cf60794a0572189cde15ed39fa7be22410afe232b62daf8df17dd2af22631ecbfa30374439c3f1b7b1ed69af2737bdc37665bd42819b0f326593
 DIST nvidia-settings-340.101.tar.bz2 1550221 SHA256 e98d2816f30182826aebb4315d4069d212709d28c129528295c012e11c5c5bd5 SHA512 145cfff7828b61566c13644d58e62495e5dfcbc0d24c49b04b24953d6822bb406de166879ef681a9ad6a6cb64fbc85948a93afb2f63f4e0a24107818eb0f2882 WHIRLPOOL bca223365521625d30bef14a752eb02d6166ee1e988087c584c0f325413cf0d92a67989d9f456f16b09611558af0eab4f8f3a37894db8c1df1fe3446bc3975ee
+DIST nvidia-settings-340.102.tar.bz2 1550093 SHA256 2895d4e2597a6ea0c425d74c7a0808775065f5cf58397fbbe6e626b00c60a55a SHA512 1ab190d8bcba7cc39d47f38db2bee28fab48d48c9a6674c9ff29ea3f51103e13746ee1df2d30581bd8259fc1104fed90b36cba88907bb2f202c931d256eab66a WHIRLPOOL 58105b371bc7156c2749f4bf85377f06fca71eb0a933721d70987aa53bb6c94494de3be25363ccf326105ca475405dcd7c884ceb6158df352ac6cc70dcffbf7e
 DIST nvidia-settings-346.96.tar.bz2 1558100 SHA256 b293f269aac01dfdf59e9dff46d774f7ca77d4628f377c01cabfbfccd28f3cd9 SHA512 9ead0fa5f0a55c1080d9b4da6cf96c2435c1a166297187f2c7d8b95a9e66c2e9cdd2e35739a4304b02ff1ccedb0421a7dc99a546df3a8f18804da133b93f50e3 WHIRLPOOL 4bddea94bb4c0dcde6b2b06507ffe890a1996471603de2d494f54b783cd36d44aa620fe03d16bc104ce99d6371a50666b0f029a309b78226810761cc13053f98
 DIST nvidia-settings-352.79.tar.bz2 1570988 SHA256 1f103cbfe162281355c484a5c3ef9ac1bb0528acba2d229111da7e58cf18f217 SHA512 d56e20844bf71d55e51aebca38e922a2985fdbd4edab29a07f9a4a8a0b883ca469c3b949f048837ec77464da90e2d485e5efcd314afc2810c44ad7dc497b53fe WHIRLPOOL 51999a744f6b3e36c4d12f841c136a754533de09c1802f60392666392beeccbb0bf1489269cac33b12ccb061554609d3dc8d8ffbf45b4cb860108fd9f86e2139
 DIST nvidia-settings-358.16.tar.bz2 1571104 SHA256 8cd78df738a824e282771755ae9a41d5b194b15f9df96b9fd23fcf3005967d35 SHA512 0438aa2599e98f68a04c9f663f4ef9b05092df512fbca40ad0fe17e25ca4d940d02cc55e9fd44a2551950a2a30782d1e48553c4bebd071bfff280869a6dde556 WHIRLPOOL 60b7e9abba3163ac877a3a9d944cf72352e28d2fd1a3af0996d3b7d40ef48be7f057c1063f9ca61c693cbf1bff57be61704f13d941220bf74a8049954f87154d
@@ -71,4 +86,6 @@ DIST nvidia-settings-364.19.tar.bz2 1573005 SHA256 fe8e9cc4d0ade9caaf51109e7e528
 DIST nvidia-settings-367.57.tar.bz2 1571905 SHA256 aacb66b130e4adc034e10afb518c919a96029b31b14da8975b08d250d8750140 SHA512 57bf414f4aefacd994e73ea3b31de8cf9f5d6ddc9a95ea1456c21905510c4ba9219e690a1b1bb1346b57a80caf9856c5fede80734163392f0788b995d1bd4cea WHIRLPOOL 7294f84afe8a00f59e2073773d12dc0b31273ab49fe318558eee84a72b7df1233fa004949c0512bff1974c5edbc4749eed68e172336241ea9cb24d6c585a8979
 DIST nvidia-settings-370.28.tar.bz2 1573509 SHA256 59d7818a4837144e373ce958233db059fde59e279477001e187579770ebf0c5f SHA512 c4da6ae54839a8f91d3557153a648f69095e9a486dbaaf73e453d625660f1adcada12ee5c4bccc1afe2cfd454ead13c1df0e59d5d6aa70f6065823d53f7bb461 WHIRLPOOL e5f0a9fd67e50aee42598d6a0ce9a69a162405a6121518c7aaf9ede409e9bdeb44e3102a123eb6f8c963e0fdaca429a8b693f6af2f0467e746c42f57a496d45f
 DIST nvidia-settings-375.26.tar.bz2 1615459 SHA256 beb0d88e2f63427239fd2014299ef7bf780e70800f68be5d011575e858711fe9 SHA512 e575670ccf7e3ef0089ee6a969f107f6f43d742a60cc325c6d95efc4773f34a6e013fd2c4e38b5f90054e24146a05c2300c0cf6a9b7013b556bacc1402956f49 WHIRLPOOL 854e4444beb330c97b29ebc00936c9d2f2522165ef2ca86f68ae28abadef516aedb341e2b2bf6d7a762decaeac4d5c3084bddaa21492b0a60607a2bbf541c301
+DIST nvidia-settings-375.39.tar.bz2 1618873 SHA256 e5965788368c85e8a83db27d725ea9492068d0e79f961b22fe38d22f090e0839 SHA512 de6dc16850f032f228313582c83e27fefcb045261cb8b5fdef428cca5264307ef58a5e78d91fe3624a39ab2a4361e3939d4b6592c32837a1f43caf381120bed8 WHIRLPOOL 100102effcb2fb04976f6ecadd23631b5ea28206076fdac24f2ae481c96e6856239295c65e2e527d7c9558d97f3f5a25e6c48907cb41eff0a23ee6d878790716
 DIST nvidia-settings-378.09.tar.bz2 1618262 SHA256 1bfdb4d42f4afc83a51f63574c3ae70c5f36e4dab87fc8c23564fef62bbe53ba SHA512 fd3afccc1b0412e320c8472d746ebfad0ed814548d46533c8f46f8d9e6b33f2cd1a981cbbbafb37de89692c640d73d4706a20882f3bfc0718b7ff1dc89b2aba2 WHIRLPOOL 2b9f5efd8bf7c2ffcda960b6e4bc144cf744e7183196ab31f0cb3f5861f333862c60eaa0fe3f2df6fc17175565a551f9daf1243d03e77dc6b8f0b896ca33ef5a
+DIST nvidia-settings-378.13.tar.bz2 1618011 SHA256 b23f931e3107897ff73c57ce02aa77e8e1dc95559bfa338e898126731a230023 SHA512 a12352c92fd4f56002bda2b07e8cddd5573af98521ec3495cd428b784eb368c9f2cb40f9b4372400ba1ea67c9349c6a9b4f7c218ede2d0d5dabb08325eda9844 WHIRLPOOL d143ae5fd3d09e235aca4d5f95d87d9ab0e3adee4aab5496fba89bcc75903dae5a604f76e9b34331f561dcc8e9aa222ee91e6e15ce91635cefc1e4e40eb8097f

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-375.39-profiles-rc.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-375.39-profiles-rc.patch
new file mode 100644
index 0000000000..cb62f8dcbe
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-375.39-profiles-rc.patch
@@ -0,0 +1,11 @@
+--- a/nvidia-application-profiles-375.39-rc
++++ b/nvidia-application-profiles-375.39-rc
+@@ -48,7 +48,7 @@
+         {
+           "name" : "NoEnforceShaderInputOutputMatching",
+           "settings" : [ "GLShaderPortabilityWarnings", false ]
+-        },
++        }
+     ],
+     "rules" : [
+         {

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-340.102.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-340.102.ebuild
new file mode 100644
index 0000000000..02f330e767
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-340.102.ebuild
@@ -0,0 +1,519 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+inherit eutils flag-o-matic linux-info linux-mod multilib-minimal nvidia-driver \
+	portability toolchain-funcs unpacker user udev
+
+NV_URI="http://us.download.nvidia.com/XFree86/"
+X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
+AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
+X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
+AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
+
+DESCRIPTION="NVIDIA Accelerated Graphics Driver"
+HOMEPAGE="http://www.nvidia.com/ http://www.nvidia.com/Download/Find.aspx"
+SRC_URI="
+	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
+	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
+	x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
+	x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
+	tools? ( ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2 )
+"
+
+LICENSE="GPL-2 NVIDIA-r2"
+SLOT="0/${PV%.*}"
+KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
+IUSE="acpi multilib kernel_FreeBSD kernel_linux pax_kernel static-libs +tools +X uvm"
+RESTRICT="bindist mirror"
+EMULTILIB_PKG="true"
+
+COMMON="
+	app-eselect/eselect-opencl
+	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
+	tools? (
+		dev-libs/atk[${MULTILIB_USEDEP}]
+		dev-libs/glib:2[${MULTILIB_USEDEP}]
+		dev-libs/jansson[${MULTILIB_USEDEP}]
+		x11-libs/gdk-pixbuf[${MULTILIB_USEDEP}]
+		>=x11-libs/gtk+-2.4:2[${MULTILIB_USEDEP}]
+		x11-libs/libX11[${MULTILIB_USEDEP}]
+		x11-libs/libXext[${MULTILIB_USEDEP}]
+		x11-libs/pango[X,${MULTILIB_USEDEP}]
+	)
+	X? (
+		>=app-eselect/eselect-opengl-1.0.9
+	)
+"
+DEPEND="
+	${COMMON}
+	app-arch/xz-utils
+	kernel_linux? ( virtual/linux-sources )
+"
+RDEPEND="
+	${COMMON}
+	acpi? ( sys-power/acpid )
+	tools? ( !media-video/nvidia-settings )
+	X? (
+		<x11-base/xorg-server-1.19.99:=
+		>=x11-libs/libvdpau-0.3-r1
+		sys-libs/zlib[${MULTILIB_USEDEP}]
+		multilib? (
+			>=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
+			>=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
+		)
+	)
+"
+
+REQUIRED_USE="tools? ( X )"
+
+QA_PREBUILT="opt/* usr/lib*"
+
+S=${WORKDIR}/
+
+pkg_pretend() {
+	if use amd64 && has_multilib_profile && \
+		[ "${DEFAULT_ABI}" != "amd64" ]; then
+		eerror "This ebuild doesn't currently support changing your default ABI"
+		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
+	fi
+
+	if use kernel_linux && kernel_is ge 4 10; then
+		ewarn "Gentoo supports kernels which are supported by NVIDIA"
+		ewarn "which are limited to the following kernels:"
+		ewarn "<sys-kernel/gentoo-sources-4.10"
+		ewarn "<sys-kernel/vanilla-sources-4.10"
+		ewarn ""
+		ewarn "You are free to utilize eapply_user to provide whatever"
+		ewarn "support you feel is appropriate, but will not receive"
+		ewarn "support as a result of those changes."
+		ewarn ""
+		ewarn "Do not file a bug report about this."
+		ewarn ""
+	fi
+
+	# Since Nvidia ships many different series of drivers, we need to give the user
+	# some kind of guidance as to what version they should install. This tries
+	# to point the user in the right direction but can't be perfect. check
+	# nvidia-driver.eclass
+	nvidia-driver-check-warning
+
+	# Kernel features/options to check for
+	CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
+	use x86 && CONFIG_CHECK+=" ~HIGHMEM"
+
+	# Now do the above checks
+	use kernel_linux && check_extra_config
+}
+
+pkg_setup() {
+	# try to turn off distcc and ccache for people that have a problem with it
+	export DISTCC_DISABLE=1
+	export CCACHE_DISABLE=1
+
+	if use kernel_linux; then
+		MODULE_NAMES="nvidia(video:${S}/kernel)"
+		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel/uvm)"
+
+		# This needs to run after MODULE_NAMES (so that the eclass checks
+		# whether the kernel supports loadable modules) but before BUILD_PARAMS
+		# is set (so that KV_DIR is populated).
+		linux-mod_pkg_setup
+
+		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
+		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC)"
+
+		# linux-mod_src_compile calls set_arch_to_kernel, which
+		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
+		# expects x86_64 or i386 and then converts it to x86
+		# later on in the build process
+		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
+	fi
+
+	# set variables to where files are in the package structure
+	if use kernel_FreeBSD; then
+		use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
+		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
+		NV_DOC="${S}/doc"
+		NV_OBJ="${S}/obj"
+		NV_SRC="${S}/src"
+		NV_MAN="${S}/x11/man"
+		NV_X11="${S}/obj"
+		NV_SOVER=1
+	elif use kernel_linux; then
+		NV_DOC="${S}"
+		NV_OBJ="${S}"
+		NV_SRC="${S}/kernel"
+		NV_MAN="${S}"
+		NV_X11="${S}"
+		NV_SOVER=${PV}
+	else
+		die "Could not determine proper NVIDIA package"
+	fi
+}
+
+src_prepare() {
+	# Please add a brief description for every added patch
+
+	if use kernel_linux; then
+		if kernel_is lt 2 6 9 ; then
+			eerror "You must build this against 2.6.9 or higher kernels."
+		fi
+
+		# If greater than 2.6.5 use M= instead of SUBDIR=
+#		convert_to_m "${NV_SRC}"/Makefile.kbuild
+	fi
+
+	if use pax_kernel; then
+		ewarn "Using PAX patches is not supported. You will be asked to"
+		ewarn "use a standard kernel should you have issues. Should you"
+		ewarn "need support with these patches, contact the PaX team."
+		eapply "${FILESDIR}"/${PN}-331.13-pax-usercopy.patch
+		eapply "${FILESDIR}"/${PN}-337.12-pax-constify.patch
+	fi
+
+	# Allow user patches so they can support RC kernels and whatever else
+	eapply_user
+}
+
+src_compile() {
+	# This is already the default on Linux, as there's no toplevel Makefile, but
+	# on FreeBSD there's one and triggers the kernel module build, as we install
+	# it by itself, pass this.
+
+	cd "${NV_SRC}"
+	if use kernel_FreeBSD; then
+		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
+			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
+	elif use kernel_linux; then
+		use uvm && MAKEOPTS=-j1
+		linux-mod_src_compile
+	fi
+
+	if use tools; then
+		emake -C "${S}"/nvidia-settings-${PV}/src/libXNVCtrl clean
+		emake -C "${S}"/nvidia-settings-${PV}/src/libXNVCtrl \
+			AR="$(tc-getAR)" \
+			CC="$(tc-getCC)" \
+			RANLIB="$(tc-getRANLIB)" \
+			libXNVCtrl.a
+		emake -C "${S}"/nvidia-settings-${PV}/src \
+			AR="$(tc-getAR)" \
+			CC="$(tc-getCC)" \
+			LD="$(tc-getCC)" \
+			LIBDIR="$(get_libdir)" \
+			NVML_ENABLED=0 \
+			NV_USE_BUNDLED_LIBJANSSON=0 \
+			NV_VERBOSE=1 \
+			RANLIB="$(tc-getRANLIB)" \
+			STRIP_CMD=true
+	fi
+}
+
+# Install nvidia library:
+# the first parameter is the library to install
+# the second parameter is the provided soversion
+# the third parameter is the target directory if its not /usr/lib
+donvidia() {
+	# Full path to library minus SOVER
+	MY_LIB="$1"
+
+	# SOVER to use
+	MY_SOVER="$2"
+
+	# Where to install
+	MY_DEST="$3"
+
+	if [[ -z "${MY_DEST}" ]]; then
+		MY_DEST="/usr/$(get_libdir)"
+		action="dolib.so"
+	else
+		exeinto ${MY_DEST}
+		action="doexe"
+	fi
+
+	# Get just the library name
+	libname=$(basename $1)
+
+	# Install the library with the correct SOVER
+	${action} ${MY_LIB}.${MY_SOVER} || \
+		die "failed to install ${libname}"
+
+	# If SOVER wasn't 1, then we need to create a .1 symlink
+	if [[ "${MY_SOVER}" != "1" ]]; then
+		dosym ${libname}.${MY_SOVER} \
+			${MY_DEST}/${libname}.1 || \
+			die "failed to create ${libname} symlink"
+	fi
+
+	# Always create the symlink from the raw lib to the .1
+	dosym ${libname}.1 \
+		${MY_DEST}/${libname} || \
+		die "failed to create ${libname} symlink"
+}
+
+src_install() {
+	if use kernel_linux; then
+		linux-mod_src_install
+
+		# Add the aliases
+		# This file is tweaked with the appropriate video group in
+		# pkg_preinst, see bug #491414
+		insinto /etc/modprobe.d
+		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
+		use uvm && doins "${FILESDIR}"/nvidia-uvm.conf
+
+		# Ensures that our device nodes are created when not using X
+		exeinto "$(get_udevdir)"
+		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
+		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
+	elif use kernel_FreeBSD; then
+		if use x86-fbsd; then
+			insinto /boot/modules
+			doins "${S}/src/nvidia.kld"
+		fi
+
+		exeinto /boot/modules
+		doexe "${S}/src/nvidia.ko"
+	fi
+
+	# NVIDIA kernel <-> userspace driver config lib
+	donvidia ${NV_OBJ}/libnvidia-cfg.so ${NV_SOVER}
+
+	# NVIDIA framebuffer capture library
+	donvidia ${NV_OBJ}/libnvidia-fbc.so ${NV_SOVER}
+
+	# NVIDIA video encode/decode <-> CUDA
+	if use kernel_linux; then
+		donvidia ${NV_OBJ}/libnvcuvid.so ${NV_SOVER}
+		donvidia ${NV_OBJ}/libnvidia-encode.so ${NV_SOVER}
+	fi
+
+	if use X; then
+		# Xorg DDX driver
+		insinto /usr/$(get_libdir)/xorg/modules/drivers
+		doins ${NV_X11}/nvidia_drv.so
+
+		# Xorg GLX driver
+		donvidia ${NV_X11}/libglx.so ${NV_SOVER} \
+			/usr/$(get_libdir)/opengl/nvidia/extensions
+	fi
+
+	# OpenCL ICD for NVIDIA
+	if use kernel_linux; then
+		insinto /etc/OpenCL/vendors
+		doins ${NV_OBJ}/nvidia.icd
+	fi
+
+	# Documentation
+	if use kernel_FreeBSD; then
+		dodoc "${NV_DOC}/README"
+		use X && doman "${NV_MAN}/nvidia-xconfig.1"
+		use tools && doman "${NV_MAN}/nvidia-settings.1"
+	else
+		# Docs
+		newdoc "${NV_DOC}/README.txt" README
+		dodoc "${NV_DOC}/NVIDIA_Changelog"
+		doman "${NV_MAN}/nvidia-smi.1.gz"
+		use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
+		use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
+		doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
+	fi
+
+	docinto html
+	dodoc -r ${NV_DOC}/html/*
+
+	# Helper Apps
+	exeinto /opt/bin/
+
+	if use X; then
+		doexe ${NV_OBJ}/nvidia-xconfig
+	fi
+
+	if use kernel_linux ; then
+		doexe ${NV_OBJ}/nvidia-cuda-mps-control
+		doexe ${NV_OBJ}/nvidia-cuda-mps-server
+		doexe ${NV_OBJ}/nvidia-debugdump
+		doexe ${NV_OBJ}/nvidia-persistenced
+		doexe ${NV_OBJ}/nvidia-smi
+
+		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
+		doexe ${NV_OBJ}/nvidia-modprobe
+		fowners root:video /opt/bin/nvidia-modprobe
+		fperms 4710 /opt/bin/nvidia-modprobe
+		dosym /{opt,usr}/bin/nvidia-modprobe
+
+		doman nvidia-cuda-mps-control.1.gz
+		doman nvidia-modprobe.1.gz
+		doman nvidia-persistenced.1.gz
+		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
+		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
+		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
+	fi
+
+	if use tools; then
+		emake -C "${S}"/nvidia-settings-${PV}/src/ \
+			DESTDIR="${D}" \
+			LIBDIR="${D}/usr/$(get_libdir)" \
+			PREFIX=/usr \
+			NV_USE_BUNDLED_LIBJANSSON=0 \
+			install
+
+		if use static-libs; then
+			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
+
+			insinto /usr/include/NVCtrl
+			doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
+		fi
+
+		insinto /usr/share/nvidia/
+		doins nvidia-application-profiles-${PV}-key-documentation
+
+		insinto /etc/nvidia
+		newins \
+			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
+
+		# There is no icon in the FreeBSD tarball.
+		use kernel_FreeBSD || \
+			doicon ${NV_OBJ}/nvidia-settings.png
+
+		domenu "${FILESDIR}"/nvidia-settings.desktop
+
+		exeinto /etc/X11/xinit/xinitrc.d
+		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
+
+	fi
+
+	dobin ${NV_OBJ}/nvidia-bug-report.sh
+
+	#doenvd "${FILESDIR}"/50nvidia-prelink-blacklist
+
+	if has_multilib_profile && use multilib ; then
+		local OABI=${ABI}
+		for ABI in $(get_install_abis) ; do
+			src_install-libs
+		done
+		ABI=${OABI}
+		unset OABI
+	else
+		src_install-libs
+	fi
+
+	is_final_abi || die "failed to iterate through all ABIs"
+
+	readme.gentoo_create_doc
+}
+
+src_install-libs() {
+	local inslibdir=$(get_libdir)
+	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
+	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
+	local libdir=${NV_OBJ}
+
+	if use kernel_linux && has_multilib_profile && \
+			[[ ${ABI} == "x86" ]] ; then
+		libdir=${NV_OBJ}/32
+	fi
+
+	if use X; then
+		# The GLX libraries
+		donvidia ${libdir}/libEGL.so ${NV_SOVER} ${GL_ROOT}
+		donvidia ${libdir}/libGL.so ${NV_SOVER} ${GL_ROOT}
+		donvidia ${libdir}/libGLESv1_CM.so ${NV_SOVER} ${GL_ROOT}
+		donvidia ${libdir}/libnvidia-eglcore.so ${NV_SOVER}
+		donvidia ${libdir}/libnvidia-glcore.so ${NV_SOVER}
+		donvidia ${libdir}/libnvidia-glsi.so ${NV_SOVER}
+		donvidia ${libdir}/libnvidia-ifr.so ${NV_SOVER}
+		if use kernel_FreeBSD; then
+			donvidia ${libdir}/libnvidia-tls.so ${NV_SOVER}
+		else
+			donvidia ${libdir}/tls/libnvidia-tls.so ${NV_SOVER}
+		fi
+
+		# VDPAU
+		donvidia ${libdir}/libvdpau_nvidia.so ${NV_SOVER}
+
+		# GLES v2 libraries
+		insinto ${GL_ROOT}
+		doexe ${libdir}/libGLESv2.so.${PV}
+		dosym libGLESv2.so.${PV} ${GL_ROOT}/libGLESv2.so.2
+		dosym libGLESv2.so.2 ${GL_ROOT}/libGLESv2.so
+	fi
+
+	# NVIDIA monitoring library
+	if use kernel_linux ; then
+		donvidia ${libdir}/libnvidia-ml.so ${NV_SOVER}
+	fi
+
+	# CUDA & OpenCL
+	if use kernel_linux; then
+		donvidia ${libdir}/libcuda.so ${NV_SOVER}
+		donvidia ${libdir}/libnvidia-compiler.so ${NV_SOVER}
+		donvidia ${libdir}/libOpenCL.so 1.0.0 ${CL_ROOT}
+		donvidia ${libdir}/libnvidia-opencl.so ${NV_SOVER}
+	fi
+}
+
+pkg_preinst() {
+	if use kernel_linux; then
+		linux-mod_pkg_preinst
+
+		local videogroup="$(egetent group video | cut -d ':' -f 3)"
+		if [ -z "${videogroup}" ]; then
+			eerror "Failed to determine the video group gid"
+			die "Failed to determine the video group gid"
+		else
+			sed -i \
+				-e "s:PACKAGE:${PF}:g" \
+				-e "s:VIDEOGID:${videogroup}:" \
+				"${D}"/etc/modprobe.d/nvidia.conf || die
+		fi
+	fi
+
+	# Clean the dynamic libGL stuff's home to ensure
+	# we dont have stale libs floating around
+	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ] ; then
+		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
+	fi
+	# Make sure we nuke the old nvidia-glx's env.d file
+	if [ -e "${ROOT}"/etc/env.d/09nvidia ] ; then
+		rm -f "${ROOT}"/etc/env.d/09nvidia
+	fi
+}
+
+pkg_postinst() {
+	use kernel_linux && linux-mod_pkg_postinst
+
+	# Switch to the nvidia implementation
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
+	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
+
+	readme.gentoo_print_elog
+
+	if ! use X; then
+		elog "You have elected to not install the X.org driver. Along with"
+		elog "this the OpenGL libraries and VDPAU libraries were not"
+		elog "installed. Additionally, once the driver is loaded your card"
+		elog "and fan will run at max speed which may not be desirable."
+		elog "Use the 'nvidia-smi' init script to have your card and fan"
+		elog "speed scale appropriately."
+		elog
+	fi
+	if ! use tools; then
+		elog "USE=tools controls whether the nvidia-settings application"
+		elog "is installed. If you would like to use it, enable that"
+		elog "flag and re-emerge this ebuild. Optionally you can install"
+		elog "media-video/nvidia-settings"
+		elog
+	fi
+}
+
+pkg_prerm() {
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+	use kernel_linux && linux-mod_pkg_postrm
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-375.39.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-375.39.ebuild
new file mode 100644
index 0000000000..d40f96f0a3
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-375.39.ebuild
@@ -0,0 +1,557 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+inherit eutils flag-o-matic linux-info linux-mod multilib-minimal nvidia-driver \
+	portability toolchain-funcs unpacker user udev
+
+NV_URI="http://us.download.nvidia.com/XFree86/"
+X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
+AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
+ARM_NV_PACKAGE="NVIDIA-Linux-armv7l-gnueabihf-${PV}"
+X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
+AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
+
+DESCRIPTION="NVIDIA Accelerated Graphics Driver"
+HOMEPAGE="http://www.nvidia.com/ http://www.nvidia.com/Download/Find.aspx"
+SRC_URI="
+	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
+	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
+	arm? ( ${NV_URI}Linux-x86-ARM/${PV}/${ARM_NV_PACKAGE}.run )
+	x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
+	x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
+	tools? (
+		ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2
+	)
+"
+
+LICENSE="GPL-2 NVIDIA-r2"
+SLOT="0/${PV%.*}"
+KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
+RESTRICT="bindist mirror"
+EMULTILIB_PKG="true"
+
+IUSE="acpi compat +driver gtk3 kernel_FreeBSD kernel_linux +kms multilib pax_kernel static-libs +tools uvm wayland +X"
+REQUIRED_USE="
+	tools? ( X )
+	static-libs? ( tools )
+"
+
+COMMON="
+	app-eselect/eselect-opencl
+	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
+	tools? (
+		dev-libs/atk[${MULTILIB_USEDEP}]
+		dev-libs/glib:2[${MULTILIB_USEDEP}]
+		dev-libs/jansson[${MULTILIB_USEDEP}]
+		gtk3? ( x11-libs/gtk+:3[${MULTILIB_USEDEP}] )
+		x11-libs/cairo[${MULTILIB_USEDEP}]
+		x11-libs/gdk-pixbuf[X,${MULTILIB_USEDEP}]
+		x11-libs/gtk+:2[${MULTILIB_USEDEP}]
+		x11-libs/libX11[${MULTILIB_USEDEP}]
+		x11-libs/libXext[${MULTILIB_USEDEP}]
+		x11-libs/libXrandr[${MULTILIB_USEDEP}]
+		x11-libs/libXv[${MULTILIB_USEDEP}]
+		x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
+		x11-libs/pango[X,${MULTILIB_USEDEP}]
+	)
+	X? (
+		>=app-eselect/eselect-opengl-1.0.9
+		app-misc/pax-utils
+	)
+"
+DEPEND="
+	${COMMON}
+	kernel_linux? ( virtual/linux-sources )
+"
+RDEPEND="
+	${COMMON}
+	acpi? ( sys-power/acpid )
+	tools? ( !media-video/nvidia-settings )
+	wayland? ( dev-libs/wayland[${MULTILIB_USEDEP}] )
+	X? (
+		<x11-base/xorg-server-1.19.99:=
+		>=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
+		>=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
+		>=x11-libs/libvdpau-1.0[${MULTILIB_USEDEP}]
+		sys-libs/zlib[${MULTILIB_USEDEP}]
+	)
+"
+
+QA_PREBUILT="opt/* usr/lib*"
+
+S=${WORKDIR}/
+
+pkg_pretend() {
+	if use amd64 && has_multilib_profile && \
+		[ "${DEFAULT_ABI}" != "amd64" ]; then
+		eerror "This ebuild doesn't currently support changing your default ABI"
+		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
+	fi
+
+	if use kernel_linux && kernel_is ge 4 10; then
+		ewarn "Gentoo supports kernels which are supported by NVIDIA"
+		ewarn "which are limited to the following kernels:"
+		ewarn "<sys-kernel/gentoo-sources-4.10"
+		ewarn "<sys-kernel/vanilla-sources-4.10"
+		ewarn ""
+		ewarn "You are free to utilize epatch_user to provide whatever"
+		ewarn "support you feel is appropriate, but will not receive"
+		ewarn "support as a result of those changes."
+		ewarn ""
+		ewarn "Do not file a bug report about this."
+		ewarn ""
+	fi
+
+	# Since Nvidia ships many different series of drivers, we need to give the user
+	# some kind of guidance as to what version they should install. This tries
+	# to point the user in the right direction but can't be perfect. check
+	# nvidia-driver.eclass
+	nvidia-driver-check-warning
+
+	# Kernel features/options to check for
+	CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
+	use x86 && CONFIG_CHECK+=" ~HIGHMEM"
+
+	# Now do the above checks
+	use kernel_linux && check_extra_config
+}
+
+pkg_setup() {
+	# try to turn off distcc and ccache for people that have a problem with it
+	export DISTCC_DISABLE=1
+	export CCACHE_DISABLE=1
+
+	if use driver && use kernel_linux; then
+		MODULE_NAMES="nvidia(video:${S}/kernel)"
+		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
+		use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel) nvidia-drm(video:${S}/kernel)"
+
+		# This needs to run after MODULE_NAMES (so that the eclass checks
+		# whether the kernel supports loadable modules) but before BUILD_PARAMS
+		# is set (so that KV_DIR is populated).
+		linux-mod_pkg_setup
+
+		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
+		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
+
+		# linux-mod_src_compile calls set_arch_to_kernel, which
+		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
+		# expects x86_64 or i386 and then converts it to x86
+		# later on in the build process
+		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
+	fi
+
+	if use kernel_linux && kernel_is lt 2 6 9; then
+		eerror "You must build this against 2.6.9 or higher kernels."
+	fi
+
+	# set variables to where files are in the package structure
+	if use kernel_FreeBSD; then
+		use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
+		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
+		NV_DOC="${S}/doc"
+		NV_OBJ="${S}/obj"
+		NV_SRC="${S}/src"
+		NV_MAN="${S}/x11/man"
+		NV_X11="${S}/obj"
+		NV_SOVER=1
+	elif use kernel_linux; then
+		NV_DOC="${S}"
+		NV_OBJ="${S}"
+		NV_SRC="${S}/kernel"
+		NV_MAN="${S}"
+		NV_X11="${S}"
+		NV_SOVER=${PV}
+	else
+		die "Could not determine proper NVIDIA package"
+	fi
+}
+
+src_prepare() {
+	eapply "${FILESDIR}"/${P}-profiles-rc.patch
+
+	if use pax_kernel; then
+		ewarn "Using PAX patches is not supported. You will be asked to"
+		ewarn "use a standard kernel should you have issues. Should you"
+		ewarn "need support with these patches, contact the PaX team."
+		eapply "${FILESDIR}"/${PN}-375.20-pax.patch
+	fi
+
+	# Allow user patches so they can support RC kernels and whatever else
+	eapply_user
+}
+
+src_compile() {
+	# This is already the default on Linux, as there's no toplevel Makefile, but
+	# on FreeBSD there's one and triggers the kernel module build, as we install
+	# it by itself, pass this.
+
+	cd "${NV_SRC}"
+	if use kernel_FreeBSD; then
+		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
+			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
+	elif use driver && use kernel_linux; then
+		MAKEOPTS=-j1 linux-mod_src_compile
+	fi
+
+	if use tools; then
+		emake -C "${S}"/nvidia-settings-${PV}/src \
+			AR="$(tc-getAR)" \
+			CC="$(tc-getCC)" \
+			LIBDIR="$(get_libdir)" \
+			NV_VERBOSE=1 \
+			RANLIB="$(tc-getRANLIB)" \
+			DO_STRIP= \
+			build-xnvctrl
+
+		emake -C "${S}"/nvidia-settings-${PV}/src \
+			CC="$(tc-getCC)" \
+			GTK3_AVAILABLE=$(usex gtk3 1 0) \
+			LD="$(tc-getCC)" \
+			LIBDIR="$(get_libdir)" \
+			NVML_ENABLED=0 \
+			NV_USE_BUNDLED_LIBJANSSON=0 \
+			NV_VERBOSE=1 \
+			DO_STRIP=
+	fi
+}
+
+# Install nvidia library:
+# the first parameter is the library to install
+# the second parameter is the provided soversion
+# the third parameter is the target directory if it is not /usr/lib
+donvidia() {
+	# Full path to library
+	nv_LIB="${1}"
+
+	# SOVER to use
+	nv_SOVER="$(scanelf -qF'%S#F' ${nv_LIB})"
+
+	# Where to install
+	nv_DEST="${2}"
+
+	# Get just the library name
+	nv_LIBNAME=$(basename "${nv_LIB}")
+
+	if [[ "${nv_DEST}" ]]; then
+		exeinto ${nv_DEST}
+		action="doexe"
+	else
+		nv_DEST="/usr/$(get_libdir)"
+		action="dolib.so"
+	fi
+
+	# Install the library
+	${action} ${nv_LIB} || die "failed to install ${nv_LIBNAME}"
+
+	# If the library has a SONAME and SONAME does not match the library name,
+	# then we need to create a symlink
+	if [[ ${nv_SOVER} ]] && ! [[ "${nv_SOVER}" = "${nv_LIBNAME}" ]]; then
+		dosym ${nv_LIBNAME} ${nv_DEST}/${nv_SOVER} \
+			|| die "failed to create ${nv_DEST}/${nv_SOVER} symlink"
+	fi
+
+	dosym ${nv_LIBNAME} ${nv_DEST}/${nv_LIBNAME/.so*/.so} \
+		|| die "failed to create ${nv_LIBNAME/.so*/.so} symlink"
+}
+
+src_install() {
+	if use driver && use kernel_linux; then
+		linux-mod_src_install
+
+		# Add the aliases
+		# This file is tweaked with the appropriate video group in
+		# pkg_preinst, see bug #491414
+		insinto /etc/modprobe.d
+		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
+		doins "${FILESDIR}"/nvidia-rmmod.conf
+
+		# Ensures that our device nodes are created when not using X
+		exeinto "$(get_udevdir)"
+		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
+		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
+	elif use kernel_FreeBSD; then
+		if use x86-fbsd; then
+			insinto /boot/modules
+			doins "${S}/src/nvidia.kld"
+		fi
+
+		exeinto /boot/modules
+		doexe "${S}/src/nvidia.ko"
+	fi
+
+	# NVIDIA kernel <-> userspace driver config lib
+	donvidia ${NV_OBJ}/libnvidia-cfg.so.${NV_SOVER}
+
+	# NVIDIA framebuffer capture library
+	donvidia ${NV_OBJ}/libnvidia-fbc.so.${NV_SOVER}
+
+	# NVIDIA video encode/decode <-> CUDA
+	if use kernel_linux; then
+		donvidia ${NV_OBJ}/libnvcuvid.so.${NV_SOVER}
+		donvidia ${NV_OBJ}/libnvidia-encode.so.${NV_SOVER}
+	fi
+
+	if use X; then
+		# Xorg DDX driver
+		insinto /usr/$(get_libdir)/xorg/modules/drivers
+		doins ${NV_X11}/nvidia_drv.so
+
+		# Xorg GLX driver
+		donvidia ${NV_X11}/libglx.so.${NV_SOVER} \
+			/usr/$(get_libdir)/opengl/nvidia/extensions
+
+		# Xorg nvidia.conf
+		if has_version '>=x11-base/xorg-server-1.16'; then
+			insinto /usr/share/X11/xorg.conf.d
+			newins {,50-}nvidia-drm-outputclass.conf
+		fi
+
+		insinto /usr/share/glvnd/egl_vendor.d
+		doins ${NV_X11}/10_nvidia.json
+	fi
+
+	# OpenCL ICD for NVIDIA
+	if use kernel_linux; then
+		insinto /etc/OpenCL/vendors
+		doins ${NV_OBJ}/nvidia.icd
+	fi
+
+	# Documentation
+	if use kernel_FreeBSD; then
+		dodoc "${NV_DOC}/README"
+		use X && doman "${NV_MAN}/nvidia-xconfig.1"
+		use tools && doman "${NV_MAN}/nvidia-settings.1"
+	else
+		# Docs
+		newdoc "${NV_DOC}/README.txt" README
+		dodoc "${NV_DOC}/NVIDIA_Changelog"
+		doman "${NV_MAN}/nvidia-smi.1.gz"
+		use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
+		use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
+		doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
+	fi
+
+	docinto html
+	dodoc -r ${NV_DOC}/html/*
+
+	# Helper Apps
+	exeinto /opt/bin/
+
+	if use X; then
+		doexe ${NV_OBJ}/nvidia-xconfig
+
+		insinto /etc/vulkan/icd.d
+		doins nvidia_icd.json
+	fi
+
+	if use kernel_linux; then
+		doexe ${NV_OBJ}/nvidia-cuda-mps-control
+		doexe ${NV_OBJ}/nvidia-cuda-mps-server
+		doexe ${NV_OBJ}/nvidia-debugdump
+		doexe ${NV_OBJ}/nvidia-persistenced
+		doexe ${NV_OBJ}/nvidia-smi
+
+		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
+		doexe ${NV_OBJ}/nvidia-modprobe
+		fowners root:video /opt/bin/nvidia-modprobe
+		fperms 4710 /opt/bin/nvidia-modprobe
+		dosym /{opt,usr}/bin/nvidia-modprobe
+
+		doman nvidia-cuda-mps-control.1.gz
+		doman nvidia-modprobe.1.gz
+		doman nvidia-persistenced.1.gz
+		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
+		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
+		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
+	fi
+
+	if use tools; then
+		emake -C "${S}"/nvidia-settings-${PV}/src/ \
+			DESTDIR="${D}" \
+			GTK3_AVAILABLE=$(usex gtk3 1 0) \
+			LIBDIR="${D}/usr/$(get_libdir)" \
+			NV_USE_BUNDLED_LIBJANSSON=0 \
+			NV_VERBOSE=1 \
+			PREFIX=/usr \
+			DO_STRIP= \
+			install
+
+		if use static-libs; then
+			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
+
+			insinto /usr/include/NVCtrl
+			doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
+		fi
+
+		insinto /usr/share/nvidia/
+		doins nvidia-application-profiles-${PV}-key-documentation
+
+		insinto /etc/nvidia
+		newins \
+			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
+
+		# There is no icon in the FreeBSD tarball.
+		use kernel_FreeBSD || \
+			doicon ${NV_OBJ}/nvidia-settings.png
+
+		domenu "${FILESDIR}"/nvidia-settings.desktop
+
+		exeinto /etc/X11/xinit/xinitrc.d
+		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
+	fi
+
+	dobin ${NV_OBJ}/nvidia-bug-report.sh
+
+	if has_multilib_profile && use multilib; then
+		local OABI=${ABI}
+		for ABI in $(get_install_abis); do
+			src_install-libs
+		done
+		ABI=${OABI}
+		unset OABI
+	else
+		src_install-libs
+	fi
+
+	is_final_abi || die "failed to iterate through all ABIs"
+
+	readme.gentoo_create_doc
+}
+
+src_install-libs() {
+	local inslibdir=$(get_libdir)
+	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
+	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
+	local libdir=${NV_OBJ}
+
+	if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
+		libdir=${NV_OBJ}/32
+	fi
+
+	if use X; then
+		NV_GLX_LIBRARIES=(
+			"libEGL.so.$(usex compat ${NV_SOVER} 1) ${GL_ROOT}"
+			"libEGL_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGL.so.$(usex compat ${NV_SOVER} 1.0.0) ${GL_ROOT}"
+			"libGLESv1_CM.so.1 ${GL_ROOT}"
+			"libGLESv1_CM_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGLESv2.so.2 ${GL_ROOT}"
+			"libGLESv2_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGLX.so.0 ${GL_ROOT}"
+			"libGLX_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGLdispatch.so.0 ${GL_ROOT}"
+			"libOpenCL.so.1.0.0 ${CL_ROOT}"
+			"libOpenGL.so.0 ${GL_ROOT}"
+			"libcuda.so.${NV_SOVER}"
+			"libnvcuvid.so.${NV_SOVER}"
+			"libnvidia-compiler.so.${NV_SOVER}"
+			"libnvidia-eglcore.so.${NV_SOVER}"
+			"libnvidia-encode.so.${NV_SOVER}"
+			"libnvidia-fatbinaryloader.so.${NV_SOVER}"
+			"libnvidia-fbc.so.${NV_SOVER}"
+			"libnvidia-glcore.so.${NV_SOVER}"
+			"libnvidia-glsi.so.${NV_SOVER}"
+			"libnvidia-ifr.so.${NV_SOVER}"
+			"libnvidia-opencl.so.${NV_SOVER}"
+			"libnvidia-ptxjitcompiler.so.${NV_SOVER}"
+			"libvdpau_nvidia.so.${NV_SOVER}"
+		)
+
+		if use wayland && has_multilib_profile && [[ ${ABI} == "amd64" ]];
+		then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-egl-wayland.so.${NV_SOVER}"
+			)
+		fi
+
+		if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
+		then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-wfb.so.${NV_SOVER}"
+			)
+		fi
+
+		if use kernel_FreeBSD; then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-tls.so.${NV_SOVER}"
+			)
+		fi
+
+		if use kernel_linux; then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-ml.so.${NV_SOVER}"
+				"tls/libnvidia-tls.so.${NV_SOVER}"
+			)
+		fi
+
+		for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
+			donvidia ${libdir}/${NV_LIB}
+		done
+	fi
+}
+
+pkg_preinst() {
+	if use driver && use kernel_linux; then
+		linux-mod_pkg_preinst
+
+		local videogroup="$(egetent group video | cut -d ':' -f 3)"
+		if [ -z "${videogroup}" ]; then
+			eerror "Failed to determine the video group gid"
+			die "Failed to determine the video group gid"
+		else
+			sed -i \
+				-e "s:PACKAGE:${PF}:g" \
+				-e "s:VIDEOGID:${videogroup}:" \
+				"${D}"/etc/modprobe.d/nvidia.conf || die
+		fi
+	fi
+
+	# Clean the dynamic libGL stuff's home to ensure
+	# we dont have stale libs floating around
+	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ]; then
+		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
+	fi
+	# Make sure we nuke the old nvidia-glx's env.d file
+	if [ -e "${ROOT}"/etc/env.d/09nvidia ]; then
+		rm -f "${ROOT}"/etc/env.d/09nvidia
+	fi
+}
+
+pkg_postinst() {
+	use driver && use kernel_linux && linux-mod_pkg_postinst
+
+	# Switch to the nvidia implementation
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
+	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
+
+	readme.gentoo_print_elog
+
+	if ! use X; then
+		elog "You have elected to not install the X.org driver. Along with"
+		elog "this the OpenGL libraries and VDPAU libraries were not"
+		elog "installed. Additionally, once the driver is loaded your card"
+		elog "and fan will run at max speed which may not be desirable."
+		elog "Use the 'nvidia-smi' init script to have your card and fan"
+		elog "speed scale appropriately."
+		elog
+	fi
+	if ! use tools; then
+		elog "USE=tools controls whether the nvidia-settings application"
+		elog "is installed. If you would like to use it, enable that"
+		elog "flag and re-emerge this ebuild. Optionally you can install"
+		elog "media-video/nvidia-settings"
+		elog
+	fi
+}
+
+pkg_prerm() {
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+	use driver && use kernel_linux && linux-mod_pkg_postrm
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-378.13.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-378.13.ebuild
new file mode 100644
index 0000000000..5d27ec4b13
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-378.13.ebuild
@@ -0,0 +1,560 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+inherit eutils flag-o-matic linux-info linux-mod multilib-minimal nvidia-driver \
+	portability toolchain-funcs unpacker user udev
+
+NV_URI="http://us.download.nvidia.com/XFree86/"
+X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
+AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
+ARM_NV_PACKAGE="NVIDIA-Linux-armv7l-gnueabihf-${PV}"
+X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
+AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
+
+DESCRIPTION="NVIDIA Accelerated Graphics Driver"
+HOMEPAGE="http://www.nvidia.com/ http://www.nvidia.com/Download/Find.aspx"
+SRC_URI="
+	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
+	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
+	arm? ( ${NV_URI}Linux-x86-ARM/${PV}/${ARM_NV_PACKAGE}.run )
+	x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
+	x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
+	tools? (
+		ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2
+	)
+"
+
+LICENSE="GPL-2 NVIDIA-r2"
+SLOT="0/${PV%.*}"
+KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
+RESTRICT="bindist mirror"
+EMULTILIB_PKG="true"
+
+IUSE="acpi compat +driver gtk3 kernel_FreeBSD kernel_linux +kms multilib pax_kernel static-libs +tools uvm wayland +X"
+REQUIRED_USE="
+	tools? ( X )
+	static-libs? ( tools )
+"
+
+COMMON="
+	app-eselect/eselect-opencl
+	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
+	tools? (
+		dev-libs/atk[${MULTILIB_USEDEP}]
+		dev-libs/glib:2[${MULTILIB_USEDEP}]
+		dev-libs/jansson[${MULTILIB_USEDEP}]
+		gtk3? ( x11-libs/gtk+:3[${MULTILIB_USEDEP}] )
+		x11-libs/cairo[${MULTILIB_USEDEP}]
+		x11-libs/gdk-pixbuf[X,${MULTILIB_USEDEP}]
+		x11-libs/gtk+:2[${MULTILIB_USEDEP}]
+		x11-libs/libX11[${MULTILIB_USEDEP}]
+		x11-libs/libXext[${MULTILIB_USEDEP}]
+		x11-libs/libXrandr[${MULTILIB_USEDEP}]
+		x11-libs/libXv[${MULTILIB_USEDEP}]
+		x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
+		x11-libs/pango[X,${MULTILIB_USEDEP}]
+	)
+	X? (
+		>=app-eselect/eselect-opengl-1.0.9
+		app-misc/pax-utils
+	)
+"
+DEPEND="
+	${COMMON}
+	kernel_linux? ( virtual/linux-sources )
+"
+RDEPEND="
+	${COMMON}
+	acpi? ( sys-power/acpid )
+	tools? ( !media-video/nvidia-settings )
+	wayland? ( dev-libs/wayland[${MULTILIB_USEDEP}] )
+	X? (
+		<x11-base/xorg-server-1.19.99:=
+		>=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
+		>=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
+		>=x11-libs/libvdpau-1.0[${MULTILIB_USEDEP}]
+		sys-libs/zlib[${MULTILIB_USEDEP}]
+	)
+"
+
+QA_PREBUILT="opt/* usr/lib*"
+
+S=${WORKDIR}/
+
+pkg_pretend() {
+	if use amd64 && has_multilib_profile && \
+		[ "${DEFAULT_ABI}" != "amd64" ]; then
+		eerror "This ebuild doesn't currently support changing your default ABI"
+		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
+	fi
+
+	if use kernel_linux && kernel_is ge 4 10; then
+		ewarn "Gentoo supports kernels which are supported by NVIDIA"
+		ewarn "which are limited to the following kernels:"
+		ewarn "<sys-kernel/gentoo-sources-4.10"
+		ewarn "<sys-kernel/vanilla-sources-4.10"
+		ewarn ""
+		ewarn "You are free to utilize epatch_user to provide whatever"
+		ewarn "support you feel is appropriate, but will not receive"
+		ewarn "support as a result of those changes."
+		ewarn ""
+		ewarn "Do not file a bug report about this."
+		ewarn ""
+	fi
+
+	# Since Nvidia ships many different series of drivers, we need to give the user
+	# some kind of guidance as to what version they should install. This tries
+	# to point the user in the right direction but can't be perfect. check
+	# nvidia-driver.eclass
+	nvidia-driver-check-warning
+
+	# Kernel features/options to check for
+	CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
+	use x86 && CONFIG_CHECK+=" ~HIGHMEM"
+
+	# Now do the above checks
+	use kernel_linux && check_extra_config
+}
+
+pkg_setup() {
+	# try to turn off distcc and ccache for people that have a problem with it
+	export DISTCC_DISABLE=1
+	export CCACHE_DISABLE=1
+
+	if use driver && use kernel_linux; then
+		MODULE_NAMES="nvidia(video:${S}/kernel)"
+		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
+		use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel) nvidia-drm(video:${S}/kernel)"
+
+		# This needs to run after MODULE_NAMES (so that the eclass checks
+		# whether the kernel supports loadable modules) but before BUILD_PARAMS
+		# is set (so that KV_DIR is populated).
+		linux-mod_pkg_setup
+
+		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
+		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
+
+		# linux-mod_src_compile calls set_arch_to_kernel, which
+		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
+		# expects x86_64 or i386 and then converts it to x86
+		# later on in the build process
+		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
+	fi
+
+	if use kernel_linux && kernel_is lt 2 6 9; then
+		eerror "You must build this against 2.6.9 or higher kernels."
+	fi
+
+	# set variables to where files are in the package structure
+	if use kernel_FreeBSD; then
+		use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
+		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
+		NV_DOC="${S}/doc"
+		NV_OBJ="${S}/obj"
+		NV_SRC="${S}/src"
+		NV_MAN="${S}/x11/man"
+		NV_X11="${S}/obj"
+		NV_SOVER=1
+	elif use kernel_linux; then
+		NV_DOC="${S}"
+		NV_OBJ="${S}"
+		NV_SRC="${S}/kernel"
+		NV_MAN="${S}"
+		NV_X11="${S}"
+		NV_SOVER=${PV}
+	else
+		die "Could not determine proper NVIDIA package"
+	fi
+}
+
+src_prepare() {
+	if use pax_kernel; then
+		ewarn "Using PAX patches is not supported. You will be asked to"
+		ewarn "use a standard kernel should you have issues. Should you"
+		ewarn "need support with these patches, contact the PaX team."
+		eapply "${FILESDIR}"/${PN}-375.20-pax.patch
+	fi
+
+	# Allow user patches so they can support RC kernels and whatever else
+	eapply_user
+}
+
+src_compile() {
+	# This is already the default on Linux, as there's no toplevel Makefile, but
+	# on FreeBSD there's one and triggers the kernel module build, as we install
+	# it by itself, pass this.
+
+	cd "${NV_SRC}"
+	if use kernel_FreeBSD; then
+		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
+			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
+	elif use driver && use kernel_linux; then
+		MAKEOPTS=-j1 linux-mod_src_compile
+	fi
+
+	if use tools; then
+		emake -C "${S}"/nvidia-settings-${PV}/src \
+			AR="$(tc-getAR)" \
+			CC="$(tc-getCC)" \
+			LIBDIR="$(get_libdir)" \
+			NV_VERBOSE=1 \
+			RANLIB="$(tc-getRANLIB)" \
+			DO_STRIP= \
+			build-xnvctrl
+
+		emake -C "${S}"/nvidia-settings-${PV}/src \
+			CC="$(tc-getCC)" \
+			GTK3_AVAILABLE=$(usex gtk3 1 0) \
+			LD="$(tc-getCC)" \
+			LIBDIR="$(get_libdir)" \
+			NVML_ENABLED=0 \
+			NV_USE_BUNDLED_LIBJANSSON=0 \
+			NV_VERBOSE=1 \
+			DO_STRIP=
+	fi
+}
+
+# Install nvidia library:
+# the first parameter is the library to install
+# the second parameter is the provided soversion
+# the third parameter is the target directory if it is not /usr/lib
+donvidia() {
+	# Full path to library
+	nv_LIB="${1}"
+
+	# SOVER to use
+	nv_SOVER="$(scanelf -qF'%S#F' ${nv_LIB})"
+
+	# Where to install
+	nv_DEST="${2}"
+
+	# Get just the library name
+	nv_LIBNAME=$(basename "${nv_LIB}")
+
+	if [[ "${nv_DEST}" ]]; then
+		exeinto ${nv_DEST}
+		action="doexe"
+	else
+		nv_DEST="/usr/$(get_libdir)"
+		action="dolib.so"
+	fi
+
+	# Install the library
+	${action} ${nv_LIB} || die "failed to install ${nv_LIBNAME}"
+
+	# If the library has a SONAME and SONAME does not match the library name,
+	# then we need to create a symlink
+	if [[ ${nv_SOVER} ]] && ! [[ "${nv_SOVER}" = "${nv_LIBNAME}" ]]; then
+		dosym ${nv_LIBNAME} ${nv_DEST}/${nv_SOVER} \
+			|| die "failed to create ${nv_DEST}/${nv_SOVER} symlink"
+	fi
+
+	dosym ${nv_LIBNAME} ${nv_DEST}/${nv_LIBNAME/.so*/.so} \
+		|| die "failed to create ${nv_LIBNAME/.so*/.so} symlink"
+}
+
+src_install() {
+	if use driver && use kernel_linux; then
+		linux-mod_src_install
+
+		# Add the aliases
+		# This file is tweaked with the appropriate video group in
+		# pkg_preinst, see bug #491414
+		insinto /etc/modprobe.d
+		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
+		doins "${FILESDIR}"/nvidia-rmmod.conf
+
+		# Ensures that our device nodes are created when not using X
+		exeinto "$(get_udevdir)"
+		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
+		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
+	elif use kernel_FreeBSD; then
+		if use x86-fbsd; then
+			insinto /boot/modules
+			doins "${S}/src/nvidia.kld"
+		fi
+
+		exeinto /boot/modules
+		doexe "${S}/src/nvidia.ko"
+	fi
+
+	# NVIDIA kernel <-> userspace driver config lib
+	donvidia ${NV_OBJ}/libnvidia-cfg.so.${NV_SOVER}
+
+	# NVIDIA framebuffer capture library
+	donvidia ${NV_OBJ}/libnvidia-fbc.so.${NV_SOVER}
+
+	# NVIDIA video encode/decode <-> CUDA
+	if use kernel_linux; then
+		donvidia ${NV_OBJ}/libnvcuvid.so.${NV_SOVER}
+		donvidia ${NV_OBJ}/libnvidia-encode.so.${NV_SOVER}
+	fi
+
+	if use X; then
+		# Xorg DDX driver
+		insinto /usr/$(get_libdir)/xorg/modules/drivers
+		doins ${NV_X11}/nvidia_drv.so
+
+		# Xorg GLX driver
+		donvidia ${NV_X11}/libglx.so.${NV_SOVER} \
+			/usr/$(get_libdir)/opengl/nvidia/extensions
+
+		# Xorg nvidia.conf
+		if has_version '>=x11-base/xorg-server-1.16'; then
+			insinto /usr/share/X11/xorg.conf.d
+			newins {,50-}nvidia-drm-outputclass.conf
+		fi
+
+		insinto /usr/share/glvnd/egl_vendor.d
+		doins ${NV_X11}/10_nvidia.json
+	fi
+
+	if use wayland; then
+		insinto /usr/share/egl/egl_external_platform.d
+		doins ${NV_X11}/10_nvidia_wayland.json
+	fi
+
+	# OpenCL ICD for NVIDIA
+	if use kernel_linux; then
+		insinto /etc/OpenCL/vendors
+		doins ${NV_OBJ}/nvidia.icd
+	fi
+
+	# Documentation
+	if use kernel_FreeBSD; then
+		dodoc "${NV_DOC}/README"
+		use X && doman "${NV_MAN}/nvidia-xconfig.1"
+		use tools && doman "${NV_MAN}/nvidia-settings.1"
+	else
+		# Docs
+		newdoc "${NV_DOC}/README.txt" README
+		dodoc "${NV_DOC}/NVIDIA_Changelog"
+		doman "${NV_MAN}/nvidia-smi.1.gz"
+		use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
+		use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
+		doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
+	fi
+
+	docinto html
+	dodoc -r ${NV_DOC}/html/*
+
+	# Helper Apps
+	exeinto /opt/bin/
+
+	if use X; then
+		doexe ${NV_OBJ}/nvidia-xconfig
+
+		insinto /etc/vulkan/icd.d
+		doins nvidia_icd.json
+	fi
+
+	if use kernel_linux; then
+		doexe ${NV_OBJ}/nvidia-cuda-mps-control
+		doexe ${NV_OBJ}/nvidia-cuda-mps-server
+		doexe ${NV_OBJ}/nvidia-debugdump
+		doexe ${NV_OBJ}/nvidia-persistenced
+		doexe ${NV_OBJ}/nvidia-smi
+
+		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
+		doexe ${NV_OBJ}/nvidia-modprobe
+		fowners root:video /opt/bin/nvidia-modprobe
+		fperms 4710 /opt/bin/nvidia-modprobe
+		dosym /{opt,usr}/bin/nvidia-modprobe
+
+		doman nvidia-cuda-mps-control.1.gz
+		doman nvidia-modprobe.1.gz
+		doman nvidia-persistenced.1.gz
+		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
+		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
+		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
+	fi
+
+	if use tools; then
+		emake -C "${S}"/nvidia-settings-${PV}/src/ \
+			DESTDIR="${D}" \
+			GTK3_AVAILABLE=$(usex gtk3 1 0) \
+			LIBDIR="${D}/usr/$(get_libdir)" \
+			NV_USE_BUNDLED_LIBJANSSON=0 \
+			NV_VERBOSE=1 \
+			PREFIX=/usr \
+			DO_STRIP= \
+			install
+
+		if use static-libs; then
+			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
+
+			insinto /usr/include/NVCtrl
+			doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
+		fi
+
+		insinto /usr/share/nvidia/
+		doins nvidia-application-profiles-${PV}-key-documentation
+
+		insinto /etc/nvidia
+		newins \
+			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
+
+		# There is no icon in the FreeBSD tarball.
+		use kernel_FreeBSD || \
+			doicon ${NV_OBJ}/nvidia-settings.png
+
+		domenu "${FILESDIR}"/nvidia-settings.desktop
+
+		exeinto /etc/X11/xinit/xinitrc.d
+		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
+	fi
+
+	dobin ${NV_OBJ}/nvidia-bug-report.sh
+
+	if has_multilib_profile && use multilib; then
+		local OABI=${ABI}
+		for ABI in $(get_install_abis); do
+			src_install-libs
+		done
+		ABI=${OABI}
+		unset OABI
+	else
+		src_install-libs
+	fi
+
+	is_final_abi || die "failed to iterate through all ABIs"
+
+	readme.gentoo_create_doc
+}
+
+src_install-libs() {
+	local inslibdir=$(get_libdir)
+	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
+	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
+	local libdir=${NV_OBJ}
+
+	if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
+		libdir=${NV_OBJ}/32
+	fi
+
+	if use X; then
+		NV_GLX_LIBRARIES=(
+			"libEGL.so.$(usex compat ${NV_SOVER} 1) ${GL_ROOT}"
+			"libEGL_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGL.so.$(usex compat ${NV_SOVER} 1.0.0) ${GL_ROOT}"
+			"libGLESv1_CM.so.1 ${GL_ROOT}"
+			"libGLESv1_CM_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGLESv2.so.2 ${GL_ROOT}"
+			"libGLESv2_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGLX.so.0 ${GL_ROOT}"
+			"libGLX_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGLdispatch.so.0 ${GL_ROOT}"
+			"libOpenCL.so.1.0.0 ${CL_ROOT}"
+			"libOpenGL.so.0 ${GL_ROOT}"
+			"libcuda.so.${NV_SOVER}"
+			"libnvcuvid.so.${NV_SOVER}"
+			"libnvidia-compiler.so.${NV_SOVER}"
+			"libnvidia-eglcore.so.${NV_SOVER}"
+			"libnvidia-encode.so.${NV_SOVER}"
+			"libnvidia-fatbinaryloader.so.${NV_SOVER}"
+			"libnvidia-fbc.so.${NV_SOVER}"
+			"libnvidia-glcore.so.${NV_SOVER}"
+			"libnvidia-glsi.so.${NV_SOVER}"
+			"libnvidia-ifr.so.${NV_SOVER}"
+			"libnvidia-opencl.so.${NV_SOVER}"
+			"libnvidia-ptxjitcompiler.so.${NV_SOVER}"
+			"libvdpau_nvidia.so.${NV_SOVER}"
+		)
+
+		if use wayland && has_multilib_profile && [[ ${ABI} == "amd64" ]];
+		then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-egl-wayland.so.1.0.1"
+			)
+		fi
+
+		if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
+		then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-wfb.so.${NV_SOVER}"
+			)
+		fi
+
+		if use kernel_FreeBSD; then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-tls.so.${NV_SOVER}"
+			)
+		fi
+
+		if use kernel_linux; then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-ml.so.${NV_SOVER}"
+				"tls/libnvidia-tls.so.${NV_SOVER}"
+			)
+		fi
+
+		for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
+			donvidia ${libdir}/${NV_LIB}
+		done
+	fi
+}
+
+pkg_preinst() {
+	if use driver && use kernel_linux; then
+		linux-mod_pkg_preinst
+
+		local videogroup="$(egetent group video | cut -d ':' -f 3)"
+		if [ -z "${videogroup}" ]; then
+			eerror "Failed to determine the video group gid"
+			die "Failed to determine the video group gid"
+		else
+			sed -i \
+				-e "s:PACKAGE:${PF}:g" \
+				-e "s:VIDEOGID:${videogroup}:" \
+				"${D}"/etc/modprobe.d/nvidia.conf || die
+		fi
+	fi
+
+	# Clean the dynamic libGL stuff's home to ensure
+	# we dont have stale libs floating around
+	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ]; then
+		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
+	fi
+	# Make sure we nuke the old nvidia-glx's env.d file
+	if [ -e "${ROOT}"/etc/env.d/09nvidia ]; then
+		rm -f "${ROOT}"/etc/env.d/09nvidia
+	fi
+}
+
+pkg_postinst() {
+	use driver && use kernel_linux && linux-mod_pkg_postinst
+
+	# Switch to the nvidia implementation
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
+	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
+
+	readme.gentoo_print_elog
+
+	if ! use X; then
+		elog "You have elected to not install the X.org driver. Along with"
+		elog "this the OpenGL libraries and VDPAU libraries were not"
+		elog "installed. Additionally, once the driver is loaded your card"
+		elog "and fan will run at max speed which may not be desirable."
+		elog "Use the 'nvidia-smi' init script to have your card and fan"
+		elog "speed scale appropriately."
+		elog
+	fi
+	if ! use tools; then
+		elog "USE=tools controls whether the nvidia-settings application"
+		elog "is installed. If you would like to use it, enable that"
+		elog "flag and re-emerge this ebuild. Optionally you can install"
+		elog "media-video/nvidia-settings"
+		elog
+	fi
+}
+
+pkg_prerm() {
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+	use driver && use kernel_linux && linux-mod_pkg_postrm
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: x11-drivers/nvidia-drivers/, x11-drivers/nvidia-drivers/files/
@ 2017-03-30  7:29 Jeroen Roovers
  0 siblings, 0 replies; 33+ messages in thread
From: Jeroen Roovers @ 2017-03-30  7:29 UTC (permalink / raw
  To: gentoo-commits

commit:     99ee8e677f6609be4ba52fc047336548106a03fd
Author:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 30 07:27:47 2017 +0000
Commit:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
CommitDate: Thu Mar 30 07:27:47 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=99ee8e67

x11-drivers/nvidia-drivers: Drop obsolete branches (bug #611712).

Package-Manager: Portage-2.3.5, Repoman-2.3.2

 x11-drivers/nvidia-drivers/Manifest                |  46 --
 .../files/nvidia-drivers-346.16-pax-constify.patch |  25 -
 .../files/nvidia-drivers-346.16-pax-usercopy.patch |  47 --
 .../files/nvidia-drivers-355.06-pax.patch          | 102 ----
 .../files/nvidia-drivers-361.28-pax.patch          | 351 -------------
 .../files/nvidia-drivers-364.12-pax.patch          | 398 ---------------
 .../files/nvidia-drivers-367.35-pax.patch          | 404 ---------------
 .../files/nvidia-drivers-367.57-pax.patch          | 391 ---------------
 .../files/nvidia-drivers-367.57-profiles-rc.patch  |  11 -
 .../files/nvidia-drivers-370.28-profiles-rc.patch  |  11 -
 .../files/nvidia-drivers-settings.desktop          |   7 -
 x11-drivers/nvidia-drivers/metadata.xml            |   1 -
 .../nvidia-drivers/nvidia-drivers-346.96-r6.ebuild | 527 --------------------
 .../nvidia-drivers/nvidia-drivers-346.96-r7.ebuild | 528 --------------------
 .../nvidia-drivers/nvidia-drivers-352.79-r4.ebuild | 526 --------------------
 .../nvidia-drivers/nvidia-drivers-352.79-r5.ebuild | 525 --------------------
 .../nvidia-drivers/nvidia-drivers-355.11-r4.ebuild | 499 -------------------
 .../nvidia-drivers/nvidia-drivers-355.11-r5.ebuild | 502 -------------------
 .../nvidia-drivers/nvidia-drivers-358.16-r5.ebuild | 538 --------------------
 .../nvidia-drivers/nvidia-drivers-358.16-r6.ebuild | 539 --------------------
 .../nvidia-drivers/nvidia-drivers-361.42-r1.ebuild | 529 --------------------
 .../nvidia-drivers/nvidia-drivers-361.42.ebuild    | 528 --------------------
 .../nvidia-drivers-361.45.18-r1.ebuild             | 529 --------------------
 .../nvidia-drivers/nvidia-drivers-361.45.18.ebuild | 528 --------------------
 .../nvidia-drivers/nvidia-drivers-364.19-r1.ebuild | 547 --------------------
 .../nvidia-drivers/nvidia-drivers-364.19-r2.ebuild | 548 --------------------
 .../nvidia-drivers/nvidia-drivers-367.57-r1.ebuild | 551 --------------------
 .../nvidia-drivers/nvidia-drivers-367.57-r2.ebuild | 552 ---------------------
 .../nvidia-drivers/nvidia-drivers-370.28-r1.ebuild | 551 --------------------
 .../nvidia-drivers/nvidia-drivers-370.28-r2.ebuild | 552 ---------------------
 30 files changed, 11393 deletions(-)

diff --git a/x11-drivers/nvidia-drivers/Manifest b/x11-drivers/nvidia-drivers/Manifest
index cecb11b3502..d4065462f18 100644
--- a/x11-drivers/nvidia-drivers/Manifest
+++ b/x11-drivers/nvidia-drivers/Manifest
@@ -3,15 +3,6 @@ DIST NVIDIA-FreeBSD-x86-304.134.tar.gz 35095790 SHA256 e7a164807c83ab0f1be98eb24
 DIST NVIDIA-FreeBSD-x86-304.135.tar.gz 35092250 SHA256 3bcecc26c67588174bcee96b25f4f70265f463e4b3eb85d83363977acf3b6d33 SHA512 2e8e8b6cc02bcb44fcfc5f7b378cfe104669d2092e5191261c800bb458281e4ae269d8ae3f7230f5e1432004d55120e063166ead5d91d80b96eb158f7927b34a WHIRLPOOL b42379f450630f20ece6f3af95b9f02d8c91121454d9c883f23cbb7a46e2099c41de2f15663932befb218eea856cb0a861fc34b19f3e84061cd0fa4f4c8722e6
 DIST NVIDIA-FreeBSD-x86-340.101.tar.gz 59992166 SHA256 f62038819eb4ba074e92ce8d26b6330ed3bc32d1c07bcc95f4e2964fa667e03b SHA512 b0d3e04acd60c1699850ecebbbdc2677f9691d3acf700effa369daedf3a45d7068c365a3298214acf396d7bcd531cfec26e9ef02e02c0896f01240219b338beb WHIRLPOOL 955e8ad5152137641fcf2d5515e8c3b0a7ed9cac5ab646c2551fb4b1b0c0295ef3e3007905d5b5f2c50daaab1b74b7d6ffeb3f96f617b464c2db745ca4b33473
 DIST NVIDIA-FreeBSD-x86-340.102.tar.gz 12057262 SHA256 d3edf43d6fc518869c35ae8d98ab5d55b86ade71127956ef66b201f60bc5dfe8 SHA512 bf15e68b1eee85e83474aaa480096991eac7506481f1192b53e0e10ff891f177c50c1492c51fb68ce0af3c5ccc54dad60edc90ec42b156e8338e51b9f9542520 WHIRLPOOL 6eb5df57b709ea2c3ab1c81d7a186fd106ff019400d66bc68c91da12d27b0b365e2f1b44c6d41cd45f605a813be1b88d587fcd7b3513c251e3248dc2f243d529
-DIST NVIDIA-FreeBSD-x86-346.96.tar.gz 58010757 SHA256 a27d7b79c053702bf6524b2c4725321fa557be18a585735e0b8122d884348c3e SHA512 f05ff7f98ae56ef992c21440e94dc12537f91353c9ba6fbe74b5928744823cb0cce38e7aa2da6c88569dda52f9ae0f6674c29255db155a2fada9b78f024dda8d WHIRLPOOL d21cfd27971847dac0118429b58b34be24f19fefc9ee05f70454e7c350d4a8678e2d01f7db72e05bd1026c45fa9373783b9817efcf76f70b70f6a5ecd8a5bc7c
-DIST NVIDIA-FreeBSD-x86-352.79.tar.gz 55381403 SHA256 baf99225383aa1b114c14504d00a400b4e2c72b521941210287d5a2f848a6189 SHA512 14dd0f52ae9fbc88b441392e32df6610121baeb5b08337d7a341d110f2735591c91a789c7825ca95fb542693f6971053a00b3dc4d7d224362d7b12a07cb315d5 WHIRLPOOL 7d5ac1efa1afb5a4cf5ef714b27fbc02190775bd11ae281df5552b836a22bc5377572a310c683d54910cbcbf5a4d57702309e5b3e61c295fb767568f8d8746bf
-DIST NVIDIA-FreeBSD-x86-355.11.tar.gz 56832647 SHA256 3d4d5d8fcf558a8f5f1a88846161b1a89bd7fc66c0268b40613c7e3457f5ce7b SHA512 744d9b8c48b82bac0bfeea5e8b2b2bbaa0e6a183cbd1f5d4f782fa7b21a6f6c5b252e556a8b2161c3b5d43938ef8fabf6cb36f995ee823fbf792f3c9a92b87e1 WHIRLPOOL 43bceb8e8d3b00789cf2c8163a055b1d2405ef93e471fda4c4e2146093289891557f4ec8debfe6bca89ad6ed6dc2e389f1d3060759a71e8949df343bc31b85b9
-DIST NVIDIA-FreeBSD-x86-358.16.tar.gz 58548165 SHA256 2257d9a2b3661d024be0864e2fe192de34fdf8e206073930541e0fa6f232016e SHA512 e1d84c2cc3473253b31aa3df8e2ad7418da5789e31d6f71f07e6bf5e712ffcb6417cf8931c16e5e5a19d0f4cdaebf229e4edbee53d5613bea1ff6b4e4c6657cc WHIRLPOOL 15b760556d978c9e82b063c1135089e1b1222460285ab2c40d450cf26820e701ff5d7ebdd04815f80a68a07eea0e622fa621b8369883f4168af5b45d4edde62d
-DIST NVIDIA-FreeBSD-x86-361.42.tar.gz 64942474 SHA256 46a28392fbe5d1688b6855c37db2e34daff0ffcdfb0c82557878b9839465a966 SHA512 74fdab9a0ef827e227cf7265768c491a1c073da5f7f3445a819749284176b8087f6bb10ca90e555685261af42e4eff9687a6c6fa2af33302b6393d0789674164 WHIRLPOOL 33f7b8ace23e50849ebf5cf4aa50310f1ee92ef17bf9f9797e8db5be3548de7502706624c219269c28e99d1ac1dcf5e114d953399f324835524356cb4bf7f544
-DIST NVIDIA-FreeBSD-x86-361.45.18.tar.gz 64962160 SHA256 5c6b04d2ee446e27466935891dc895943797e32226e8e6c486b47ee8e068bdb2 SHA512 fbe22499543e5cc900fe6b14efe12f3cb7c820fd6a1b79e0129d843ed430d77b2cb87365df123612382e32f02ce5d579b33c29c913692178d92683da868e233f WHIRLPOOL ab37570185bafacad0a27fbb0c6cd26f133b5cae34ab4c5535394a0bdc647350248179a296b3642b57700842ed713d12f23b9196880ab86b00163f5281a4475a
-DIST NVIDIA-FreeBSD-x86-364.19.tar.gz 65807198 SHA256 5096640e9ad8a774fa76d0b64d94e209110fe58f472671f63ae21fc8bca0b376 SHA512 b2dba9f06464dab01e7fcf2e488d5df1be25feaf66c9138111f1ad6db50ef893783b53d16f8676a853971ccd354b06db4b7ee0a9c48fa757b8acaae9b7ff9df9 WHIRLPOOL 5c074ca0381159cf545ab4a9efb2e9e12822a071e2aa98e9ca2faff46a2d6f8d84e08543693dc3db9b93f617821e9a1787c9e3f5b40e60c1373ee693a4c36bdd
-DIST NVIDIA-FreeBSD-x86-367.57.tar.gz 62859799 SHA256 64a0bde687aac1ec2aad859d5bea47d0691b916a851c64992bd460a05ad7c162 SHA512 13269f76d53a1818690ba8fd7aa604783e80059a031e3668c21a70158eeaa97251adda9ac058a712342e95780db86be5b893eebe0422cfce7f1073d88ea9293d WHIRLPOOL 303bebf3d73d8bc232a188c9e3a23164a70fafdd44974e5f5b1873488f682979702e2f18d838d85072a22520d959ded6bb3a4b79cb3d7cafc5de0feca6241061
-DIST NVIDIA-FreeBSD-x86-370.28.tar.gz 58718517 SHA256 52193b15b4ca822b029f860eed4d00270c925f5d24f7bb511a5b7bbea696d58c SHA512 83ffb19069cc240f8836d808a5eb02c142e7ad923fc2e3049a3b316acc12df070d42dfdc5a8a8e1411ccc9fba0bfa4ed84f457435e985434cd86ae966a63a3f4 WHIRLPOOL b1bec4d5e34ea39c3b1b44adcf85b7392cef39517979d32bc800e48a79a57cfb5f1ca5ff82bc302aa67ed12094782e09ab146f021a9c04e18430034a5ab341a9
 DIST NVIDIA-FreeBSD-x86-375.26.tar.gz 59091851 SHA256 5249d01a21bb846a08975c4f3a90935b6dc8fd33ec8e5faa0d624ef15bcf2b88 SHA512 281f41f341ccf7f7c1e0de9a6519813c7fd2d13ef59001c0a6f126cd5b8f2b67848c780ddaf6647e0c8b9a79c12ff77493c07203510084e741746834b26f5fdb WHIRLPOOL 48e5f810f41337f6b8f5db419288ae5050c3efd71d0b4b7f7b64251612860d5c7e83cb78885a73f6752160ca8dce852560db7d95ce93d5d86dba21e59bae5e77
 DIST NVIDIA-FreeBSD-x86-375.39.tar.gz 59111267 SHA256 ca39ab55716516bbca62fc888ec786745a8df7f346e68703f54e1a42afad733e SHA512 8f5bf9ffc731ca90a2604b80c3974ee123a12d7db9ee9be1811f5e78711798d7a29737a3651406c1c5e24a197d50f2f2fc39d94c8d11f9700900ef13266a5bf7 WHIRLPOOL e6ce83478238b2f6497ed48688531a6ba4bf78baa2d376e6c8a0f04b35039ed1532a4618f8a53c60ab0778330313ca1e9eecb836a4ade4c5b006844386d4b23f
 DIST NVIDIA-FreeBSD-x86-378.13.tar.gz 59610253 SHA256 aca461f050950f1a3a81137ec8adf2057deaa20ad166bdd4ce8f3e34616e7a98 SHA512 a0101201089df2bbf5bdc4ded2228dd989da6a47da31c3ec8d55916b1ff3457924555f82c7381934745fdc1b1f8f78e3fc10e5089279eb13423628dbfe560c6b WHIRLPOOL ac67d07d3ffb0959f685b7d59de152ba8fc97e11c30ed3f1a200511bcaf3de1cd1879147f37fde66a1c8d13dd327aac8a9ac78d42cc9656ef79e3180897aaef1
@@ -20,20 +11,9 @@ DIST NVIDIA-FreeBSD-x86_64-304.134.tar.gz 36148973 SHA256 3eafced8f8095c7f1135fe
 DIST NVIDIA-FreeBSD-x86_64-304.135.tar.gz 36144428 SHA256 0e415045b96bb272150d35d72c4a17c3d8e7b593dc7ffc577f6f25cc04f9de95 SHA512 8939f0153e7dc98ed147c79a042731461f87582ef46c4762afadf6a5e1cd0ca32ca99415a3819f7e5abefb2df5c59731454e80873d3d622b73f27e75518c8793 WHIRLPOOL e8689e07f12e169f9abad243111bcddee7796826f0028d29bb5eb340649696a3688a74068f07f52d6764fba9924ddd1dba18e8ae442654fffa9b902ccbde2c7f
 DIST NVIDIA-FreeBSD-x86_64-340.101.tar.gz 60860185 SHA256 aa75da2de6656bf8c4b8cf73b9e330b21ebc5da6de509cf90aed8a571716b111 SHA512 0a69e90c2ddd574736ae666fb0216afe639423c8bf73c69e7403bbd5e2aca640f130196402d81924137b34d30befeaaf8174a3fe3ca7efc16a2c5e650e87ab99 WHIRLPOOL b7652dcfc6116f865876cbb43807b1573ee6506e8f626a0da9123efe6fd6987d6bdd3c78dc833a38f0bff78ea290c34ecd69a65f7870248ac2c1bdff6cdb87b5
 DIST NVIDIA-FreeBSD-x86_64-340.102.tar.gz 60862932 SHA256 6d1108c2e8d1b25eb16cd8dc4eb221f2a20d2e4c39a515c0b5809fb407991f94 SHA512 fddef644937093550f9e5dfc25dc5cb81280785735c2d11f644b5eece8144b23bc88a353534ca95e925f54da9131ed5dd7460b72e554b6625df33e243476588f WHIRLPOOL 0b19ef96124768b8cafb0211a79f8ba6e3d04d9289d5194a59fdaa4eb15ab898c103346892007d9fd6eac75d6d503cd9724ab8f60bd7cf28fee2f9307b03d70b
-DIST NVIDIA-FreeBSD-x86_64-346.96.tar.gz 58774970 SHA256 89daaff29afe92d825ec8c00149a703b4eb234e4f16bbfb98673f077521bcff9 SHA512 99fd84f1b2177b4af2fd83088c4f8a9a6259f059c002a771ff9c3993953787dd96f83322e4ce611234674a00792a83fa439af915d6ad6886af6de2d88de94edb WHIRLPOOL 5bca7c540c713b8e070b7d8412bcc2547335b9379429dc3a04ab50eae22c03eaa922486a900b2ab3cf147e0c4f2e8d3b60e81aa329b6b2956c28d2b32900082c
-DIST NVIDIA-FreeBSD-x86_64-352.79.tar.gz 57044396 SHA256 d2a406c4a7502096964b6fd19e99a046a0106a60ffb9e45865156c62718bf49a SHA512 7fe8564744e522b0f8ddb2fb3bc44235e5189d87acff1f894f271404315bbd17ea41f469c6cdbaf51a27f85e8103ed3cec574ed29323deeb56869746691e977c WHIRLPOOL 677b670218510228d9a03dc0f259e36a5896124ead204fff2d294135c1b7d79dd10c0b2e144e79a68d27b282e12097adf76f8694ecb5daa53f4b689935130c6f
-DIST NVIDIA-FreeBSD-x86_64-355.11.tar.gz 54031364 SHA256 3637a879905bb541bf02f9bcdfe37c242a52ec6071671a0ba33581efdce1504e SHA512 84add7d90c7f45d19d736ee70c1c4a6434be1c512bafa29cbbf9221e99a31fc383971696dce99da5a77a171eb3537c98cfec7005ff061411ac9c310fa219c906 WHIRLPOOL d8ade5d63c3ef78fa92f9dc07934eed8fdd4ead1e40f1820ad95feb166264a95a800879e1fc6374bf2deef419b0838b4864796d9f81a81110d06ccd9b65c459d
-DIST NVIDIA-FreeBSD-x86_64-358.16.tar.gz 55338634 SHA256 29b62c266bb96604e82c5a514aebea86b65057fa59ba37f91bd01cd870a0725c SHA512 2e5aef35d5c4aa605ebe18a23ab132fe373c9b87a915ada005ecd28d75a476d6ac9d978394f8c63123f98a408dcc97d624b5deda5f242faea7304fc8ddf76d0d WHIRLPOOL bc8ee78214209fdeb0c6fc196cbc3acc244c777df8a83b5a5489959a73b744ecc125d7a9be6ca2f08d43b6a080898b1090eca45e627c96210dcfeb6207512c8e
-DIST NVIDIA-FreeBSD-x86_64-361.42.tar.gz 61730815 SHA256 5ac9a081d3b27307d79a20dfda82de38c3be319a93dbbe80b3458c0c521fb723 SHA512 d4331158b4d2a75b9884fb8999c6ae9cf1a0697ce1d4fcd8bd5e2c3d6043bdfd1bdb7665031828dd94226f9205d2c8a4a2585cff5fef5548fbf5ffff531e0e2c WHIRLPOOL 01f54f0b8bd25f7af888e27223807a1a182adca1d427d03500e9ec3b89a0f618bd2fb91fab4853e996cc1b3115680859b4fc91fe997ed32c36f75fb25da4cc43
-DIST NVIDIA-FreeBSD-x86_64-361.45.18.tar.gz 61749816 SHA256 7edcb70fa7388fa15fc949d5bfd2c952b66d3fe6f7cb1a0a9c415dbf84da5fb2 SHA512 27f5f98db0a41938f9c9ca2433486fae8e90136e355d51ee49ff4932f45e0e073f79a1f7e693fa5170dd3367e148cc04e51b440b0d51bdae0236e6f8caf3f01e WHIRLPOOL 835c1a73ae33113518d05b7a1a864d96f22c2a0a8c6993d56884b1b769b2a0d20943a36eb366e32f9e7ee52af67c58d23d8062791e35220641f5210f0eefe134
-DIST NVIDIA-FreeBSD-x86_64-364.19.tar.gz 62553892 SHA256 3b691c259b2a85da49d16ceab52b62363496fd764bbc3772e30c5f138a832ec3 SHA512 0e0cf1cea93a8e272bb7e7a939b73ea5a54888b0d4e870472cca92bc0f07ca7ec33616bf0a3f8f741167b7ffc173813574da541fdff83d66d19a230a07622b21 WHIRLPOOL 29945d058e24967afa4c5fdf71fb70f8bd8e0a80b6280d4a0ed47b27bf770da384ed04534681fa25869e3d2814400aafa0c57e44d6339ff2d16f5039ead04a4a
-DIST NVIDIA-FreeBSD-x86_64-367.57.tar.gz 59604884 SHA256 6f2986941a9f4cdcb3692c39919e5eeec09f2799b7797d3c0be0d4c61f7eed5b SHA512 06e4fd656efc88260c10b2a86308461754302dc9bad88285efe8b864012806f2d7147173ded9ee7b4ef2518ddbd6f02c5d36b184f913176732dd90cce0df006c WHIRLPOOL 9c33dd392ba0335b08c7710aaf97564d7cc0fdcc2fe87ec67ae1932848dbd6e6ad0437f6b44409b11cefc7ec33be7656199dcb2a34ab296f969fd65243bd114e
-DIST NVIDIA-FreeBSD-x86_64-370.28.tar.gz 57905860 SHA256 5087a93af8aaab6cff35ba60c9d67b4249827f6b7681abaaa571a20784a54552 SHA512 40637d64a0ee5029bb1c5ad7a590c5be61253ef6283c4217666768ad8601d7f51ef0d8705c8711f65c3d0a5a5721490813220c5f9186c6d2d12baf5d9c11122e WHIRLPOOL 361648788b7efb9e550b3e67d2e6022e31dab29f5660c42a1b6c961fe4638216fb8785814ee9fa1636fc39c39afce7caffbdc24fcf8bbd14e4eec5b5eeaeb1eb
 DIST NVIDIA-FreeBSD-x86_64-375.26.tar.gz 58287080 SHA256 c7d32cb434f9a7e84903a1305d7577705f991fdb6eb4ab3ff79d41b2df82265d SHA512 514c92636eeffa68cea5140819a9ad14888c18c1c60b0865e5cc9f9896b503f22c1236f76e65ed5e11cf3685ceb483c78d2a442b4e9bf274ae3ab399cf40ed9e WHIRLPOOL aa4eb254a6f3c5b0a9b2aaab12a011a92763e7a966b31840a595c18e24d82935dbe0ab3faa4c9aeb7ae24ec7505cb60c20c1e117396cf0527161a2aa1face296
 DIST NVIDIA-FreeBSD-x86_64-375.39.tar.gz 58308585 SHA256 0d58c450b3391cf28655f15505aaca8d011590efe5dd3ebc6a3212a9d7597b17 SHA512 2b9e4fe4c850c59050d6f586be743e6e9511d12ee3e5f760b6c6ef5ff2084b7bc147267a7844191db1bfab842806a47054ce8f7534d5fee614efbf08e1faaca4 WHIRLPOOL fe195242a1a3657609eb9ea0eda27daa22fcc40beaa35e3cfcda575978361f68da27a46411ad38a93bef333bba91c06b911545d4d14f19b3dd2d085ae7012408
 DIST NVIDIA-FreeBSD-x86_64-378.13.tar.gz 58779963 SHA256 451b9e4b2da86609c760a9a133efa8d37d844ad036299689f007c90463a7ca39 SHA512 34cfc383ba196ecec2cd27fc12bf30dd58f8782b73414e7b4c182e832ae0dce1f8c017afbb2101d7525d4e321f80cac49d3b578a8fc0cf88be9310f4deb77057 WHIRLPOOL 23929abd50467f267cf6b7d58a49fc6f667036b7e92363cc05b021790d0d5ebc61e181c3b2e7c32a6338328cfcc05311d74112b005d638c0295b2c6189dfa3b8
-DIST NVIDIA-Linux-armv7l-gnueabihf-367.57.run 25701866 SHA256 e856debfabffe0e4ed2900e4acbc8e68340c4773651ec7a0000659588431ef7d SHA512 2d1221b8c6f01148412790c24f88a74104da4dc40f30ebe57a47468818c811119ed629ffa565f3ed58ce0b12b292b4304a2b364a83faff41ba14ea747f4e1c88 WHIRLPOOL bf7011f50360516f76ea5e176aea7d761193de877a5357a54704c60d512faf1af8e8e2450c547b5181fba98ee627a297b1c573e147c4db623324c1c35396330d
-DIST NVIDIA-Linux-armv7l-gnueabihf-370.28.run 26117701 SHA256 efb60a23aa22b46e94e91d5f5a5fc0c17b47bcf50471e4371653ced5a5350dce SHA512 04699849441bccfb9214fda4c7ff8ecefa11249d1fbfe470e37fefdd132becc225a1bcc16bc976c3fb145a427961f5402c95ecc84b613adb71caef9c96fe7d90 WHIRLPOOL 675a495594c46666ec11c83a76cdc8821e9b57079ee53cd7adcf00e783d121e163b7c5b10598aa55a1fee72eee47defc514fba986685af41c90ab2c5d890abbd
 DIST NVIDIA-Linux-armv7l-gnueabihf-375.26.run 26735389 SHA256 8d2b7b36e74ceb1c439b2a5f8d2cdf009fda4f668509bb5d45171455abc774b9 SHA512 f18031c9b9ca6825f93f433d3f59b76a380a12b55e2f4556c2a1725fcdbea58176f22dcdb322f20e27d524f3fda75dd4f5a2a9263268411e0f5e361c580d865d WHIRLPOOL 4ecd41bebae3df91a39612849eb6f7e926398e906d2cb878aa788571976fb1cdfeabd47ac0cd3db26c4a0408608b8dfbc3815d10cdd1acd8eeaba6ed5824bb73
 DIST NVIDIA-Linux-armv7l-gnueabihf-375.39.run 25350238 SHA256 52f512bbb3e2d5747df9b294667df9975564408c5ce4f3124aca7dba4355a3a9 SHA512 d888ab0c81c53138eec06e25be683798b5459a6862affa92429feb1e63fcd4cd7ac76bd78eff8c1bef245a25a6a7eb77994ad99c15ed65e8be1a64b3e4c45030 WHIRLPOOL 5714fdcd9e226a336e0abd46bd8a91eef486fc14de543a98d284b3ae3955e924dbde10a08144309b6c0b4e19fcb011bffb8c046a05cbe05f6123b22d270e2939
 DIST NVIDIA-Linux-armv7l-gnueabihf-378.13.run 26514235 SHA256 399abf527d84e4b4d01ea66e0de4a1f9b1b39871b180ef3bf99c4718ebe3db91 SHA512 253786a821df85fa926ae842114321b3c70502f887ea7c2b6790dfe3836039ee5d390e6722ca8785904ec6487e465916923d3042dc6191b3b4522c3161b80cb0 WHIRLPOOL 154b13ecb368716980ab779894942831c13e4b2d47c1d5765ab14590663b34be1571df7934e1277c9a29cdfe93e209a04e2a9fed2830c407a42547433fd9e721
@@ -42,15 +22,6 @@ DIST NVIDIA-Linux-x86-304.134.run 41201159 SHA256 84f7891af131bb9f9a8a34401dfef4
 DIST NVIDIA-Linux-x86-304.135.run 41202842 SHA256 5cb0a191ddca7b4c72b3c26cd57b7d719878ce628d24b5b026a0e5c8d3a00d93 SHA512 c2645cc9a6f23641d8b6da51e72e203980068c05e365fcc73b32322a6875ce95e81f4e0d893276e14e84e93464488539c16db6b3be04f5324cf7d7a12bb557f8 WHIRLPOOL 79d0d0badd36c94f3d48eef2c40184ee876bf78e153b18e73521fbe756cd78248da38405e7c08abbfa400ee8cd8150d81987bd7f45501937a77c39f7fc9a0ee6
 DIST NVIDIA-Linux-x86-340.101.run 38932143 SHA256 5f5eda9c3d9bf53b56ef4f546dd1be5317eed46df425edbdd2c34023fb9eb062 SHA512 5866f2b4e6e22863c54d9fc08c9c88c9c911df2396d0ceaca653ded04589ea3a9e4550ed58f4b182b0a42cfe205ef643fe43ea709478e5df5360a7f74fa87f41 WHIRLPOOL d44d6075dd64804cfc3fbdc28510defc7796a2f22ac24625aab8552bd8bd6b16f51dea15f04d56f7b53ed3df514a92582171d27ec4e9aa099bef2d3e940a62be
 DIST NVIDIA-Linux-x86-340.102.run 38779756 SHA256 61b13d5dae0f6f5d788a4d8c4c98e8d971d19cb90b606058060d007946248828 SHA512 bea700c925a6044fcded40324bb389c5fa1aadc40831f685a76e7b0ded11161f492960950c201467e564d157dcbe0c330d13a2014f51d0073002c5a262a6f0ca WHIRLPOOL f7a3e3c5f8bb9eedf0a93104564d3d9c3eabc39a807c47e87f84373f89513afcafecb94e602b12fd24f872971f2d16a5f945326c670a6eebcd9ffcdcb70cb99e
-DIST NVIDIA-Linux-x86-346.96.run 40751579 SHA256 8a299ddce7d34389206599a306a41d30754bb9bddda1be1a7fd85012f9aedf39 SHA512 9d413dd0559a4035a842527371cb1a27030c9eaeff510e529d2a205ea3eddc6e5666989418a6172aead4f5b2a924cf4cbf05269cb435dc2516af37eb35ba5d4d WHIRLPOOL 055127105804f2a6dc5067b20e771b4c12ad9dad62f4e874719385c7115e8394a8618eed3d6b330c8b5d90cbd3ae7fd09998e2a0017e35b4adca0f626110f238
-DIST NVIDIA-Linux-x86-352.79.run 42378162 SHA256 2929d6e509ed4502312c1b7384f6d12cb63bd4af03fc847a281d3ccdd4db4f69 SHA512 d2b50e55110f84412fd5c456849ceac0537ede643d12d1228cdda9dcca52f1f9d0a6e5a02eb4ee32cb68bbfa5adeacb8e4fc4e299848f70954d032daa989c122 WHIRLPOOL 19153e166b561dcc04730b6439999e625b5c4358f69d18127cf347cb86d39cb22f87b75d2623916021e9e774d234d6b41c3dc91f0524cebdf44f2a3007d4b8ee
-DIST NVIDIA-Linux-x86-355.11.run 43569515 SHA256 94ce6b879581b931b84d83a9111040b9a5aa9306b012b4380cd93f6ffede3066 SHA512 450caea472c5e1b3d7098adba28d18c1221cf809c6bd0071466ff2a946dd0eca6555475f5f6bc044fb19a21c8939b1020357d4aeb0ce47d0edfcda071a66fd46 WHIRLPOOL 3a95e83ab3f46e64150caf1489aa3173aae69919bf432eabcdd0501de8bcdee5402cdb33e149a4d5d429ccb85e4b4af9b30bec5516ad7b7f091ae42f6093d26f
-DIST NVIDIA-Linux-x86-358.16.run 43972195 SHA256 d3a2842cbfb1163e20c658fbfaf5a235d5c9f035cd2d657f15df8a14b3fe80b1 SHA512 a5d37fb56a59b9958f6c34139250baf13a1c42ffc70f7deb19ffaac1ae6c2ce80b96649c5797d60754050d75792d14141cd5ebc8820bb73ee4aad4aa6d6c5b20 WHIRLPOOL 336e56827619ad53622c3fbf9fb3e9895a08b8500b81f3830514a34913180e3dc5c6f170f14675fa628e2c9658a084d7f9c45f47213d28335ecfee53c8110907
-DIST NVIDIA-Linux-x86-361.42.run 49273826 SHA256 e32d047f62da3aaabe718a5b835e6efa2c0265e76dd0f4e6b9af35266b6e4e82 SHA512 f20af256d3ab4cbac0bdf59ada558c27827439ab0170e22824bf10f52a4a7944994904db8b062d0948f2e5470c3220ea4ff6e8dae74000ae29d2badc71022cba WHIRLPOOL 8d798514726b9d36777464ce13e8ddc8900cf831b2c878cee54ca17e0af3af8c8800f3ac5130b9066aa94b02d7997e06441ffced9f89343277534d9464d43f8e
-DIST NVIDIA-Linux-x86-361.45.18.run 49760149 SHA256 0128d396b90cdd84446a893439fc1a76d2e84cfb057a1837f2cb804a4bf71407 SHA512 8f6b7fa4ecdea21090e56d4227e50186c8ac1009006c8e1848f118483355f73cd63c7425477dffc523e7b61acdf7b1cf97a66a4f61c30a57d6ffe3efcbfd1f70 WHIRLPOOL d1597c2b6a6ef6dfc7b8178ab135ccf8014e80d7429d790a4a6bddfe0df32608472513e87464069624982d7aada73c50f1852e392361727b42a649962f2c0237
-DIST NVIDIA-Linux-x86-364.19.run 50074922 SHA256 9f891d4b22c43c9094b59af5c8474e29c70813110b346834a5cad81a224d4112 SHA512 2b1cb0769d8c4d817588ab1071dbdbeda54291274392fd74009fc666bf198e6fcba1fe15db9d925a56ef98b147b48e58042a079b4f5773e95efe85531e25b01a WHIRLPOOL be7c48441e62c7038b58a3008dcb673f26607751ab62ab0197edf5d165b5d1ceb64ed654fd515746fe3cabe81d286e14b8343cf586cc5cb4ffcedf1f6df7eeeb
-DIST NVIDIA-Linux-x86-367.57.run 44731570 SHA256 43d4e926f71ac6c581018badf467458709822e97a7564ed9f1b521b7b63d88bb SHA512 6316cdd94131057a584b3a893cfbca5e8b0f5e79060cb5bfe2c149b5a76bdcdc21d20338febb54f7201985c5b05545c3f6b63b26c32699717057cfb047993972 WHIRLPOOL 443ca9b389f78c13ae5344cb3cce67035a2b5a605b94518d91c253965263d37a84dff9ca29d47509a2d43017afde4786a55bfd45613882b5d4889dc27b67622f
-DIST NVIDIA-Linux-x86-370.28.run 44189522 SHA256 6323254ccf2a75d7ced1374a76ca56778689d0d8a9819e4ee5378ea3347b9835 SHA512 2df8b3d1064073c8b793287994fe0648625d095f3434b7b67531e19632cbad318994df90b55de18aa457d55a1374b35d64a646564259995d3f2197c48737921c WHIRLPOOL 85a089c833311abdc06bbc1fc68cd5ff8ed43dd5e5887d340dc854f905ae741de0ae4343d024259f493dd668075096c460bc1f93c1795d2befb81dd3c4a4983a
 DIST NVIDIA-Linux-x86-375.26.run 44541069 SHA256 7c79cfaae5512f34ff14cf0fe76632c7c720600d4bbae71d90ff73f1674e617b SHA512 3bc859a95469a45f3c627018248d83e178d160385c3d17d9f890b0d142ecd1220fb21c442e4fe7755b831227a9c820736f447b162acd9699819c6e8145d6d841 WHIRLPOOL 33ad62f7021f38fd9dfa6b0fcfbc0b69a263409bd5b3b8da8eea6aa9af84299f0d5318bbc8b54139b1744b96fa08114029f8cc70b4f80b0fbd2d76efc47d0462
 DIST NVIDIA-Linux-x86-375.39.run 44434734 SHA256 7f33f6572c5c5c57df71531749c7339309a2097918375685ea8018826cf19456 SHA512 0f4e784f69f7b4c4696b62779892d8e77aef0adb701dcf5e844027e3a1870aa56bb913bc05f30b079c2519bdda87fa0096d612e9d74ea35b97882fc54fa5d2ca WHIRLPOOL 1d1e6a49d86a72f38d3c84a0b75735c9b64b0bbc75bc54e91318b316298609dd34ab3affff5795fedba44133536e22bf287a76d8271bf0cee990204a383e8a93
 DIST NVIDIA-Linux-x86-378.13.run 44397547 SHA256 05e62a6098aac7373438ee381072253a861d56522f74948c2b714e20e69a46b1 SHA512 b96d2558a1003a3c66cade3a1e16abd34d855c0e27cdebacdc0495e0ba3cd5c68bb84cc5f81bff1b9ddce36ac52e0dc125c56d868b77d7c8e2f606d559b13b4a WHIRLPOOL e8231978664cec766813821c0f363ef437ba627debc2d2664164fe44c344c480c50799710dbeeee782fdacdb66b16317d69a9dec4f21d347dc40e471201b3ed1
@@ -60,15 +31,6 @@ DIST NVIDIA-Linux-x86_64-304.134.run 69761152 SHA256 a014261a28a0a9829d255a5580c
 DIST NVIDIA-Linux-x86_64-304.135.run 69766944 SHA256 706269a507995544a24d24b3386d8f7bddbad3ce52167fae0da9e00dad8ab588 SHA512 1b444eb4af219506c88fdc78746eca1afb8571017858cb387d8546f1950d6d82c1077c74e9bda9ccebb0e42bc5cb4d50d9b8c01989ae4cb52c3fc069304b7ab5 WHIRLPOOL 1fdb38f634ad8e41e37e1fb7d84ffb22566b4c5e182aa90f6a034db99c251864759909ad0b9db77ed08645c0da50362e40bc37574f526d58bb3eece7c37772a6
 DIST NVIDIA-Linux-x86_64-340.101.run 70042051 SHA256 d2cf81b5994a1728dc4851cdf0480cde0a34b040c94de0d5265edcfe3b90680a SHA512 64e3acee913864296421f0fcc44ffef0d89d20fc9f422e61f9a30a0c867ddedd2e88ead4a9607842a639ef593a19e725b70cf4ee051651d1d2ad48f3c5a189f3 WHIRLPOOL 59a7c3b40ae75e0fb3b7ae2c1125fd73071882347cfee6b6c0b76e9a117dfaa93bf6b391459f2ca96c50df24b220e5b8941e02f4cf48e7ae0833af67e180b195
 DIST NVIDIA-Linux-x86_64-340.102.run 69960567 SHA256 2b96d2f26c00405471e0ce10dca0b6639e91aeb43f7c5aadbdae28445a28df5a SHA512 eead5b6f18afd5384f30f36a9ef569dea7d6ca1dbc590f63d603694bcc6a8bf251942b36ca606cfd5e6775ef180cd564f3cf226a3f4c04d7ed354204fec15577 WHIRLPOOL 6596a178aa35ac841bf287fa1372f6748cda0430c6b4bcd18fa63d63030331df59e75d4a3dde63f28a6fa15cdfaa90d27136c96e9abe81fb05202f00430ecaa9
-DIST NVIDIA-Linux-x86_64-346.96.run 73538317 SHA256 229b28a6b65965a248d07223d941de7d79b54cee7c6574f1037293e8a8026727 SHA512 188f8aac88085c3cac9637e87f4d9259d0c508075bbbf684775650a12f4760f47ba9e92f79e8bbe96d33ee014092edd38efce7dd730f67e0f11c2079eca938c5 WHIRLPOOL c9f4a5163018dc0b53aeff84b410cb34720d06ca7bdd17ce166ad3a2b057ffe94e6773594cd617fce79d9d0a02e5e1cd0525ca30dade7247ad5b7b20ff661a64
-DIST NVIDIA-Linux-x86_64-352.79.run 77140528 SHA256 e05a825a5e0027f062b1a1344ff3484286f50df990d66d567348b80101a0c4e3 SHA512 b54257e9aa6f6353d4f149d4dfab5ea12bf1907260ad98fd9102da1b458c1cf32e28707c8c5136efdaeccd0f60e6e013736b349a59ea50044dceddf265afa38b WHIRLPOOL 25be659c5784558c42c4f2fb0b50d5d56c0419f175ad8c019e00bdc033707297668705e051e4f176fff67340ec68054848a8b3aa5a9922ee0c9f9a270787a6d6
-DIST NVIDIA-Linux-x86_64-355.11.run 76490009 SHA256 a59b425381add9d9058dc2d987bf3087ab59c43224b5eb04c3f273f5886451ed SHA512 bfc7ab7741183408aa0226dc29176c8ffe08566fbea7cebf78f4aa30627dc27ddf90bb82951c99006b34bc481be15712b4f5867ef543a32bfe3fe81a8e6ddeae WHIRLPOOL bb5d3397a855a53c2cd7e48056564085b906550f856207932e4670fef995030a3a7bcc0a9b97fee2e60aaff9b41c4a954afc57585441f5dec92c795358da810a
-DIST NVIDIA-Linux-x86_64-358.16.run 77353969 SHA256 a942cdb29ed715ff1ce25beb06b6c2490126b98ef8bee5d9973967b557596bf2 SHA512 4ae43f5e8c311d6c97eb89b02504bf52e3a947c71662f30641988a78eb9fe083370124aeee3b89db74f8ee50f454338db98dc7abeb35a242ba5729fefccead77 WHIRLPOOL 3dd0dcd4b455fcac12d55f40cfb8db0536af82d90c32b8471528b44a9fa1b3f3706ac26558d7395f82649c37550fded17b48d75d5584b3a41390c94bb1135c48
-DIST NVIDIA-Linux-x86_64-361.42.run 86760004 SHA256 b7011cbae605bed5db7082d7028db3ee5d9a37e802f26a095719e7cfa5716cba SHA512 7a018be43f810f1cd674e0817d2975e0ca490149809455f014cfc3d0cc550ec60c1097d7442d3fa302e03465172156131e4e99523f509c6d010c61eb01369bc0 WHIRLPOOL 3b3c6f8f0ee2351bee6d0a36b8279305b1cc4ee3a980402f8736047181be2df822c773c65914034efe8e03d8b6e20a455d47369790cffe5d9dcd282d5d429298
-DIST NVIDIA-Linux-x86_64-361.45.18.run 87468802 SHA256 fb43b321609f314d39435a1146392b4d3920dbce593dcd19b3848a056e91c570 SHA512 a085766075d990b11586c701e2efe758a6940b5f3ddc4db8a3840f7e587e82785e38473ab266535f39da0552b95ba97c789398ad6c795041c7073ed301fba8ec WHIRLPOOL 37d30388937d2eb0797a094615057c936d9e0c9b176b52605b277a2c5b35624674de67adcdc7ee55312498611a5e99fc24af8eca71bf04faf64bdfddf1fc9349
-DIST NVIDIA-Linux-x86_64-364.19.run 87961023 SHA256 7b8680a815ac74d5b3a7e3d38113b05ed1e2ce781575e966c27f68457aaf694e SHA512 c02fea3eb0404e9f17eb6fdef43008c09653239b884fc599d3639f50a36b8d2708539c429e4b3be96d509c83ce5416145add7f152a3f08cada555617e9fcf1fc WHIRLPOOL 40c19fb5bfbc3a6b2c631e7768a04af9b250b4e8845adbf40b6408e2e7c6bb5b2b3142760387995c83450490e26591029d44aa8a6ee7a7b39a50128c7e4211af
-DIST NVIDIA-Linux-x86_64-367.57.run 77127324 SHA256 a1615db29f1377817b610cca997e0339753ee9d58b28e1618b892691df3a8851 SHA512 fc94f5df7eb2ef243db381bc4458f911a6d76bff949701bedb249a3ebf369ff3da8dc5a7d52ab6ae3f23e947c419923f303cd57429a266a0f8e96df1039b1f5d WHIRLPOOL 5580b7839652c250ba134ecc97438d1810453d5bd5d8cffd44f01379d7509bca6f0c58318a150a5b4786f955d4de708ce9be618572212eca2c7098a36eab24d5
-DIST NVIDIA-Linux-x86_64-370.28.run 76690360 SHA256 90aa3c186e45b39e6fc0064ab8dbda8bcc897cb61d2e7b7cb30b4ec9a4b39239 SHA512 931476f92a63d142478b2d6b3da4031769fd3b93aee2387800a78b1354b59a5fb5e4e293436b6b4c246627d51c0f55d140ab230de385cb1567bc8b25518eb741 WHIRLPOOL ce866c38291d2ab4aeeff05654a0e61196129f77baea5af93ddbc22fab9574ba39cc05d58020ea2407cc7342f0bcf5c2702d42290f4cc3b53c9e04fb7c617413
 DIST NVIDIA-Linux-x86_64-375.26.run 75869960 SHA256 4f42b2c3709dc2f11a1deca89628582062f4e9bca87f28a4fde50d25bd4a1ecf SHA512 0990ac2e7b045bf62a8c58eb7acf91458756de91887d43486d9754bfc1493b28193072a9687d2d892cc98aaa4e584a8b2a8471756d4f19965da904d51e437dd1 WHIRLPOOL b9890e705dbc3e967a978c5f823f71a418b03aa1b36669c1763559ed81a6a103e9d011246ffe049eda899425e254e8955b921ea9132a8d36530dc4a230cb4832
 DIST NVIDIA-Linux-x86_64-375.39.run 77264092 SHA256 91be5a20841678d671f32074e2901791fe12c00ce1f3b6b3c4199ce302da85a7 SHA512 9a7e865db44f8e65be257b26250adcdf6f3dfac4e164f14a42b8e03c576016dfedf152d6a6cb84fb3ae9930d2b4ba472a63cf32d557395ff7fa429d9b8c9ccd0 WHIRLPOOL 03a27813464847958d9d2adb0bc260e31c6458df18e567c4c36e1eac5f7288108f88147cf1115f360b159a6d0ab459692abb35a79879e19fec2db30709802df1
 DIST NVIDIA-Linux-x86_64-378.13.run 76239469 SHA256 3de379249ef25a8c10a24be2718bf1cb2e338da204e37874c4a0c66dbcdf42ee SHA512 2f6789aa0a400c035c0a074631dc5c26abb4f8a62efe928ca3a2865b89d29acfc09c27f23a664e438275e4bfd25c261745d4d495f9aca5f54ee6c53a389059d2 WHIRLPOOL 6e8dcc7be0981591f377babbd9e1430fddeac9a42291f36a95243d418882bc8b38a1e692e2fd62d4b785feca93165e54a64c015bd99193c699831465f512b180
@@ -77,14 +39,6 @@ DIST nvidia-settings-304.134.tar.bz2 1480967 SHA256 8e562823fe9a7b1d33775db56050
 DIST nvidia-settings-304.135.tar.bz2 1480857 SHA256 f5431a6547d7727506b72616156c18f927a89c0702e7f939b5043fdb66e4faf8 SHA512 ce77819c223d02bc5330a57047b45cf9022159b0d03b3fb1572a64aebbcb5872312acef3f56e2574acc4c2c92eae9ac6e602327fd2658c47f2b97c69cf61ebfb WHIRLPOOL 5fc6c4ada22d8a1b0cade4049691c013a5dfa0a7777d7789f310d363c9c4ed5cb724acc153ec562fcc2266228325096e3f733e8f1517a74c047388a4361d25d8
 DIST nvidia-settings-340.101.tar.bz2 1550221 SHA256 e98d2816f30182826aebb4315d4069d212709d28c129528295c012e11c5c5bd5 SHA512 145cfff7828b61566c13644d58e62495e5dfcbc0d24c49b04b24953d6822bb406de166879ef681a9ad6a6cb64fbc85948a93afb2f63f4e0a24107818eb0f2882 WHIRLPOOL bca223365521625d30bef14a752eb02d6166ee1e988087c584c0f325413cf0d92a67989d9f456f16b09611558af0eab4f8f3a37894db8c1df1fe3446bc3975ee
 DIST nvidia-settings-340.102.tar.bz2 1550093 SHA256 2895d4e2597a6ea0c425d74c7a0808775065f5cf58397fbbe6e626b00c60a55a SHA512 1ab190d8bcba7cc39d47f38db2bee28fab48d48c9a6674c9ff29ea3f51103e13746ee1df2d30581bd8259fc1104fed90b36cba88907bb2f202c931d256eab66a WHIRLPOOL 58105b371bc7156c2749f4bf85377f06fca71eb0a933721d70987aa53bb6c94494de3be25363ccf326105ca475405dcd7c884ceb6158df352ac6cc70dcffbf7e
-DIST nvidia-settings-346.96.tar.bz2 1558100 SHA256 b293f269aac01dfdf59e9dff46d774f7ca77d4628f377c01cabfbfccd28f3cd9 SHA512 9ead0fa5f0a55c1080d9b4da6cf96c2435c1a166297187f2c7d8b95a9e66c2e9cdd2e35739a4304b02ff1ccedb0421a7dc99a546df3a8f18804da133b93f50e3 WHIRLPOOL 4bddea94bb4c0dcde6b2b06507ffe890a1996471603de2d494f54b783cd36d44aa620fe03d16bc104ce99d6371a50666b0f029a309b78226810761cc13053f98
-DIST nvidia-settings-352.79.tar.bz2 1570988 SHA256 1f103cbfe162281355c484a5c3ef9ac1bb0528acba2d229111da7e58cf18f217 SHA512 d56e20844bf71d55e51aebca38e922a2985fdbd4edab29a07f9a4a8a0b883ca469c3b949f048837ec77464da90e2d485e5efcd314afc2810c44ad7dc497b53fe WHIRLPOOL 51999a744f6b3e36c4d12f841c136a754533de09c1802f60392666392beeccbb0bf1489269cac33b12ccb061554609d3dc8d8ffbf45b4cb860108fd9f86e2139
-DIST nvidia-settings-358.16.tar.bz2 1571104 SHA256 8cd78df738a824e282771755ae9a41d5b194b15f9df96b9fd23fcf3005967d35 SHA512 0438aa2599e98f68a04c9f663f4ef9b05092df512fbca40ad0fe17e25ca4d940d02cc55e9fd44a2551950a2a30782d1e48553c4bebd071bfff280869a6dde556 WHIRLPOOL 60b7e9abba3163ac877a3a9d944cf72352e28d2fd1a3af0996d3b7d40ef48be7f057c1063f9ca61c693cbf1bff57be61704f13d941220bf74a8049954f87154d
-DIST nvidia-settings-361.42.tar.bz2 1571226 SHA256 d8a8943289de60ccebc86335bbe1f16f7486afedc4334a9584aa56ab6e7cb8bf SHA512 052e35f1204068e631cf34108783a95bf96350475776e3fe7074cd6e2186e9f0f34642ff298389c5aaabd3e2dcd905e0b14604efc71e9a54054d59df43ebe173 WHIRLPOOL 9a89d47c42360fd1712f2fa14d65a416a5b6fe42176439f22b250c754ac2e63826df3449118941073dcf704eb96023d4256475772ca1a1511aa4cc1facbf5910
-DIST nvidia-settings-361.45.18.tar.bz2 1571655 SHA256 15a26c318114675c5906879388fbd14445570935454200d39c510abdaa8256ae SHA512 bb4d7234065a9541317aeab1d1229f75b092a99a4b5b1093cb4eb854ccc4005615b12010cf20b299ac46f1bccb0c35c323451d3262ef3325f0b55e88ce11e6bf WHIRLPOOL bbdabbd29882d3323338308878eb95b25e84bd2a4b5d0188e8049457d2dc5b37cba4c1e55aac0088bc6d950a9abb0117744914e6c58d1e1576929ab00434326f
-DIST nvidia-settings-364.19.tar.bz2 1573005 SHA256 fe8e9cc4d0ade9caaf51109e7e5287d1cbea111e73fae56f6c1b36ff8e55c370 SHA512 5274d908df284bc0ad2f7e6dd62c4052b2d0445e36dc84007bcb7c4e2382a8e9a4439e3507c229e96461031e1f3207911e659ddc73eea847052fa98b677f82c0 WHIRLPOOL dc93fc3635ff78b0a74d717a825ac630d38779f280c0d611fe43ff69adfda116c2363cb88cac1035d0169038ff4f82e51cd1b741cb5394e8e285cf5fe72ef046
-DIST nvidia-settings-367.57.tar.bz2 1571905 SHA256 aacb66b130e4adc034e10afb518c919a96029b31b14da8975b08d250d8750140 SHA512 57bf414f4aefacd994e73ea3b31de8cf9f5d6ddc9a95ea1456c21905510c4ba9219e690a1b1bb1346b57a80caf9856c5fede80734163392f0788b995d1bd4cea WHIRLPOOL 7294f84afe8a00f59e2073773d12dc0b31273ab49fe318558eee84a72b7df1233fa004949c0512bff1974c5edbc4749eed68e172336241ea9cb24d6c585a8979
-DIST nvidia-settings-370.28.tar.bz2 1573509 SHA256 59d7818a4837144e373ce958233db059fde59e279477001e187579770ebf0c5f SHA512 c4da6ae54839a8f91d3557153a648f69095e9a486dbaaf73e453d625660f1adcada12ee5c4bccc1afe2cfd454ead13c1df0e59d5d6aa70f6065823d53f7bb461 WHIRLPOOL e5f0a9fd67e50aee42598d6a0ce9a69a162405a6121518c7aaf9ede409e9bdeb44e3102a123eb6f8c963e0fdaca429a8b693f6af2f0467e746c42f57a496d45f
 DIST nvidia-settings-375.26.tar.bz2 1615459 SHA256 beb0d88e2f63427239fd2014299ef7bf780e70800f68be5d011575e858711fe9 SHA512 e575670ccf7e3ef0089ee6a969f107f6f43d742a60cc325c6d95efc4773f34a6e013fd2c4e38b5f90054e24146a05c2300c0cf6a9b7013b556bacc1402956f49 WHIRLPOOL 854e4444beb330c97b29ebc00936c9d2f2522165ef2ca86f68ae28abadef516aedb341e2b2bf6d7a762decaeac4d5c3084bddaa21492b0a60607a2bbf541c301
 DIST nvidia-settings-375.39.tar.bz2 1618873 SHA256 e5965788368c85e8a83db27d725ea9492068d0e79f961b22fe38d22f090e0839 SHA512 de6dc16850f032f228313582c83e27fefcb045261cb8b5fdef428cca5264307ef58a5e78d91fe3624a39ab2a4361e3939d4b6592c32837a1f43caf381120bed8 WHIRLPOOL 100102effcb2fb04976f6ecadd23631b5ea28206076fdac24f2ae481c96e6856239295c65e2e527d7c9558d97f3f5a25e6c48907cb41eff0a23ee6d878790716
 DIST nvidia-settings-378.13.tar.bz2 1618011 SHA256 b23f931e3107897ff73c57ce02aa77e8e1dc95559bfa338e898126731a230023 SHA512 a12352c92fd4f56002bda2b07e8cddd5573af98521ec3495cd428b784eb368c9f2cb40f9b4372400ba1ea67c9349c6a9b4f7c218ede2d0d5dabb08325eda9844 WHIRLPOOL d143ae5fd3d09e235aca4d5f95d87d9ab0e3adee4aab5496fba89bcc75903dae5a604f76e9b34331f561dcc8e9aa222ee91e6e15ce91635cefc1e4e40eb8097f

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-346.16-pax-constify.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-346.16-pax-constify.patch
deleted file mode 100644
index 9b9f53e45dc..00000000000
--- a/x11-drivers/nvidia-drivers/files/nvidia-drivers-346.16-pax-constify.patch
+++ /dev/null
@@ -1,25 +0,0 @@
---- a/kernel/uvm/uvm_common.c
-+++ b/kernel/uvm/uvm_common.c
-@@ -95,7 +95,6 @@ static RM_STATUS uvmnext_gpu_event_stop_
- #endif // NVIDIA_UVM_NEXT_ENABLED
- 
- static dev_t g_uvmBaseDev;
--struct UvmOpsUvmEvents g_exportedUvmOps;
- 
- // TODO: This would be easier if RM allowed for multiple registrations, since we
- //       could register UVM-Lite and UVM-Next separately (bug 1372835).
-@@ -147,9 +146,11 @@ static RM_STATUS uvmSetupGpuProvider(voi
-     RM_STATUS status = RM_OK;
- 
- #ifdef NVIDIA_UVM_RM_ENABLED
--    g_exportedUvmOps.startDevice = uvm_gpu_event_start_device;
--    g_exportedUvmOps.stopDevice  = uvm_gpu_event_stop_device;
--    g_exportedUvmOps.isrTopHalf  = uvmnext_isr_top_half;
-+    static struct UvmOpsUvmEvents g_exportedUvmOps = {
-+        .startDevice = uvm_gpu_event_start_device,
-+        .stopDevice  = uvm_gpu_event_stop_device,
-+        .isrTopHalf  = uvmnext_isr_top_half,
-+    };
- 
-     // call RM to exchange the function pointers.
-     status = nvUvmInterfaceRegisterUvmCallbacks(&g_exportedUvmOps);

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-346.16-pax-usercopy.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-346.16-pax-usercopy.patch
deleted file mode 100644
index d1a440c94aa..00000000000
--- a/x11-drivers/nvidia-drivers/files/nvidia-drivers-346.16-pax-usercopy.patch
+++ /dev/null
@@ -1,47 +0,0 @@
---- a/kernel/nv.c
-+++ b/kernel/nv.c
-@@ -705,7 +705,7 @@ int __init nvidia_init_module(void)
- #endif
- 
-     nvidia_stack_t_cache = NV_KMEM_CACHE_CREATE(nvidia_stack_cache_name,
--                                                nvidia_stack_t);
-+                                                nvidia_stack_t, SLAB_USERCOPY);
-     if (nvidia_stack_t_cache == NULL)
-     {
-         nv_printf(NV_DBG_ERRORS, "NVRM: stack cache allocation failed!\n");
-@@ -846,7 +846,7 @@ int __init nvidia_init_module(void)
-     nv_lock_init_locks(nv);
- 
-     nvidia_pte_t_cache = NV_KMEM_CACHE_CREATE(nvidia_pte_cache_name,
--                                              nvidia_pte_t);
-+                                              nvidia_pte_t, 0);
-     if (nvidia_pte_t_cache == NULL)
-     {
-         rc = -ENOMEM;
-@@ -857,7 +857,7 @@ int __init nvidia_init_module(void)
-     if (!nv_multiple_kernel_modules)
-     {
-         nvidia_p2p_page_t_cache = NV_KMEM_CACHE_CREATE(nvidia_p2p_page_cache_name,
--                                                       nvidia_p2p_page_t);
-+                                                       nvidia_p2p_page_t, 0);
-         if (nvidia_p2p_page_t_cache == NULL)
-         {
-             rc = -ENOMEM;
---- a/kernel/nv-linux.h
-+++ b/kernel/nv-linux.h
-@@ -1431,11 +1431,11 @@ extern void *nvidia_stack_t_cache;
- 
- #if !defined(NV_VMWARE)
- #if (NV_KMEM_CACHE_CREATE_ARGUMENT_COUNT == 5)
--#define NV_KMEM_CACHE_CREATE(name, type)    \
--    kmem_cache_create(name, sizeof(type), 0, 0, NULL)
-+#define NV_KMEM_CACHE_CREATE(name, type, flags)    \
-+    kmem_cache_create(name, sizeof(type), 0, flags, NULL)
- #else
--#define NV_KMEM_CACHE_CREATE(name, type)    \
--    kmem_cache_create(name, sizeof(type), 0, 0, NULL, \
-+#define NV_KMEM_CACHE_CREATE(name, type, flags)    \
-+    kmem_cache_create(name, sizeof(type), 0, flags, NULL, \
-                       NULL)
- #endif
- #define NV_KMEM_CACHE_DESTROY(kmem_cache)   \

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-355.06-pax.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-355.06-pax.patch
deleted file mode 100644
index cc5ebdf7957..00000000000
--- a/x11-drivers/nvidia-drivers/files/nvidia-drivers-355.06-pax.patch
+++ /dev/null
@@ -1,102 +0,0 @@
-diff -urp NVIDIA-Linux-x86_64-355.06.orig/kernel/common/inc/nv-linux.h NVIDIA-Linux-x86_64-355.06/kernel/common/inc/nv-linux.h
---- NVIDIA-Linux-x86_64-355.06.orig/kernel/common/inc/nv-linux.h	2015-07-29 05:13:57.000000000 +0200
-+++ NVIDIA-Linux-x86_64-355.06/kernel/common/inc/nv-linux.h	2015-08-21 16:45:55.624336728 +0200
-@@ -1408,11 +1408,11 @@ extern void *nvidia_stack_t_cache;
- 
- #if !defined(NV_VMWARE)
- #if (NV_KMEM_CACHE_CREATE_ARGUMENT_COUNT == 5)
--#define NV_KMEM_CACHE_CREATE(name, type)    \
--    kmem_cache_create(name, sizeof(type), 0, 0, NULL)
-+#define NV_KMEM_CACHE_CREATE(name, type, flags)    \
-+    kmem_cache_create(name, sizeof(type), 0, flags, NULL)
- #else
--#define NV_KMEM_CACHE_CREATE(name, type)    \
--    kmem_cache_create(name, sizeof(type), 0, 0, NULL, \
-+#define NV_KMEM_CACHE_CREATE(name, type, flags)    \
-+    kmem_cache_create(name, sizeof(type), 0, flags, NULL, \
-                       NULL)
- #endif
- #define NV_KMEM_CACHE_DESTROY(kmem_cache)   \
-diff -urp NVIDIA-Linux-x86_64-355.06.orig/kernel/nvidia/nv.c NVIDIA-Linux-x86_64-355.06/kernel/nvidia/nv.c
---- NVIDIA-Linux-x86_64-355.06.orig/kernel/nvidia/nv.c	2015-07-29 05:13:57.000000000 +0200
-+++ NVIDIA-Linux-x86_64-355.06/kernel/nvidia/nv.c	2015-08-21 16:44:51.008340178 +0200
-@@ -719,7 +719,7 @@ int __init nvidia_init_module(void)
- #endif
- 
-     nvidia_stack_t_cache = NV_KMEM_CACHE_CREATE(nvidia_stack_cache_name,
--                                                nvidia_stack_t);
-+                                                nvidia_stack_t, SLAB_USERCOPY);
-     if (nvidia_stack_t_cache == NULL)
-     {
-         nv_printf(NV_DBG_ERRORS, "NVRM: stack cache allocation failed!\n");
-@@ -861,7 +861,7 @@ int __init nvidia_init_module(void)
-     nv_state_init_gpu_uuid_cache(nv);
- 
-     nvidia_pte_t_cache = NV_KMEM_CACHE_CREATE(nvidia_pte_cache_name,
--                                              nvidia_pte_t);
-+                                              nvidia_pte_t, 0);
-     if (nvidia_pte_t_cache == NULL)
-     {
-         rc = -ENOMEM;
-@@ -872,7 +872,7 @@ int __init nvidia_init_module(void)
-     if (!nv_multiple_kernel_modules)
-     {
-         nvidia_p2p_page_t_cache = NV_KMEM_CACHE_CREATE(nvidia_p2p_page_cache_name,
--                                                       nvidia_p2p_page_t);
-+                                                       nvidia_p2p_page_t, 0);
-         if (nvidia_p2p_page_t_cache == NULL)
-         {
-             rc = -ENOMEM;
-diff -urp NVIDIA-Linux-x86_64-355.06.orig/kernel/nvidia/nv-mmap.c NVIDIA-Linux-x86_64-355.06/kernel/nvidia/nv-mmap.c
---- NVIDIA-Linux-x86_64-355.06.orig/kernel/nvidia/nv-mmap.c	2015-07-29 05:13:57.000000000 +0200
-+++ NVIDIA-Linux-x86_64-355.06/kernel/nvidia/nv-mmap.c	2015-08-21 16:58:15.968297199 +0200
-@@ -113,12 +113,12 @@ nvidia_vma_release(struct vm_area_struct
- }
- 
- #if defined(NV_VM_OPERATIONS_STRUCT_HAS_ACCESS)
--static int
-+static ssize_t
- nvidia_vma_access(
-     struct vm_area_struct *vma,
-     unsigned long addr,
-     void *buffer,
--    int length,
-+    size_t length,
-     int write
- )
- {
-diff -urp NVIDIA-Linux-x86_64-355.06.orig/kernel/nvidia-uvm/uvm_common.c NVIDIA-Linux-x86_64-355.06/kernel/nvidia-uvm/uvm_common.c
---- NVIDIA-Linux-x86_64-355.06.orig/kernel/nvidia-uvm/uvm_common.c	2015-07-29 05:10:08.000000000 +0200
-+++ NVIDIA-Linux-x86_64-355.06/kernel/nvidia-uvm/uvm_common.c	2015-08-21 17:00:33.788289841 +0200
-@@ -60,7 +60,7 @@ static void uvmnext_exit(void)
- {
- 
- }
--static NV_STATUS uvmnext_isr_top_half(void)
-+static NV_STATUS uvmnext_isr_top_half(UvmGpuUuid *gpuUuidStruct)
- {
-     return NV_ERR_NO_INTR_PENDING;
- }
-@@ -79,7 +79,6 @@ NvBool uvmnext_activated(void)
- #endif // NVIDIA_UVM_NEXT_ENABLED
- 
- static dev_t g_uvmBaseDev;
--struct UvmOpsUvmEvents g_exportedUvmOps;
- 
- // TODO: This would be easier if RM allowed for multiple registrations, since we
- //       could register UVM-Lite and UVM-Next separately (bug 1372835).
-@@ -112,9 +111,11 @@ static NV_STATUS uvmSetupGpuProvider(voi
-     NV_STATUS status = NV_OK;
- 
- #ifdef NVIDIA_UVM_RM_ENABLED
--    g_exportedUvmOps.startDevice = uvm_gpu_event_start_device;
--    g_exportedUvmOps.stopDevice  = uvm_gpu_event_stop_device;
--    g_exportedUvmOps.isrTopHalf  = uvmnext_isr_top_half;
-+    static struct UvmOpsUvmEvents g_exportedUvmOps = {
-+        .startDevice = uvm_gpu_event_start_device,
-+        .stopDevice  = uvm_gpu_event_stop_device,
-+        .isrTopHalf  = uvmnext_isr_top_half,
-+    };
- 
-     // call RM to exchange the function pointers.
-     status = nvUvmInterfaceRegisterUvmCallbacks(&g_exportedUvmOps);

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-361.28-pax.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-361.28-pax.patch
deleted file mode 100644
index 09e4384b942..00000000000
--- a/x11-drivers/nvidia-drivers/files/nvidia-drivers-361.28-pax.patch
+++ /dev/null
@@ -1,351 +0,0 @@
-diff -urp work.orig/kernel/common/inc/nv-linux.h work/kernel/common/inc/nv-linux.h
---- work.orig/kernel/common/inc/nv-linux.h	2016-02-03 23:31:51.000000000 +0100
-+++ work/kernel/common/inc/nv-linux.h	2016-02-10 11:49:15.309410457 +0100
-@@ -1351,6 +1351,9 @@ extern void *nvidia_stack_t_cache;
- #define NV_KMEM_CACHE_CREATE(name, type)    \
-     NV_KMEM_CACHE_CREATE_FULL(name, sizeof(type), 0, 0, NULL)
- 
-+#define NV_KMEM_CACHE_CREATE_USERCOPY(name, type)    \
-+    NV_KMEM_CACHE_CREATE_FULL(name, sizeof(type), 0, SLAB_USERCOPY, NULL)
-+
- #define NV_KMEM_CACHE_DESTROY(kmem_cache)   \
-     kmem_cache_destroy(kmem_cache)
- 
-diff -urp work.orig/kernel/common/inc/nv-modeset-interface.h work/kernel/common/inc/nv-modeset-interface.h
---- work.orig/kernel/common/inc/nv-modeset-interface.h	2016-02-03 23:31:51.000000000 +0100
-+++ work/kernel/common/inc/nv-modeset-interface.h	2016-02-10 11:49:54.970985152 +0100
-@@ -70,7 +70,7 @@ typedef struct {
-      * mix nvidia and nvidia-modeset kernel modules from different
-      * releases.
-      */
--    const char *version_string;
-+//    const char *version_string;
- 
-     /*
-      * Allocate and free an nvidia_stack_t to pass into
-@@ -104,6 +104,6 @@ typedef struct {
- 
- } nvidia_modeset_rm_ops_t;
- 
--NV_STATUS nvidia_get_rm_ops(nvidia_modeset_rm_ops_t *rm_ops);
-+NV_STATUS nvidia_get_rm_ops(const nvidia_modeset_rm_ops_t **rm_ops, const char **version_string);
- 
- #endif /* _NV_MODESET_INTERFACE_H_ */
-diff -urp work.orig/kernel/common/inc/nv-register-module.h work/kernel/common/inc/nv-register-module.h
---- work.orig/kernel/common/inc/nv-register-module.h	2016-02-03 23:31:51.000000000 +0100
-+++ work/kernel/common/inc/nv-register-module.h	2016-02-10 11:50:18.941376865 +0100
-@@ -34,7 +34,7 @@ typedef struct nvidia_module_s {
-     int (*ioctl)(struct inode *, struct file * file, unsigned int cmd, unsigned long arg);
-     unsigned int (*poll)(struct file * file, poll_table *wait);
- 
--} nvidia_module_t;
-+} __do_const nvidia_module_t;
- 
- int nvidia_register_module(nvidia_module_t *);
- int nvidia_unregister_module(nvidia_module_t *);
-diff -urp work.orig/kernel/nvidia/nv.c work/kernel/nvidia/nv.c
---- work.orig/kernel/nvidia/nv.c	2016-02-03 23:31:51.000000000 +0100
-+++ work/kernel/nvidia/nv.c	2016-02-10 11:50:40.191828792 +0100
-@@ -704,7 +704,7 @@ int __init nvidia_init_module(void)
-     NV_SPIN_LOCK_INIT(&km_lock);
- #endif
- 
--    nvidia_stack_t_cache = NV_KMEM_CACHE_CREATE(nvidia_stack_cache_name,
-+    nvidia_stack_t_cache = NV_KMEM_CACHE_CREATE_USERCOPY(nvidia_stack_cache_name,
-                                                 nvidia_stack_t);
-     if (nvidia_stack_t_cache == NULL)
-     {
-diff -urp work.orig/kernel/nvidia/nv-chrdev.c work/kernel/nvidia/nv-chrdev.c
---- work.orig/kernel/nvidia/nv-chrdev.c	2016-02-03 23:31:51.000000000 +0100
-+++ work/kernel/nvidia/nv-chrdev.c	2016-02-10 11:50:57.201126955 +0100
-@@ -20,8 +20,6 @@ int nv_register_chrdev(void *param)
- {
-     nvidia_module_t *module = (nvidia_module_t *)param;
- 
--    module->instance = nv_module_instance;
--
-     return (nvidia_register_module(module));
- }
- 
-diff -urp work.orig/kernel/nvidia/nv-instance.c work/kernel/nvidia/nv-instance.c
---- work.orig/kernel/nvidia/nv-instance.c	2016-02-03 23:31:51.000000000 +0100
-+++ work/kernel/nvidia/nv-instance.c	2016-02-10 11:51:35.418977554 +0100
-@@ -54,6 +54,7 @@ struct pci_driver nv_pci_driver = {
- nvidia_module_t nv_fops = {
-     .owner       = THIS_MODULE,
-     .module_name = MODULE_NAME,
-+    .instance    = MODULE_INSTANCE_NUMBER,
-     .open        = nvidia_open,
-     .close       = nvidia_close,
-     .ioctl       = nvidia_ioctl,
-diff -urp work.orig/kernel/nvidia/nv-mmap.c work/kernel/nvidia/nv-mmap.c
---- work.orig/kernel/nvidia/nv-mmap.c	2016-02-03 23:31:51.000000000 +0100
-+++ work/kernel/nvidia/nv-mmap.c	2016-02-10 11:14:27.996577127 +0100
-@@ -113,12 +113,12 @@ nvidia_vma_release(struct vm_area_struct
- }
- 
- #if defined(NV_VM_OPERATIONS_STRUCT_HAS_ACCESS)
--static int
-+static ssize_t
- nvidia_vma_access(
-     struct vm_area_struct *vma,
-     unsigned long addr,
-     void *buffer,
--    int length,
-+    size_t length,
-     int write
- )
- {
-diff -urp work.orig/kernel/nvidia/nv-modeset-interface.c work/kernel/nvidia/nv-modeset-interface.c
---- work.orig/kernel/nvidia/nv-modeset-interface.c	2016-02-03 23:31:51.000000000 +0100
-+++ work/kernel/nvidia/nv-modeset-interface.c	2016-02-10 12:05:23.822391866 +0100
-@@ -59,10 +59,9 @@ void nvidia_modeset_resume(NvU32 gpuId)
-     }
- }
- 
--NV_STATUS nvidia_get_rm_ops(nvidia_modeset_rm_ops_t *rm_ops)
-+NV_STATUS nvidia_get_rm_ops(const nvidia_modeset_rm_ops_t **rm_ops, const char **version_string)
- {
--    const nvidia_modeset_rm_ops_t local_rm_ops = {
--        .version_string = NV_VERSION_STRING,
-+    static const nvidia_modeset_rm_ops_t local_rm_ops = {
-         .alloc_stack    = nvidia_modeset_rm_ops_alloc_stack,
-         .free_stack     = nvidia_modeset_rm_ops_free_stack,
-         .get_gpuid_list = nvidia_get_gpuid_list,
-@@ -72,13 +71,13 @@ NV_STATUS nvidia_get_rm_ops(nvidia_modes
-         .set_callbacks  = nvidia_modeset_set_callbacks,
-     };
- 
--    if (strcmp(rm_ops->version_string, NV_VERSION_STRING) != 0)
-+    if (strcmp(*version_string, NV_VERSION_STRING) != 0)
-     {
--        rm_ops->version_string = NV_VERSION_STRING;
-+        *version_string = NV_VERSION_STRING;
-         return NV_ERR_GENERIC;
-     }
- 
--    *rm_ops = local_rm_ops;
-+    *rm_ops = &local_rm_ops;
- 
-     return NV_OK;
- }
-diff -urp work.orig/kernel/nvidia-modeset/nvidia-modeset-linux.c work/kernel/nvidia-modeset/nvidia-modeset-linux.c
---- work.orig/kernel/nvidia-modeset/nvidia-modeset-linux.c	2016-02-03 23:32:20.000000000 +0100
-+++ work/kernel/nvidia-modeset/nvidia-modeset-linux.c	2016-02-10 12:08:02.275059160 +0100
-@@ -320,49 +320,48 @@ static void nvkms_resume(NvU32 gpuId)
-  * so we can use a single nvidia_modeset_stack_ptr for calling RM.
-  *************************************************************************/
- 
--static nvidia_modeset_rm_ops_t __rm_ops = { 0 };
-+static const nvidia_modeset_rm_ops_t *__rm_ops;
- static nvidia_modeset_stack_ptr nvkms_nvidia_stack = NULL;
- static nvidia_modeset_callbacks_t nvkms_rm_callbacks = {
--    nvkms_suspend,
--    nvkms_resume
-+    .suspend = nvkms_suspend,
-+    .resume = nvkms_resume
- };
- 
- static int nvkms_alloc_rm(void)
- {
-     NV_STATUS nvstatus;
-     int ret;
-+    const char *version_string = NV_VERSION_STRING;
- 
--    __rm_ops.version_string = NV_VERSION_STRING;
--
--    nvstatus = nvidia_get_rm_ops(&__rm_ops);
-+    nvstatus = nvidia_get_rm_ops(&__rm_ops, &version_string);
- 
-     if (nvstatus != NV_OK) {
-         printk(KERN_ERR NVKMS_LOG_PREFIX "Version mismatch: "
-                "nvidia.ko(%s) nvidia-modeset.ko(%s)\n",
--               __rm_ops.version_string, NV_VERSION_STRING);
-+               version_string, NV_VERSION_STRING);
-         return -EINVAL;
-     }
- 
--    ret = __rm_ops.set_callbacks(&nvkms_rm_callbacks);
-+    ret = __rm_ops->set_callbacks(&nvkms_rm_callbacks);
-     if (ret < 0) {
-         printk(KERN_ERR NVKMS_LOG_PREFIX "Failed to register callbacks\n");
-         return ret;
-     }
- 
--    return __rm_ops.alloc_stack(&nvkms_nvidia_stack);
-+    return __rm_ops->alloc_stack(&nvkms_nvidia_stack);
- }
- 
- static void nvkms_free_rm(void)
- {
--    __rm_ops.set_callbacks(NULL);
--    if (__rm_ops.free_stack != NULL) {
--        __rm_ops.free_stack(nvkms_nvidia_stack);
-+    __rm_ops->set_callbacks(NULL);
-+    if (__rm_ops->free_stack != NULL) {
-+        __rm_ops->free_stack(nvkms_nvidia_stack);
-     }
- }
- 
- void NVKMS_API_CALL nvkms_call_rm(void *ops)
- {
--    __rm_ops.op(nvkms_nvidia_stack, ops);
-+    __rm_ops->op(nvkms_nvidia_stack, ops);
- }
- 
- /*************************************************************************
-@@ -681,17 +680,17 @@ done:
- 
- NvBool NVKMS_API_CALL nvkms_open_gpu(NvU32 gpuId)
- {
--    return __rm_ops.open_gpu(gpuId, nvkms_nvidia_stack) == 0;
-+    return __rm_ops->open_gpu(gpuId, nvkms_nvidia_stack) == 0;
- }
- 
- void NVKMS_API_CALL nvkms_close_gpu(NvU32 gpuId)
- {
--    __rm_ops.close_gpu(gpuId, nvkms_nvidia_stack);
-+    __rm_ops->close_gpu(gpuId, nvkms_nvidia_stack);
- }
- 
- NvBool NVKMS_API_CALL nvkms_list_gpus(NvU32 *gpu_ids, NvU32 *gpu_count)
- {
--    return __rm_ops.get_gpuid_list(gpu_ids, gpu_count);
-+    return __rm_ops->get_gpuid_list(gpu_ids, gpu_count);
- }
- 
- /*************************************************************************
-diff -urp work.orig/kernel/nvidia-uvm/uvm8_channel.c work/kernel/nvidia-uvm/uvm8_channel.c
---- work.orig/kernel/nvidia-uvm/uvm8_channel.c	2016-02-03 23:32:32.000000000 +0100
-+++ work/kernel/nvidia-uvm/uvm8_channel.c	2016-02-10 11:39:16.735603941 +0100
-@@ -268,7 +268,7 @@ void uvm_channel_end_push(uvm_push_t *pu
-     mb();
- 
-     channel->cpu_put = new_cpu_put;
--    ACCESS_ONCE(*channel->channel_info.GPPut) = new_cpu_put;
-+    ACCESS_ONCE_RW(*channel->channel_info.GPPut) = new_cpu_put;
- 
-     uvm_spin_unlock(&channel->pool->lock);
- 
-diff -urp work.orig/kernel/nvidia-uvm/uvm8_global.c work/kernel/nvidia-uvm/uvm8_global.c
---- work.orig/kernel/nvidia-uvm/uvm8_global.c	2016-02-03 23:32:32.000000000 +0100
-+++ work/kernel/nvidia-uvm/uvm8_global.c	2016-02-10 11:28:23.142115625 +0100
-@@ -32,16 +32,16 @@
- #include "nv_uvm_interface.h"
- 
- uvm_global_t g_uvm_global;
--static struct UvmOpsUvmEvents g_exported_uvm8_ops;
-+static struct UvmOpsUvmEvents g_exported_uvm8_ops = {
-+    .startDevice = NULL,
-+    .stopDevice  = NULL,
-+    .isrTopHalf  = uvm8_isr_top_half,
-+};
- 
- static NV_STATUS uvm8_register_callbacks(void)
- {
-     NV_STATUS status = NV_OK;
- 
--    g_exported_uvm8_ops.startDevice = NULL;
--    g_exported_uvm8_ops.stopDevice  = NULL;
--    g_exported_uvm8_ops.isrTopHalf  = uvm8_isr_top_half;
--
-     // Register the UVM callbacks with the main GPU driver:
-     status = uvm_rm_locked_call(nvUvmInterfaceRegisterUvmCallbacks(&g_exported_uvm8_ops));
-     return status;
-diff -urp work.orig/kernel/nvidia-uvm/uvm8_gpu_semaphore.c work/kernel/nvidia-uvm/uvm8_gpu_semaphore.c
---- work.orig/kernel/nvidia-uvm/uvm8_gpu_semaphore.c	2016-02-03 23:32:32.000000000 +0100
-+++ work/kernel/nvidia-uvm/uvm8_gpu_semaphore.c	2016-02-10 11:38:57.478030852 +0100
-@@ -288,7 +288,7 @@ NvU64 uvm_gpu_semaphore_get_gpu_va(uvm_g
- 
- NvU32 uvm_gpu_semaphore_get_payload(uvm_gpu_semaphore_t *semaphore)
- {
--    return ACCESS_ONCE(*semaphore->payload);
-+    return ACCESS_ONCE_RW(*semaphore->payload);
- }
- 
- void uvm_gpu_semaphore_set_payload(uvm_gpu_semaphore_t *semaphore, NvU32 payload)
-@@ -304,7 +304,7 @@ void uvm_gpu_semaphore_set_payload(uvm_g
-     // being optimized out on non-SMP configs (we need them for interacting with
-     // the GPU correctly even on non-SMP).
-     mb();
--    ACCESS_ONCE(*semaphore->payload) = payload;
-+    ACCESS_ONCE_RW(*semaphore->payload) = payload;
- }
- 
- NV_STATUS uvm_gpu_tracking_semaphore_alloc(uvm_gpu_semaphore_pool_t *pool, uvm_gpu_tracking_semaphore_t *tracking_sem)
-diff -urp work.orig/kernel/nvidia-uvm/uvm8_hal.c work/kernel/nvidia-uvm/uvm8_hal.c
---- work.orig/kernel/nvidia-uvm/uvm8_hal.c	2016-02-03 23:32:32.000000000 +0100
-+++ work/kernel/nvidia-uvm/uvm8_hal.c	2016-02-10 11:47:13.377356162 +0100
-@@ -58,7 +58,7 @@ typedef struct
-         // arch_ops: id is an architecture
-         uvm_arch_hal_t arch_ops;
-     } u;
--} uvm_hal_class_ops_t;
-+} __do_const uvm_hal_class_ops_t;
- 
- // Table for copy engine functions.
- // Each entry is associated with a copy engine class through the 'class' field.
-diff -urp work.orig/kernel/nvidia-uvm/uvm8_mmu.h work/kernel/nvidia-uvm/uvm8_mmu.h
---- work.orig/kernel/nvidia-uvm/uvm8_mmu.h	2016-02-03 23:32:32.000000000 +0100
-+++ work/kernel/nvidia-uvm/uvm8_mmu.h	2016-02-10 12:09:05.463637996 +0100
-@@ -24,7 +24,6 @@
- #ifndef __UVM8_MMU_H__
- #define __UVM8_MMU_H__
- 
--#include "uvm8_forward_decl.h"
- #include "uvm8_pmm_gpu.h"
- #include "uvmtypes.h"
- #include "uvm_common.h"
-diff -urp work.orig/kernel/nvidia-uvm/uvm_common.c work/kernel/nvidia-uvm/uvm_common.c
---- work.orig/kernel/nvidia-uvm/uvm_common.c	2016-02-03 23:32:32.000000000 +0100
-+++ work/kernel/nvidia-uvm/uvm_common.c	2016-02-10 11:45:58.008501609 +0100
-@@ -74,7 +74,6 @@ static int uvmnext_activated(void)
- #endif
- 
- static dev_t g_uvmBaseDev;
--struct UvmOpsUvmEvents g_exportedUvmOps;
- 
- static char* uvm_driver_mode = "lite";
- 
-@@ -198,12 +197,17 @@ static NV_STATUS uvmSetupGpuProvider(voi
- {
-     NV_STATUS status = NV_OK;
- 
--    g_exportedUvmOps.startDevice = uvm_gpu_event_start_device;
--    g_exportedUvmOps.stopDevice  = uvm_gpu_event_stop_device;
-+    static struct UvmOpsUvmEvents g_exportedUvmOps = {
-+        .startDevice = uvm_gpu_event_start_device,
-+        .stopDevice  = uvm_gpu_event_stop_device,
-+    };
-+
-+    pax_open_kernel();
-     if (uvmnext_activated())
--        g_exportedUvmOps.isrTopHalf = uvmnext_isr_top_half;
-+        *(void **)&g_exportedUvmOps.isrTopHalf = uvmnext_isr_top_half;
-     else if (uvmfull_activated())
--        g_exportedUvmOps.isrTopHalf = uvmfull_isr_top_half;
-+        *(void **)&g_exportedUvmOps.isrTopHalf = uvmfull_isr_top_half;
-+    pax_close_kernel();
- 
-     // call RM to exchange the function pointers.
-     status = nvUvmInterfaceRegisterUvmCallbacks(&g_exportedUvmOps);
-diff -urp work.orig/kernel/nvidia-uvm/uvm_full_fault_buffer.h work/kernel/nvidia-uvm/uvm_full_fault_buffer.h
---- work.orig/kernel/nvidia-uvm/uvm_full_fault_buffer.h	2016-02-03 23:32:32.000000000 +0100
-+++ work/kernel/nvidia-uvm/uvm_full_fault_buffer.h	2016-02-10 11:26:28.143422741 +0100
-@@ -31,6 +31,7 @@
- #define _UVM_FULL_FAULT_BUFFER_H_
- 
- #include "uvmtypes.h"
-+#include "linux/compiler.h"
- 
- #define MAXWELL_FAULT_BUFFER_A (0xb069)
- #define MEM_RD32(a) (*(const volatile NvU32 *)(a)) 
-@@ -303,7 +304,7 @@ typedef struct
-     NvUvmControlPrefetch_t              controlPrefetch;
-     NvUvmTestFaultBufferOverflow_t      testFaultBufferOverflow;
-     NvUvmClearFaultBufferOverflow_t     clearFaultBufferOverflow;
--} UvmFaultBufferOps;
-+} __no_const UvmFaultBufferOps;
- 
- /******************************************************************************
-     uvmfull_fault_buffer_init

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-364.12-pax.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-364.12-pax.patch
deleted file mode 100644
index 18c316282bc..00000000000
--- a/x11-drivers/nvidia-drivers/files/nvidia-drivers-364.12-pax.patch
+++ /dev/null
@@ -1,398 +0,0 @@
-diff -urp work.orig/kernel/common/inc/nv-linux.h work/kernel/common/inc/nv-linux.h
---- work.orig/kernel/common/inc/nv-linux.h	2016-03-17 03:58:29.000000000 +0100
-+++ work/kernel/common/inc/nv-linux.h	2016-03-22 13:51:58.637292065 +0100
-@@ -1307,6 +1307,9 @@ extern void *nvidia_stack_t_cache;
- #define NV_KMEM_CACHE_CREATE(name, type)    \
-     NV_KMEM_CACHE_CREATE_FULL(name, sizeof(type), 0, 0, NULL)
- 
-+#define NV_KMEM_CACHE_CREATE_USERCOPY(name, type)    \
-+    NV_KMEM_CACHE_CREATE_FULL(name, sizeof(type), 0, SLAB_USERCOPY, NULL)
-+
- #define NV_KMEM_CACHE_DESTROY(kmem_cache)   \
-     kmem_cache_destroy(kmem_cache)
- 
-diff -urp work.orig/kernel/common/inc/nv-modeset-interface.h work/kernel/common/inc/nv-modeset-interface.h
---- work.orig/kernel/common/inc/nv-modeset-interface.h	2016-03-17 03:58:29.000000000 +0100
-+++ work/kernel/common/inc/nv-modeset-interface.h	2016-03-22 13:51:58.637292065 +0100
-@@ -72,7 +72,7 @@ typedef struct {
-      * mix nvidia and nvidia-modeset kernel modules from different
-      * releases.
-      */
--    const char *version_string;
-+//    const char *version_string;
- 
-     /*
-      * Allocate and free an nvidia_stack_t to pass into
-@@ -115,6 +115,6 @@ typedef struct {
- 
- } nvidia_modeset_rm_ops_t;
- 
--NV_STATUS nvidia_get_rm_ops(nvidia_modeset_rm_ops_t *rm_ops);
-+NV_STATUS nvidia_get_rm_ops(const nvidia_modeset_rm_ops_t **rm_ops, const char **version_string);
- 
- #endif /* _NV_MODESET_INTERFACE_H_ */
-diff -urp work.orig/kernel/common/inc/nv-register-module.h work/kernel/common/inc/nv-register-module.h
---- work.orig/kernel/common/inc/nv-register-module.h	2016-03-17 03:58:29.000000000 +0100
-+++ work/kernel/common/inc/nv-register-module.h	2016-03-22 13:51:58.637292065 +0100
-@@ -34,7 +34,7 @@ typedef struct nvidia_module_s {
-     int (*ioctl)(struct inode *, struct file * file, unsigned int cmd, unsigned long arg);
-     unsigned int (*poll)(struct file * file, poll_table *wait);
- 
--} nvidia_module_t;
-+} __do_const nvidia_module_t;
- 
- int nvidia_register_module(nvidia_module_t *);
- int nvidia_unregister_module(nvidia_module_t *);
-diff -urp work.orig/kernel/nvidia/nv.c work/kernel/nvidia/nv.c
---- work.orig/kernel/nvidia/nv.c	2016-03-17 03:58:29.000000000 +0100
-+++ work/kernel/nvidia/nv.c	2016-03-22 13:51:58.637292065 +0100
-@@ -654,7 +654,7 @@ int __init nvidia_init_module(void)
-     NV_SPIN_LOCK_INIT(&km_lock);
- #endif
- 
--    nvidia_stack_t_cache = NV_KMEM_CACHE_CREATE(nvidia_stack_cache_name,
-+    nvidia_stack_t_cache = NV_KMEM_CACHE_CREATE_USERCOPY(nvidia_stack_cache_name,
-                                                 nvidia_stack_t);
-     if (nvidia_stack_t_cache == NULL)
-     {
-diff -urp work.orig/kernel/nvidia/nv-chrdev.c work/kernel/nvidia/nv-chrdev.c
---- work.orig/kernel/nvidia/nv-chrdev.c	2016-03-17 03:58:29.000000000 +0100
-+++ work/kernel/nvidia/nv-chrdev.c	2016-03-22 13:51:58.637292065 +0100
-@@ -20,8 +20,6 @@ int nv_register_chrdev(void *param)
- {
-     nvidia_module_t *module = (nvidia_module_t *)param;
- 
--    module->instance = nv_module_instance;
--
-     return (nvidia_register_module(module));
- }
- 
-diff -urp work.orig/kernel/nvidia/nv-instance.c work/kernel/nvidia/nv-instance.c
---- work.orig/kernel/nvidia/nv-instance.c	2016-03-17 03:58:29.000000000 +0100
-+++ work/kernel/nvidia/nv-instance.c	2016-03-22 13:51:58.637292065 +0100
-@@ -51,6 +51,7 @@ struct pci_driver nv_pci_driver = {
- nvidia_module_t nv_fops = {
-     .owner       = THIS_MODULE,
-     .module_name = MODULE_NAME,
-+    .instance    = MODULE_INSTANCE_NUMBER,
-     .open        = nvidia_open,
-     .close       = nvidia_close,
-     .ioctl       = nvidia_ioctl,
-diff -urp work.orig/kernel/nvidia/nv-mmap.c work/kernel/nvidia/nv-mmap.c
---- work.orig/kernel/nvidia/nv-mmap.c	2016-03-17 03:58:29.000000000 +0100
-+++ work/kernel/nvidia/nv-mmap.c	2016-03-22 13:51:58.637292065 +0100
-@@ -113,12 +113,12 @@ nvidia_vma_release(struct vm_area_struct
- }
- 
- #if defined(NV_VM_OPERATIONS_STRUCT_HAS_ACCESS)
--static int
-+static ssize_t
- nvidia_vma_access(
-     struct vm_area_struct *vma,
-     unsigned long addr,
-     void *buffer,
--    int length,
-+    size_t length,
-     int write
- )
- {
-diff -urp work.orig/kernel/nvidia/nv-modeset-interface.c work/kernel/nvidia/nv-modeset-interface.c
---- work.orig/kernel/nvidia/nv-modeset-interface.c	2016-03-17 03:58:29.000000000 +0100
-+++ work/kernel/nvidia/nv-modeset-interface.c	2016-03-22 13:56:37.019870910 +0100
-@@ -100,10 +100,9 @@ static NvU32 nvidia_modeset_enumerate_gp
-     return count;
- }
- 
--NV_STATUS nvidia_get_rm_ops(nvidia_modeset_rm_ops_t *rm_ops)
-+NV_STATUS nvidia_get_rm_ops(const nvidia_modeset_rm_ops_t **rm_ops, const char **version_string)
- {
--    const nvidia_modeset_rm_ops_t local_rm_ops = {
--        .version_string = NV_VERSION_STRING,
-+    static const nvidia_modeset_rm_ops_t local_rm_ops = {
-         .alloc_stack    = nvidia_modeset_rm_ops_alloc_stack,
-         .free_stack     = nvidia_modeset_rm_ops_free_stack,
-         .get_gpuid_list = nvidia_get_gpuid_list,
-@@ -114,13 +113,13 @@ NV_STATUS nvidia_get_rm_ops(nvidia_modes
-         .set_callbacks  = nvidia_modeset_set_callbacks,
-     };
- 
--    if (strcmp(rm_ops->version_string, NV_VERSION_STRING) != 0)
-+    if (strcmp(*version_string, NV_VERSION_STRING) != 0)
-     {
--        rm_ops->version_string = NV_VERSION_STRING;
-+        *version_string = NV_VERSION_STRING;
-         return NV_ERR_GENERIC;
-     }
- 
--    *rm_ops = local_rm_ops;
-+    *rm_ops = &local_rm_ops;
- 
-     return NV_OK;
- }
-diff -urp work.orig/kernel/nvidia-drm/nvidia-drm-drv.c work/kernel/nvidia-drm/nvidia-drm-drv.c
---- work.orig/kernel/nvidia-drm/nvidia-drm-drv.c	2016-03-17 03:57:24.000000000 +0100
-+++ work/kernel/nvidia-drm/nvidia-drm-drv.c	2016-03-22 14:23:07.084230003 +0100
-@@ -586,7 +586,7 @@ static const struct drm_ioctl_desc nv_dr
-                       DRM_CONTROL_ALLOW|DRM_RENDER_ALLOW|DRM_UNLOCKED),
- };
- 
--static struct drm_driver nv_drm_driver = {
-+static drm_driver_no_const nv_drm_driver __read_only = {
- 
-     .driver_features        = DRIVER_GEM | DRIVER_PRIME | DRIVER_RENDER,
- 
-@@ -643,6 +643,7 @@ static void nvidia_update_drm_driver_fea
-         return;
-     }
- 
-+    pax_open_kernel();
-     nv_drm_driver.driver_features |= DRIVER_MODESET | DRIVER_ATOMIC;
- 
-     nv_drm_driver.master_set       = nvidia_drm_master_set;
-@@ -651,6 +652,7 @@ static void nvidia_update_drm_driver_fea
-     nv_drm_driver.dumb_create      = nvidia_drm_dumb_create;
-     nv_drm_driver.dumb_map_offset  = nvidia_drm_dumb_map_offset;
-     nv_drm_driver.dumb_destroy     = drm_gem_dumb_destroy;
-+    pax_close_kernel();
- 
- #endif /* NV_DRM_ATOMIC_MODESET_AVAILABLE */
- }
-diff -urp work.orig/kernel/nvidia-modeset/nvidia-modeset-linux.c work/kernel/nvidia-modeset/nvidia-modeset-linux.c
---- work.orig/kernel/nvidia-modeset/nvidia-modeset-linux.c	2016-03-17 03:57:25.000000000 +0100
-+++ work/kernel/nvidia-modeset/nvidia-modeset-linux.c	2016-03-22 13:55:05.208148788 +0100
-@@ -317,29 +317,28 @@ static void nvkms_resume(NvU32 gpuId)
-  * Interface with resman.
-  *************************************************************************/
- 
--static nvidia_modeset_rm_ops_t __rm_ops = { 0 };
-+static const nvidia_modeset_rm_ops_t *__rm_ops;
- static nvidia_modeset_callbacks_t nvkms_rm_callbacks = {
--    nvkms_suspend,
--    nvkms_resume
-+    .suspend = nvkms_suspend,
-+    .resume = nvkms_resume
- };
- 
- static int nvkms_alloc_rm(void)
- {
-     NV_STATUS nvstatus;
-     int ret;
-+    const char *version_string = NV_VERSION_STRING;
- 
--    __rm_ops.version_string = NV_VERSION_STRING;
--
--    nvstatus = nvidia_get_rm_ops(&__rm_ops);
-+    nvstatus = nvidia_get_rm_ops(&__rm_ops, &version_string);
- 
-     if (nvstatus != NV_OK) {
-         printk(KERN_ERR NVKMS_LOG_PREFIX "Version mismatch: "
-                "nvidia.ko(%s) nvidia-modeset.ko(%s)\n",
--               __rm_ops.version_string, NV_VERSION_STRING);
-+               version_string, NV_VERSION_STRING);
-         return -EINVAL;
-     }
- 
--    ret = __rm_ops.set_callbacks(&nvkms_rm_callbacks);
-+    ret = __rm_ops->set_callbacks(&nvkms_rm_callbacks);
-     if (ret < 0) {
-         printk(KERN_ERR NVKMS_LOG_PREFIX "Failed to register callbacks\n");
-         return ret;
-@@ -350,20 +349,20 @@ static int nvkms_alloc_rm(void)
- 
- static void nvkms_free_rm(void)
- {
--    __rm_ops.set_callbacks(NULL);
-+    __rm_ops->set_callbacks(NULL);
- }
- 
- void NVKMS_API_CALL nvkms_call_rm(void *ops)
- {
-     nvidia_modeset_stack_ptr stack = NULL;
- 
--    if (__rm_ops.alloc_stack(&stack) != 0) {
-+    if (__rm_ops->alloc_stack(&stack) != 0) {
-         return;
-     }
- 
--    __rm_ops.op(stack, ops);
-+    __rm_ops->op(stack, ops);
- 
--    __rm_ops.free_stack(stack);
-+    __rm_ops->free_stack(stack);
- }
- 
- /*************************************************************************
-@@ -685,13 +684,13 @@ NvBool NVKMS_API_CALL nvkms_open_gpu(NvU
-     nvidia_modeset_stack_ptr stack = NULL;
-     NvBool ret;
- 
--    if (__rm_ops.alloc_stack(&stack) != 0) {
-+    if (__rm_ops->alloc_stack(&stack) != 0) {
-         return NV_FALSE;
-     }
- 
--    ret = __rm_ops.open_gpu(gpuId, stack) == 0;
-+    ret = __rm_ops->open_gpu(gpuId, stack) == 0;
- 
--    __rm_ops.free_stack(stack);
-+    __rm_ops->free_stack(stack);
- 
-     return ret;
- }
-@@ -700,18 +699,18 @@ void NVKMS_API_CALL nvkms_close_gpu(NvU3
- {
-     nvidia_modeset_stack_ptr stack = NULL;
- 
--    if (__rm_ops.alloc_stack(&stack) != 0) {
-+    if (__rm_ops->alloc_stack(&stack) != 0) {
-         return;
-     }
- 
--    __rm_ops.close_gpu(gpuId, stack);
-+    __rm_ops->close_gpu(gpuId, stack);
- 
--    __rm_ops.free_stack(stack);
-+    __rm_ops->free_stack(stack);
- }
- 
- NvU32 NVKMS_API_CALL nvkms_enumerate_gpus(nv_gpu_info_t *gpu_info)
- {
--    return __rm_ops.enumerate_gpus(gpu_info);
-+    return __rm_ops->enumerate_gpus(gpu_info);
- }
- 
- /*************************************************************************
-diff -urp work.orig/kernel/nvidia-uvm/uvm8_global.c work/kernel/nvidia-uvm/uvm8_global.c
---- work.orig/kernel/nvidia-uvm/uvm8_global.c	2016-03-17 03:59:59.000000000 +0100
-+++ work/kernel/nvidia-uvm/uvm8_global.c	2016-03-22 14:00:03.852089935 +0100
-@@ -33,17 +33,17 @@
- #include "nv_uvm_interface.h"
- 
- uvm_global_t g_uvm_global;
--static struct UvmOpsUvmEvents g_exported_uvm8_ops;
-+static struct UvmOpsUvmEvents g_exported_uvm8_ops = {
-+    .startDevice = NULL,
-+    .stopDevice  = NULL,
-+    .isrTopHalf  = uvm8_isr_top_half,
-+};
- static bool g_ops_registered = false;
- 
- static NV_STATUS uvm8_register_callbacks(void)
- {
-     NV_STATUS status = NV_OK;
- 
--    g_exported_uvm8_ops.startDevice = NULL;
--    g_exported_uvm8_ops.stopDevice  = NULL;
--    g_exported_uvm8_ops.isrTopHalf  = uvm8_isr_top_half;
--
-     // Register the UVM callbacks with the main GPU driver:
-     status = uvm_rm_locked_call(nvUvmInterfaceRegisterUvmCallbacks(&g_exported_uvm8_ops));
-     if (status != NV_OK)
-diff -urp work.orig/kernel/nvidia-uvm/uvm8_gpu_semaphore.c work/kernel/nvidia-uvm/uvm8_gpu_semaphore.c
---- work.orig/kernel/nvidia-uvm/uvm8_gpu_semaphore.c	2016-03-17 03:59:59.000000000 +0100
-+++ work/kernel/nvidia-uvm/uvm8_gpu_semaphore.c	2016-03-22 13:51:58.641294799 +0100
-@@ -285,7 +285,7 @@ NvU64 uvm_gpu_semaphore_get_gpu_va(uvm_g
- 
- NvU32 uvm_gpu_semaphore_get_payload(uvm_gpu_semaphore_t *semaphore)
- {
--    return ACCESS_ONCE(*semaphore->payload);
-+    return ACCESS_ONCE_RW(*semaphore->payload);
- }
- 
- void uvm_gpu_semaphore_set_payload(uvm_gpu_semaphore_t *semaphore, NvU32 payload)
-@@ -301,7 +301,7 @@ void uvm_gpu_semaphore_set_payload(uvm_g
-     // being optimized out on non-SMP configs (we need them for interacting with
-     // the GPU correctly even on non-SMP).
-     mb();
--    ACCESS_ONCE(*semaphore->payload) = payload;
-+    ACCESS_ONCE_RW(*semaphore->payload) = payload;
- }
- 
- NV_STATUS uvm_gpu_tracking_semaphore_alloc(uvm_gpu_semaphore_pool_t *pool, uvm_gpu_tracking_semaphore_t *tracking_sem)
-diff -urp work.orig/kernel/nvidia-uvm/uvm8_hal.h work/kernel/nvidia-uvm/uvm8_hal.h
---- work.orig/kernel/nvidia-uvm/uvm8_hal.h	2016-03-17 03:59:59.000000000 +0100
-+++ work/kernel/nvidia-uvm/uvm8_hal.h	2016-03-22 13:55:38.620347598 +0100
-@@ -293,7 +293,7 @@ typedef struct
-         // fault_buffer_ops: id is a hardware class
-         uvm_fault_buffer_hal_t fault_buffer_ops;
-     } u;
--} uvm_hal_class_ops_t;
-+} __do_const uvm_hal_class_ops_t;
- 
- // When UVM next support is enabled support for future chips in the hal is
- // enabled by providing additional hal table entries below.
-diff -urp work.orig/kernel/nvidia-uvm/uvm8_mmu.h work/kernel/nvidia-uvm/uvm8_mmu.h
---- work.orig/kernel/nvidia-uvm/uvm8_mmu.h	2016-03-17 03:59:59.000000000 +0100
-+++ work/kernel/nvidia-uvm/uvm8_mmu.h	2016-03-22 13:57:44.255581049 +0100
-@@ -24,7 +24,6 @@
- #ifndef __UVM8_MMU_H__
- #define __UVM8_MMU_H__
- 
--#include "uvm8_forward_decl.h"
- #include "uvm8_hal_types.h"
- #include "uvm8_pmm_gpu.h"
- #include "uvmtypes.h"
-diff -urp work.orig/kernel/nvidia-uvm/uvm_common.c work/kernel/nvidia-uvm/uvm_common.c
---- work.orig/kernel/nvidia-uvm/uvm_common.c	2016-03-17 03:59:59.000000000 +0100
-+++ work/kernel/nvidia-uvm/uvm_common.c	2016-03-22 13:59:20.045675359 +0100
-@@ -54,7 +54,6 @@
- #include "uvm8_forward_decl.h"
- 
- static dev_t g_uvmBaseDev;
--struct UvmOpsUvmEvents g_exportedUvmOps;
- 
- static char* uvm_driver_mode = "lite";
- 
-@@ -171,10 +170,16 @@ static NV_STATUS uvmSetupGpuProvider(voi
- {
-     NV_STATUS status = NV_OK;
- 
--    g_exportedUvmOps.startDevice = uvm_gpu_event_start_device;
--    g_exportedUvmOps.stopDevice  = uvm_gpu_event_stop_device;
--    if (uvmfull_activated())
--        g_exportedUvmOps.isrTopHalf = uvmfull_isr_top_half;
-+    static struct UvmOpsUvmEvents g_exportedUvmOps = {
-+        .startDevice = uvm_gpu_event_start_device,
-+        .stopDevice  = uvm_gpu_event_stop_device,
-+    };
-+
-+    if (uvmfull_activated()) {
-+        pax_open_kernel();
-+        *(void **)&g_exportedUvmOps.isrTopHalf = uvmfull_isr_top_half;
-+        pax_close_kernel();
-+    }
- 
-     // call RM to exchange the function pointers.
-     status = nvUvmInterfaceRegisterUvmCallbacks(&g_exportedUvmOps);
-diff -urp work.orig/kernel/nvidia-uvm/uvm_full_fault_buffer.h work/kernel/nvidia-uvm/uvm_full_fault_buffer.h
---- work.orig/kernel/nvidia-uvm/uvm_full_fault_buffer.h	2016-03-17 03:59:59.000000000 +0100
-+++ work/kernel/nvidia-uvm/uvm_full_fault_buffer.h	2016-03-22 13:51:58.645297533 +0100
-@@ -31,6 +31,7 @@
- #define _UVM_FULL_FAULT_BUFFER_H_
- 
- #include "uvmtypes.h"
-+#include "linux/compiler.h"
- 
- #define MAXWELL_FAULT_BUFFER_A (0xb069)
- #define MEM_RD32(a) (*(const volatile NvU32 *)(a)) 
-@@ -303,7 +304,7 @@ typedef struct
-     NvUvmControlPrefetch_t              controlPrefetch;
-     NvUvmTestFaultBufferOverflow_t      testFaultBufferOverflow;
-     NvUvmClearFaultBufferOverflow_t     clearFaultBufferOverflow;
--} UvmFaultBufferOps;
-+} __no_const UvmFaultBufferOps;
- 
- /******************************************************************************
-     uvmfull_fault_buffer_init
-diff -urp work.orig/kernel/nvidia-uvm/uvm_linux.h work/kernel/nvidia-uvm/uvm_linux.h
---- work.orig/kernel/nvidia-uvm/uvm_linux.h	2016-03-17 03:59:59.000000000 +0100
-+++ work/kernel/nvidia-uvm/uvm_linux.h	2016-03-22 14:09:14.810534336 +0100
-@@ -485,7 +485,7 @@ static inline NvU64 NV_GETTIME(void)
- 
- // WRITE_ONCE/READ_ONCE have incompatible definitions across versions, which produces warnings.
- // Therefore, we define our own macros
--#define UVM_WRITE_ONCE(x, val) (ACCESS_ONCE(x) = (val))
-+#define UVM_WRITE_ONCE(x, val) (ACCESS_ONCE_RW(x) = (val))
- #define UVM_READ_ONCE(x) ACCESS_ONCE(x)
- 
- // Added in 3.11

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-367.35-pax.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-367.35-pax.patch
deleted file mode 100644
index b615064ddc4..00000000000
--- a/x11-drivers/nvidia-drivers/files/nvidia-drivers-367.35-pax.patch
+++ /dev/null
@@ -1,404 +0,0 @@
-diff -urp work.orig/kernel/common/inc/nv-linux.h work/kernel/common/inc/nv-linux.h
---- work.orig/kernel/common/inc/nv-linux.h	2016-07-12 06:52:21.000000000 +0200
-+++ work/kernel/common/inc/nv-linux.h	2016-07-16 22:45:59.870806346 +0200
-@@ -1308,6 +1308,9 @@ extern void *nvidia_stack_t_cache;
- #define NV_KMEM_CACHE_CREATE(name, type)    \
-     NV_KMEM_CACHE_CREATE_FULL(name, sizeof(type), 0, 0, NULL)
- 
-+#define NV_KMEM_CACHE_CREATE_USERCOPY(name, type)    \
-+    NV_KMEM_CACHE_CREATE_FULL(name, sizeof(type), 0, SLAB_USERCOPY, NULL)
-+
- #define NV_KMEM_CACHE_DESTROY(kmem_cache)   \
-     kmem_cache_destroy(kmem_cache)
- 
-diff -urp work.orig/kernel/common/inc/nv-modeset-interface.h work/kernel/common/inc/nv-modeset-interface.h
---- work.orig/kernel/common/inc/nv-modeset-interface.h	2016-07-12 06:52:21.000000000 +0200
-+++ work/kernel/common/inc/nv-modeset-interface.h	2016-07-16 22:46:16.223400774 +0200
-@@ -72,7 +72,7 @@ typedef struct {
-      * mix nvidia and nvidia-modeset kernel modules from different
-      * releases.
-      */
--    const char *version_string;
-+//    const char *version_string;
- 
-     /*
-      * Return system information.
-@@ -117,6 +117,6 @@ typedef struct {
- 
- } nvidia_modeset_rm_ops_t;
- 
--NV_STATUS nvidia_get_rm_ops(nvidia_modeset_rm_ops_t *rm_ops);
-+NV_STATUS nvidia_get_rm_ops(const nvidia_modeset_rm_ops_t **rm_ops, const char **version_string);
- 
- #endif /* _NV_MODESET_INTERFACE_H_ */
-diff -urp work.orig/kernel/common/inc/nv-register-module.h work/kernel/common/inc/nv-register-module.h
---- work.orig/kernel/common/inc/nv-register-module.h	2016-07-12 06:52:21.000000000 +0200
-+++ work/kernel/common/inc/nv-register-module.h	2016-07-16 22:45:59.870806346 +0200
-@@ -34,7 +34,7 @@ typedef struct nvidia_module_s {
-     int (*ioctl)(struct inode *, struct file * file, unsigned int cmd, unsigned long arg);
-     unsigned int (*poll)(struct file * file, poll_table *wait);
- 
--} nvidia_module_t;
-+} __do_const nvidia_module_t;
- 
- int nvidia_register_module(nvidia_module_t *);
- int nvidia_unregister_module(nvidia_module_t *);
-diff -urp work.orig/kernel/nvidia/nv.c work/kernel/nvidia/nv.c
---- work.orig/kernel/nvidia/nv.c	2016-07-12 06:52:21.000000000 +0200
-+++ work/kernel/nvidia/nv.c	2016-07-16 22:45:59.874809435 +0200
-@@ -654,7 +654,7 @@ int __init nvidia_init_module(void)
-     NV_SPIN_LOCK_INIT(&km_lock);
- #endif
- 
--    nvidia_stack_t_cache = NV_KMEM_CACHE_CREATE(nvidia_stack_cache_name,
-+    nvidia_stack_t_cache = NV_KMEM_CACHE_CREATE_USERCOPY(nvidia_stack_cache_name,
-                                                 nvidia_stack_t);
-     if (nvidia_stack_t_cache == NULL)
-     {
-diff -urp work.orig/kernel/nvidia/nv-chrdev.c work/kernel/nvidia/nv-chrdev.c
---- work.orig/kernel/nvidia/nv-chrdev.c	2016-07-12 06:52:21.000000000 +0200
-+++ work/kernel/nvidia/nv-chrdev.c	2016-07-16 22:45:59.874809435 +0200
-@@ -20,8 +20,6 @@ int nv_register_chrdev(void *param)
- {
-     nvidia_module_t *module = (nvidia_module_t *)param;
- 
--    module->instance = nv_module_instance;
--
-     return (nvidia_register_module(module));
- }
- 
-diff -urp work.orig/kernel/nvidia/nv-instance.c work/kernel/nvidia/nv-instance.c
---- work.orig/kernel/nvidia/nv-instance.c	2016-07-12 06:52:21.000000000 +0200
-+++ work/kernel/nvidia/nv-instance.c	2016-07-16 22:45:59.874809435 +0200
-@@ -51,6 +51,7 @@ struct pci_driver nv_pci_driver = {
- nvidia_module_t nv_fops = {
-     .owner       = THIS_MODULE,
-     .module_name = MODULE_NAME,
-+    .instance    = MODULE_INSTANCE_NUMBER,
-     .open        = nvidia_open,
-     .close       = nvidia_close,
-     .ioctl       = nvidia_ioctl,
-diff -urp work.orig/kernel/nvidia/nv-mmap.c work/kernel/nvidia/nv-mmap.c
---- work.orig/kernel/nvidia/nv-mmap.c	2016-07-12 06:52:21.000000000 +0200
-+++ work/kernel/nvidia/nv-mmap.c	2016-07-16 22:45:59.874809435 +0200
-@@ -113,12 +113,12 @@ nvidia_vma_release(struct vm_area_struct
- }
- 
- #if defined(NV_VM_OPERATIONS_STRUCT_HAS_ACCESS)
--static int
-+static ssize_t
- nvidia_vma_access(
-     struct vm_area_struct *vma,
-     unsigned long addr,
-     void *buffer,
--    int length,
-+    size_t length,
-     int write
- )
- {
-diff -urp work.orig/kernel/nvidia/nv-modeset-interface.c work/kernel/nvidia/nv-modeset-interface.c
---- work.orig/kernel/nvidia/nv-modeset-interface.c	2016-07-12 06:52:21.000000000 +0200
-+++ work/kernel/nvidia/nv-modeset-interface.c	2016-07-16 22:54:36.567962197 +0200
-@@ -100,10 +100,9 @@ static NvU32 nvidia_modeset_enumerate_gp
-     return count;
- }
- 
--NV_STATUS nvidia_get_rm_ops(nvidia_modeset_rm_ops_t *rm_ops)
-+NV_STATUS nvidia_get_rm_ops(const nvidia_modeset_rm_ops_t **rm_ops, const char **version_string)
- {
--    const nvidia_modeset_rm_ops_t local_rm_ops = {
--        .version_string = NV_VERSION_STRING,
-+    static const nvidia_modeset_rm_ops_t local_rm_ops = {
-         .system_info    = {
-             .allow_write_combining = NV_FALSE,
-         },
-@@ -116,17 +115,26 @@ NV_STATUS nvidia_get_rm_ops(nvidia_modes
-         .set_callbacks  = nvidia_modeset_set_callbacks,
-     };
- 
--    if (strcmp(rm_ops->version_string, NV_VERSION_STRING) != 0)
-+    static const nvidia_modeset_rm_ops_t local_rm_ops_wc = {
-+        .system_info    = {
-+            .allow_write_combining = NV_TRUE,
-+        },
-+        .alloc_stack    = nvidia_modeset_rm_ops_alloc_stack,
-+        .free_stack     = nvidia_modeset_rm_ops_free_stack,
-+        .enumerate_gpus = nvidia_modeset_enumerate_gpus,
-+        .open_gpu       = nvidia_dev_get,
-+        .close_gpu      = nvidia_dev_put,
-+        .op             = rm_kernel_rmapi_op, /* provided by nv-kernel.o */
-+        .set_callbacks  = nvidia_modeset_set_callbacks,
-+    };
-+
-+    if (strcmp(*version_string, NV_VERSION_STRING) != 0)
-     {
--        rm_ops->version_string = NV_VERSION_STRING;
-+        *version_string = NV_VERSION_STRING;
-         return NV_ERR_GENERIC;
-     }
- 
--    *rm_ops = local_rm_ops;
--
--    if (NV_ALLOW_WRITE_COMBINING(NV_MEMORY_TYPE_FRAMEBUFFER)) {
--        rm_ops->system_info.allow_write_combining = NV_TRUE;
--    }
-+    *rm_ops = NV_ALLOW_WRITE_COMBINING(NV_MEMORY_TYPE_FRAMEBUFFER) ? &local_rm_ops_wc : &local_rm_ops;
- 
-     return NV_OK;
- }
-diff -urp work.orig/kernel/nvidia-drm/nvidia-drm-drv.c work/kernel/nvidia-drm/nvidia-drm-drv.c
---- work.orig/kernel/nvidia-drm/nvidia-drm-drv.c	2016-07-12 06:53:45.000000000 +0200
-+++ work/kernel/nvidia-drm/nvidia-drm-drv.c	2016-07-16 22:45:59.878812524 +0200
-@@ -592,7 +592,7 @@ static const struct drm_ioctl_desc nv_dr
-                       DRM_CONTROL_ALLOW|DRM_RENDER_ALLOW|DRM_UNLOCKED),
- };
- 
--static struct drm_driver nv_drm_driver = {
-+static drm_driver_no_const nv_drm_driver __read_only = {
- 
-     .driver_features        = DRIVER_GEM | DRIVER_PRIME | DRIVER_RENDER,
- 
-@@ -649,6 +649,7 @@ static void nvidia_update_drm_driver_fea
-         return;
-     }
- 
-+    pax_open_kernel();
-     nv_drm_driver.driver_features |= DRIVER_MODESET | DRIVER_ATOMIC;
- 
-     nv_drm_driver.master_set       = nvidia_drm_master_set;
-@@ -657,6 +658,7 @@ static void nvidia_update_drm_driver_fea
-     nv_drm_driver.dumb_create      = nvidia_drm_dumb_create;
-     nv_drm_driver.dumb_map_offset  = nvidia_drm_dumb_map_offset;
-     nv_drm_driver.dumb_destroy     = drm_gem_dumb_destroy;
-+    pax_close_kernel();
- 
- #endif /* NV_DRM_ATOMIC_MODESET_AVAILABLE */
- }
-diff -urp work.orig/kernel/nvidia-modeset/nvidia-modeset-linux.c work/kernel/nvidia-modeset/nvidia-modeset-linux.c
---- work.orig/kernel/nvidia-modeset/nvidia-modeset-linux.c	2016-07-12 06:53:46.000000000 +0200
-+++ work/kernel/nvidia-modeset/nvidia-modeset-linux.c	2016-07-16 22:47:09.334133112 +0200
-@@ -317,29 +317,28 @@ static void nvkms_resume(NvU32 gpuId)
-  * Interface with resman.
-  *************************************************************************/
- 
--static nvidia_modeset_rm_ops_t __rm_ops = { 0 };
-+static const nvidia_modeset_rm_ops_t *__rm_ops;
- static nvidia_modeset_callbacks_t nvkms_rm_callbacks = {
--    nvkms_suspend,
--    nvkms_resume
-+    .suspend = nvkms_suspend,
-+    .resume = nvkms_resume
- };
- 
- static int nvkms_alloc_rm(void)
- {
-     NV_STATUS nvstatus;
-     int ret;
-+    const char *version_string = NV_VERSION_STRING;
- 
--    __rm_ops.version_string = NV_VERSION_STRING;
--
--    nvstatus = nvidia_get_rm_ops(&__rm_ops);
-+    nvstatus = nvidia_get_rm_ops(&__rm_ops, &version_string);
- 
-     if (nvstatus != NV_OK) {
-         printk(KERN_ERR NVKMS_LOG_PREFIX "Version mismatch: "
-                "nvidia.ko(%s) nvidia-modeset.ko(%s)\n",
--               __rm_ops.version_string, NV_VERSION_STRING);
-+               version_string, NV_VERSION_STRING);
-         return -EINVAL;
-     }
- 
--    ret = __rm_ops.set_callbacks(&nvkms_rm_callbacks);
-+    ret = __rm_ops->set_callbacks(&nvkms_rm_callbacks);
-     if (ret < 0) {
-         printk(KERN_ERR NVKMS_LOG_PREFIX "Failed to register callbacks\n");
-         return ret;
-@@ -350,20 +349,20 @@ static int nvkms_alloc_rm(void)
- 
- static void nvkms_free_rm(void)
- {
--    __rm_ops.set_callbacks(NULL);
-+    __rm_ops->set_callbacks(NULL);
- }
- 
- void NVKMS_API_CALL nvkms_call_rm(void *ops)
- {
-     nvidia_modeset_stack_ptr stack = NULL;
- 
--    if (__rm_ops.alloc_stack(&stack) != 0) {
-+    if (__rm_ops->alloc_stack(&stack) != 0) {
-         return;
-     }
- 
--    __rm_ops.op(stack, ops);
-+    __rm_ops->op(stack, ops);
- 
--    __rm_ops.free_stack(stack);
-+    __rm_ops->free_stack(stack);
- }
- 
- /*************************************************************************
-@@ -685,13 +684,13 @@ NvBool NVKMS_API_CALL nvkms_open_gpu(NvU
-     nvidia_modeset_stack_ptr stack = NULL;
-     NvBool ret;
- 
--    if (__rm_ops.alloc_stack(&stack) != 0) {
-+    if (__rm_ops->alloc_stack(&stack) != 0) {
-         return NV_FALSE;
-     }
- 
--    ret = __rm_ops.open_gpu(gpuId, stack) == 0;
-+    ret = __rm_ops->open_gpu(gpuId, stack) == 0;
- 
--    __rm_ops.free_stack(stack);
-+    __rm_ops->free_stack(stack);
- 
-     return ret;
- }
-@@ -700,23 +699,23 @@ void NVKMS_API_CALL nvkms_close_gpu(NvU3
- {
-     nvidia_modeset_stack_ptr stack = NULL;
- 
--    if (__rm_ops.alloc_stack(&stack) != 0) {
-+    if (__rm_ops->alloc_stack(&stack) != 0) {
-         return;
-     }
- 
--    __rm_ops.close_gpu(gpuId, stack);
-+    __rm_ops->close_gpu(gpuId, stack);
- 
--    __rm_ops.free_stack(stack);
-+    __rm_ops->free_stack(stack);
- }
- 
- NvU32 NVKMS_API_CALL nvkms_enumerate_gpus(nv_gpu_info_t *gpu_info)
- {
--    return __rm_ops.enumerate_gpus(gpu_info);
-+    return __rm_ops->enumerate_gpus(gpu_info);
- }
- 
- NvBool NVKMS_API_CALL nvkms_allow_write_combining(void)
- {
--    return __rm_ops.system_info.allow_write_combining;
-+    return __rm_ops->system_info.allow_write_combining;
- }
- 
- /*************************************************************************
-diff -urp work.orig/kernel/nvidia-uvm/uvm8_global.c work/kernel/nvidia-uvm/uvm8_global.c
---- work.orig/kernel/nvidia-uvm/uvm8_global.c	2016-07-12 06:52:17.000000000 +0200
-+++ work/kernel/nvidia-uvm/uvm8_global.c	2016-07-16 22:45:59.878812524 +0200
-@@ -35,17 +35,17 @@
- #include "nv_uvm_interface.h"
- 
- uvm_global_t g_uvm_global;
--static struct UvmOpsUvmEvents g_exported_uvm8_ops;
-+static struct UvmOpsUvmEvents g_exported_uvm8_ops = {
-+    .startDevice = NULL,
-+    .stopDevice  = NULL,
-+    .isrTopHalf  = uvm8_isr_top_half,
-+};
- static bool g_ops_registered = false;
- 
- static NV_STATUS uvm8_register_callbacks(void)
- {
-     NV_STATUS status = NV_OK;
- 
--    g_exported_uvm8_ops.startDevice = NULL;
--    g_exported_uvm8_ops.stopDevice  = NULL;
--    g_exported_uvm8_ops.isrTopHalf  = uvm8_isr_top_half;
--
-     // Register the UVM callbacks with the main GPU driver:
-     status = uvm_rm_locked_call(nvUvmInterfaceRegisterUvmCallbacks(&g_exported_uvm8_ops));
-     if (status != NV_OK)
-diff -urp work.orig/kernel/nvidia-uvm/uvm8_gpu_semaphore.c work/kernel/nvidia-uvm/uvm8_gpu_semaphore.c
---- work.orig/kernel/nvidia-uvm/uvm8_gpu_semaphore.c	2016-07-12 06:52:17.000000000 +0200
-+++ work/kernel/nvidia-uvm/uvm8_gpu_semaphore.c	2016-07-16 22:45:59.878812524 +0200
-@@ -368,7 +368,7 @@ void uvm_gpu_semaphore_set_payload(uvm_g
-     // being optimized out on non-SMP configs (we need them for interacting with
-     // the GPU correctly even on non-SMP).
-     mb();
--    ACCESS_ONCE(*semaphore->payload) = payload;
-+    ACCESS_ONCE_RW(*semaphore->payload) = payload;
- }
- 
- // This function is intended to catch channels which have been left dangling in
-diff -urp work.orig/kernel/nvidia-uvm/uvm8_hal.h work/kernel/nvidia-uvm/uvm8_hal.h
---- work.orig/kernel/nvidia-uvm/uvm8_hal.h	2016-07-12 06:52:17.000000000 +0200
-+++ work/kernel/nvidia-uvm/uvm8_hal.h	2016-07-16 22:45:59.878812524 +0200
-@@ -310,7 +310,7 @@ typedef struct
-         // fault_buffer_ops: id is a hardware class
-         uvm_fault_buffer_hal_t fault_buffer_ops;
-     } u;
--} uvm_hal_class_ops_t;
-+} __do_const uvm_hal_class_ops_t;
- 
- // When UVM next support is enabled support for future chips in the hal is
- // enabled by providing additional hal table entries below.
-diff -urp work.orig/kernel/nvidia-uvm/uvm8_mmu.h work/kernel/nvidia-uvm/uvm8_mmu.h
---- work.orig/kernel/nvidia-uvm/uvm8_mmu.h	2016-07-12 06:52:17.000000000 +0200
-+++ work/kernel/nvidia-uvm/uvm8_mmu.h	2016-07-16 22:45:59.878812524 +0200
-@@ -24,7 +24,6 @@
- #ifndef __UVM8_MMU_H__
- #define __UVM8_MMU_H__
- 
--#include "uvm8_forward_decl.h"
- #include "uvm8_hal_types.h"
- #include "uvm8_pmm_gpu.h"
- #include "uvmtypes.h"
-diff -urp work.orig/kernel/nvidia-uvm/uvm_common.c work/kernel/nvidia-uvm/uvm_common.c
---- work.orig/kernel/nvidia-uvm/uvm_common.c	2016-07-12 06:52:17.000000000 +0200
-+++ work/kernel/nvidia-uvm/uvm_common.c	2016-07-16 22:45:59.878812524 +0200
-@@ -51,7 +51,6 @@
- #define UVM_SPIN_LOOP_PRINT_TIMEOUT_SEC     30ULL
- 
- static dev_t g_uvmBaseDev;
--struct UvmOpsUvmEvents g_exportedUvmOps;
- 
- static char* uvm_driver_mode = "8";
- 
-@@ -175,8 +174,10 @@ static NV_STATUS uvmSetupGpuProvider(voi
- {
-     NV_STATUS status = NV_OK;
- 
--    g_exportedUvmOps.startDevice = uvm_gpu_event_start_device;
--    g_exportedUvmOps.stopDevice  = uvm_gpu_event_stop_device;
-+    static struct UvmOpsUvmEvents g_exportedUvmOps = {
-+        .startDevice = uvm_gpu_event_start_device,
-+        .stopDevice  = uvm_gpu_event_stop_device,
-+    };
- 
-     // call RM to exchange the function pointers.
-     status = nvUvmInterfaceRegisterUvmCallbacks(&g_exportedUvmOps);
-diff -urp work.orig/kernel/nvidia-uvm/uvm_full_fault_buffer.h work/kernel/nvidia-uvm/uvm_full_fault_buffer.h
---- work.orig/kernel/nvidia-uvm/uvm_full_fault_buffer.h	2016-07-12 06:52:17.000000000 +0200
-+++ work/kernel/nvidia-uvm/uvm_full_fault_buffer.h	2016-07-16 22:45:59.878812524 +0200
-@@ -31,6 +31,7 @@
- #define _UVM_FULL_FAULT_BUFFER_H_
- 
- #include "uvmtypes.h"
-+#include "linux/compiler.h"
- 
- #define MAXWELL_FAULT_BUFFER_A (0xb069)
- #define MEM_RD32(a) (*(const volatile NvU32 *)(a)) 
-@@ -303,7 +304,7 @@ typedef struct
-     NvUvmControlPrefetch_t              controlPrefetch;
-     NvUvmTestFaultBufferOverflow_t      testFaultBufferOverflow;
-     NvUvmClearFaultBufferOverflow_t     clearFaultBufferOverflow;
--} UvmFaultBufferOps;
-+} __no_const UvmFaultBufferOps;
- 
- /******************************************************************************
-     uvmfull_fault_buffer_init
-diff -urp work.orig/kernel/nvidia-uvm/uvm_linux.h work/kernel/nvidia-uvm/uvm_linux.h
---- work.orig/kernel/nvidia-uvm/uvm_linux.h	2016-07-12 06:52:17.000000000 +0200
-+++ work/kernel/nvidia-uvm/uvm_linux.h	2016-07-16 22:45:59.882815613 +0200
-@@ -508,7 +508,7 @@ static inline NvU64 NV_GETTIME(void)
- 
- // WRITE_ONCE/READ_ONCE have incompatible definitions across versions, which produces warnings.
- // Therefore, we define our own macros
--#define UVM_WRITE_ONCE(x, val) (ACCESS_ONCE(x) = (val))
-+#define UVM_WRITE_ONCE(x, val) (ACCESS_ONCE_RW(x) = (val))
- #define UVM_READ_ONCE(x) ACCESS_ONCE(x)
- 
- // Added in 3.11

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-367.57-pax.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-367.57-pax.patch
deleted file mode 100644
index bf2013265ad..00000000000
--- a/x11-drivers/nvidia-drivers/files/nvidia-drivers-367.57-pax.patch
+++ /dev/null
@@ -1,391 +0,0 @@
-diff -urp work.orig/kernel/common/inc/nv-linux.h work/kernel/common/inc/nv-linux.h
---- work.orig/kernel/common/inc/nv-linux.h	2016-07-12 06:52:21.000000000 +0200
-+++ work/kernel/common/inc/nv-linux.h	2016-07-16 22:45:59.870806346 +0200
-@@ -1308,6 +1308,9 @@ extern void *nvidia_stack_t_cache;
- #define NV_KMEM_CACHE_CREATE(name, type)    \
-     NV_KMEM_CACHE_CREATE_FULL(name, sizeof(type), 0, 0, NULL)
- 
-+#define NV_KMEM_CACHE_CREATE_USERCOPY(name, type)    \
-+    NV_KMEM_CACHE_CREATE_FULL(name, sizeof(type), 0, SLAB_USERCOPY, NULL)
-+
- #define NV_KMEM_CACHE_DESTROY(kmem_cache)   \
-     kmem_cache_destroy(kmem_cache)
- 
-diff -urp work.orig/kernel/common/inc/nv-modeset-interface.h work/kernel/common/inc/nv-modeset-interface.h
---- work.orig/kernel/common/inc/nv-modeset-interface.h	2016-07-12 06:52:21.000000000 +0200
-+++ work/kernel/common/inc/nv-modeset-interface.h	2016-07-16 22:46:16.223400774 +0200
-@@ -72,7 +72,7 @@ typedef struct {
-      * mix nvidia and nvidia-modeset kernel modules from different
-      * releases.
-      */
--    const char *version_string;
-+//    const char *version_string;
- 
-     /*
-      * Return system information.
-@@ -117,6 +117,6 @@ typedef struct {
- 
- } nvidia_modeset_rm_ops_t;
- 
--NV_STATUS nvidia_get_rm_ops(nvidia_modeset_rm_ops_t *rm_ops);
-+NV_STATUS nvidia_get_rm_ops(const nvidia_modeset_rm_ops_t **rm_ops, const char **version_string);
- 
- #endif /* _NV_MODESET_INTERFACE_H_ */
-diff -urp work.orig/kernel/common/inc/nv-register-module.h work/kernel/common/inc/nv-register-module.h
---- work.orig/kernel/common/inc/nv-register-module.h	2016-07-12 06:52:21.000000000 +0200
-+++ work/kernel/common/inc/nv-register-module.h	2016-07-16 22:45:59.870806346 +0200
-@@ -34,7 +34,7 @@ typedef struct nvidia_module_s {
-     int (*ioctl)(struct inode *, struct file * file, unsigned int cmd, unsigned long arg);
-     unsigned int (*poll)(struct file * file, poll_table *wait);
- 
--} nvidia_module_t;
-+} __do_const nvidia_module_t;
- 
- int nvidia_register_module(nvidia_module_t *);
- int nvidia_unregister_module(nvidia_module_t *);
-diff -urp work.orig/kernel/nvidia/nv.c work/kernel/nvidia/nv.c
---- work.orig/kernel/nvidia/nv.c	2016-07-12 06:52:21.000000000 +0200
-+++ work/kernel/nvidia/nv.c	2016-07-16 22:45:59.874809435 +0200
-@@ -654,7 +654,7 @@ int __init nvidia_init_module(void)
-     NV_SPIN_LOCK_INIT(&km_lock);
- #endif
- 
--    nvidia_stack_t_cache = NV_KMEM_CACHE_CREATE(nvidia_stack_cache_name,
-+    nvidia_stack_t_cache = NV_KMEM_CACHE_CREATE_USERCOPY(nvidia_stack_cache_name,
-                                                 nvidia_stack_t);
-     if (nvidia_stack_t_cache == NULL)
-     {
-diff -urp work.orig/kernel/nvidia/nv-chrdev.c work/kernel/nvidia/nv-chrdev.c
---- work.orig/kernel/nvidia/nv-chrdev.c	2016-07-12 06:52:21.000000000 +0200
-+++ work/kernel/nvidia/nv-chrdev.c	2016-07-16 22:45:59.874809435 +0200
-@@ -20,8 +20,6 @@ int nv_register_chrdev(void *param)
- {
-     nvidia_module_t *module = (nvidia_module_t *)param;
- 
--    module->instance = nv_module_instance;
--
-     return (nvidia_register_module(module));
- }
- 
-diff -urp work.orig/kernel/nvidia/nv-instance.c work/kernel/nvidia/nv-instance.c
---- work.orig/kernel/nvidia/nv-instance.c	2016-07-12 06:52:21.000000000 +0200
-+++ work/kernel/nvidia/nv-instance.c	2016-07-16 22:45:59.874809435 +0200
-@@ -51,6 +51,7 @@ struct pci_driver nv_pci_driver = {
- nvidia_module_t nv_fops = {
-     .owner       = THIS_MODULE,
-     .module_name = MODULE_NAME,
-+    .instance    = MODULE_INSTANCE_NUMBER,
-     .open        = nvidia_open,
-     .close       = nvidia_close,
-     .ioctl       = nvidia_ioctl,
-diff -urp work.orig/kernel/nvidia/nv-mmap.c work/kernel/nvidia/nv-mmap.c
---- work.orig/kernel/nvidia/nv-mmap.c	2016-07-12 06:52:21.000000000 +0200
-+++ work/kernel/nvidia/nv-mmap.c	2016-07-16 22:45:59.874809435 +0200
-@@ -113,12 +113,12 @@ nvidia_vma_release(struct vm_area_struct
- }
- 
- #if defined(NV_VM_OPERATIONS_STRUCT_HAS_ACCESS)
--static int
-+static ssize_t
- nvidia_vma_access(
-     struct vm_area_struct *vma,
-     unsigned long addr,
-     void *buffer,
--    int length,
-+    size_t length,
-     int write
- )
- {
-diff -urp work.orig/kernel/nvidia/nv-modeset-interface.c work/kernel/nvidia/nv-modeset-interface.c
---- work.orig/kernel/nvidia/nv-modeset-interface.c	2016-07-12 06:52:21.000000000 +0200
-+++ work/kernel/nvidia/nv-modeset-interface.c	2016-07-16 22:54:36.567962197 +0200
-@@ -100,10 +100,9 @@ static NvU32 nvidia_modeset_enumerate_gp
-     return count;
- }
- 
--NV_STATUS nvidia_get_rm_ops(nvidia_modeset_rm_ops_t *rm_ops)
-+NV_STATUS nvidia_get_rm_ops(const nvidia_modeset_rm_ops_t **rm_ops, const char **version_string)
- {
--    const nvidia_modeset_rm_ops_t local_rm_ops = {
--        .version_string = NV_VERSION_STRING,
-+    static const nvidia_modeset_rm_ops_t local_rm_ops = {
-         .system_info    = {
-             .allow_write_combining = NV_FALSE,
-         },
-@@ -116,17 +115,26 @@ NV_STATUS nvidia_get_rm_ops(nvidia_modes
-         .set_callbacks  = nvidia_modeset_set_callbacks,
-     };
- 
--    if (strcmp(rm_ops->version_string, NV_VERSION_STRING) != 0)
-+    static const nvidia_modeset_rm_ops_t local_rm_ops_wc = {
-+        .system_info    = {
-+            .allow_write_combining = NV_TRUE,
-+        },
-+        .alloc_stack    = nvidia_modeset_rm_ops_alloc_stack,
-+        .free_stack     = nvidia_modeset_rm_ops_free_stack,
-+        .enumerate_gpus = nvidia_modeset_enumerate_gpus,
-+        .open_gpu       = nvidia_dev_get,
-+        .close_gpu      = nvidia_dev_put,
-+        .op             = rm_kernel_rmapi_op, /* provided by nv-kernel.o */
-+        .set_callbacks  = nvidia_modeset_set_callbacks,
-+    };
-+
-+    if (strcmp(*version_string, NV_VERSION_STRING) != 0)
-     {
--        rm_ops->version_string = NV_VERSION_STRING;
-+        *version_string = NV_VERSION_STRING;
-         return NV_ERR_GENERIC;
-     }
- 
--    *rm_ops = local_rm_ops;
--
--    if (NV_ALLOW_WRITE_COMBINING(NV_MEMORY_TYPE_FRAMEBUFFER)) {
--        rm_ops->system_info.allow_write_combining = NV_TRUE;
--    }
-+    *rm_ops = NV_ALLOW_WRITE_COMBINING(NV_MEMORY_TYPE_FRAMEBUFFER) ? &local_rm_ops_wc : &local_rm_ops;
- 
-     return NV_OK;
- }
-diff -urp work.orig/kernel/nvidia-drm/nvidia-drm-drv.c work/kernel/nvidia-drm/nvidia-drm-drv.c
---- work.orig/kernel/nvidia-drm/nvidia-drm-drv.c	2016-07-12 06:53:45.000000000 +0200
-+++ work/kernel/nvidia-drm/nvidia-drm-drv.c	2016-07-16 22:45:59.878812524 +0200
-@@ -592,7 +592,7 @@ static const struct drm_ioctl_desc nv_dr
-                       DRM_CONTROL_ALLOW|DRM_RENDER_ALLOW|DRM_UNLOCKED),
- };
- 
--static struct drm_driver nv_drm_driver = {
-+static drm_driver_no_const nv_drm_driver __read_only = {
- 
-     .driver_features        = DRIVER_GEM | DRIVER_PRIME | DRIVER_RENDER,
- 
-@@ -649,6 +649,7 @@ static void nvidia_update_drm_driver_fea
-         return;
-     }
- 
-+    pax_open_kernel();
-     nv_drm_driver.driver_features |= DRIVER_MODESET | DRIVER_ATOMIC;
- 
-     nv_drm_driver.master_set       = nvidia_drm_master_set;
-@@ -657,6 +658,7 @@ static void nvidia_update_drm_driver_fea
-     nv_drm_driver.dumb_create      = nvidia_drm_dumb_create;
-     nv_drm_driver.dumb_map_offset  = nvidia_drm_dumb_map_offset;
-     nv_drm_driver.dumb_destroy     = drm_gem_dumb_destroy;
-+    pax_close_kernel();
- 
- #endif /* NV_DRM_ATOMIC_MODESET_AVAILABLE */
- }
-diff -urp work.orig/kernel/nvidia-modeset/nvidia-modeset-linux.c work/kernel/nvidia-modeset/nvidia-modeset-linux.c
---- work.orig/kernel/nvidia-modeset/nvidia-modeset-linux.c	2016-07-12 06:53:46.000000000 +0200
-+++ work/kernel/nvidia-modeset/nvidia-modeset-linux.c	2016-07-16 22:47:09.334133112 +0200
-@@ -317,29 +317,28 @@ static void nvkms_resume(NvU32 gpuId)
-  * Interface with resman.
-  *************************************************************************/
- 
--static nvidia_modeset_rm_ops_t __rm_ops = { 0 };
-+static const nvidia_modeset_rm_ops_t *__rm_ops;
- static nvidia_modeset_callbacks_t nvkms_rm_callbacks = {
--    nvkms_suspend,
--    nvkms_resume
-+    .suspend = nvkms_suspend,
-+    .resume = nvkms_resume
- };
- 
- static int nvkms_alloc_rm(void)
- {
-     NV_STATUS nvstatus;
-     int ret;
-+    const char *version_string = NV_VERSION_STRING;
- 
--    __rm_ops.version_string = NV_VERSION_STRING;
--
--    nvstatus = nvidia_get_rm_ops(&__rm_ops);
-+    nvstatus = nvidia_get_rm_ops(&__rm_ops, &version_string);
- 
-     if (nvstatus != NV_OK) {
-         printk(KERN_ERR NVKMS_LOG_PREFIX "Version mismatch: "
-                "nvidia.ko(%s) nvidia-modeset.ko(%s)\n",
--               __rm_ops.version_string, NV_VERSION_STRING);
-+               version_string, NV_VERSION_STRING);
-         return -EINVAL;
-     }
- 
--    ret = __rm_ops.set_callbacks(&nvkms_rm_callbacks);
-+    ret = __rm_ops->set_callbacks(&nvkms_rm_callbacks);
-     if (ret < 0) {
-         printk(KERN_ERR NVKMS_LOG_PREFIX "Failed to register callbacks\n");
-         return ret;
-@@ -350,20 +349,20 @@ static int nvkms_alloc_rm(void)
- 
- static void nvkms_free_rm(void)
- {
--    __rm_ops.set_callbacks(NULL);
-+    __rm_ops->set_callbacks(NULL);
- }
- 
- void NVKMS_API_CALL nvkms_call_rm(void *ops)
- {
-     nvidia_modeset_stack_ptr stack = NULL;
- 
--    if (__rm_ops.alloc_stack(&stack) != 0) {
-+    if (__rm_ops->alloc_stack(&stack) != 0) {
-         return;
-     }
- 
--    __rm_ops.op(stack, ops);
-+    __rm_ops->op(stack, ops);
- 
--    __rm_ops.free_stack(stack);
-+    __rm_ops->free_stack(stack);
- }
- 
- /*************************************************************************
-@@ -685,13 +684,13 @@ NvBool NVKMS_API_CALL nvkms_open_gpu(NvU
-     nvidia_modeset_stack_ptr stack = NULL;
-     NvBool ret;
- 
--    if (__rm_ops.alloc_stack(&stack) != 0) {
-+    if (__rm_ops->alloc_stack(&stack) != 0) {
-         return NV_FALSE;
-     }
- 
--    ret = __rm_ops.open_gpu(gpuId, stack) == 0;
-+    ret = __rm_ops->open_gpu(gpuId, stack) == 0;
- 
--    __rm_ops.free_stack(stack);
-+    __rm_ops->free_stack(stack);
- 
-     return ret;
- }
-@@ -700,23 +699,23 @@ void NVKMS_API_CALL nvkms_close_gpu(NvU3
- {
-     nvidia_modeset_stack_ptr stack = NULL;
- 
--    if (__rm_ops.alloc_stack(&stack) != 0) {
-+    if (__rm_ops->alloc_stack(&stack) != 0) {
-         return;
-     }
- 
--    __rm_ops.close_gpu(gpuId, stack);
-+    __rm_ops->close_gpu(gpuId, stack);
- 
--    __rm_ops.free_stack(stack);
-+    __rm_ops->free_stack(stack);
- }
- 
- NvU32 NVKMS_API_CALL nvkms_enumerate_gpus(nv_gpu_info_t *gpu_info)
- {
--    return __rm_ops.enumerate_gpus(gpu_info);
-+    return __rm_ops->enumerate_gpus(gpu_info);
- }
- 
- NvBool NVKMS_API_CALL nvkms_allow_write_combining(void)
- {
--    return __rm_ops.system_info.allow_write_combining;
-+    return __rm_ops->system_info.allow_write_combining;
- }
- 
- /*************************************************************************
-diff -urp work.orig/kernel/nvidia-uvm/uvm8_global.c work/kernel/nvidia-uvm/uvm8_global.c
---- work.orig/kernel/nvidia-uvm/uvm8_global.c	2016-07-12 06:52:17.000000000 +0200
-+++ work/kernel/nvidia-uvm/uvm8_global.c	2016-07-16 22:45:59.878812524 +0200
-@@ -35,17 +35,17 @@
- #include "nv_uvm_interface.h"
- 
- uvm_global_t g_uvm_global;
--static struct UvmOpsUvmEvents g_exported_uvm8_ops;
-+static struct UvmOpsUvmEvents g_exported_uvm8_ops = {
-+    .startDevice = NULL,
-+    .stopDevice  = NULL,
-+    .isrTopHalf  = uvm8_isr_top_half,
-+};
- static bool g_ops_registered = false;
- 
- static NV_STATUS uvm8_register_callbacks(void)
- {
-     NV_STATUS status = NV_OK;
- 
--    g_exported_uvm8_ops.startDevice = NULL;
--    g_exported_uvm8_ops.stopDevice  = NULL;
--    g_exported_uvm8_ops.isrTopHalf  = uvm8_isr_top_half;
--
-     // Register the UVM callbacks with the main GPU driver:
-     status = uvm_rm_locked_call(nvUvmInterfaceRegisterUvmCallbacks(&g_exported_uvm8_ops));
-     if (status != NV_OK)
-diff -urp work.orig/kernel/nvidia-uvm/uvm8_gpu_semaphore.c work/kernel/nvidia-uvm/uvm8_gpu_semaphore.c
---- work.orig/kernel/nvidia-uvm/uvm8_gpu_semaphore.c	2016-07-12 06:52:17.000000000 +0200
-+++ work/kernel/nvidia-uvm/uvm8_gpu_semaphore.c	2016-07-16 22:45:59.878812524 +0200
-@@ -368,7 +368,7 @@ void uvm_gpu_semaphore_set_payload(uvm_g
-     // being optimized out on non-SMP configs (we need them for interacting with
-     // the GPU correctly even on non-SMP).
-     mb();
--    ACCESS_ONCE(*semaphore->payload) = payload;
-+    ACCESS_ONCE_RW(*semaphore->payload) = payload;
- }
- 
- // This function is intended to catch channels which have been left dangling in
-diff -urp work.orig/kernel/nvidia-uvm/uvm8_hal.h work/kernel/nvidia-uvm/uvm8_hal.h
---- work.orig/kernel/nvidia-uvm/uvm8_hal.h	2016-07-12 06:52:17.000000000 +0200
-+++ work/kernel/nvidia-uvm/uvm8_hal.h	2016-07-16 22:45:59.878812524 +0200
-@@ -310,7 +310,7 @@ typedef struct
-         // fault_buffer_ops: id is a hardware class
-         uvm_fault_buffer_hal_t fault_buffer_ops;
-     } u;
--} uvm_hal_class_ops_t;
-+} __do_const uvm_hal_class_ops_t;
- 
- // When UVM next support is enabled support for future chips in the hal is
- // enabled by providing additional hal table entries below.
-diff -urp work.orig/kernel/nvidia-uvm/uvm8_mmu.h work/kernel/nvidia-uvm/uvm8_mmu.h
---- work.orig/kernel/nvidia-uvm/uvm8_mmu.h	2016-07-12 06:52:17.000000000 +0200
-+++ work/kernel/nvidia-uvm/uvm8_mmu.h	2016-07-16 22:45:59.878812524 +0200
-@@ -24,7 +24,6 @@
- #ifndef __UVM8_MMU_H__
- #define __UVM8_MMU_H__
- 
--#include "uvm8_forward_decl.h"
- #include "uvm8_hal_types.h"
- #include "uvm8_pmm_gpu.h"
- #include "uvmtypes.h"
-diff -urp work.orig/kernel/nvidia-uvm/uvm_common.c work/kernel/nvidia-uvm/uvm_common.c
---- work.orig/kernel/nvidia-uvm/uvm_common.c	2016-07-12 06:52:17.000000000 +0200
-+++ work/kernel/nvidia-uvm/uvm_common.c	2016-07-16 22:45:59.878812524 +0200
-@@ -51,7 +51,6 @@
- #define UVM_SPIN_LOOP_PRINT_TIMEOUT_SEC     30ULL
- 
- static dev_t g_uvmBaseDev;
--struct UvmOpsUvmEvents g_exportedUvmOps;
- 
- static char* uvm_driver_mode = "8";
- 
-diff -urp work.orig/kernel/nvidia-uvm/uvm_full_fault_buffer.h work/kernel/nvidia-uvm/uvm_full_fault_buffer.h
---- work.orig/kernel/nvidia-uvm/uvm_full_fault_buffer.h	2016-07-12 06:52:17.000000000 +0200
-+++ work/kernel/nvidia-uvm/uvm_full_fault_buffer.h	2016-07-16 22:45:59.878812524 +0200
-@@ -31,6 +31,7 @@
- #define _UVM_FULL_FAULT_BUFFER_H_
- 
- #include "uvmtypes.h"
-+#include "linux/compiler.h"
- 
- #define MAXWELL_FAULT_BUFFER_A (0xb069)
- #define MEM_RD32(a) (*(const volatile NvU32 *)(a)) 
-@@ -303,7 +304,7 @@ typedef struct
-     NvUvmControlPrefetch_t              controlPrefetch;
-     NvUvmTestFaultBufferOverflow_t      testFaultBufferOverflow;
-     NvUvmClearFaultBufferOverflow_t     clearFaultBufferOverflow;
--} UvmFaultBufferOps;
-+} __no_const UvmFaultBufferOps;
- 
- /******************************************************************************
-     uvmfull_fault_buffer_init
-diff -urp work.orig/kernel/nvidia-uvm/uvm_linux.h work/kernel/nvidia-uvm/uvm_linux.h
---- work.orig/kernel/nvidia-uvm/uvm_linux.h	2016-07-12 06:52:17.000000000 +0200
-+++ work/kernel/nvidia-uvm/uvm_linux.h	2016-07-16 22:45:59.882815613 +0200
-@@ -508,7 +508,7 @@ static inline NvU64 NV_GETTIME(void)
- 
- // WRITE_ONCE/READ_ONCE have incompatible definitions across versions, which produces warnings.
- // Therefore, we define our own macros
--#define UVM_WRITE_ONCE(x, val) (ACCESS_ONCE(x) = (val))
-+#define UVM_WRITE_ONCE(x, val) (ACCESS_ONCE_RW(x) = (val))
- #define UVM_READ_ONCE(x) ACCESS_ONCE(x)
- 
- // Added in 3.11

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-367.57-profiles-rc.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-367.57-profiles-rc.patch
deleted file mode 100644
index b29895c3dff..00000000000
--- a/x11-drivers/nvidia-drivers/files/nvidia-drivers-367.57-profiles-rc.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/nvidia-application-profiles-367.57-rc
-+++ b/nvidia-application-profiles-367.57-rc
-@@ -44,7 +44,7 @@
-         {
-           "name" : "NamedVertexAttributesApplyDivisor",
-           "settings" : [ "GL23cd0e", 1 ]
--        },
-+        }
-     ],
-     "rules" : [
-         {

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-370.28-profiles-rc.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-370.28-profiles-rc.patch
deleted file mode 100644
index cec890b28cc..00000000000
--- a/x11-drivers/nvidia-drivers/files/nvidia-drivers-370.28-profiles-rc.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/nvidia-application-profiles-370.28-rc
-+++ b/nvidia-application-profiles-370.28-rc
-@@ -44,7 +44,7 @@
-         {
-           "name" : "NamedVertexAttributesApplyDivisor",
-           "settings" : [ "GL23cd0e", 1 ]
--        },
-+        }
-     ],
-     "rules" : [
-         {

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-settings.desktop b/x11-drivers/nvidia-drivers/files/nvidia-drivers-settings.desktop
deleted file mode 100644
index 773a5af2466..00000000000
--- a/x11-drivers/nvidia-drivers/files/nvidia-drivers-settings.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=NVIDIA X Server Settings
-Comment=Configure NVIDIA X Server Settings
-Exec=/opt/bin/nvidia-settings
-Icon=nvidia-drivers-settings
-Categories=System;Settings;

diff --git a/x11-drivers/nvidia-drivers/metadata.xml b/x11-drivers/nvidia-drivers/metadata.xml
index 8f630f27655..8de5b844b79 100644
--- a/x11-drivers/nvidia-drivers/metadata.xml
+++ b/x11-drivers/nvidia-drivers/metadata.xml
@@ -17,7 +17,6 @@ branches.
 	<flag name="compat">Install non-GLVND libGL for backwards compatibility</flag>
 	<flag name="driver">Install the kernel driver module</flag>
 	<flag name="X">Install the X.org driver, OpenGL libraries, XvMC libraries, and VDPAU libraries</flag>
-	<flag name="gtk2">Install nvidia-settings with support for GTK+ 2</flag>
 	<flag name="gtk3">Install nvidia-settings with support for GTK+ 3</flag>
 	<flag name="kms">Enable support for kernel mode setting (KMS)</flag>
 	<flag name="pax_kernel">PaX patches from the PaX project</flag> 

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-346.96-r6.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-346.96-r6.ebuild
deleted file mode 100644
index 2efeb5df250..00000000000
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-346.96-r6.ebuild
+++ /dev/null
@@ -1,527 +0,0 @@
-# Copyright 1999-2016 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-
-inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \
-	portability toolchain-funcs unpacker user udev
-
-NV_URI="http://us.download.nvidia.com/XFree86/"
-X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
-AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
-X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
-AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
-
-DESCRIPTION="NVIDIA Accelerated Graphics Driver"
-HOMEPAGE="http://www.nvidia.com/ http://www.nvidia.com/Download/Find.aspx"
-SRC_URI="
-	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
-	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
-	x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
-	x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
-	tools? ( ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2 )
-"
-
-LICENSE="GPL-2 NVIDIA-r2"
-SLOT="0/${PV%.*}"
-KEYWORDS="-* amd64 x86 ~amd64-fbsd ~x86-fbsd"
-RESTRICT="bindist mirror"
-EMULTILIB_PKG="true"
-
-IUSE="acpi gtk3 kernel_FreeBSD kernel_linux multilib pax_kernel static-libs +tools uvm +X"
-REQUIRED_USE="
-	tools? ( X )
-	static-libs? ( tools )
-"
-
-COMMON="
-	app-eselect/eselect-opencl
-	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
-	tools? (
-		dev-libs/atk
-		dev-libs/glib:2
-		dev-libs/jansson
-		gtk3? ( x11-libs/gtk+:3 )
-		x11-libs/cairo
-		x11-libs/gdk-pixbuf[X]
-		x11-libs/gtk+:2
-		x11-libs/libX11
-		x11-libs/libXext
-		x11-libs/libXrandr
-		x11-libs/libXv
-		x11-libs/libXxf86vm
-		x11-libs/pango[X]
-	)
-	X? (
-		>=app-eselect/eselect-opengl-1.0.9
-	)
-"
-DEPEND="
-	${COMMON}
-	app-arch/xz-utils
-	kernel_linux? ( virtual/linux-sources )
-"
-RDEPEND="
-	${COMMON}
-	acpi? ( sys-power/acpid )
-	tools? ( !media-video/nvidia-settings )
-	X? (
-		<x11-base/xorg-server-1.18.99:=
-		>=x11-libs/libvdpau-0.3-r1
-		multilib? (
-			>=x11-libs/libX11-1.6.2[abi_x86_32]
-			>=x11-libs/libXext-1.3.2[abi_x86_32]
-		)
-	)
-"
-
-QA_PREBUILT="opt/* usr/lib*"
-
-S=${WORKDIR}/
-
-pkg_pretend() {
-	if use amd64 && has_multilib_profile && \
-		[ "${DEFAULT_ABI}" != "amd64" ]; then
-		eerror "This ebuild doesn't currently support changing your default ABI"
-		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
-	fi
-
-	if use kernel_linux && kernel_is ge 4 3; then
-		ewarn "Gentoo supports kernels which are supported by NVIDIA"
-		ewarn "which are limited to the following kernels:"
-		ewarn "<sys-kernel/gentoo-sources-4.3"
-		ewarn "<sys-kernel/vanilla-sources-4.3"
-		ewarn ""
-		ewarn "You are free to utilize epatch_user to provide whatever"
-		ewarn "support you feel is appropriate, but will not receive"
-		ewarn "support as a result of those changes."
-		ewarn ""
-		ewarn "Do not file a bug report about this."
-	fi
-
-	# Since Nvidia ships many different series of drivers, we need to give the user
-	# some kind of guidance as to what version they should install. This tries
-	# to point the user in the right direction but can't be perfect. check
-	# nvidia-driver.eclass
-	nvidia-driver-check-warning
-
-	# Kernel features/options to check for
-	CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
-	use x86 && CONFIG_CHECK+=" ~HIGHMEM"
-
-	# Now do the above checks
-	use kernel_linux && check_extra_config
-}
-
-pkg_setup() {
-	# try to turn off distcc and ccache for people that have a problem with it
-	export DISTCC_DISABLE=1
-	export CCACHE_DISABLE=1
-
-	if use kernel_linux; then
-		MODULE_NAMES="nvidia(video:${S}/kernel)"
-		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel/uvm)"
-
-		# This needs to run after MODULE_NAMES (so that the eclass checks
-		# whether the kernel supports loadable modules) but before BUILD_PARAMS
-		# is set (so that KV_DIR is populated).
-		linux-mod_pkg_setup
-
-		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
-		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC)"
-
-		# linux-mod_src_compile calls set_arch_to_kernel, which
-		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
-		# expects x86_64 or i386 and then converts it to x86
-		# later on in the build process
-		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
-	fi
-
-	# set variables to where files are in the package structure
-	if use kernel_FreeBSD; then
-		use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
-		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
-		NV_DOC="${S}/doc"
-		NV_OBJ="${S}/obj"
-		NV_SRC="${S}/src"
-		NV_MAN="${S}/x11/man"
-		NV_X11="${S}/obj"
-		NV_SOVER=1
-	elif use kernel_linux; then
-		NV_DOC="${S}"
-		NV_OBJ="${S}"
-		NV_SRC="${S}/kernel"
-		NV_MAN="${S}"
-		NV_X11="${S}"
-		NV_SOVER=${PV}
-	else
-		die "Could not determine proper NVIDIA package"
-	fi
-}
-
-src_prepare() {
-	# Please add a brief description for every added patch
-
-	if use kernel_linux; then
-		if kernel_is lt 2 6 9 ; then
-			eerror "You must build this against 2.6.9 or higher kernels."
-		fi
-
-		# If greater than 2.6.5 use M= instead of SUBDIR=
-#		convert_to_m "${NV_SRC}"/Makefile.kbuild
-	fi
-
-	if use pax_kernel; then
-		ewarn "Using PAX patches is not supported. You will be asked to"
-		ewarn "use a standard kernel should you have issues. Should you"
-		ewarn "need support with these patches, contact the PaX team."
-		epatch "${FILESDIR}"/${PN}-346.16-pax-usercopy.patch
-		epatch "${FILESDIR}"/${PN}-346.16-pax-constify.patch
-	fi
-
-	# Allow user patches so they can support RC kernels and whatever else
-	epatch_user
-}
-
-src_compile() {
-	# This is already the default on Linux, as there's no toplevel Makefile, but
-	# on FreeBSD there's one and triggers the kernel module build, as we install
-	# it by itself, pass this.
-
-	cd "${NV_SRC}"
-	if use kernel_FreeBSD; then
-		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
-			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
-	elif use kernel_linux; then
-		MAKEOPTS=-j1
-		linux-mod_src_compile
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			AR="$(tc-getAR)" \
-			CC="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			RANLIB="$(tc-getRANLIB)" \
-			build-xnvctrl
-
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			CC="$(tc-getCC)" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LD="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			NVML_ENABLED=0 \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			NV_VERBOSE=1 \
-			STRIP_CMD=true
-	fi
-}
-
-# Install nvidia library:
-# the first parameter is the library to install
-# the second parameter is the provided soversion
-# the third parameter is the target directory if its not /usr/lib
-donvidia() {
-	# Full path to library minus SOVER
-	MY_LIB="$1"
-
-	# SOVER to use
-	MY_SOVER="$2"
-
-	# Where to install
-	MY_DEST="$3"
-
-	if [[ -z "${MY_DEST}" ]]; then
-		MY_DEST="/usr/$(get_libdir)"
-		action="dolib.so"
-	else
-		exeinto ${MY_DEST}
-		action="doexe"
-	fi
-
-	# Get just the library name
-	libname=$(basename $1)
-
-	# Install the library with the correct SOVER
-	${action} ${MY_LIB}.${MY_SOVER} || \
-		die "failed to install ${libname}"
-
-	# If SOVER wasn't 1, then we need to create a .1 symlink
-	if [[ "${MY_SOVER}" != "1" ]]; then
-		dosym ${libname}.${MY_SOVER} \
-			${MY_DEST}/${libname}.1 || \
-			die "failed to create ${libname} symlink"
-	fi
-
-	# Always create the symlink from the raw lib to the .1
-	dosym ${libname}.1 \
-		${MY_DEST}/${libname} || \
-		die "failed to create ${libname} symlink"
-}
-
-src_install() {
-	if use kernel_linux; then
-		linux-mod_src_install
-
-		# Add the aliases
-		# This file is tweaked with the appropriate video group in
-		# pkg_preinst, see bug #491414
-		insinto /etc/modprobe.d
-		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
-		use uvm && doins "${FILESDIR}"/nvidia-uvm.conf
-
-		# Ensures that our device nodes are created when not using X
-		exeinto "$(get_udevdir)"
-		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
-		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
-	elif use kernel_FreeBSD; then
-		if use x86-fbsd; then
-			insinto /boot/modules
-			doins "${S}/src/nvidia.kld"
-		fi
-
-		exeinto /boot/modules
-		doexe "${S}/src/nvidia.ko"
-	fi
-
-	# NVIDIA kernel <-> userspace driver config lib
-	donvidia ${NV_OBJ}/libnvidia-cfg.so ${NV_SOVER}
-
-	# NVIDIA framebuffer capture library
-	donvidia ${NV_OBJ}/libnvidia-fbc.so ${NV_SOVER}
-
-	# NVIDIA video encode/decode <-> CUDA
-	if use kernel_linux; then
-		donvidia ${NV_OBJ}/libnvcuvid.so ${NV_SOVER}
-		donvidia ${NV_OBJ}/libnvidia-encode.so ${NV_SOVER}
-	fi
-
-	if use X; then
-		# Xorg DDX driver
-		insinto /usr/$(get_libdir)/xorg/modules/drivers
-		doins ${NV_X11}/nvidia_drv.so
-
-		# Xorg GLX driver
-		donvidia ${NV_X11}/libglx.so ${NV_SOVER} \
-			/usr/$(get_libdir)/opengl/nvidia/extensions
-
-		# Xorg nvidia.conf
-		if has_version '>=x11-base/xorg-server-1.16'; then
-			insinto /usr/share/X11/xorg.conf.d
-			newins {,50-}nvidia-drm-outputclass.conf
-		fi
-	fi
-
-	# OpenCL ICD for NVIDIA
-	if use kernel_linux; then
-		insinto /etc/OpenCL/vendors
-		doins ${NV_OBJ}/nvidia.icd
-	fi
-
-	# Documentation
-	dohtml ${NV_DOC}/html/*
-	if use kernel_FreeBSD; then
-		dodoc "${NV_DOC}/README"
-		use X && doman "${NV_MAN}/nvidia-xconfig.1"
-		use tools && doman "${NV_MAN}/nvidia-settings.1"
-	else
-		# Docs
-		newdoc "${NV_DOC}/README.txt" README
-		dodoc "${NV_DOC}/NVIDIA_Changelog"
-		doman "${NV_MAN}/nvidia-smi.1.gz"
-		use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
-		use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
-		doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
-	fi
-
-	# Helper Apps
-	exeinto /opt/bin/
-
-	if use X; then
-		doexe ${NV_OBJ}/nvidia-xconfig
-	fi
-
-	if use kernel_linux ; then
-		doexe ${NV_OBJ}/nvidia-cuda-mps-control
-		doexe ${NV_OBJ}/nvidia-cuda-mps-server
-		doexe ${NV_OBJ}/nvidia-debugdump
-		doexe ${NV_OBJ}/nvidia-persistenced
-		doexe ${NV_OBJ}/nvidia-smi
-
-		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
-		doexe ${NV_OBJ}/nvidia-modprobe
-		fowners root:video /opt/bin/nvidia-modprobe
-		fperms 4710 /opt/bin/nvidia-modprobe
-		dosym /{opt,usr}/bin/nvidia-modprobe
-
-		doman nvidia-cuda-mps-control.1.gz
-		doman nvidia-modprobe.1.gz
-		doman nvidia-persistenced.1.gz
-		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
-		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
-		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src/ \
-			DESTDIR="${D}" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LIBDIR="${D}/usr/$(get_libdir)" \
-			PREFIX=/usr \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			install
-
-		if use static-libs; then
-			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
-
-			insinto /usr/include/NVCtrl
-			doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
-		fi
-
-		insinto /usr/share/nvidia/
-		doins nvidia-application-profiles-${PV}-key-documentation
-
-		insinto /etc/nvidia
-		newins \
-			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
-
-		# There is no icon in the FreeBSD tarball.
-		use kernel_FreeBSD || \
-			doicon ${NV_OBJ}/nvidia-settings.png
-
-		domenu "${FILESDIR}"/nvidia-settings.desktop
-
-		exeinto /etc/X11/xinit/xinitrc.d
-		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
-	fi
-
-	dobin ${NV_OBJ}/nvidia-bug-report.sh
-
-	if has_multilib_profile && use multilib ; then
-		local OABI=${ABI}
-		for ABI in $(get_install_abis) ; do
-			src_install-libs
-		done
-		ABI=${OABI}
-		unset OABI
-	else
-		src_install-libs
-	fi
-
-	is_final_abi || die "failed to iterate through all ABIs"
-
-	readme.gentoo_create_doc
-}
-
-src_install-libs() {
-	local inslibdir=$(get_libdir)
-	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
-	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
-	local libdir=${NV_OBJ}
-
-	if use kernel_linux && has_multilib_profile && \
-			[[ ${ABI} == "x86" ]] ; then
-		libdir=${NV_OBJ}/32
-	fi
-
-	if use X; then
-		# The GLX libraries
-		donvidia ${libdir}/libEGL.so ${NV_SOVER} ${GL_ROOT}
-		donvidia ${libdir}/libGL.so ${NV_SOVER} ${GL_ROOT}
-		donvidia ${libdir}/libGLESv1_CM.so ${NV_SOVER} ${GL_ROOT}
-		donvidia ${libdir}/libnvidia-eglcore.so ${NV_SOVER}
-		donvidia ${libdir}/libnvidia-glcore.so ${NV_SOVER}
-		donvidia ${libdir}/libnvidia-glsi.so ${NV_SOVER}
-		donvidia ${libdir}/libnvidia-ifr.so ${NV_SOVER}
-		if use kernel_FreeBSD; then
-			donvidia ${libdir}/libnvidia-tls.so ${NV_SOVER}
-		else
-			donvidia ${libdir}/tls/libnvidia-tls.so ${NV_SOVER}
-		fi
-
-		# VDPAU
-		donvidia ${libdir}/libvdpau_nvidia.so ${NV_SOVER}
-
-		# GLES v2 libraries
-		insinto ${GL_ROOT}
-		doexe ${libdir}/libGLESv2.so.${PV}
-		dosym libGLESv2.so.${PV} ${GL_ROOT}/libGLESv2.so.2
-		dosym libGLESv2.so.2 ${GL_ROOT}/libGLESv2.so
-	fi
-
-	# NVIDIA monitoring library
-	if use kernel_linux ; then
-		donvidia ${libdir}/libnvidia-ml.so ${NV_SOVER}
-	fi
-
-	# CUDA & OpenCL
-	if use kernel_linux; then
-		donvidia ${libdir}/libcuda.so ${NV_SOVER}
-		donvidia ${libdir}/libnvidia-compiler.so ${NV_SOVER}
-		donvidia ${libdir}/libOpenCL.so 1.0.0 ${CL_ROOT}
-		donvidia ${libdir}/libnvidia-opencl.so ${NV_SOVER}
-	fi
-}
-
-pkg_preinst() {
-	if use kernel_linux; then
-		linux-mod_pkg_preinst
-
-		local videogroup="$(egetent group video | cut -d ':' -f 3)"
-		if [ -z "${videogroup}" ]; then
-			eerror "Failed to determine the video group gid"
-			die "Failed to determine the video group gid"
-		else
-			sed -i \
-				-e "s:PACKAGE:${PF}:g" \
-				-e "s:VIDEOGID:${videogroup}:" \
-				"${D}"/etc/modprobe.d/nvidia.conf || die
-		fi
-	fi
-
-	# Clean the dynamic libGL stuff's home to ensure
-	# we dont have stale libs floating around
-	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ] ; then
-		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
-	fi
-	# Make sure we nuke the old nvidia-glx's env.d file
-	if [ -e "${ROOT}"/etc/env.d/09nvidia ] ; then
-		rm -f "${ROOT}"/etc/env.d/09nvidia
-	fi
-}
-
-pkg_postinst() {
-	use kernel_linux && linux-mod_pkg_postinst
-
-	# Switch to the nvidia implementation
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
-	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
-
-	readme.gentoo_print_elog
-
-	if ! use X; then
-		elog "You have elected to not install the X.org driver. Along with"
-		elog "this the OpenGL libraries and VDPAU libraries were not"
-		elog "installed. Additionally, once the driver is loaded your card"
-		elog "and fan will run at max speed which may not be desirable."
-		elog "Use the 'nvidia-smi' init script to have your card and fan"
-		elog "speed scale appropriately."
-		elog
-	fi
-	if ! use tools; then
-		elog "USE=tools controls whether the nvidia-settings application"
-		elog "is installed. If you would like to use it, enable that"
-		elog "flag and re-emerge this ebuild. Optionally you can install"
-		elog "media-video/nvidia-settings"
-		elog
-	fi
-}
-
-pkg_prerm() {
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}
-
-pkg_postrm() {
-	use kernel_linux && linux-mod_pkg_postrm
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-346.96-r7.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-346.96-r7.ebuild
deleted file mode 100644
index 5fca7a1b697..00000000000
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-346.96-r7.ebuild
+++ /dev/null
@@ -1,528 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-
-inherit eutils flag-o-matic linux-info linux-mod multilib-minimal nvidia-driver \
-	portability toolchain-funcs unpacker user udev
-
-NV_URI="http://us.download.nvidia.com/XFree86/"
-X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
-AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
-X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
-AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
-
-DESCRIPTION="NVIDIA Accelerated Graphics Driver"
-HOMEPAGE="http://www.nvidia.com/ http://www.nvidia.com/Download/Find.aspx"
-SRC_URI="
-	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
-	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
-	x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
-	x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
-	tools? ( ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2 )
-"
-
-LICENSE="GPL-2 NVIDIA-r2"
-SLOT="0/${PV%.*}"
-KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
-RESTRICT="bindist mirror"
-EMULTILIB_PKG="true"
-
-IUSE="acpi gtk3 kernel_FreeBSD kernel_linux multilib pax_kernel static-libs +tools uvm +X"
-REQUIRED_USE="
-	tools? ( X )
-	static-libs? ( tools )
-"
-
-COMMON="
-	app-eselect/eselect-opencl
-	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
-	tools? (
-		dev-libs/atk
-		dev-libs/glib:2
-		dev-libs/jansson
-		gtk3? (
-			x11-libs/gtk+:3
-		)
-		x11-libs/cairo
-		x11-libs/gdk-pixbuf[X]
-		x11-libs/gtk+:2
-		x11-libs/libX11
-		x11-libs/libXext
-		x11-libs/libXrandr
-		x11-libs/libXv
-		x11-libs/libXxf86vm
-		x11-libs/pango[X]
-	)
-	X? (
-		>=app-eselect/eselect-opengl-1.0.9
-	)
-"
-DEPEND="
-	${COMMON}
-	app-arch/xz-utils
-	kernel_linux? ( virtual/linux-sources )
-"
-RDEPEND="
-	${COMMON}
-	acpi? ( sys-power/acpid )
-	tools? ( !media-video/nvidia-settings )
-	X? (
-		<x11-base/xorg-server-1.18.99:=
-		>=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
-		>=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
-		>=x11-libs/libvdpau-0.3-r1[${MULTILIB_USEDEP}]
-		sys-libs/zlib[${MULTILIB_USEDEP}]
-	)
-"
-
-QA_PREBUILT="opt/* usr/lib*"
-
-S=${WORKDIR}/
-
-pkg_pretend() {
-	if use amd64 && has_multilib_profile && \
-		[ "${DEFAULT_ABI}" != "amd64" ]; then
-		eerror "This ebuild doesn't currently support changing your default ABI"
-		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
-	fi
-
-	if use kernel_linux && kernel_is ge 4 3; then
-		ewarn "Gentoo supports kernels which are supported by NVIDIA"
-		ewarn "which are limited to the following kernels:"
-		ewarn "<sys-kernel/gentoo-sources-4.3"
-		ewarn "<sys-kernel/vanilla-sources-4.3"
-		ewarn ""
-		ewarn "You are free to utilize epatch_user to provide whatever"
-		ewarn "support you feel is appropriate, but will not receive"
-		ewarn "support as a result of those changes."
-		ewarn ""
-		ewarn "Do not file a bug report about this."
-	fi
-
-	# Since Nvidia ships many different series of drivers, we need to give the user
-	# some kind of guidance as to what version they should install. This tries
-	# to point the user in the right direction but can't be perfect. check
-	# nvidia-driver.eclass
-	nvidia-driver-check-warning
-
-	# Kernel features/options to check for
-	CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
-	use x86 && CONFIG_CHECK+=" ~HIGHMEM"
-
-	# Now do the above checks
-	use kernel_linux && check_extra_config
-}
-
-pkg_setup() {
-	# try to turn off distcc and ccache for people that have a problem with it
-	export DISTCC_DISABLE=1
-	export CCACHE_DISABLE=1
-
-	if use kernel_linux; then
-		MODULE_NAMES="nvidia(video:${S}/kernel)"
-		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel/uvm)"
-
-		# This needs to run after MODULE_NAMES (so that the eclass checks
-		# whether the kernel supports loadable modules) but before BUILD_PARAMS
-		# is set (so that KV_DIR is populated).
-		linux-mod_pkg_setup
-
-		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
-		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC)"
-
-		# linux-mod_src_compile calls set_arch_to_kernel, which
-		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
-		# expects x86_64 or i386 and then converts it to x86
-		# later on in the build process
-		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
-	fi
-
-	# set variables to where files are in the package structure
-	if use kernel_FreeBSD; then
-		use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
-		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
-		NV_DOC="${S}/doc"
-		NV_OBJ="${S}/obj"
-		NV_SRC="${S}/src"
-		NV_MAN="${S}/x11/man"
-		NV_X11="${S}/obj"
-		NV_SOVER=1
-	elif use kernel_linux; then
-		NV_DOC="${S}"
-		NV_OBJ="${S}"
-		NV_SRC="${S}/kernel"
-		NV_MAN="${S}"
-		NV_X11="${S}"
-		NV_SOVER=${PV}
-	else
-		die "Could not determine proper NVIDIA package"
-	fi
-}
-
-src_prepare() {
-	# Please add a brief description for every added patch
-
-	if use kernel_linux; then
-		if kernel_is lt 2 6 9 ; then
-			eerror "You must build this against 2.6.9 or higher kernels."
-		fi
-
-		# If greater than 2.6.5 use M= instead of SUBDIR=
-#		convert_to_m "${NV_SRC}"/Makefile.kbuild
-	fi
-
-	if use pax_kernel; then
-		ewarn "Using PAX patches is not supported. You will be asked to"
-		ewarn "use a standard kernel should you have issues. Should you"
-		ewarn "need support with these patches, contact the PaX team."
-		epatch "${FILESDIR}"/${PN}-346.16-pax-usercopy.patch
-		epatch "${FILESDIR}"/${PN}-346.16-pax-constify.patch
-	fi
-
-	# Allow user patches so they can support RC kernels and whatever else
-	epatch_user
-}
-
-src_compile() {
-	# This is already the default on Linux, as there's no toplevel Makefile, but
-	# on FreeBSD there's one and triggers the kernel module build, as we install
-	# it by itself, pass this.
-
-	cd "${NV_SRC}"
-	if use kernel_FreeBSD; then
-		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
-			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
-	elif use kernel_linux; then
-		MAKEOPTS=-j1
-		linux-mod_src_compile
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			AR="$(tc-getAR)" \
-			CC="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			RANLIB="$(tc-getRANLIB)" \
-			build-xnvctrl
-
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			CC="$(tc-getCC)" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LD="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			NVML_ENABLED=0 \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			NV_VERBOSE=1 \
-			STRIP_CMD=true
-	fi
-}
-
-# Install nvidia library:
-# the first parameter is the library to install
-# the second parameter is the provided soversion
-# the third parameter is the target directory if its not /usr/lib
-donvidia() {
-	# Full path to library minus SOVER
-	MY_LIB="$1"
-
-	# SOVER to use
-	MY_SOVER="$2"
-
-	# Where to install
-	MY_DEST="$3"
-
-	if [[ -z "${MY_DEST}" ]]; then
-		MY_DEST="/usr/$(get_libdir)"
-		action="dolib.so"
-	else
-		exeinto ${MY_DEST}
-		action="doexe"
-	fi
-
-	# Get just the library name
-	libname=$(basename $1)
-
-	# Install the library with the correct SOVER
-	${action} ${MY_LIB}.${MY_SOVER} || \
-		die "failed to install ${libname}"
-
-	# If SOVER wasn't 1, then we need to create a .1 symlink
-	if [[ "${MY_SOVER}" != "1" ]]; then
-		dosym ${libname}.${MY_SOVER} \
-			${MY_DEST}/${libname}.1 || \
-			die "failed to create ${libname} symlink"
-	fi
-
-	# Always create the symlink from the raw lib to the .1
-	dosym ${libname}.1 \
-		${MY_DEST}/${libname} || \
-		die "failed to create ${libname} symlink"
-}
-
-src_install() {
-	if use kernel_linux; then
-		linux-mod_src_install
-
-		# Add the aliases
-		# This file is tweaked with the appropriate video group in
-		# pkg_preinst, see bug #491414
-		insinto /etc/modprobe.d
-		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
-		use uvm && doins "${FILESDIR}"/nvidia-uvm.conf
-
-		# Ensures that our device nodes are created when not using X
-		exeinto "$(get_udevdir)"
-		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
-		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
-	elif use kernel_FreeBSD; then
-		if use x86-fbsd; then
-			insinto /boot/modules
-			doins "${S}/src/nvidia.kld"
-		fi
-
-		exeinto /boot/modules
-		doexe "${S}/src/nvidia.ko"
-	fi
-
-	# NVIDIA kernel <-> userspace driver config lib
-	donvidia ${NV_OBJ}/libnvidia-cfg.so ${NV_SOVER}
-
-	# NVIDIA framebuffer capture library
-	donvidia ${NV_OBJ}/libnvidia-fbc.so ${NV_SOVER}
-
-	# NVIDIA video encode/decode <-> CUDA
-	if use kernel_linux; then
-		donvidia ${NV_OBJ}/libnvcuvid.so ${NV_SOVER}
-		donvidia ${NV_OBJ}/libnvidia-encode.so ${NV_SOVER}
-	fi
-
-	if use X; then
-		# Xorg DDX driver
-		insinto /usr/$(get_libdir)/xorg/modules/drivers
-		doins ${NV_X11}/nvidia_drv.so
-
-		# Xorg GLX driver
-		donvidia ${NV_X11}/libglx.so ${NV_SOVER} \
-			/usr/$(get_libdir)/opengl/nvidia/extensions
-
-		# Xorg nvidia.conf
-		if has_version '>=x11-base/xorg-server-1.16'; then
-			insinto /usr/share/X11/xorg.conf.d
-			newins {,50-}nvidia-drm-outputclass.conf
-		fi
-	fi
-
-	# OpenCL ICD for NVIDIA
-	if use kernel_linux; then
-		insinto /etc/OpenCL/vendors
-		doins ${NV_OBJ}/nvidia.icd
-	fi
-
-	# Documentation
-	dohtml ${NV_DOC}/html/*
-	if use kernel_FreeBSD; then
-		dodoc "${NV_DOC}/README"
-		use X && doman "${NV_MAN}/nvidia-xconfig.1"
-		use tools && doman "${NV_MAN}/nvidia-settings.1"
-	else
-		# Docs
-		newdoc "${NV_DOC}/README.txt" README
-		dodoc "${NV_DOC}/NVIDIA_Changelog"
-		doman "${NV_MAN}/nvidia-smi.1.gz"
-		use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
-		use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
-		doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
-	fi
-
-	# Helper Apps
-	exeinto /opt/bin/
-
-	if use X; then
-		doexe ${NV_OBJ}/nvidia-xconfig
-	fi
-
-	if use kernel_linux ; then
-		doexe ${NV_OBJ}/nvidia-cuda-mps-control
-		doexe ${NV_OBJ}/nvidia-cuda-mps-server
-		doexe ${NV_OBJ}/nvidia-debugdump
-		doexe ${NV_OBJ}/nvidia-persistenced
-		doexe ${NV_OBJ}/nvidia-smi
-
-		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
-		doexe ${NV_OBJ}/nvidia-modprobe
-		fowners root:video /opt/bin/nvidia-modprobe
-		fperms 4710 /opt/bin/nvidia-modprobe
-		dosym /{opt,usr}/bin/nvidia-modprobe
-
-		doman nvidia-cuda-mps-control.1.gz
-		doman nvidia-modprobe.1.gz
-		doman nvidia-persistenced.1.gz
-		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
-		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
-		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src/ \
-			DESTDIR="${D}" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LIBDIR="${D}/usr/$(get_libdir)" \
-			PREFIX=/usr \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			install
-
-		if use static-libs; then
-			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
-
-			insinto /usr/include/NVCtrl
-			doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
-		fi
-
-		insinto /usr/share/nvidia/
-		doins nvidia-application-profiles-${PV}-key-documentation
-
-		insinto /etc/nvidia
-		newins \
-			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
-
-		# There is no icon in the FreeBSD tarball.
-		use kernel_FreeBSD || \
-			doicon ${NV_OBJ}/nvidia-settings.png
-
-		domenu "${FILESDIR}"/nvidia-settings.desktop
-
-		exeinto /etc/X11/xinit/xinitrc.d
-		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
-	fi
-
-	dobin ${NV_OBJ}/nvidia-bug-report.sh
-
-	if has_multilib_profile && use multilib ; then
-		local OABI=${ABI}
-		for ABI in $(get_install_abis) ; do
-			src_install-libs
-		done
-		ABI=${OABI}
-		unset OABI
-	else
-		src_install-libs
-	fi
-
-	is_final_abi || die "failed to iterate through all ABIs"
-
-	readme.gentoo_create_doc
-}
-
-src_install-libs() {
-	local inslibdir=$(get_libdir)
-	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
-	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
-	local libdir=${NV_OBJ}
-
-	if use kernel_linux && has_multilib_profile && \
-			[[ ${ABI} == "x86" ]] ; then
-		libdir=${NV_OBJ}/32
-	fi
-
-	if use X; then
-		# The GLX libraries
-		donvidia ${libdir}/libEGL.so ${NV_SOVER} ${GL_ROOT}
-		donvidia ${libdir}/libGL.so ${NV_SOVER} ${GL_ROOT}
-		donvidia ${libdir}/libGLESv1_CM.so ${NV_SOVER} ${GL_ROOT}
-		donvidia ${libdir}/libnvidia-eglcore.so ${NV_SOVER}
-		donvidia ${libdir}/libnvidia-glcore.so ${NV_SOVER}
-		donvidia ${libdir}/libnvidia-glsi.so ${NV_SOVER}
-		donvidia ${libdir}/libnvidia-ifr.so ${NV_SOVER}
-		if use kernel_FreeBSD; then
-			donvidia ${libdir}/libnvidia-tls.so ${NV_SOVER}
-		else
-			donvidia ${libdir}/tls/libnvidia-tls.so ${NV_SOVER}
-		fi
-
-		# VDPAU
-		donvidia ${libdir}/libvdpau_nvidia.so ${NV_SOVER}
-
-		# GLES v2 libraries
-		insinto ${GL_ROOT}
-		doexe ${libdir}/libGLESv2.so.${PV}
-		dosym libGLESv2.so.${PV} ${GL_ROOT}/libGLESv2.so.2
-		dosym libGLESv2.so.2 ${GL_ROOT}/libGLESv2.so
-	fi
-
-	# NVIDIA monitoring library
-	if use kernel_linux ; then
-		donvidia ${libdir}/libnvidia-ml.so ${NV_SOVER}
-	fi
-
-	# CUDA & OpenCL
-	if use kernel_linux; then
-		donvidia ${libdir}/libcuda.so ${NV_SOVER}
-		donvidia ${libdir}/libnvidia-compiler.so ${NV_SOVER}
-		donvidia ${libdir}/libOpenCL.so 1.0.0 ${CL_ROOT}
-		donvidia ${libdir}/libnvidia-opencl.so ${NV_SOVER}
-	fi
-}
-
-pkg_preinst() {
-	if use kernel_linux; then
-		linux-mod_pkg_preinst
-
-		local videogroup="$(egetent group video | cut -d ':' -f 3)"
-		if [ -z "${videogroup}" ]; then
-			eerror "Failed to determine the video group gid"
-			die "Failed to determine the video group gid"
-		else
-			sed -i \
-				-e "s:PACKAGE:${PF}:g" \
-				-e "s:VIDEOGID:${videogroup}:" \
-				"${D}"/etc/modprobe.d/nvidia.conf || die
-		fi
-	fi
-
-	# Clean the dynamic libGL stuff's home to ensure
-	# we dont have stale libs floating around
-	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ] ; then
-		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
-	fi
-	# Make sure we nuke the old nvidia-glx's env.d file
-	if [ -e "${ROOT}"/etc/env.d/09nvidia ] ; then
-		rm -f "${ROOT}"/etc/env.d/09nvidia
-	fi
-}
-
-pkg_postinst() {
-	use kernel_linux && linux-mod_pkg_postinst
-
-	# Switch to the nvidia implementation
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
-	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
-
-	readme.gentoo_print_elog
-
-	if ! use X; then
-		elog "You have elected to not install the X.org driver. Along with"
-		elog "this the OpenGL libraries and VDPAU libraries were not"
-		elog "installed. Additionally, once the driver is loaded your card"
-		elog "and fan will run at max speed which may not be desirable."
-		elog "Use the 'nvidia-smi' init script to have your card and fan"
-		elog "speed scale appropriately."
-		elog
-	fi
-	if ! use tools; then
-		elog "USE=tools controls whether the nvidia-settings application"
-		elog "is installed. If you would like to use it, enable that"
-		elog "flag and re-emerge this ebuild. Optionally you can install"
-		elog "media-video/nvidia-settings"
-		elog
-	fi
-}
-
-pkg_prerm() {
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}
-
-pkg_postrm() {
-	use kernel_linux && linux-mod_pkg_postrm
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-352.79-r4.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-352.79-r4.ebuild
deleted file mode 100644
index dd5ab2bf43c..00000000000
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-352.79-r4.ebuild
+++ /dev/null
@@ -1,526 +0,0 @@
-# Copyright 1999-2016 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-
-inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \
-	portability toolchain-funcs unpacker user udev
-
-NV_URI="http://us.download.nvidia.com/XFree86/"
-X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
-AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
-X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
-AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
-
-DESCRIPTION="NVIDIA Accelerated Graphics Driver"
-HOMEPAGE="http://www.nvidia.com/ http://www.nvidia.com/Download/Find.aspx"
-SRC_URI="
-	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
-	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
-	x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
-	x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
-	tools? ( ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2 )
-"
-
-LICENSE="GPL-2 NVIDIA-r2"
-SLOT="0/${PV%.*}"
-KEYWORDS="-* amd64 x86 ~amd64-fbsd ~x86-fbsd"
-RESTRICT="bindist mirror"
-EMULTILIB_PKG="true"
-
-IUSE="acpi gtk3 multilib kernel_FreeBSD kernel_linux pax_kernel static-libs +tools +X uvm"
-REQUIRED_USE="
-	tools? ( X )
-	static-libs? ( tools )
-"
-
-COMMON="
-	app-eselect/eselect-opencl
-	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
-	tools? (
-		dev-libs/atk
-		dev-libs/glib:2
-		dev-libs/jansson
-		gtk3? (
-			x11-libs/gtk+:3
-		)
-		x11-libs/cairo
-		x11-libs/gdk-pixbuf[X]
-		x11-libs/gtk+:2
-		x11-libs/libX11
-		x11-libs/libXext
-		x11-libs/libXrandr
-		x11-libs/libXv
-		x11-libs/libXxf86vm
-		x11-libs/pango[X]
-	)
-	X? (
-		>=app-eselect/eselect-opengl-1.0.9
-	)
-"
-DEPEND="
-	${COMMON}
-	kernel_linux? ( virtual/linux-sources )
-"
-RDEPEND="
-	${COMMON}
-	acpi? ( sys-power/acpid )
-	tools? ( !media-video/nvidia-settings )
-	X? (
-		<x11-base/xorg-server-1.18.99:=
-		>=x11-libs/libvdpau-1.0
-		multilib? (
-			>=x11-libs/libX11-1.6.2[abi_x86_32]
-			>=x11-libs/libXext-1.3.2[abi_x86_32]
-		)
-	)
-"
-
-QA_PREBUILT="opt/* usr/lib*"
-
-S=${WORKDIR}/
-
-pkg_pretend() {
-	if use amd64 && has_multilib_profile && \
-		[ "${DEFAULT_ABI}" != "amd64" ]; then
-		eerror "This ebuild doesn't currently support changing your default ABI"
-		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
-	fi
-
-	if use kernel_linux && kernel_is ge 4 4; then
-		ewarn "Gentoo supports kernels which are supported by NVIDIA"
-		ewarn "which are limited to the following kernels:"
-		ewarn "<sys-kernel/gentoo-sources-4.4"
-		ewarn "<sys-kernel/vanilla-sources-4.4"
-		ewarn ""
-		ewarn "You are free to utilize epatch_user to provide whatever"
-		ewarn "support you feel is appropriate, but will not receive"
-		ewarn "support as a result of those changes."
-		ewarn ""
-		ewarn "Do not file a bug report about this."
-		ewarn ""
-	fi
-
-	# Since Nvidia ships many different series of drivers, we need to give the user
-	# some kind of guidance as to what version they should install. This tries
-	# to point the user in the right direction but can't be perfect. check
-	# nvidia-driver.eclass
-	nvidia-driver-check-warning
-
-	# Kernel features/options to check for
-	CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
-	use x86 && CONFIG_CHECK+=" ~HIGHMEM"
-
-	# Now do the above checks
-	use kernel_linux && check_extra_config
-}
-
-pkg_setup() {
-	# try to turn off distcc and ccache for people that have a problem with it
-	export DISTCC_DISABLE=1
-	export CCACHE_DISABLE=1
-
-	if use kernel_linux; then
-		MODULE_NAMES="nvidia(video:${S}/kernel)"
-		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel/uvm)"
-
-		# This needs to run after MODULE_NAMES (so that the eclass checks
-		# whether the kernel supports loadable modules) but before BUILD_PARAMS
-		# is set (so that KV_DIR is populated).
-		linux-mod_pkg_setup
-
-		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
-		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC)"
-
-		# linux-mod_src_compile calls set_arch_to_kernel, which
-		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
-		# expects x86_64 or i386 and then converts it to x86
-		# later on in the build process
-		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
-	fi
-
-	# set variables to where files are in the package structure
-	if use kernel_FreeBSD; then
-		use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
-		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
-		NV_DOC="${S}/doc"
-		NV_OBJ="${S}/obj"
-		NV_SRC="${S}/src"
-		NV_MAN="${S}/x11/man"
-		NV_X11="${S}/obj"
-		NV_SOVER=1
-	elif use kernel_linux; then
-		NV_DOC="${S}"
-		NV_OBJ="${S}"
-		NV_SRC="${S}/kernel"
-		NV_MAN="${S}"
-		NV_X11="${S}"
-		NV_SOVER=${PV}
-	else
-		die "Could not determine proper NVIDIA package"
-	fi
-}
-
-src_prepare() {
-	# Please add a brief description for every added patch
-
-	if use kernel_linux; then
-		if kernel_is lt 2 6 9 ; then
-			eerror "You must build this against 2.6.9 or higher kernels."
-		fi
-
-		# If greater than 2.6.5 use M= instead of SUBDIR=
-#		convert_to_m "${NV_SRC}"/Makefile.kbuild
-	fi
-
-	if use pax_kernel; then
-		ewarn "Using PAX patches is not supported. You will be asked to"
-		ewarn "use a standard kernel should you have issues. Should you"
-		ewarn "need support with these patches, contact the PaX team."
-		epatch "${FILESDIR}"/${PN}-346.16-pax-usercopy.patch
-		epatch "${FILESDIR}"/${PN}-346.16-pax-constify.patch
-	fi
-
-	# Allow user patches so they can support RC kernels and whatever else
-	epatch_user
-}
-
-src_compile() {
-	# This is already the default on Linux, as there's no toplevel Makefile, but
-	# on FreeBSD there's one and triggers the kernel module build, as we install
-	# it by itself, pass this.
-
-	cd "${NV_SRC}"
-	if use kernel_FreeBSD; then
-		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
-			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
-	elif use kernel_linux; then
-		MAKEOPTS=-j1
-		linux-mod_src_compile
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			AR="$(tc-getAR)" \
-			CC="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			RANLIB="$(tc-getRANLIB)" \
-			build-xnvctrl
-
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			CC="$(tc-getCC)" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LD="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			NVML_ENABLED=0 \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			NV_VERBOSE=1 \
-			STRIP_CMD=true
-	fi
-}
-
-# Install nvidia library:
-# the first parameter is the library to install
-# the second parameter is the provided soversion
-# the third parameter is the target directory if its not /usr/lib
-donvidia() {
-	# Full path to library minus SOVER
-	MY_LIB="$1"
-
-	# SOVER to use
-	MY_SOVER="$2"
-
-	# Where to install
-	MY_DEST="$3"
-
-	if [[ -z "${MY_DEST}" ]]; then
-		MY_DEST="/usr/$(get_libdir)"
-		action="dolib.so"
-	else
-		exeinto ${MY_DEST}
-		action="doexe"
-	fi
-
-	# Get just the library name
-	libname=$(basename $1)
-
-	# Install the library with the correct SOVER
-	${action} ${MY_LIB}.${MY_SOVER} || \
-		die "failed to install ${libname}"
-
-	# If SOVER wasn't 1, then we need to create a .1 symlink
-	if [[ "${MY_SOVER}" != "1" ]]; then
-		dosym ${libname}.${MY_SOVER} \
-			${MY_DEST}/${libname}.1 || \
-			die "failed to create ${libname} symlink"
-	fi
-
-	# Always create the symlink from the raw lib to the .1
-	dosym ${libname}.1 \
-		${MY_DEST}/${libname} || \
-		die "failed to create ${libname} symlink"
-}
-
-src_install() {
-	if use kernel_linux; then
-		linux-mod_src_install
-
-		# Add the aliases
-		# This file is tweaked with the appropriate video group in
-		# pkg_preinst, see bug #491414
-		insinto /etc/modprobe.d
-		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
-		use uvm && doins "${FILESDIR}"/nvidia-uvm.conf
-
-		# Ensures that our device nodes are created when not using X
-		exeinto "$(get_udevdir)"
-		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
-		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
-	elif use kernel_FreeBSD; then
-		if use x86-fbsd; then
-			insinto /boot/modules
-			doins "${S}/src/nvidia.kld"
-		fi
-
-		exeinto /boot/modules
-		doexe "${S}/src/nvidia.ko"
-	fi
-
-	# NVIDIA kernel <-> userspace driver config lib
-	donvidia ${NV_OBJ}/libnvidia-cfg.so ${NV_SOVER}
-
-	# NVIDIA framebuffer capture library
-	donvidia ${NV_OBJ}/libnvidia-fbc.so ${NV_SOVER}
-
-	# NVIDIA video encode/decode <-> CUDA
-	if use kernel_linux; then
-		donvidia ${NV_OBJ}/libnvcuvid.so ${NV_SOVER}
-		donvidia ${NV_OBJ}/libnvidia-encode.so ${NV_SOVER}
-	fi
-
-	if use X; then
-		# Xorg DDX driver
-		insinto /usr/$(get_libdir)/xorg/modules/drivers
-		doins ${NV_X11}/nvidia_drv.so
-
-		# Xorg GLX driver
-		donvidia ${NV_X11}/libglx.so ${NV_SOVER} \
-			/usr/$(get_libdir)/opengl/nvidia/extensions
-
-		# Xorg nvidia.conf
-		if has_version '>=x11-base/xorg-server-1.16'; then
-			insinto /usr/share/X11/xorg.conf.d
-			newins {,50-}nvidia-drm-outputclass.conf
-		fi
-	fi
-
-	# OpenCL ICD for NVIDIA
-	if use kernel_linux; then
-		insinto /etc/OpenCL/vendors
-		doins ${NV_OBJ}/nvidia.icd
-	fi
-
-	# Documentation
-	dohtml ${NV_DOC}/html/*
-	if use kernel_FreeBSD; then
-		dodoc "${NV_DOC}/README"
-		use X && doman "${NV_MAN}/nvidia-xconfig.1"
-		use tools && doman "${NV_MAN}/nvidia-settings.1"
-	else
-		# Docs
-		newdoc "${NV_DOC}/README.txt" README
-		dodoc "${NV_DOC}/NVIDIA_Changelog"
-		doman "${NV_MAN}/nvidia-smi.1.gz"
-		use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
-		use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
-		doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
-	fi
-
-	# Helper Apps
-	exeinto /opt/bin/
-
-	if use X; then
-		doexe ${NV_OBJ}/nvidia-xconfig
-	fi
-
-	if use kernel_linux ; then
-		doexe ${NV_OBJ}/nvidia-cuda-mps-control
-		doexe ${NV_OBJ}/nvidia-cuda-mps-server
-		doexe ${NV_OBJ}/nvidia-debugdump
-		doexe ${NV_OBJ}/nvidia-persistenced
-		doexe ${NV_OBJ}/nvidia-smi
-
-		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
-		doexe ${NV_OBJ}/nvidia-modprobe
-		fowners root:video /opt/bin/nvidia-modprobe
-		fperms 4710 /opt/bin/nvidia-modprobe
-		dosym /{opt,usr}/bin/nvidia-modprobe
-
-		doman nvidia-cuda-mps-control.1.gz
-		doman nvidia-modprobe.1.gz
-		doman nvidia-persistenced.1.gz
-		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
-		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
-		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src/ \
-			DESTDIR="${D}" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LIBDIR="${D}/usr/$(get_libdir)" \
-			PREFIX=/usr \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			install
-
-		if use static-libs; then
-			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
-
-			insinto /usr/share/nvidia/
-			doins nvidia-application-profiles-${PV}-key-documentation
-		fi
-
-		insinto /etc/nvidia
-		newins \
-			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
-
-		# There is no icon in the FreeBSD tarball.
-		use kernel_FreeBSD || \
-			doicon ${NV_OBJ}/nvidia-settings.png
-
-		domenu "${FILESDIR}"/nvidia-settings.desktop
-
-		exeinto /etc/X11/xinit/xinitrc.d
-		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
-	fi
-
-	dobin ${NV_OBJ}/nvidia-bug-report.sh
-
-	if has_multilib_profile && use multilib ; then
-		local OABI=${ABI}
-		for ABI in $(get_install_abis) ; do
-			src_install-libs
-		done
-		ABI=${OABI}
-		unset OABI
-	else
-		src_install-libs
-	fi
-
-	is_final_abi || die "failed to iterate through all ABIs"
-
-	readme.gentoo_create_doc
-}
-
-src_install-libs() {
-	local inslibdir=$(get_libdir)
-	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
-	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
-	local libdir=${NV_OBJ}
-
-	if use kernel_linux && has_multilib_profile && \
-			[[ ${ABI} == "x86" ]] ; then
-		libdir=${NV_OBJ}/32
-	fi
-
-	if use X; then
-		# The GLX libraries
-		donvidia ${libdir}/libEGL.so ${NV_SOVER} ${GL_ROOT}
-		donvidia ${libdir}/libGL.so ${NV_SOVER} ${GL_ROOT}
-		donvidia ${libdir}/libGLESv1_CM.so ${NV_SOVER} ${GL_ROOT}
-		donvidia ${libdir}/libnvidia-eglcore.so ${NV_SOVER}
-		donvidia ${libdir}/libnvidia-glcore.so ${NV_SOVER}
-		donvidia ${libdir}/libnvidia-glsi.so ${NV_SOVER}
-		donvidia ${libdir}/libnvidia-ifr.so ${NV_SOVER}
-		if use kernel_FreeBSD; then
-			donvidia ${libdir}/libnvidia-tls.so ${NV_SOVER}
-		else
-			donvidia ${libdir}/tls/libnvidia-tls.so ${NV_SOVER}
-		fi
-
-		# VDPAU
-		donvidia ${libdir}/libvdpau_nvidia.so ${NV_SOVER}
-
-		# GLES v2 libraries
-		insinto ${GL_ROOT}
-		doexe ${libdir}/libGLESv2.so.${PV}
-		dosym libGLESv2.so.${PV} ${GL_ROOT}/libGLESv2.so.2
-		dosym libGLESv2.so.2 ${GL_ROOT}/libGLESv2.so
-	fi
-
-	# NVIDIA monitoring library
-	if use kernel_linux ; then
-		donvidia ${libdir}/libnvidia-ml.so ${NV_SOVER}
-	fi
-
-	# CUDA & OpenCL
-	if use kernel_linux; then
-		donvidia ${libdir}/libcuda.so ${NV_SOVER}
-		donvidia ${libdir}/libnvidia-compiler.so ${NV_SOVER}
-		donvidia ${libdir}/libOpenCL.so 1.0.0 ${CL_ROOT}
-		donvidia ${libdir}/libnvidia-opencl.so ${NV_SOVER}
-	fi
-}
-
-pkg_preinst() {
-	if use kernel_linux; then
-		linux-mod_pkg_preinst
-
-		local videogroup="$(egetent group video | cut -d ':' -f 3)"
-		if [ -z "${videogroup}" ]; then
-			eerror "Failed to determine the video group gid"
-			die "Failed to determine the video group gid"
-		else
-			sed -i \
-				-e "s:PACKAGE:${PF}:g" \
-				-e "s:VIDEOGID:${videogroup}:" \
-				"${D}"/etc/modprobe.d/nvidia.conf || die
-		fi
-	fi
-
-	# Clean the dynamic libGL stuff's home to ensure
-	# we dont have stale libs floating around
-	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ] ; then
-		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
-	fi
-	# Make sure we nuke the old nvidia-glx's env.d file
-	if [ -e "${ROOT}"/etc/env.d/09nvidia ] ; then
-		rm -f "${ROOT}"/etc/env.d/09nvidia
-	fi
-}
-
-pkg_postinst() {
-	use kernel_linux && linux-mod_pkg_postinst
-
-	# Switch to the nvidia implementation
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
-	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
-
-	readme.gentoo_print_elog
-
-	if ! use X; then
-		elog "You have elected to not install the X.org driver. Along with"
-		elog "this the OpenGL libraries and VDPAU libraries were not"
-		elog "installed. Additionally, once the driver is loaded your card"
-		elog "and fan will run at max speed which may not be desirable."
-		elog "Use the 'nvidia-smi' init script to have your card and fan"
-		elog "speed scale appropriately."
-		elog
-	fi
-	if ! use tools; then
-		elog "USE=tools controls whether the nvidia-settings application"
-		elog "is installed. If you would like to use it, enable that"
-		elog "flag and re-emerge this ebuild. Optionally you can install"
-		elog "media-video/nvidia-settings"
-		elog
-	fi
-}
-
-pkg_prerm() {
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}
-
-pkg_postrm() {
-	use kernel_linux && linux-mod_pkg_postrm
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-352.79-r5.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-352.79-r5.ebuild
deleted file mode 100644
index 7451b354b2f..00000000000
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-352.79-r5.ebuild
+++ /dev/null
@@ -1,525 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-
-inherit eutils flag-o-matic linux-info linux-mod multilib-minimal nvidia-driver \
-	portability toolchain-funcs unpacker user udev
-
-NV_URI="http://us.download.nvidia.com/XFree86/"
-X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
-AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
-X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
-AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
-
-DESCRIPTION="NVIDIA Accelerated Graphics Driver"
-HOMEPAGE="http://www.nvidia.com/ http://www.nvidia.com/Download/Find.aspx"
-SRC_URI="
-	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
-	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
-	x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
-	x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
-	tools? ( ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2 )
-"
-
-LICENSE="GPL-2 NVIDIA-r2"
-SLOT="0/${PV%.*}"
-KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
-RESTRICT="bindist mirror"
-EMULTILIB_PKG="true"
-
-IUSE="acpi gtk3 multilib kernel_FreeBSD kernel_linux pax_kernel static-libs +tools +X uvm"
-REQUIRED_USE="
-	tools? ( X )
-	static-libs? ( tools )
-"
-
-COMMON="
-	app-eselect/eselect-opencl
-	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
-	tools? (
-		dev-libs/atk
-		dev-libs/glib:2
-		dev-libs/jansson
-		gtk3? (
-			x11-libs/gtk+:3
-		)
-		x11-libs/cairo
-		x11-libs/gdk-pixbuf[X]
-		x11-libs/gtk+:2
-		x11-libs/libX11
-		x11-libs/libXext
-		x11-libs/libXrandr
-		x11-libs/libXv
-		x11-libs/libXxf86vm
-		x11-libs/pango[X]
-	)
-	X? (
-		>=app-eselect/eselect-opengl-1.0.9
-	)
-"
-DEPEND="
-	${COMMON}
-	kernel_linux? ( virtual/linux-sources )
-"
-RDEPEND="
-	${COMMON}
-	acpi? ( sys-power/acpid )
-	tools? ( !media-video/nvidia-settings )
-	X? (
-		<x11-base/xorg-server-1.18.99:=
-		>=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
-		>=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
-		>=x11-libs/libvdpau-1.0[${MULTILIB_USEDEP}]
-		sys-libs/zlib[${MULTILIB_USEDEP}]
-	)
-"
-
-QA_PREBUILT="opt/* usr/lib*"
-
-S=${WORKDIR}/
-
-pkg_pretend() {
-	if use amd64 && has_multilib_profile && \
-		[ "${DEFAULT_ABI}" != "amd64" ]; then
-		eerror "This ebuild doesn't currently support changing your default ABI"
-		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
-	fi
-
-	if use kernel_linux && kernel_is ge 4 4; then
-		ewarn "Gentoo supports kernels which are supported by NVIDIA"
-		ewarn "which are limited to the following kernels:"
-		ewarn "<sys-kernel/gentoo-sources-4.4"
-		ewarn "<sys-kernel/vanilla-sources-4.4"
-		ewarn ""
-		ewarn "You are free to utilize epatch_user to provide whatever"
-		ewarn "support you feel is appropriate, but will not receive"
-		ewarn "support as a result of those changes."
-		ewarn ""
-		ewarn "Do not file a bug report about this."
-		ewarn ""
-	fi
-
-	# Since Nvidia ships many different series of drivers, we need to give the user
-	# some kind of guidance as to what version they should install. This tries
-	# to point the user in the right direction but can't be perfect. check
-	# nvidia-driver.eclass
-	nvidia-driver-check-warning
-
-	# Kernel features/options to check for
-	CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
-	use x86 && CONFIG_CHECK+=" ~HIGHMEM"
-
-	# Now do the above checks
-	use kernel_linux && check_extra_config
-}
-
-pkg_setup() {
-	# try to turn off distcc and ccache for people that have a problem with it
-	export DISTCC_DISABLE=1
-	export CCACHE_DISABLE=1
-
-	if use kernel_linux; then
-		MODULE_NAMES="nvidia(video:${S}/kernel)"
-		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel/uvm)"
-
-		# This needs to run after MODULE_NAMES (so that the eclass checks
-		# whether the kernel supports loadable modules) but before BUILD_PARAMS
-		# is set (so that KV_DIR is populated).
-		linux-mod_pkg_setup
-
-		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
-		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC)"
-
-		# linux-mod_src_compile calls set_arch_to_kernel, which
-		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
-		# expects x86_64 or i386 and then converts it to x86
-		# later on in the build process
-		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
-	fi
-
-	# set variables to where files are in the package structure
-	if use kernel_FreeBSD; then
-		use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
-		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
-		NV_DOC="${S}/doc"
-		NV_OBJ="${S}/obj"
-		NV_SRC="${S}/src"
-		NV_MAN="${S}/x11/man"
-		NV_X11="${S}/obj"
-		NV_SOVER=1
-	elif use kernel_linux; then
-		NV_DOC="${S}"
-		NV_OBJ="${S}"
-		NV_SRC="${S}/kernel"
-		NV_MAN="${S}"
-		NV_X11="${S}"
-		NV_SOVER=${PV}
-	else
-		die "Could not determine proper NVIDIA package"
-	fi
-}
-
-src_prepare() {
-	# Please add a brief description for every added patch
-
-	if use kernel_linux; then
-		if kernel_is lt 2 6 9 ; then
-			eerror "You must build this against 2.6.9 or higher kernels."
-		fi
-
-		# If greater than 2.6.5 use M= instead of SUBDIR=
-#		convert_to_m "${NV_SRC}"/Makefile.kbuild
-	fi
-
-	if use pax_kernel; then
-		ewarn "Using PAX patches is not supported. You will be asked to"
-		ewarn "use a standard kernel should you have issues. Should you"
-		ewarn "need support with these patches, contact the PaX team."
-		epatch "${FILESDIR}"/${PN}-346.16-pax-usercopy.patch
-		epatch "${FILESDIR}"/${PN}-346.16-pax-constify.patch
-	fi
-
-	# Allow user patches so they can support RC kernels and whatever else
-	epatch_user
-}
-
-src_compile() {
-	# This is already the default on Linux, as there's no toplevel Makefile, but
-	# on FreeBSD there's one and triggers the kernel module build, as we install
-	# it by itself, pass this.
-
-	cd "${NV_SRC}"
-	if use kernel_FreeBSD; then
-		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
-			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
-	elif use kernel_linux; then
-		MAKEOPTS=-j1
-		linux-mod_src_compile
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			AR="$(tc-getAR)" \
-			CC="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			RANLIB="$(tc-getRANLIB)" \
-			build-xnvctrl
-
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			CC="$(tc-getCC)" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LD="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			NVML_ENABLED=0 \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			NV_VERBOSE=1 \
-			STRIP_CMD=true
-	fi
-}
-
-# Install nvidia library:
-# the first parameter is the library to install
-# the second parameter is the provided soversion
-# the third parameter is the target directory if its not /usr/lib
-donvidia() {
-	# Full path to library minus SOVER
-	MY_LIB="$1"
-
-	# SOVER to use
-	MY_SOVER="$2"
-
-	# Where to install
-	MY_DEST="$3"
-
-	if [[ -z "${MY_DEST}" ]]; then
-		MY_DEST="/usr/$(get_libdir)"
-		action="dolib.so"
-	else
-		exeinto ${MY_DEST}
-		action="doexe"
-	fi
-
-	# Get just the library name
-	libname=$(basename $1)
-
-	# Install the library with the correct SOVER
-	${action} ${MY_LIB}.${MY_SOVER} || \
-		die "failed to install ${libname}"
-
-	# If SOVER wasn't 1, then we need to create a .1 symlink
-	if [[ "${MY_SOVER}" != "1" ]]; then
-		dosym ${libname}.${MY_SOVER} \
-			${MY_DEST}/${libname}.1 || \
-			die "failed to create ${libname} symlink"
-	fi
-
-	# Always create the symlink from the raw lib to the .1
-	dosym ${libname}.1 \
-		${MY_DEST}/${libname} || \
-		die "failed to create ${libname} symlink"
-}
-
-src_install() {
-	if use kernel_linux; then
-		linux-mod_src_install
-
-		# Add the aliases
-		# This file is tweaked with the appropriate video group in
-		# pkg_preinst, see bug #491414
-		insinto /etc/modprobe.d
-		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
-		use uvm && doins "${FILESDIR}"/nvidia-uvm.conf
-
-		# Ensures that our device nodes are created when not using X
-		exeinto "$(get_udevdir)"
-		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
-		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
-	elif use kernel_FreeBSD; then
-		if use x86-fbsd; then
-			insinto /boot/modules
-			doins "${S}/src/nvidia.kld"
-		fi
-
-		exeinto /boot/modules
-		doexe "${S}/src/nvidia.ko"
-	fi
-
-	# NVIDIA kernel <-> userspace driver config lib
-	donvidia ${NV_OBJ}/libnvidia-cfg.so ${NV_SOVER}
-
-	# NVIDIA framebuffer capture library
-	donvidia ${NV_OBJ}/libnvidia-fbc.so ${NV_SOVER}
-
-	# NVIDIA video encode/decode <-> CUDA
-	if use kernel_linux; then
-		donvidia ${NV_OBJ}/libnvcuvid.so ${NV_SOVER}
-		donvidia ${NV_OBJ}/libnvidia-encode.so ${NV_SOVER}
-	fi
-
-	if use X; then
-		# Xorg DDX driver
-		insinto /usr/$(get_libdir)/xorg/modules/drivers
-		doins ${NV_X11}/nvidia_drv.so
-
-		# Xorg GLX driver
-		donvidia ${NV_X11}/libglx.so ${NV_SOVER} \
-			/usr/$(get_libdir)/opengl/nvidia/extensions
-
-		# Xorg nvidia.conf
-		if has_version '>=x11-base/xorg-server-1.16'; then
-			insinto /usr/share/X11/xorg.conf.d
-			newins {,50-}nvidia-drm-outputclass.conf
-		fi
-	fi
-
-	# OpenCL ICD for NVIDIA
-	if use kernel_linux; then
-		insinto /etc/OpenCL/vendors
-		doins ${NV_OBJ}/nvidia.icd
-	fi
-
-	# Documentation
-	dohtml ${NV_DOC}/html/*
-	if use kernel_FreeBSD; then
-		dodoc "${NV_DOC}/README"
-		use X && doman "${NV_MAN}/nvidia-xconfig.1"
-		use tools && doman "${NV_MAN}/nvidia-settings.1"
-	else
-		# Docs
-		newdoc "${NV_DOC}/README.txt" README
-		dodoc "${NV_DOC}/NVIDIA_Changelog"
-		doman "${NV_MAN}/nvidia-smi.1.gz"
-		use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
-		use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
-		doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
-	fi
-
-	# Helper Apps
-	exeinto /opt/bin/
-
-	if use X; then
-		doexe ${NV_OBJ}/nvidia-xconfig
-	fi
-
-	if use kernel_linux ; then
-		doexe ${NV_OBJ}/nvidia-cuda-mps-control
-		doexe ${NV_OBJ}/nvidia-cuda-mps-server
-		doexe ${NV_OBJ}/nvidia-debugdump
-		doexe ${NV_OBJ}/nvidia-persistenced
-		doexe ${NV_OBJ}/nvidia-smi
-
-		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
-		doexe ${NV_OBJ}/nvidia-modprobe
-		fowners root:video /opt/bin/nvidia-modprobe
-		fperms 4710 /opt/bin/nvidia-modprobe
-		dosym /{opt,usr}/bin/nvidia-modprobe
-
-		doman nvidia-cuda-mps-control.1.gz
-		doman nvidia-modprobe.1.gz
-		doman nvidia-persistenced.1.gz
-		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
-		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
-		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src/ \
-			DESTDIR="${D}" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LIBDIR="${D}/usr/$(get_libdir)" \
-			PREFIX=/usr \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			install
-
-		if use static-libs; then
-			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
-
-			insinto /usr/share/nvidia/
-			doins nvidia-application-profiles-${PV}-key-documentation
-		fi
-
-		insinto /etc/nvidia
-		newins \
-			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
-
-		# There is no icon in the FreeBSD tarball.
-		use kernel_FreeBSD || \
-			doicon ${NV_OBJ}/nvidia-settings.png
-
-		domenu "${FILESDIR}"/nvidia-settings.desktop
-
-		exeinto /etc/X11/xinit/xinitrc.d
-		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
-	fi
-
-	dobin ${NV_OBJ}/nvidia-bug-report.sh
-
-	if has_multilib_profile && use multilib ; then
-		local OABI=${ABI}
-		for ABI in $(get_install_abis) ; do
-			src_install-libs
-		done
-		ABI=${OABI}
-		unset OABI
-	else
-		src_install-libs
-	fi
-
-	is_final_abi || die "failed to iterate through all ABIs"
-
-	readme.gentoo_create_doc
-}
-
-src_install-libs() {
-	local inslibdir=$(get_libdir)
-	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
-	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
-	local libdir=${NV_OBJ}
-
-	if use kernel_linux && has_multilib_profile && \
-			[[ ${ABI} == "x86" ]] ; then
-		libdir=${NV_OBJ}/32
-	fi
-
-	if use X; then
-		# The GLX libraries
-		donvidia ${libdir}/libEGL.so ${NV_SOVER} ${GL_ROOT}
-		donvidia ${libdir}/libGL.so ${NV_SOVER} ${GL_ROOT}
-		donvidia ${libdir}/libGLESv1_CM.so ${NV_SOVER} ${GL_ROOT}
-		donvidia ${libdir}/libnvidia-eglcore.so ${NV_SOVER}
-		donvidia ${libdir}/libnvidia-glcore.so ${NV_SOVER}
-		donvidia ${libdir}/libnvidia-glsi.so ${NV_SOVER}
-		donvidia ${libdir}/libnvidia-ifr.so ${NV_SOVER}
-		if use kernel_FreeBSD; then
-			donvidia ${libdir}/libnvidia-tls.so ${NV_SOVER}
-		else
-			donvidia ${libdir}/tls/libnvidia-tls.so ${NV_SOVER}
-		fi
-
-		# VDPAU
-		donvidia ${libdir}/libvdpau_nvidia.so ${NV_SOVER}
-
-		# GLES v2 libraries
-		insinto ${GL_ROOT}
-		doexe ${libdir}/libGLESv2.so.${PV}
-		dosym libGLESv2.so.${PV} ${GL_ROOT}/libGLESv2.so.2
-		dosym libGLESv2.so.2 ${GL_ROOT}/libGLESv2.so
-	fi
-
-	# NVIDIA monitoring library
-	if use kernel_linux ; then
-		donvidia ${libdir}/libnvidia-ml.so ${NV_SOVER}
-	fi
-
-	# CUDA & OpenCL
-	if use kernel_linux; then
-		donvidia ${libdir}/libcuda.so ${NV_SOVER}
-		donvidia ${libdir}/libnvidia-compiler.so ${NV_SOVER}
-		donvidia ${libdir}/libOpenCL.so 1.0.0 ${CL_ROOT}
-		donvidia ${libdir}/libnvidia-opencl.so ${NV_SOVER}
-	fi
-}
-
-pkg_preinst() {
-	if use kernel_linux; then
-		linux-mod_pkg_preinst
-
-		local videogroup="$(egetent group video | cut -d ':' -f 3)"
-		if [ -z "${videogroup}" ]; then
-			eerror "Failed to determine the video group gid"
-			die "Failed to determine the video group gid"
-		else
-			sed -i \
-				-e "s:PACKAGE:${PF}:g" \
-				-e "s:VIDEOGID:${videogroup}:" \
-				"${D}"/etc/modprobe.d/nvidia.conf || die
-		fi
-	fi
-
-	# Clean the dynamic libGL stuff's home to ensure
-	# we dont have stale libs floating around
-	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ] ; then
-		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
-	fi
-	# Make sure we nuke the old nvidia-glx's env.d file
-	if [ -e "${ROOT}"/etc/env.d/09nvidia ] ; then
-		rm -f "${ROOT}"/etc/env.d/09nvidia
-	fi
-}
-
-pkg_postinst() {
-	use kernel_linux && linux-mod_pkg_postinst
-
-	# Switch to the nvidia implementation
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
-	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
-
-	readme.gentoo_print_elog
-
-	if ! use X; then
-		elog "You have elected to not install the X.org driver. Along with"
-		elog "this the OpenGL libraries and VDPAU libraries were not"
-		elog "installed. Additionally, once the driver is loaded your card"
-		elog "and fan will run at max speed which may not be desirable."
-		elog "Use the 'nvidia-smi' init script to have your card and fan"
-		elog "speed scale appropriately."
-		elog
-	fi
-	if ! use tools; then
-		elog "USE=tools controls whether the nvidia-settings application"
-		elog "is installed. If you would like to use it, enable that"
-		elog "flag and re-emerge this ebuild. Optionally you can install"
-		elog "media-video/nvidia-settings"
-		elog
-	fi
-}
-
-pkg_prerm() {
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}
-
-pkg_postrm() {
-	use kernel_linux && linux-mod_pkg_postrm
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-355.11-r4.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-355.11-r4.ebuild
deleted file mode 100644
index 4dc2199f3e7..00000000000
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-355.11-r4.ebuild
+++ /dev/null
@@ -1,499 +0,0 @@
-# Copyright 1999-2016 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-
-inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \
-	portability toolchain-funcs unpacker user udev
-
-NV_URI="http://us.download.nvidia.com/XFree86/"
-X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
-AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
-X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
-AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
-
-DESCRIPTION="NVIDIA Accelerated Graphics Driver"
-HOMEPAGE="http://www.nvidia.com/ http://www.nvidia.com/Download/Find.aspx"
-SRC_URI="
-	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
-	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
-	x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
-	x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
-"
-
-LICENSE="GPL-2 NVIDIA-r2"
-SLOT="0/${PV%.*}"
-KEYWORDS="-* amd64 x86 ~amd64-fbsd ~x86-fbsd"
-RESTRICT="bindist mirror"
-EMULTILIB_PKG="true"
-
-IUSE="acpi multilib kernel_FreeBSD kernel_linux pax_kernel +tools gtk2 gtk3 +X uvm"
-REQUIRED_USE="
-	tools? ( X || ( gtk2 gtk3 ) )
-"
-
-COMMON="
-	app-eselect/eselect-opencl
-	gtk3? ( x11-libs/cairo )
-	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
-	X? (
-		>=app-eselect/eselect-opengl-1.0.9
-	)
-"
-DEPEND="
-	${COMMON}
-	app-arch/xz-utils
-	kernel_linux? ( virtual/linux-sources )
-"
-RDEPEND="
-	${COMMON}
-	acpi? ( sys-power/acpid )
-	tools? (
-		dev-libs/atk
-		dev-libs/glib:2
-		x11-libs/gdk-pixbuf
-		gtk2? ( >=x11-libs/gtk+-2.4:2 )
-		gtk3? ( x11-libs/gtk+:3 )
-		x11-libs/libX11
-		x11-libs/libXext
-		x11-libs/pango[X]
-	)
-	X? (
-		<x11-base/xorg-server-1.18.99:=
-		>=x11-libs/libvdpau-1.0
-		multilib? (
-			>=x11-libs/libX11-1.6.2[abi_x86_32]
-			>=x11-libs/libXext-1.3.2[abi_x86_32]
-		)
-	)
-"
-
-QA_PREBUILT="opt/* usr/lib*"
-
-S=${WORKDIR}/
-
-pkg_pretend() {
-	if use amd64 && has_multilib_profile && \
-		[ "${DEFAULT_ABI}" != "amd64" ]; then
-		eerror "This ebuild doesn't currently support changing your default ABI"
-		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
-	fi
-
-	if use kernel_linux && kernel_is ge 4 3; then
-		ewarn "Gentoo supports kernels which are supported by NVIDIA"
-		ewarn "which are limited to the following kernels:"
-		ewarn "<sys-kernel/gentoo-sources-4.3"
-		ewarn "<sys-kernel/vanilla-sources-4.3"
-		ewarn ""
-		ewarn "You are free to utilize epatch_user to provide whatever"
-		ewarn "support you feel is appropriate, but will not receive"
-		ewarn "support as a result of those changes."
-		ewarn ""
-		ewarn "Do not file a bug report about this."
-	fi
-
-	# Since Nvidia ships many different series of drivers, we need to give the user
-	# some kind of guidance as to what version they should install. This tries
-	# to point the user in the right direction but can't be perfect. check
-	# nvidia-driver.eclass
-	nvidia-driver-check-warning
-
-	# Kernel features/options to check for
-	CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
-	use x86 && CONFIG_CHECK+=" ~HIGHMEM"
-
-	# Now do the above checks
-	use kernel_linux && check_extra_config
-}
-
-pkg_setup() {
-	# try to turn off distcc and ccache for people that have a problem with it
-	export DISTCC_DISABLE=1
-	export CCACHE_DISABLE=1
-
-	if use kernel_linux; then
-		MODULE_NAMES="nvidia(video:${S}/kernel)"
-		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
-
-		# This needs to run after MODULE_NAMES (so that the eclass checks
-		# whether the kernel supports loadable modules) but before BUILD_PARAMS
-		# is set (so that KV_DIR is populated).
-		linux-mod_pkg_setup
-
-		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
-		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
-
-		# linux-mod_src_compile calls set_arch_to_kernel, which
-		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
-		# expects x86_64 or i386 and then converts it to x86
-		# later on in the build process
-		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
-	fi
-
-	# set variables to where files are in the package structure
-	if use kernel_FreeBSD; then
-		use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
-		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
-		NV_DOC="${S}/doc"
-		NV_OBJ="${S}/obj"
-		NV_SRC="${S}/src"
-		NV_MAN="${S}/x11/man"
-		NV_X11="${S}/obj"
-		NV_SOVER=1
-	elif use kernel_linux; then
-		NV_DOC="${S}"
-		NV_OBJ="${S}"
-		NV_SRC="${S}/kernel"
-		NV_MAN="${S}"
-		NV_X11="${S}"
-		NV_SOVER=${PV}
-	else
-		die "Could not determine proper NVIDIA package"
-	fi
-}
-
-src_prepare() {
-	# Please add a brief description for every added patch
-
-	if use kernel_linux; then
-		if kernel_is lt 2 6 9; then
-			eerror "You must build this against 2.6.9 or higher kernels."
-		fi
-
-		# If greater than 2.6.5 use M= instead of SUBDIR=
-#		convert_to_m "${NV_SRC}"/Makefile.kbuild
-	fi
-
-	if use pax_kernel; then
-		ewarn "Using PAX patches is not supported. You will be asked to"
-		ewarn "use a standard kernel should you have issues. Should you"
-		ewarn "need support with these patches, contact the PaX team."
-		epatch "${FILESDIR}"/${PN}-355.06-pax.patch
-	fi
-
-	# Allow user patches so they can support RC kernels and whatever else
-	epatch_user
-}
-
-src_compile() {
-	# This is already the default on Linux, as there's no toplevel Makefile, but
-	# on FreeBSD there's one and triggers the kernel module build, as we install
-	# it by itself, pass this.
-
-	cd "${NV_SRC}"
-	if use kernel_FreeBSD; then
-		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
-			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
-	elif use kernel_linux; then
-		MAKEOPTS=-j1
-		linux-mod_src_compile
-	fi
-}
-
-# Install nvidia library:
-# the first parameter is the library to install
-# the second parameter is the provided soversion
-# the third parameter is the target directory if it is not /usr/lib
-donvidia() {
-	# Full path to library minus SOVER
-	MY_LIB="$1"
-
-	# SOVER to use
-	MY_SOVER="$2"
-
-	# Where to install
-	MY_DEST="$3"
-
-	if [[ -z "${MY_DEST}" ]]; then
-		MY_DEST="/usr/$(get_libdir)"
-		action="dolib.so"
-	else
-		exeinto ${MY_DEST}
-		action="doexe"
-	fi
-
-	# Get just the library name
-	libname=$(basename $1)
-
-	# Install the library with the correct SOVER
-	${action} ${MY_LIB}.${MY_SOVER} || \
-		die "failed to install ${libname}"
-
-	# If SOVER wasn't 1, then we need to create a .1 symlink
-	if [[ "${MY_SOVER}" != "1" ]]; then
-		dosym ${libname}.${MY_SOVER} \
-			${MY_DEST}/${libname}.1 || \
-			die "failed to create ${libname} symlink"
-	fi
-
-	# Always create the symlink from the raw lib to the .1
-	dosym ${libname}.1 \
-		${MY_DEST}/${libname} || \
-		die "failed to create ${libname} symlink"
-}
-
-src_install() {
-	if use kernel_linux; then
-		linux-mod_src_install
-
-		# Add the aliases
-		# This file is tweaked with the appropriate video group in
-		# pkg_preinst, see bug #491414
-		insinto /etc/modprobe.d
-		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
-		use uvm && doins "${FILESDIR}"/nvidia-uvm.conf
-
-		# Ensures that our device nodes are created when not using X
-		exeinto "$(get_udevdir)"
-		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
-		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
-	elif use kernel_FreeBSD; then
-		if use x86-fbsd; then
-			insinto /boot/modules
-			doins "${S}/src/nvidia.kld"
-		fi
-
-		exeinto /boot/modules
-		doexe "${S}/src/nvidia.ko"
-	fi
-
-	# NVIDIA kernel <-> userspace driver config lib
-	donvidia ${NV_OBJ}/libnvidia-cfg.so ${NV_SOVER}
-
-	# NVIDIA framebuffer capture library
-	donvidia ${NV_OBJ}/libnvidia-fbc.so ${NV_SOVER}
-
-	# NVIDIA video encode/decode <-> CUDA
-	if use kernel_linux; then
-		donvidia ${NV_OBJ}/libnvcuvid.so ${NV_SOVER}
-		donvidia ${NV_OBJ}/libnvidia-encode.so ${NV_SOVER}
-	fi
-
-	if use X; then
-		# Xorg DDX driver
-		insinto /usr/$(get_libdir)/xorg/modules/drivers
-		doins ${NV_X11}/nvidia_drv.so
-
-		# Xorg GLX driver
-		donvidia ${NV_X11}/libglx.so ${NV_SOVER} \
-			/usr/$(get_libdir)/opengl/nvidia/extensions
-
-		# Xorg nvidia.conf
-		if has_version '>=x11-base/xorg-server-1.16'; then
-			insinto /usr/share/X11/xorg.conf.d
-			newins {,50-}nvidia-drm-outputclass.conf
-		fi
-	fi
-
-	# OpenCL ICD for NVIDIA
-	if use kernel_linux; then
-		insinto /etc/OpenCL/vendors
-		doins ${NV_OBJ}/nvidia.icd
-	fi
-
-	# Documentation
-	dohtml ${NV_DOC}/html/*
-	if use kernel_FreeBSD; then
-		dodoc "${NV_DOC}/README"
-		use X && doman "${NV_MAN}/nvidia-xconfig.1"
-		use tools && doman "${NV_MAN}/nvidia-settings.1"
-	else
-		# Docs
-		newdoc "${NV_DOC}/README.txt" README
-		dodoc "${NV_DOC}/NVIDIA_Changelog"
-		doman "${NV_MAN}/nvidia-smi.1.gz"
-		use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
-		use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
-		doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
-	fi
-
-	# Helper Apps
-	exeinto /opt/bin/
-
-	if use X; then
-		doexe ${NV_OBJ}/nvidia-xconfig
-	fi
-
-	if use kernel_linux; then
-		doexe ${NV_OBJ}/nvidia-cuda-mps-control
-		doexe ${NV_OBJ}/nvidia-cuda-mps-server
-		doexe ${NV_OBJ}/nvidia-debugdump
-		doexe ${NV_OBJ}/nvidia-persistenced
-		doexe ${NV_OBJ}/nvidia-smi
-
-		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
-		doexe ${NV_OBJ}/nvidia-modprobe
-		fowners root:video /opt/bin/nvidia-modprobe
-		fperms 4710 /opt/bin/nvidia-modprobe
-		dosym /{opt,usr}/bin/nvidia-modprobe
-
-		doman nvidia-cuda-mps-control.1.gz
-		doman nvidia-modprobe.1.gz
-		doman nvidia-persistenced.1.gz
-		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
-		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
-		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
-	fi
-
-	if use tools; then
-		doexe ${NV_OBJ}/nvidia-settings
-		use gtk2 && donvidia libnvidia-gtk2.so ${PV}
-		use gtk3 && donvidia libnvidia-gtk3.so ${PV}
-		insinto /usr/share/nvidia/
-		doins nvidia-application-profiles-${PV}-key-documentation
-		insinto /etc/nvidia
-		newins nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
-	fi
-
-	dobin ${NV_OBJ}/nvidia-bug-report.sh
-
-	# Desktop entries for nvidia-settings
-	if use tools; then
-		# There is no icon in the FreeBSD tarball.
-		use kernel_FreeBSD || newicon ${NV_OBJ}/nvidia-settings.png ${PN}-settings.png
-		domenu "${FILESDIR}"/${PN}-settings.desktop
-		exeinto /etc/X11/xinit/xinitrc.d
-		doexe "${FILESDIR}"/95-nvidia-settings
-	fi
-
-	#doenvd "${FILESDIR}"/50nvidia-prelink-blacklist
-
-	if has_multilib_profile && use multilib; then
-		local OABI=${ABI}
-		for ABI in $(get_install_abis); do
-			src_install-libs
-		done
-		ABI=${OABI}
-		unset OABI
-	else
-		src_install-libs
-	fi
-
-	is_final_abi || die "failed to iterate through all ABIs"
-
-	readme.gentoo_create_doc
-}
-
-src_install-libs() {
-	local inslibdir=$(get_libdir)
-	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
-	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
-	local libdir=${NV_OBJ}
-
-	if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
-		libdir=${NV_OBJ}/32
-	fi
-
-	if use X; then
-		NV_GLX_LIBRARIES=(
-			"libEGL.so 1 ${GL_ROOT}"
-			"libEGL_nvidia.so 0 ${GL_ROOT}"
-			"libGL.so ${NV_SOVER} ${GL_ROOT}"
-			"libGLESv1_CM.so ${NV_SOVER} ${GL_ROOT}"
-			"libGLdispatch.so 0 ${GL_ROOT}"
-			"libOpenCL.so 1.0.0 ${CL_ROOT}"
-			"libOpenGL.so 0 ${GL_ROOT}"
-			"libcuda.so ${NV_SOVER}"
-			"libnvcuvid.so ${NV_SOVER}"
-			"libnvidia-compiler.so ${NV_SOVER}"
-			"libnvidia-eglcore.so ${NV_SOVER}"
-			"libnvidia-encode.so ${NV_SOVER}"
-			"libnvidia-fbc.so ${NV_SOVER}"
-			"libnvidia-glcore.so ${NV_SOVER}"
-			"libnvidia-glsi.so ${NV_SOVER}"
-			"libnvidia-ifr.so ${NV_SOVER}"
-			"libnvidia-opencl.so ${NV_SOVER}"
-			"libvdpau.so ${NV_SOVER} ${GL_ROOT}"
-			"libvdpau_nvidia.so ${NV_SOVER}"
-			"libvdpau_trace.so ${NV_SOVER} ${GL_ROOT}"
-		)
-		if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
-		then
-			NV_GLX_LIBRARIES+=( "libnvidia-wfb.so ${NV_SOVER}" )
-		fi
-
-		if use kernel_FreeBSD; then
-			NV_GLX_LIBRARIES+=( "libnvidia-tls.so ${NV_SOVER}" )
-		fi
-
-		if use kernel_linux; then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-ml.so ${NV_SOVER}"
-				"tls/libnvidia-tls.so ${NV_SOVER}"
-			)
-		fi
-
-		for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
-			donvidia ${libdir}/${NV_LIB}
-		done
-
-		# GLES v2 library is special
-		insinto ${GL_ROOT}
-		doexe ${libdir}/libGLESv2.so.${PV}
-		dosym libGLESv2.so.${PV} ${GL_ROOT}/libGLESv2.so.2
-		dosym libGLESv2.so.2 ${GL_ROOT}/libGLESv2.so
-	fi
-}
-
-pkg_preinst() {
-	if use kernel_linux; then
-		linux-mod_pkg_preinst
-
-		local videogroup="$(egetent group video | cut -d ':' -f 3)"
-		if [ -z "${videogroup}" ]; then
-			eerror "Failed to determine the video group gid"
-			die "Failed to determine the video group gid"
-		else
-			sed -i \
-				-e "s:PACKAGE:${PF}:g" \
-				-e "s:VIDEOGID:${videogroup}:" \
-				"${D}"/etc/modprobe.d/nvidia.conf || die
-		fi
-	fi
-
-	# Clean the dynamic libGL stuff's home to ensure
-	# we dont have stale libs floating around
-	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ]; then
-		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
-	fi
-	# Make sure we nuke the old nvidia-glx's env.d file
-	if [ -e "${ROOT}"/etc/env.d/09nvidia ]; then
-		rm -f "${ROOT}"/etc/env.d/09nvidia
-	fi
-}
-
-pkg_postinst() {
-	use kernel_linux && linux-mod_pkg_postinst
-
-	# Switch to the nvidia implementation
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
-	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
-
-	readme.gentoo_print_elog
-
-	if ! use X; then
-		elog "You have elected to not install the X.org driver. Along with"
-		elog "this the OpenGL libraries and VDPAU libraries were not"
-		elog "installed. Additionally, once the driver is loaded your card"
-		elog "and fan will run at max speed which may not be desirable."
-		elog "Use the 'nvidia-smi' init script to have your card and fan"
-		elog "speed scale appropriately."
-		elog
-	fi
-	if ! use tools; then
-		elog "USE=tools controls whether the nvidia-settings application"
-		elog "is installed. If you would like to use it, enable that"
-		elog "flag and re-emerge this ebuild. Optionally you can install"
-		elog "media-video/nvidia-settings"
-		elog
-	fi
-}
-
-pkg_prerm() {
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}
-
-pkg_postrm() {
-	use kernel_linux && linux-mod_pkg_postrm
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-355.11-r5.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-355.11-r5.ebuild
deleted file mode 100644
index 2bdc6e727de..00000000000
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-355.11-r5.ebuild
+++ /dev/null
@@ -1,502 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-
-inherit eutils flag-o-matic linux-info linux-mod multilib-minimal nvidia-driver \
-	portability toolchain-funcs unpacker user udev
-
-NV_URI="http://us.download.nvidia.com/XFree86/"
-X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
-AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
-X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
-AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
-
-DESCRIPTION="NVIDIA Accelerated Graphics Driver"
-HOMEPAGE="http://www.nvidia.com/ http://www.nvidia.com/Download/Find.aspx"
-SRC_URI="
-	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
-	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
-	x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
-	x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
-"
-
-LICENSE="GPL-2 NVIDIA-r2"
-SLOT="0/${PV%.*}"
-KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
-RESTRICT="bindist mirror"
-EMULTILIB_PKG="true"
-
-IUSE="acpi multilib kernel_FreeBSD kernel_linux pax_kernel +tools gtk2 gtk3 +X uvm"
-REQUIRED_USE="
-	tools? ( X || ( gtk2 gtk3 ) )
-"
-
-COMMON="
-	app-eselect/eselect-opencl
-	gtk3? ( x11-libs/cairo[${MULTILIB_USEDEP}] )
-	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
-	X? (
-		>=app-eselect/eselect-opengl-1.0.9
-	)
-"
-DEPEND="
-	${COMMON}
-	app-arch/xz-utils
-	kernel_linux? ( virtual/linux-sources )
-"
-RDEPEND="
-	${COMMON}
-	acpi? ( sys-power/acpid )
-	tools? (
-		dev-libs/atk
-		dev-libs/glib:2
-		x11-libs/gdk-pixbuf
-		gtk2? (
-			>=x11-libs/gtk+-2.4:2
-		)
-		gtk3? (
-			x11-libs/gtk+:3
-		)
-		x11-libs/libX11
-		x11-libs/libXext
-		x11-libs/pango[X]
-	)
-	X? (
-		<x11-base/xorg-server-1.18.99:=
-		>=x11-libs/libvdpau-1.0[${MULTILIB_USEDEP}]
-		sys-libs/zlib[${MULTILIB_USEDEP}]
-		>=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
-		>=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
-	)
-"
-
-QA_PREBUILT="opt/* usr/lib*"
-
-S=${WORKDIR}/
-
-pkg_pretend() {
-	if use amd64 && has_multilib_profile && \
-		[ "${DEFAULT_ABI}" != "amd64" ]; then
-		eerror "This ebuild doesn't currently support changing your default ABI"
-		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
-	fi
-
-	if use kernel_linux && kernel_is ge 4 3; then
-		ewarn "Gentoo supports kernels which are supported by NVIDIA"
-		ewarn "which are limited to the following kernels:"
-		ewarn "<sys-kernel/gentoo-sources-4.3"
-		ewarn "<sys-kernel/vanilla-sources-4.3"
-		ewarn ""
-		ewarn "You are free to utilize epatch_user to provide whatever"
-		ewarn "support you feel is appropriate, but will not receive"
-		ewarn "support as a result of those changes."
-		ewarn ""
-		ewarn "Do not file a bug report about this."
-	fi
-
-	# Since Nvidia ships many different series of drivers, we need to give the user
-	# some kind of guidance as to what version they should install. This tries
-	# to point the user in the right direction but can't be perfect. check
-	# nvidia-driver.eclass
-	nvidia-driver-check-warning
-
-	# Kernel features/options to check for
-	CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
-	use x86 && CONFIG_CHECK+=" ~HIGHMEM"
-
-	# Now do the above checks
-	use kernel_linux && check_extra_config
-}
-
-pkg_setup() {
-	# try to turn off distcc and ccache for people that have a problem with it
-	export DISTCC_DISABLE=1
-	export CCACHE_DISABLE=1
-
-	if use kernel_linux; then
-		MODULE_NAMES="nvidia(video:${S}/kernel)"
-		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
-
-		# This needs to run after MODULE_NAMES (so that the eclass checks
-		# whether the kernel supports loadable modules) but before BUILD_PARAMS
-		# is set (so that KV_DIR is populated).
-		linux-mod_pkg_setup
-
-		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
-		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
-
-		# linux-mod_src_compile calls set_arch_to_kernel, which
-		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
-		# expects x86_64 or i386 and then converts it to x86
-		# later on in the build process
-		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
-	fi
-
-	# set variables to where files are in the package structure
-	if use kernel_FreeBSD; then
-		use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
-		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
-		NV_DOC="${S}/doc"
-		NV_OBJ="${S}/obj"
-		NV_SRC="${S}/src"
-		NV_MAN="${S}/x11/man"
-		NV_X11="${S}/obj"
-		NV_SOVER=1
-	elif use kernel_linux; then
-		NV_DOC="${S}"
-		NV_OBJ="${S}"
-		NV_SRC="${S}/kernel"
-		NV_MAN="${S}"
-		NV_X11="${S}"
-		NV_SOVER=${PV}
-	else
-		die "Could not determine proper NVIDIA package"
-	fi
-}
-
-src_prepare() {
-	# Please add a brief description for every added patch
-
-	if use kernel_linux; then
-		if kernel_is lt 2 6 9; then
-			eerror "You must build this against 2.6.9 or higher kernels."
-		fi
-
-		# If greater than 2.6.5 use M= instead of SUBDIR=
-#		convert_to_m "${NV_SRC}"/Makefile.kbuild
-	fi
-
-	if use pax_kernel; then
-		ewarn "Using PAX patches is not supported. You will be asked to"
-		ewarn "use a standard kernel should you have issues. Should you"
-		ewarn "need support with these patches, contact the PaX team."
-		epatch "${FILESDIR}"/${PN}-355.06-pax.patch
-	fi
-
-	# Allow user patches so they can support RC kernels and whatever else
-	epatch_user
-}
-
-src_compile() {
-	# This is already the default on Linux, as there's no toplevel Makefile, but
-	# on FreeBSD there's one and triggers the kernel module build, as we install
-	# it by itself, pass this.
-
-	cd "${NV_SRC}"
-	if use kernel_FreeBSD; then
-		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
-			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
-	elif use kernel_linux; then
-		MAKEOPTS=-j1
-		linux-mod_src_compile
-	fi
-}
-
-# Install nvidia library:
-# the first parameter is the library to install
-# the second parameter is the provided soversion
-# the third parameter is the target directory if it is not /usr/lib
-donvidia() {
-	# Full path to library minus SOVER
-	MY_LIB="$1"
-
-	# SOVER to use
-	MY_SOVER="$2"
-
-	# Where to install
-	MY_DEST="$3"
-
-	if [[ -z "${MY_DEST}" ]]; then
-		MY_DEST="/usr/$(get_libdir)"
-		action="dolib.so"
-	else
-		exeinto ${MY_DEST}
-		action="doexe"
-	fi
-
-	# Get just the library name
-	libname=$(basename $1)
-
-	# Install the library with the correct SOVER
-	${action} ${MY_LIB}.${MY_SOVER} || \
-		die "failed to install ${libname}"
-
-	# If SOVER wasn't 1, then we need to create a .1 symlink
-	if [[ "${MY_SOVER}" != "1" ]]; then
-		dosym ${libname}.${MY_SOVER} \
-			${MY_DEST}/${libname}.1 || \
-			die "failed to create ${libname} symlink"
-	fi
-
-	# Always create the symlink from the raw lib to the .1
-	dosym ${libname}.1 \
-		${MY_DEST}/${libname} || \
-		die "failed to create ${libname} symlink"
-}
-
-src_install() {
-	if use kernel_linux; then
-		linux-mod_src_install
-
-		# Add the aliases
-		# This file is tweaked with the appropriate video group in
-		# pkg_preinst, see bug #491414
-		insinto /etc/modprobe.d
-		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
-		use uvm && doins "${FILESDIR}"/nvidia-uvm.conf
-
-		# Ensures that our device nodes are created when not using X
-		exeinto "$(get_udevdir)"
-		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
-		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
-	elif use kernel_FreeBSD; then
-		if use x86-fbsd; then
-			insinto /boot/modules
-			doins "${S}/src/nvidia.kld"
-		fi
-
-		exeinto /boot/modules
-		doexe "${S}/src/nvidia.ko"
-	fi
-
-	# NVIDIA kernel <-> userspace driver config lib
-	donvidia ${NV_OBJ}/libnvidia-cfg.so ${NV_SOVER}
-
-	# NVIDIA framebuffer capture library
-	donvidia ${NV_OBJ}/libnvidia-fbc.so ${NV_SOVER}
-
-	# NVIDIA video encode/decode <-> CUDA
-	if use kernel_linux; then
-		donvidia ${NV_OBJ}/libnvcuvid.so ${NV_SOVER}
-		donvidia ${NV_OBJ}/libnvidia-encode.so ${NV_SOVER}
-	fi
-
-	if use X; then
-		# Xorg DDX driver
-		insinto /usr/$(get_libdir)/xorg/modules/drivers
-		doins ${NV_X11}/nvidia_drv.so
-
-		# Xorg GLX driver
-		donvidia ${NV_X11}/libglx.so ${NV_SOVER} \
-			/usr/$(get_libdir)/opengl/nvidia/extensions
-
-		# Xorg nvidia.conf
-		if has_version '>=x11-base/xorg-server-1.16'; then
-			insinto /usr/share/X11/xorg.conf.d
-			newins {,50-}nvidia-drm-outputclass.conf
-		fi
-	fi
-
-	# OpenCL ICD for NVIDIA
-	if use kernel_linux; then
-		insinto /etc/OpenCL/vendors
-		doins ${NV_OBJ}/nvidia.icd
-	fi
-
-	# Documentation
-	dohtml ${NV_DOC}/html/*
-	if use kernel_FreeBSD; then
-		dodoc "${NV_DOC}/README"
-		use X && doman "${NV_MAN}/nvidia-xconfig.1"
-		use tools && doman "${NV_MAN}/nvidia-settings.1"
-	else
-		# Docs
-		newdoc "${NV_DOC}/README.txt" README
-		dodoc "${NV_DOC}/NVIDIA_Changelog"
-		doman "${NV_MAN}/nvidia-smi.1.gz"
-		use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
-		use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
-		doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
-	fi
-
-	# Helper Apps
-	exeinto /opt/bin/
-
-	if use X; then
-		doexe ${NV_OBJ}/nvidia-xconfig
-	fi
-
-	if use kernel_linux; then
-		doexe ${NV_OBJ}/nvidia-cuda-mps-control
-		doexe ${NV_OBJ}/nvidia-cuda-mps-server
-		doexe ${NV_OBJ}/nvidia-debugdump
-		doexe ${NV_OBJ}/nvidia-persistenced
-		doexe ${NV_OBJ}/nvidia-smi
-
-		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
-		doexe ${NV_OBJ}/nvidia-modprobe
-		fowners root:video /opt/bin/nvidia-modprobe
-		fperms 4710 /opt/bin/nvidia-modprobe
-		dosym /{opt,usr}/bin/nvidia-modprobe
-
-		doman nvidia-cuda-mps-control.1.gz
-		doman nvidia-modprobe.1.gz
-		doman nvidia-persistenced.1.gz
-		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
-		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
-		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
-	fi
-
-	if use tools; then
-		doexe ${NV_OBJ}/nvidia-settings
-		use gtk2 && donvidia libnvidia-gtk2.so ${PV}
-		use gtk3 && donvidia libnvidia-gtk3.so ${PV}
-		insinto /usr/share/nvidia/
-		doins nvidia-application-profiles-${PV}-key-documentation
-		insinto /etc/nvidia
-		newins nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
-	fi
-
-	dobin ${NV_OBJ}/nvidia-bug-report.sh
-
-	# Desktop entries for nvidia-settings
-	if use tools; then
-		# There is no icon in the FreeBSD tarball.
-		use kernel_FreeBSD || newicon ${NV_OBJ}/nvidia-settings.png ${PN}-settings.png
-		domenu "${FILESDIR}"/${PN}-settings.desktop
-		exeinto /etc/X11/xinit/xinitrc.d
-		doexe "${FILESDIR}"/95-nvidia-settings
-	fi
-
-	#doenvd "${FILESDIR}"/50nvidia-prelink-blacklist
-
-	if has_multilib_profile && use multilib; then
-		local OABI=${ABI}
-		for ABI in $(get_install_abis); do
-			src_install-libs
-		done
-		ABI=${OABI}
-		unset OABI
-	else
-		src_install-libs
-	fi
-
-	is_final_abi || die "failed to iterate through all ABIs"
-
-	readme.gentoo_create_doc
-}
-
-src_install-libs() {
-	local inslibdir=$(get_libdir)
-	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
-	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
-	local libdir=${NV_OBJ}
-
-	if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
-		libdir=${NV_OBJ}/32
-	fi
-
-	if use X; then
-		NV_GLX_LIBRARIES=(
-			"libEGL.so 1 ${GL_ROOT}"
-			"libEGL_nvidia.so 0 ${GL_ROOT}"
-			"libGL.so ${NV_SOVER} ${GL_ROOT}"
-			"libGLESv1_CM.so ${NV_SOVER} ${GL_ROOT}"
-			"libGLdispatch.so 0 ${GL_ROOT}"
-			"libOpenCL.so 1.0.0 ${CL_ROOT}"
-			"libOpenGL.so 0 ${GL_ROOT}"
-			"libcuda.so ${NV_SOVER}"
-			"libnvcuvid.so ${NV_SOVER}"
-			"libnvidia-compiler.so ${NV_SOVER}"
-			"libnvidia-eglcore.so ${NV_SOVER}"
-			"libnvidia-encode.so ${NV_SOVER}"
-			"libnvidia-fbc.so ${NV_SOVER}"
-			"libnvidia-glcore.so ${NV_SOVER}"
-			"libnvidia-glsi.so ${NV_SOVER}"
-			"libnvidia-ifr.so ${NV_SOVER}"
-			"libnvidia-opencl.so ${NV_SOVER}"
-			"libvdpau.so ${NV_SOVER} ${GL_ROOT}"
-			"libvdpau_nvidia.so ${NV_SOVER}"
-			"libvdpau_trace.so ${NV_SOVER} ${GL_ROOT}"
-		)
-		if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
-		then
-			NV_GLX_LIBRARIES+=( "libnvidia-wfb.so ${NV_SOVER}" )
-		fi
-
-		if use kernel_FreeBSD; then
-			NV_GLX_LIBRARIES+=( "libnvidia-tls.so ${NV_SOVER}" )
-		fi
-
-		if use kernel_linux; then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-ml.so ${NV_SOVER}"
-				"tls/libnvidia-tls.so ${NV_SOVER}"
-			)
-		fi
-
-		for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
-			donvidia ${libdir}/${NV_LIB}
-		done
-
-		# GLES v2 library is special
-		insinto ${GL_ROOT}
-		doexe ${libdir}/libGLESv2.so.${PV}
-		dosym libGLESv2.so.${PV} ${GL_ROOT}/libGLESv2.so.2
-		dosym libGLESv2.so.2 ${GL_ROOT}/libGLESv2.so
-	fi
-}
-
-pkg_preinst() {
-	if use kernel_linux; then
-		linux-mod_pkg_preinst
-
-		local videogroup="$(egetent group video | cut -d ':' -f 3)"
-		if [ -z "${videogroup}" ]; then
-			eerror "Failed to determine the video group gid"
-			die "Failed to determine the video group gid"
-		else
-			sed -i \
-				-e "s:PACKAGE:${PF}:g" \
-				-e "s:VIDEOGID:${videogroup}:" \
-				"${D}"/etc/modprobe.d/nvidia.conf || die
-		fi
-	fi
-
-	# Clean the dynamic libGL stuff's home to ensure
-	# we dont have stale libs floating around
-	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ]; then
-		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
-	fi
-	# Make sure we nuke the old nvidia-glx's env.d file
-	if [ -e "${ROOT}"/etc/env.d/09nvidia ]; then
-		rm -f "${ROOT}"/etc/env.d/09nvidia
-	fi
-}
-
-pkg_postinst() {
-	use kernel_linux && linux-mod_pkg_postinst
-
-	# Switch to the nvidia implementation
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
-	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
-
-	readme.gentoo_print_elog
-
-	if ! use X; then
-		elog "You have elected to not install the X.org driver. Along with"
-		elog "this the OpenGL libraries and VDPAU libraries were not"
-		elog "installed. Additionally, once the driver is loaded your card"
-		elog "and fan will run at max speed which may not be desirable."
-		elog "Use the 'nvidia-smi' init script to have your card and fan"
-		elog "speed scale appropriately."
-		elog
-	fi
-	if ! use tools; then
-		elog "USE=tools controls whether the nvidia-settings application"
-		elog "is installed. If you would like to use it, enable that"
-		elog "flag and re-emerge this ebuild. Optionally you can install"
-		elog "media-video/nvidia-settings"
-		elog
-	fi
-}
-
-pkg_prerm() {
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}
-
-pkg_postrm() {
-	use kernel_linux && linux-mod_pkg_postrm
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-358.16-r5.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-358.16-r5.ebuild
deleted file mode 100644
index d01fb426381..00000000000
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-358.16-r5.ebuild
+++ /dev/null
@@ -1,538 +0,0 @@
-# Copyright 1999-2016 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-
-inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \
-	portability toolchain-funcs unpacker user udev
-
-NV_URI="http://us.download.nvidia.com/XFree86/"
-X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
-AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
-X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
-AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
-
-DESCRIPTION="NVIDIA Accelerated Graphics Driver"
-HOMEPAGE="http://www.nvidia.com/ http://www.nvidia.com/Download/Find.aspx"
-SRC_URI="
-	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
-	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
-	x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
-	x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
-	tools? ( ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2 )
-"
-
-LICENSE="GPL-2 NVIDIA-r2"
-SLOT="0/${PV%.*}"
-KEYWORDS="-* amd64 x86 ~amd64-fbsd ~x86-fbsd"
-RESTRICT="bindist mirror"
-EMULTILIB_PKG="true"
-
-IUSE="acpi multilib kernel_FreeBSD kernel_linux +kms pax_kernel static-libs +tools gtk3 +X uvm"
-REQUIRED_USE="
-	tools? ( X )
-	static-libs? ( tools )
-"
-
-COMMON="
-	app-eselect/eselect-opencl
-	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
-	tools? (
-		dev-libs/atk
-		dev-libs/glib:2
-		dev-libs/jansson
-		gtk3? ( x11-libs/gtk+:3 )
-		x11-libs/cairo
-		x11-libs/gdk-pixbuf[X]
-		x11-libs/gtk+:2
-		x11-libs/libX11
-		x11-libs/libXext
-		x11-libs/libXrandr
-		x11-libs/libXv
-		x11-libs/libXxf86vm
-		x11-libs/pango[X]
-	)
-	X? (
-		>=app-eselect/eselect-opengl-1.0.9
-	)
-"
-DEPEND="
-	${COMMON}
-	kernel_linux? ( virtual/linux-sources )
-"
-RDEPEND="
-	${COMMON}
-	acpi? ( sys-power/acpid )
-	tools? ( !media-video/nvidia-settings )
-	X? (
-		<x11-base/xorg-server-1.18.99:=
-		>=x11-libs/libvdpau-1.0
-		multilib? (
-			>=x11-libs/libX11-1.6.2[abi_x86_32]
-			>=x11-libs/libXext-1.3.2[abi_x86_32]
-		)
-	)
-"
-
-QA_PREBUILT="opt/* usr/lib*"
-
-S=${WORKDIR}/
-
-pkg_pretend() {
-	if use amd64 && has_multilib_profile && \
-		[ "${DEFAULT_ABI}" != "amd64" ]; then
-		eerror "This ebuild doesn't currently support changing your default ABI"
-		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
-	fi
-
-	if use kernel_linux && kernel_is ge 4 4; then
-		ewarn "Gentoo supports kernels which are supported by NVIDIA"
-		ewarn "which are limited to the following kernels:"
-		ewarn "<sys-kernel/gentoo-sources-4.4"
-		ewarn "<sys-kernel/vanilla-sources-4.4"
-		ewarn ""
-		ewarn "You are free to utilize epatch_user to provide whatever"
-		ewarn "support you feel is appropriate, but will not receive"
-		ewarn "support as a result of those changes."
-		ewarn ""
-		ewarn "Do not file a bug report about this."
-		ewarn ""
-	fi
-
-	# Since Nvidia ships many different series of drivers, we need to give the user
-	# some kind of guidance as to what version they should install. This tries
-	# to point the user in the right direction but can't be perfect. check
-	# nvidia-driver.eclass
-	nvidia-driver-check-warning
-
-	# Kernel features/options to check for
-	CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
-	use x86 && CONFIG_CHECK+=" ~HIGHMEM"
-
-	# Now do the above checks
-	use kernel_linux && check_extra_config
-}
-
-pkg_setup() {
-	# try to turn off distcc and ccache for people that have a problem with it
-	export DISTCC_DISABLE=1
-	export CCACHE_DISABLE=1
-
-	if use kernel_linux; then
-		MODULE_NAMES="nvidia(video:${S}/kernel)"
-		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
-		use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel)"
-
-		# This needs to run after MODULE_NAMES (so that the eclass checks
-		# whether the kernel supports loadable modules) but before BUILD_PARAMS
-		# is set (so that KV_DIR is populated).
-		linux-mod_pkg_setup
-
-		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
-		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
-
-		# linux-mod_src_compile calls set_arch_to_kernel, which
-		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
-		# expects x86_64 or i386 and then converts it to x86
-		# later on in the build process
-		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
-	fi
-
-	# set variables to where files are in the package structure
-	if use kernel_FreeBSD; then
-		use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
-		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
-		NV_DOC="${S}/doc"
-		NV_OBJ="${S}/obj"
-		NV_SRC="${S}/src"
-		NV_MAN="${S}/x11/man"
-		NV_X11="${S}/obj"
-		NV_SOVER=1
-	elif use kernel_linux; then
-		NV_DOC="${S}"
-		NV_OBJ="${S}"
-		NV_SRC="${S}/kernel"
-		NV_MAN="${S}"
-		NV_X11="${S}"
-		NV_SOVER=${PV}
-	else
-		die "Could not determine proper NVIDIA package"
-	fi
-}
-
-src_prepare() {
-	# Please add a brief description for every added patch
-
-	if use kernel_linux; then
-		if kernel_is lt 2 6 9; then
-			eerror "You must build this against 2.6.9 or higher kernels."
-		fi
-
-		# If greater than 2.6.5 use M= instead of SUBDIR=
-#		convert_to_m "${NV_SRC}"/Makefile.kbuild
-	fi
-
-	if use pax_kernel; then
-		ewarn "Using PAX patches is not supported. You will be asked to"
-		ewarn "use a standard kernel should you have issues. Should you"
-		ewarn "need support with these patches, contact the PaX team."
-		epatch "${FILESDIR}"/${PN}-355.06-pax.patch
-	fi
-
-	# Allow user patches so they can support RC kernels and whatever else
-	epatch_user
-}
-
-src_compile() {
-	# This is already the default on Linux, as there's no toplevel Makefile, but
-	# on FreeBSD there's one and triggers the kernel module build, as we install
-	# it by itself, pass this.
-
-	cd "${NV_SRC}"
-	if use kernel_FreeBSD; then
-		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
-			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
-	elif use kernel_linux; then
-		MAKEOPTS=-j1
-		linux-mod_src_compile
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			AR="$(tc-getAR)" \
-			CC="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			RANLIB="$(tc-getRANLIB)" \
-			build-xnvctrl
-
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			CC="$(tc-getCC)" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LD="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			NVML_ENABLED=0 \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			NV_VERBOSE=1 \
-			STRIP_CMD=true
-	fi
-}
-
-# Install nvidia library:
-# the first parameter is the library to install
-# the second parameter is the provided soversion
-# the third parameter is the target directory if it is not /usr/lib
-donvidia() {
-	# Full path to library minus SOVER
-	MY_LIB="$1"
-
-	# SOVER to use
-	MY_SOVER="$2"
-
-	# Where to install
-	MY_DEST="$3"
-
-	if [[ -z "${MY_DEST}" ]]; then
-		MY_DEST="/usr/$(get_libdir)"
-		action="dolib.so"
-	else
-		exeinto ${MY_DEST}
-		action="doexe"
-	fi
-
-	# Get just the library name
-	libname=$(basename $1)
-
-	# Install the library with the correct SOVER
-	${action} ${MY_LIB}.${MY_SOVER} || \
-		die "failed to install ${libname}"
-
-	# If SOVER wasn't 1, then we need to create a .1 symlink
-	if [[ "${MY_SOVER}" != "1" ]]; then
-		dosym ${libname}.${MY_SOVER} \
-			${MY_DEST}/${libname}.1 || \
-			die "failed to create ${libname} symlink"
-	fi
-
-	# Always create the symlink from the raw lib to the .1
-	dosym ${libname}.1 \
-		${MY_DEST}/${libname} || \
-		die "failed to create ${libname} symlink"
-}
-
-src_install() {
-	if use kernel_linux; then
-		linux-mod_src_install
-
-		# Add the aliases
-		# This file is tweaked with the appropriate video group in
-		# pkg_preinst, see bug #491414
-		insinto /etc/modprobe.d
-		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
-		doins "${FILESDIR}"/nvidia-rmmod.conf
-
-		# Ensures that our device nodes are created when not using X
-		exeinto "$(get_udevdir)"
-		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
-		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
-	elif use kernel_FreeBSD; then
-		if use x86-fbsd; then
-			insinto /boot/modules
-			doins "${S}/src/nvidia.kld"
-		fi
-
-		exeinto /boot/modules
-		doexe "${S}/src/nvidia.ko"
-	fi
-
-	# NVIDIA kernel <-> userspace driver config lib
-	donvidia ${NV_OBJ}/libnvidia-cfg.so ${NV_SOVER}
-
-	# NVIDIA framebuffer capture library
-	donvidia ${NV_OBJ}/libnvidia-fbc.so ${NV_SOVER}
-
-	# NVIDIA video encode/decode <-> CUDA
-	if use kernel_linux; then
-		donvidia ${NV_OBJ}/libnvcuvid.so ${NV_SOVER}
-		donvidia ${NV_OBJ}/libnvidia-encode.so ${NV_SOVER}
-	fi
-
-	if use X; then
-		# Xorg DDX driver
-		insinto /usr/$(get_libdir)/xorg/modules/drivers
-		doins ${NV_X11}/nvidia_drv.so
-
-		# Xorg GLX driver
-		donvidia ${NV_X11}/libglx.so ${NV_SOVER} \
-			/usr/$(get_libdir)/opengl/nvidia/extensions
-
-		# Xorg nvidia.conf
-		if has_version '>=x11-base/xorg-server-1.16'; then
-			insinto /usr/share/X11/xorg.conf.d
-			newins {,50-}nvidia-drm-outputclass.conf
-		fi
-	fi
-
-	# OpenCL ICD for NVIDIA
-	if use kernel_linux; then
-		insinto /etc/OpenCL/vendors
-		doins ${NV_OBJ}/nvidia.icd
-	fi
-
-	# Documentation
-	dohtml ${NV_DOC}/html/*
-	if use kernel_FreeBSD; then
-		dodoc "${NV_DOC}/README"
-		use X && doman "${NV_MAN}/nvidia-xconfig.1"
-		use tools && doman "${NV_MAN}/nvidia-settings.1"
-	else
-		# Docs
-		newdoc "${NV_DOC}/README.txt" README
-		dodoc "${NV_DOC}/NVIDIA_Changelog"
-		doman "${NV_MAN}/nvidia-smi.1.gz"
-		use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
-		use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
-		doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
-	fi
-
-	# Helper Apps
-	exeinto /opt/bin/
-
-	if use X; then
-		doexe ${NV_OBJ}/nvidia-xconfig
-	fi
-
-	if use kernel_linux; then
-		doexe ${NV_OBJ}/nvidia-cuda-mps-control
-		doexe ${NV_OBJ}/nvidia-cuda-mps-server
-		doexe ${NV_OBJ}/nvidia-debugdump
-		doexe ${NV_OBJ}/nvidia-persistenced
-		doexe ${NV_OBJ}/nvidia-smi
-
-		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
-		doexe ${NV_OBJ}/nvidia-modprobe
-		fowners root:video /opt/bin/nvidia-modprobe
-		fperms 4710 /opt/bin/nvidia-modprobe
-		dosym /{opt,usr}/bin/nvidia-modprobe
-
-		doman nvidia-cuda-mps-control.1.gz
-		doman nvidia-modprobe.1.gz
-		doman nvidia-persistenced.1.gz
-		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
-		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
-		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src/ \
-			DESTDIR="${D}" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LIBDIR="${D}/usr/$(get_libdir)" \
-			PREFIX=/usr \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			install
-
-		if use static-libs; then
-			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
-
-			insinto /usr/include/NVCtrl
-			doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
-		fi
-
-		insinto /usr/share/nvidia/
-		doins nvidia-application-profiles-${PV}-key-documentation
-
-		insinto /etc/nvidia
-		newins \
-			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
-
-		# There is no icon in the FreeBSD tarball.
-		use kernel_FreeBSD || \
-			doicon ${NV_OBJ}/nvidia-settings.png
-
-		domenu "${FILESDIR}"/nvidia-settings.desktop
-
-		exeinto /etc/X11/xinit/xinitrc.d
-		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
-	fi
-
-	dobin ${NV_OBJ}/nvidia-bug-report.sh
-
-	if has_multilib_profile && use multilib; then
-		local OABI=${ABI}
-		for ABI in $(get_install_abis); do
-			src_install-libs
-		done
-		ABI=${OABI}
-		unset OABI
-	else
-		src_install-libs
-	fi
-
-	is_final_abi || die "failed to iterate through all ABIs"
-
-	readme.gentoo_create_doc
-}
-
-src_install-libs() {
-	local inslibdir=$(get_libdir)
-	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
-	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
-	local libdir=${NV_OBJ}
-
-	if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
-		libdir=${NV_OBJ}/32
-	fi
-
-	if use X; then
-		NV_GLX_LIBRARIES=(
-			"libEGL.so 1 ${GL_ROOT}"
-			"libEGL_nvidia.so 0 ${GL_ROOT}"
-			"libGL.so ${NV_SOVER} ${GL_ROOT}"
-			"libGLESv1_CM.so ${NV_SOVER} ${GL_ROOT}"
-			"libGLdispatch.so 0 ${GL_ROOT}"
-			"libOpenCL.so 1.0.0 ${CL_ROOT}"
-			"libOpenGL.so 0 ${GL_ROOT}"
-			"libcuda.so ${NV_SOVER}"
-			"libnvcuvid.so ${NV_SOVER}"
-			"libnvidia-compiler.so ${NV_SOVER}"
-			"libnvidia-eglcore.so ${NV_SOVER}"
-			"libnvidia-encode.so ${NV_SOVER}"
-			"libnvidia-fbc.so ${NV_SOVER}"
-			"libnvidia-glcore.so ${NV_SOVER}"
-			"libnvidia-glsi.so ${NV_SOVER}"
-			"libnvidia-ifr.so ${NV_SOVER}"
-			"libnvidia-opencl.so ${NV_SOVER}"
-			"libvdpau.so ${NV_SOVER} ${GL_ROOT}"
-			"libvdpau_nvidia.so ${NV_SOVER}"
-			"libvdpau_trace.so ${NV_SOVER} ${GL_ROOT}"
-		)
-		if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
-		then
-			NV_GLX_LIBRARIES+=( "libnvidia-wfb.so ${NV_SOVER}" )
-		fi
-
-		if use kernel_FreeBSD; then
-			NV_GLX_LIBRARIES+=( "libnvidia-tls.so ${NV_SOVER}" )
-		fi
-
-		if use kernel_linux; then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-ml.so ${NV_SOVER}"
-				"tls/libnvidia-tls.so ${NV_SOVER}"
-			)
-		fi
-
-		for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
-			donvidia ${libdir}/${NV_LIB}
-		done
-
-		# GLES v2 library is special
-		insinto ${GL_ROOT}
-		doexe ${libdir}/libGLESv2.so.${PV}
-		dosym libGLESv2.so.${PV} ${GL_ROOT}/libGLESv2.so.2
-		dosym libGLESv2.so.2 ${GL_ROOT}/libGLESv2.so
-	fi
-}
-
-pkg_preinst() {
-	if use kernel_linux; then
-		linux-mod_pkg_preinst
-
-		local videogroup="$(egetent group video | cut -d ':' -f 3)"
-		if [ -z "${videogroup}" ]; then
-			eerror "Failed to determine the video group gid"
-			die "Failed to determine the video group gid"
-		else
-			sed -i \
-				-e "s:PACKAGE:${PF}:g" \
-				-e "s:VIDEOGID:${videogroup}:" \
-				"${D}"/etc/modprobe.d/nvidia.conf || die
-		fi
-	fi
-
-	# Clean the dynamic libGL stuff's home to ensure
-	# we dont have stale libs floating around
-	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ]; then
-		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
-	fi
-	# Make sure we nuke the old nvidia-glx's env.d file
-	if [ -e "${ROOT}"/etc/env.d/09nvidia ]; then
-		rm -f "${ROOT}"/etc/env.d/09nvidia
-	fi
-}
-
-pkg_postinst() {
-	use kernel_linux && linux-mod_pkg_postinst
-
-	# Switch to the nvidia implementation
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
-	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
-
-	readme.gentoo_print_elog
-
-	if ! use X; then
-		elog "You have elected to not install the X.org driver. Along with"
-		elog "this the OpenGL libraries and VDPAU libraries were not"
-		elog "installed. Additionally, once the driver is loaded your card"
-		elog "and fan will run at max speed which may not be desirable."
-		elog "Use the 'nvidia-smi' init script to have your card and fan"
-		elog "speed scale appropriately."
-		elog
-	fi
-	if ! use tools; then
-		elog "USE=tools controls whether the nvidia-settings application"
-		elog "is installed. If you would like to use it, enable that"
-		elog "flag and re-emerge this ebuild. Optionally you can install"
-		elog "media-video/nvidia-settings"
-		elog
-	fi
-}
-
-pkg_prerm() {
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}
-
-pkg_postrm() {
-	use kernel_linux && linux-mod_pkg_postrm
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-358.16-r6.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-358.16-r6.ebuild
deleted file mode 100644
index de83a03dd35..00000000000
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-358.16-r6.ebuild
+++ /dev/null
@@ -1,539 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-
-inherit eutils flag-o-matic linux-info linux-mod multilib-minimal nvidia-driver \
-	portability toolchain-funcs unpacker user udev
-
-NV_URI="http://us.download.nvidia.com/XFree86/"
-X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
-AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
-X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
-AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
-
-DESCRIPTION="NVIDIA Accelerated Graphics Driver"
-HOMEPAGE="http://www.nvidia.com/ http://www.nvidia.com/Download/Find.aspx"
-SRC_URI="
-	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
-	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
-	x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
-	x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
-	tools? ( ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2 )
-"
-
-LICENSE="GPL-2 NVIDIA-r2"
-SLOT="0/${PV%.*}"
-KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
-RESTRICT="bindist mirror"
-EMULTILIB_PKG="true"
-
-IUSE="acpi multilib kernel_FreeBSD kernel_linux +kms pax_kernel static-libs +tools gtk3 +X uvm"
-REQUIRED_USE="
-	tools? ( X )
-	static-libs? ( tools )
-"
-
-COMMON="
-	app-eselect/eselect-opencl
-	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
-	tools? (
-		dev-libs/atk
-		dev-libs/glib:2
-		dev-libs/jansson
-		gtk3? (
-			x11-libs/gtk+:3
-		)
-		x11-libs/cairo
-		x11-libs/gdk-pixbuf[X]
-		x11-libs/gtk+:2
-		x11-libs/libX11
-		x11-libs/libXext
-		x11-libs/libXrandr
-		x11-libs/libXv
-		x11-libs/libXxf86vm
-		x11-libs/pango[X]
-	)
-	X? (
-		>=app-eselect/eselect-opengl-1.0.9
-	)
-"
-DEPEND="
-	${COMMON}
-	kernel_linux? ( virtual/linux-sources )
-"
-RDEPEND="
-	${COMMON}
-	acpi? ( sys-power/acpid )
-	tools? ( !media-video/nvidia-settings )
-	X? (
-		<x11-base/xorg-server-1.18.99:=
-		>=x11-libs/libvdpau-1.0[${MULTILIB_USEDEP}]
-		sys-libs/zlib[${MULTILIB_USEDEP}]
-		>=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
-		>=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
-	)
-"
-
-QA_PREBUILT="opt/* usr/lib*"
-
-S=${WORKDIR}/
-
-pkg_pretend() {
-	if use amd64 && has_multilib_profile && \
-		[ "${DEFAULT_ABI}" != "amd64" ]; then
-		eerror "This ebuild doesn't currently support changing your default ABI"
-		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
-	fi
-
-	if use kernel_linux && kernel_is ge 4 4; then
-		ewarn "Gentoo supports kernels which are supported by NVIDIA"
-		ewarn "which are limited to the following kernels:"
-		ewarn "<sys-kernel/gentoo-sources-4.4"
-		ewarn "<sys-kernel/vanilla-sources-4.4"
-		ewarn ""
-		ewarn "You are free to utilize epatch_user to provide whatever"
-		ewarn "support you feel is appropriate, but will not receive"
-		ewarn "support as a result of those changes."
-		ewarn ""
-		ewarn "Do not file a bug report about this."
-		ewarn ""
-	fi
-
-	# Since Nvidia ships many different series of drivers, we need to give the user
-	# some kind of guidance as to what version they should install. This tries
-	# to point the user in the right direction but can't be perfect. check
-	# nvidia-driver.eclass
-	nvidia-driver-check-warning
-
-	# Kernel features/options to check for
-	CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
-	use x86 && CONFIG_CHECK+=" ~HIGHMEM"
-
-	# Now do the above checks
-	use kernel_linux && check_extra_config
-}
-
-pkg_setup() {
-	# try to turn off distcc and ccache for people that have a problem with it
-	export DISTCC_DISABLE=1
-	export CCACHE_DISABLE=1
-
-	if use kernel_linux; then
-		MODULE_NAMES="nvidia(video:${S}/kernel)"
-		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
-		use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel)"
-
-		# This needs to run after MODULE_NAMES (so that the eclass checks
-		# whether the kernel supports loadable modules) but before BUILD_PARAMS
-		# is set (so that KV_DIR is populated).
-		linux-mod_pkg_setup
-
-		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
-		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
-
-		# linux-mod_src_compile calls set_arch_to_kernel, which
-		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
-		# expects x86_64 or i386 and then converts it to x86
-		# later on in the build process
-		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
-	fi
-
-	# set variables to where files are in the package structure
-	if use kernel_FreeBSD; then
-		use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
-		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
-		NV_DOC="${S}/doc"
-		NV_OBJ="${S}/obj"
-		NV_SRC="${S}/src"
-		NV_MAN="${S}/x11/man"
-		NV_X11="${S}/obj"
-		NV_SOVER=1
-	elif use kernel_linux; then
-		NV_DOC="${S}"
-		NV_OBJ="${S}"
-		NV_SRC="${S}/kernel"
-		NV_MAN="${S}"
-		NV_X11="${S}"
-		NV_SOVER=${PV}
-	else
-		die "Could not determine proper NVIDIA package"
-	fi
-}
-
-src_prepare() {
-	# Please add a brief description for every added patch
-
-	if use kernel_linux; then
-		if kernel_is lt 2 6 9; then
-			eerror "You must build this against 2.6.9 or higher kernels."
-		fi
-
-		# If greater than 2.6.5 use M= instead of SUBDIR=
-#		convert_to_m "${NV_SRC}"/Makefile.kbuild
-	fi
-
-	if use pax_kernel; then
-		ewarn "Using PAX patches is not supported. You will be asked to"
-		ewarn "use a standard kernel should you have issues. Should you"
-		ewarn "need support with these patches, contact the PaX team."
-		epatch "${FILESDIR}"/${PN}-355.06-pax.patch
-	fi
-
-	# Allow user patches so they can support RC kernels and whatever else
-	epatch_user
-}
-
-src_compile() {
-	# This is already the default on Linux, as there's no toplevel Makefile, but
-	# on FreeBSD there's one and triggers the kernel module build, as we install
-	# it by itself, pass this.
-
-	cd "${NV_SRC}"
-	if use kernel_FreeBSD; then
-		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
-			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
-	elif use kernel_linux; then
-		MAKEOPTS=-j1
-		linux-mod_src_compile
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			AR="$(tc-getAR)" \
-			CC="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			RANLIB="$(tc-getRANLIB)" \
-			build-xnvctrl
-
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			CC="$(tc-getCC)" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LD="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			NVML_ENABLED=0 \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			NV_VERBOSE=1 \
-			STRIP_CMD=true
-	fi
-}
-
-# Install nvidia library:
-# the first parameter is the library to install
-# the second parameter is the provided soversion
-# the third parameter is the target directory if it is not /usr/lib
-donvidia() {
-	# Full path to library minus SOVER
-	MY_LIB="$1"
-
-	# SOVER to use
-	MY_SOVER="$2"
-
-	# Where to install
-	MY_DEST="$3"
-
-	if [[ -z "${MY_DEST}" ]]; then
-		MY_DEST="/usr/$(get_libdir)"
-		action="dolib.so"
-	else
-		exeinto ${MY_DEST}
-		action="doexe"
-	fi
-
-	# Get just the library name
-	libname=$(basename $1)
-
-	# Install the library with the correct SOVER
-	${action} ${MY_LIB}.${MY_SOVER} || \
-		die "failed to install ${libname}"
-
-	# If SOVER wasn't 1, then we need to create a .1 symlink
-	if [[ "${MY_SOVER}" != "1" ]]; then
-		dosym ${libname}.${MY_SOVER} \
-			${MY_DEST}/${libname}.1 || \
-			die "failed to create ${libname} symlink"
-	fi
-
-	# Always create the symlink from the raw lib to the .1
-	dosym ${libname}.1 \
-		${MY_DEST}/${libname} || \
-		die "failed to create ${libname} symlink"
-}
-
-src_install() {
-	if use kernel_linux; then
-		linux-mod_src_install
-
-		# Add the aliases
-		# This file is tweaked with the appropriate video group in
-		# pkg_preinst, see bug #491414
-		insinto /etc/modprobe.d
-		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
-		doins "${FILESDIR}"/nvidia-rmmod.conf
-
-		# Ensures that our device nodes are created when not using X
-		exeinto "$(get_udevdir)"
-		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
-		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
-	elif use kernel_FreeBSD; then
-		if use x86-fbsd; then
-			insinto /boot/modules
-			doins "${S}/src/nvidia.kld"
-		fi
-
-		exeinto /boot/modules
-		doexe "${S}/src/nvidia.ko"
-	fi
-
-	# NVIDIA kernel <-> userspace driver config lib
-	donvidia ${NV_OBJ}/libnvidia-cfg.so ${NV_SOVER}
-
-	# NVIDIA framebuffer capture library
-	donvidia ${NV_OBJ}/libnvidia-fbc.so ${NV_SOVER}
-
-	# NVIDIA video encode/decode <-> CUDA
-	if use kernel_linux; then
-		donvidia ${NV_OBJ}/libnvcuvid.so ${NV_SOVER}
-		donvidia ${NV_OBJ}/libnvidia-encode.so ${NV_SOVER}
-	fi
-
-	if use X; then
-		# Xorg DDX driver
-		insinto /usr/$(get_libdir)/xorg/modules/drivers
-		doins ${NV_X11}/nvidia_drv.so
-
-		# Xorg GLX driver
-		donvidia ${NV_X11}/libglx.so ${NV_SOVER} \
-			/usr/$(get_libdir)/opengl/nvidia/extensions
-
-		# Xorg nvidia.conf
-		if has_version '>=x11-base/xorg-server-1.16'; then
-			insinto /usr/share/X11/xorg.conf.d
-			newins {,50-}nvidia-drm-outputclass.conf
-		fi
-	fi
-
-	# OpenCL ICD for NVIDIA
-	if use kernel_linux; then
-		insinto /etc/OpenCL/vendors
-		doins ${NV_OBJ}/nvidia.icd
-	fi
-
-	# Documentation
-	dohtml ${NV_DOC}/html/*
-	if use kernel_FreeBSD; then
-		dodoc "${NV_DOC}/README"
-		use X && doman "${NV_MAN}/nvidia-xconfig.1"
-		use tools && doman "${NV_MAN}/nvidia-settings.1"
-	else
-		# Docs
-		newdoc "${NV_DOC}/README.txt" README
-		dodoc "${NV_DOC}/NVIDIA_Changelog"
-		doman "${NV_MAN}/nvidia-smi.1.gz"
-		use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
-		use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
-		doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
-	fi
-
-	# Helper Apps
-	exeinto /opt/bin/
-
-	if use X; then
-		doexe ${NV_OBJ}/nvidia-xconfig
-	fi
-
-	if use kernel_linux; then
-		doexe ${NV_OBJ}/nvidia-cuda-mps-control
-		doexe ${NV_OBJ}/nvidia-cuda-mps-server
-		doexe ${NV_OBJ}/nvidia-debugdump
-		doexe ${NV_OBJ}/nvidia-persistenced
-		doexe ${NV_OBJ}/nvidia-smi
-
-		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
-		doexe ${NV_OBJ}/nvidia-modprobe
-		fowners root:video /opt/bin/nvidia-modprobe
-		fperms 4710 /opt/bin/nvidia-modprobe
-		dosym /{opt,usr}/bin/nvidia-modprobe
-
-		doman nvidia-cuda-mps-control.1.gz
-		doman nvidia-modprobe.1.gz
-		doman nvidia-persistenced.1.gz
-		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
-		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
-		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src/ \
-			DESTDIR="${D}" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LIBDIR="${D}/usr/$(get_libdir)" \
-			PREFIX=/usr \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			install
-
-		if use static-libs; then
-			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
-
-			insinto /usr/include/NVCtrl
-			doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
-		fi
-
-		insinto /usr/share/nvidia/
-		doins nvidia-application-profiles-${PV}-key-documentation
-
-		insinto /etc/nvidia
-		newins \
-			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
-
-		# There is no icon in the FreeBSD tarball.
-		use kernel_FreeBSD || \
-			doicon ${NV_OBJ}/nvidia-settings.png
-
-		domenu "${FILESDIR}"/nvidia-settings.desktop
-
-		exeinto /etc/X11/xinit/xinitrc.d
-		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
-	fi
-
-	dobin ${NV_OBJ}/nvidia-bug-report.sh
-
-	if has_multilib_profile && use multilib; then
-		local OABI=${ABI}
-		for ABI in $(get_install_abis); do
-			src_install-libs
-		done
-		ABI=${OABI}
-		unset OABI
-	else
-		src_install-libs
-	fi
-
-	is_final_abi || die "failed to iterate through all ABIs"
-
-	readme.gentoo_create_doc
-}
-
-src_install-libs() {
-	local inslibdir=$(get_libdir)
-	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
-	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
-	local libdir=${NV_OBJ}
-
-	if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
-		libdir=${NV_OBJ}/32
-	fi
-
-	if use X; then
-		NV_GLX_LIBRARIES=(
-			"libEGL.so 1 ${GL_ROOT}"
-			"libEGL_nvidia.so 0 ${GL_ROOT}"
-			"libGL.so ${NV_SOVER} ${GL_ROOT}"
-			"libGLESv1_CM.so ${NV_SOVER} ${GL_ROOT}"
-			"libGLdispatch.so 0 ${GL_ROOT}"
-			"libOpenCL.so 1.0.0 ${CL_ROOT}"
-			"libOpenGL.so 0 ${GL_ROOT}"
-			"libcuda.so ${NV_SOVER}"
-			"libnvcuvid.so ${NV_SOVER}"
-			"libnvidia-compiler.so ${NV_SOVER}"
-			"libnvidia-eglcore.so ${NV_SOVER}"
-			"libnvidia-encode.so ${NV_SOVER}"
-			"libnvidia-fbc.so ${NV_SOVER}"
-			"libnvidia-glcore.so ${NV_SOVER}"
-			"libnvidia-glsi.so ${NV_SOVER}"
-			"libnvidia-ifr.so ${NV_SOVER}"
-			"libnvidia-opencl.so ${NV_SOVER}"
-			"libvdpau.so ${NV_SOVER} ${GL_ROOT}"
-			"libvdpau_nvidia.so ${NV_SOVER}"
-			"libvdpau_trace.so ${NV_SOVER} ${GL_ROOT}"
-		)
-		if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
-		then
-			NV_GLX_LIBRARIES+=( "libnvidia-wfb.so ${NV_SOVER}" )
-		fi
-
-		if use kernel_FreeBSD; then
-			NV_GLX_LIBRARIES+=( "libnvidia-tls.so ${NV_SOVER}" )
-		fi
-
-		if use kernel_linux; then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-ml.so ${NV_SOVER}"
-				"tls/libnvidia-tls.so ${NV_SOVER}"
-			)
-		fi
-
-		for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
-			donvidia ${libdir}/${NV_LIB}
-		done
-
-		# GLES v2 library is special
-		insinto ${GL_ROOT}
-		doexe ${libdir}/libGLESv2.so.${PV}
-		dosym libGLESv2.so.${PV} ${GL_ROOT}/libGLESv2.so.2
-		dosym libGLESv2.so.2 ${GL_ROOT}/libGLESv2.so
-	fi
-}
-
-pkg_preinst() {
-	if use kernel_linux; then
-		linux-mod_pkg_preinst
-
-		local videogroup="$(egetent group video | cut -d ':' -f 3)"
-		if [ -z "${videogroup}" ]; then
-			eerror "Failed to determine the video group gid"
-			die "Failed to determine the video group gid"
-		else
-			sed -i \
-				-e "s:PACKAGE:${PF}:g" \
-				-e "s:VIDEOGID:${videogroup}:" \
-				"${D}"/etc/modprobe.d/nvidia.conf || die
-		fi
-	fi
-
-	# Clean the dynamic libGL stuff's home to ensure
-	# we dont have stale libs floating around
-	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ]; then
-		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
-	fi
-	# Make sure we nuke the old nvidia-glx's env.d file
-	if [ -e "${ROOT}"/etc/env.d/09nvidia ]; then
-		rm -f "${ROOT}"/etc/env.d/09nvidia
-	fi
-}
-
-pkg_postinst() {
-	use kernel_linux && linux-mod_pkg_postinst
-
-	# Switch to the nvidia implementation
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
-	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
-
-	readme.gentoo_print_elog
-
-	if ! use X; then
-		elog "You have elected to not install the X.org driver. Along with"
-		elog "this the OpenGL libraries and VDPAU libraries were not"
-		elog "installed. Additionally, once the driver is loaded your card"
-		elog "and fan will run at max speed which may not be desirable."
-		elog "Use the 'nvidia-smi' init script to have your card and fan"
-		elog "speed scale appropriately."
-		elog
-	fi
-	if ! use tools; then
-		elog "USE=tools controls whether the nvidia-settings application"
-		elog "is installed. If you would like to use it, enable that"
-		elog "flag and re-emerge this ebuild. Optionally you can install"
-		elog "media-video/nvidia-settings"
-		elog
-	fi
-}
-
-pkg_prerm() {
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}
-
-pkg_postrm() {
-	use kernel_linux && linux-mod_pkg_postrm
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-361.42-r1.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-361.42-r1.ebuild
deleted file mode 100644
index 0dba6a68af0..00000000000
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-361.42-r1.ebuild
+++ /dev/null
@@ -1,529 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-inherit eutils flag-o-matic linux-info linux-mod multilib-minimal nvidia-driver \
-	portability toolchain-funcs unpacker user udev
-
-NV_URI="http://us.download.nvidia.com/XFree86/"
-X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
-AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
-X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
-AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
-
-DESCRIPTION="NVIDIA Accelerated Graphics Driver"
-HOMEPAGE="http://www.nvidia.com/ http://www.nvidia.com/Download/Find.aspx"
-SRC_URI="
-	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
-	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
-	x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
-	x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
-	tools? ( ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2 )
-"
-
-LICENSE="GPL-2 NVIDIA-r2"
-SLOT="0/${PV%.*}"
-KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
-RESTRICT="bindist mirror"
-EMULTILIB_PKG="true"
-
-IUSE="acpi compat +driver gtk3 kernel_FreeBSD kernel_linux +kms multilib pax_kernel static-libs +tools uvm +X"
-REQUIRED_USE="
-	tools? ( X )
-	static-libs? ( tools )
-"
-
-COMMON="
-	app-eselect/eselect-opencl
-	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
-	tools? (
-		dev-libs/atk
-		dev-libs/glib:2
-		dev-libs/jansson
-		gtk3? (
-			x11-libs/gtk+:3
-		)
-		x11-libs/cairo
-		x11-libs/gdk-pixbuf[X]
-		x11-libs/gtk+:2
-		x11-libs/libX11
-		x11-libs/libXext
-		x11-libs/libXrandr
-		x11-libs/libXv
-		x11-libs/libXxf86vm
-		x11-libs/pango[X]
-	)
-	X? (
-		>=app-eselect/eselect-opengl-1.0.9
-		app-misc/pax-utils
-	)
-"
-DEPEND="
-	${COMMON}
-	kernel_linux? ( virtual/linux-sources )
-"
-RDEPEND="
-	${COMMON}
-	acpi? ( sys-power/acpid )
-	tools? ( !media-video/nvidia-settings )
-	X? (
-		<x11-base/xorg-server-1.18.99:=
-		>=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
-		>=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
-		>=x11-libs/libvdpau-1.0
-		sys-libs/zlib[${MULTILIB_USEDEP}]
-	)
-"
-
-QA_PREBUILT="opt/* usr/lib*"
-
-S=${WORKDIR}/
-
-pkg_pretend() {
-	if use amd64 && has_multilib_profile && \
-		[ "${DEFAULT_ABI}" != "amd64" ]; then
-		eerror "This ebuild doesn't currently support changing your default ABI"
-		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
-	fi
-
-	if use kernel_linux && kernel_is ge 4 5; then
-		ewarn "Gentoo supports kernels which are supported by NVIDIA"
-		ewarn "which are limited to the following kernels:"
-		ewarn "<sys-kernel/gentoo-sources-4.5"
-		ewarn "<sys-kernel/vanilla-sources-4.5"
-		ewarn ""
-		ewarn "You are free to utilize eapply_user to provide whatever"
-		ewarn "support you feel is appropriate, but will not receive"
-		ewarn "support as a result of those changes."
-		ewarn ""
-		ewarn "Do not file a bug report about this."
-		ewarn ""
-	fi
-
-	# Since Nvidia ships many different series of drivers, we need to give the user
-	# some kind of guidance as to what version they should install. This tries
-	# to point the user in the right direction but can't be perfect. check
-	# nvidia-driver.eclass
-	nvidia-driver-check-warning
-
-	# Kernel features/options to check for
-	CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
-	use x86 && CONFIG_CHECK+=" ~HIGHMEM"
-
-	# Now do the above checks
-	use kernel_linux && check_extra_config
-}
-
-pkg_setup() {
-	# try to turn off distcc and ccache for people that have a problem with it
-	export DISTCC_DISABLE=1
-	export CCACHE_DISABLE=1
-
-	if use driver && use kernel_linux; then
-		MODULE_NAMES="nvidia(video:${S}/kernel)"
-		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
-		use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel)"
-
-		# This needs to run after MODULE_NAMES (so that the eclass checks
-		# whether the kernel supports loadable modules) but before BUILD_PARAMS
-		# is set (so that KV_DIR is populated).
-		linux-mod_pkg_setup
-
-		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
-		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
-
-		# linux-mod_src_compile calls set_arch_to_kernel, which
-		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
-		# expects x86_64 or i386 and then converts it to x86
-		# later on in the build process
-		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
-	fi
-
-	if use kernel_linux && kernel_is lt 2 6 9; then
-		eerror "You must build this against 2.6.9 or higher kernels."
-	fi
-
-	# set variables to where files are in the package structure
-	if use kernel_FreeBSD; then
-		use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
-		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
-		NV_DOC="${S}/doc"
-		NV_OBJ="${S}/obj"
-		NV_SRC="${S}/src"
-		NV_MAN="${S}/x11/man"
-		NV_X11="${S}/obj"
-		NV_SOVER=1
-	elif use kernel_linux; then
-		NV_DOC="${S}"
-		NV_OBJ="${S}"
-		NV_SRC="${S}/kernel"
-		NV_MAN="${S}"
-		NV_X11="${S}"
-		NV_SOVER=${PV}
-	else
-		die "Could not determine proper NVIDIA package"
-	fi
-}
-
-src_prepare() {
-	if use pax_kernel; then
-		ewarn "Using PAX patches is not supported. You will be asked to"
-		ewarn "use a standard kernel should you have issues. Should you"
-		ewarn "need support with these patches, contact the PaX team."
-		eapply "${FILESDIR}"/${PN}-361.28-pax.patch
-	fi
-
-	# Allow user patches so they can support RC kernels and whatever else
-	eapply_user
-}
-
-src_compile() {
-	# This is already the default on Linux, as there's no toplevel Makefile, but
-	# on FreeBSD there's one and triggers the kernel module build, as we install
-	# it by itself, pass this.
-
-	cd "${NV_SRC}"
-	if use kernel_FreeBSD; then
-		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
-			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
-	elif use driver && use kernel_linux; then
-		MAKEOPTS=-j1 linux-mod_src_compile
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			AR="$(tc-getAR)" \
-			CC="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			RANLIB="$(tc-getRANLIB)" \
-			build-xnvctrl
-
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			CC="$(tc-getCC)" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LD="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			NVML_ENABLED=0 \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			NV_VERBOSE=1 \
-			STRIP_CMD=true
-	fi
-}
-
-# Install nvidia library:
-# the first parameter is the library to install
-# the second parameter is the provided soversion
-# the third parameter is the target directory if it is not /usr/lib
-donvidia() {
-	# Full path to library
-	nv_LIB="${1}"
-
-	# SOVER to use
-	nv_SOVER="$(scanelf -qF'%S#F' ${nv_LIB})"
-
-	# Where to install
-	nv_DEST="${2}"
-
-	# Get just the library name
-	nv_LIBNAME=$(basename "${nv_LIB}")
-
-	if [[ "${nv_DEST}" ]]; then
-		exeinto ${nv_DEST}
-		action="doexe"
-	else
-		nv_DEST="/usr/$(get_libdir)"
-		action="dolib.so"
-	fi
-
-	# Install the library
-	${action} ${nv_LIB} || die "failed to install ${nv_LIBNAME}"
-
-	# If the library has a SONAME and SONAME does not match the library name,
-	# then we need to create a symlink
-	if [[ ${nv_SOVER} ]] && ! [[ "${nv_SOVER}" = "${nv_LIBNAME}" ]]; then
-		dosym ${nv_LIBNAME} ${nv_DEST}/${nv_SOVER} \
-			|| die "failed to create ${nv_DEST}/${nv_SOVER} symlink"
-	fi
-
-	dosym ${nv_LIBNAME} ${nv_DEST}/${nv_LIBNAME/.so*/.so} \
-		|| die "failed to create ${nv_LIBNAME/.so*/.so} symlink"
-}
-
-src_install() {
-	if use driver && use kernel_linux; then
-		linux-mod_src_install
-
-		# Add the aliases
-		# This file is tweaked with the appropriate video group in
-		# pkg_preinst, see bug #491414
-		insinto /etc/modprobe.d
-		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
-		doins "${FILESDIR}"/nvidia-rmmod.conf
-
-		# Ensures that our device nodes are created when not using X
-		exeinto "$(get_udevdir)"
-		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
-		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
-	elif use kernel_FreeBSD; then
-		if use x86-fbsd; then
-			insinto /boot/modules
-			doins "${S}/src/nvidia.kld"
-		fi
-
-		exeinto /boot/modules
-		doexe "${S}/src/nvidia.ko"
-	fi
-
-	# NVIDIA kernel <-> userspace driver config lib
-	donvidia ${NV_OBJ}/libnvidia-cfg.so.${NV_SOVER}
-
-	# NVIDIA framebuffer capture library
-	donvidia ${NV_OBJ}/libnvidia-fbc.so.${NV_SOVER}
-
-	# NVIDIA video encode/decode <-> CUDA
-	if use kernel_linux; then
-		donvidia ${NV_OBJ}/libnvcuvid.so.${NV_SOVER}
-		donvidia ${NV_OBJ}/libnvidia-encode.so.${NV_SOVER}
-	fi
-
-	if use X; then
-		# Xorg DDX driver
-		insinto /usr/$(get_libdir)/xorg/modules/drivers
-		doins ${NV_X11}/nvidia_drv.so
-
-		# Xorg GLX driver
-		donvidia ${NV_X11}/libglx.so.${NV_SOVER} \
-			/usr/$(get_libdir)/opengl/nvidia/extensions
-
-		# Xorg nvidia.conf
-		if has_version '>=x11-base/xorg-server-1.16'; then
-			insinto /usr/share/X11/xorg.conf.d
-			newins {,50-}nvidia-drm-outputclass.conf
-		fi
-	fi
-
-	# OpenCL ICD for NVIDIA
-	if use kernel_linux; then
-		insinto /etc/OpenCL/vendors
-		doins ${NV_OBJ}/nvidia.icd
-	fi
-
-	# Documentation
-	dohtml ${NV_DOC}/html/*
-	if use kernel_FreeBSD; then
-		dodoc "${NV_DOC}/README"
-		use X && doman "${NV_MAN}/nvidia-xconfig.1"
-		use tools && doman "${NV_MAN}/nvidia-settings.1"
-	else
-		# Docs
-		newdoc "${NV_DOC}/README.txt" README
-		dodoc "${NV_DOC}/NVIDIA_Changelog"
-		doman "${NV_MAN}/nvidia-smi.1.gz"
-		use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
-		use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
-		doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
-	fi
-
-	# Helper Apps
-	exeinto /opt/bin/
-
-	if use X; then
-		doexe ${NV_OBJ}/nvidia-xconfig
-	fi
-
-	if use kernel_linux; then
-		doexe ${NV_OBJ}/nvidia-cuda-mps-control
-		doexe ${NV_OBJ}/nvidia-cuda-mps-server
-		doexe ${NV_OBJ}/nvidia-debugdump
-		doexe ${NV_OBJ}/nvidia-persistenced
-		doexe ${NV_OBJ}/nvidia-smi
-
-		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
-		doexe ${NV_OBJ}/nvidia-modprobe
-		fowners root:video /opt/bin/nvidia-modprobe
-		fperms 4710 /opt/bin/nvidia-modprobe
-		dosym /{opt,usr}/bin/nvidia-modprobe
-
-		doman nvidia-cuda-mps-control.1.gz
-		doman nvidia-modprobe.1.gz
-		doman nvidia-persistenced.1.gz
-		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
-		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
-		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src/ \
-			DESTDIR="${D}" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LIBDIR="${D}/usr/$(get_libdir)" \
-			PREFIX=/usr \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			install
-
-		if use static-libs; then
-			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
-
-			insinto /usr/include/NVCtrl
-			doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
-		fi
-
-		insinto /usr/share/nvidia/
-		doins nvidia-application-profiles-${PV}-key-documentation
-
-		insinto /etc/nvidia
-		newins \
-			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
-
-		# There is no icon in the FreeBSD tarball.
-		use kernel_FreeBSD || \
-			doicon ${NV_OBJ}/nvidia-settings.png
-
-		domenu "${FILESDIR}"/nvidia-settings.desktop
-
-		exeinto /etc/X11/xinit/xinitrc.d
-		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
-	fi
-
-	dobin ${NV_OBJ}/nvidia-bug-report.sh
-
-	if has_multilib_profile && use multilib; then
-		local OABI=${ABI}
-		for ABI in $(get_install_abis); do
-			src_install-libs
-		done
-		ABI=${OABI}
-		unset OABI
-	else
-		src_install-libs
-	fi
-
-	is_final_abi || die "failed to iterate through all ABIs"
-
-	readme.gentoo_create_doc
-}
-
-src_install-libs() {
-	local inslibdir=$(get_libdir)
-	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
-	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
-	local libdir=${NV_OBJ}
-
-	if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
-		libdir=${NV_OBJ}/32
-	fi
-
-	if use X; then
-		NV_GLX_LIBRARIES=(
-			"libEGL.so.1 ${GL_ROOT}"
-			"libEGL_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGL.so.$(usex compat ${NV_SOVER} 1.0.0) ${GL_ROOT}"
-			"libGLESv1_CM.so.1 ${GL_ROOT}"
-			"libGLESv1_CM_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLESv2.so.2 ${GL_ROOT}"
-			"libGLESv2_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLX.so.0 ${GL_ROOT}"
-			"libGLX_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLdispatch.so.0 ${GL_ROOT}"
-			"libOpenCL.so.1.0.0 ${CL_ROOT}"
-			"libOpenGL.so.0 ${GL_ROOT}"
-			"libcuda.so.${NV_SOVER}"
-			"libnvcuvid.so.${NV_SOVER}"
-			"libnvidia-compiler.so.${NV_SOVER}"
-			"libnvidia-eglcore.so.${NV_SOVER}"
-			"libnvidia-encode.so.${NV_SOVER}"
-			"libnvidia-fatbinaryloader.so.${NV_SOVER}"
-			"libnvidia-fbc.so.${NV_SOVER}"
-			"libnvidia-glcore.so.${NV_SOVER}"
-			"libnvidia-glsi.so.${NV_SOVER}"
-			"libnvidia-ifr.so.${NV_SOVER}"
-			"libnvidia-opencl.so.${NV_SOVER}"
-			"libnvidia-ptxjitcompiler.so.${NV_SOVER}"
-			"libvdpau_nvidia.so.${NV_SOVER}"
-		)
-
-		if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
-		then
-			NV_GLX_LIBRARIES+=( "libnvidia-wfb.so.${NV_SOVER}" )
-		fi
-
-		if use kernel_FreeBSD; then
-			NV_GLX_LIBRARIES+=( "libnvidia-tls.so.${NV_SOVER}" )
-		fi
-
-		if use kernel_linux; then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-ml.so.${NV_SOVER}"
-				"tls/libnvidia-tls.so.${NV_SOVER}"
-			)
-		fi
-
-		for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
-			donvidia ${libdir}/${NV_LIB}
-		done
-	fi
-}
-
-pkg_preinst() {
-	if use driver && use kernel_linux; then
-		linux-mod_pkg_preinst
-
-		local videogroup="$(egetent group video | cut -d ':' -f 3)"
-		if [ -z "${videogroup}" ]; then
-			eerror "Failed to determine the video group gid"
-			die "Failed to determine the video group gid"
-		else
-			sed -i \
-				-e "s:PACKAGE:${PF}:g" \
-				-e "s:VIDEOGID:${videogroup}:" \
-				"${D}"/etc/modprobe.d/nvidia.conf || die
-		fi
-	fi
-
-	# Clean the dynamic libGL stuff's home to ensure
-	# we dont have stale libs floating around
-	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ]; then
-		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
-	fi
-	# Make sure we nuke the old nvidia-glx's env.d file
-	if [ -e "${ROOT}"/etc/env.d/09nvidia ]; then
-		rm -f "${ROOT}"/etc/env.d/09nvidia
-	fi
-}
-
-pkg_postinst() {
-	use driver && use kernel_linux && linux-mod_pkg_postinst
-
-	# Switch to the nvidia implementation
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
-	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
-
-	readme.gentoo_print_elog
-
-	if ! use X; then
-		elog "You have elected to not install the X.org driver. Along with"
-		elog "this the OpenGL libraries and VDPAU libraries were not"
-		elog "installed. Additionally, once the driver is loaded your card"
-		elog "and fan will run at max speed which may not be desirable."
-		elog "Use the 'nvidia-smi' init script to have your card and fan"
-		elog "speed scale appropriately."
-		elog
-	fi
-	if ! use tools; then
-		elog "USE=tools controls whether the nvidia-settings application"
-		elog "is installed. If you would like to use it, enable that"
-		elog "flag and re-emerge this ebuild. Optionally you can install"
-		elog "media-video/nvidia-settings"
-		elog
-	fi
-}
-
-pkg_prerm() {
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}
-
-pkg_postrm() {
-	use driver && use kernel_linux && linux-mod_pkg_postrm
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-361.42.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-361.42.ebuild
deleted file mode 100644
index c1de4d2fe82..00000000000
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-361.42.ebuild
+++ /dev/null
@@ -1,528 +0,0 @@
-# Copyright 1999-2016 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-
-inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \
-	portability toolchain-funcs unpacker user udev
-
-NV_URI="http://us.download.nvidia.com/XFree86/"
-X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
-AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
-X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
-AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
-
-DESCRIPTION="NVIDIA Accelerated Graphics Driver"
-HOMEPAGE="http://www.nvidia.com/ http://www.nvidia.com/Download/Find.aspx"
-SRC_URI="
-	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
-	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
-	x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
-	x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
-	tools? ( ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2 )
-"
-
-LICENSE="GPL-2 NVIDIA-r2"
-SLOT="0/${PV%.*}"
-KEYWORDS="-* amd64 x86 ~amd64-fbsd ~x86-fbsd"
-RESTRICT="bindist mirror"
-EMULTILIB_PKG="true"
-
-IUSE="acpi compat +driver gtk3 kernel_FreeBSD kernel_linux +kms multilib pax_kernel static-libs +tools uvm +X"
-REQUIRED_USE="
-	tools? ( X )
-	static-libs? ( tools )
-"
-
-COMMON="
-	app-eselect/eselect-opencl
-	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
-	tools? (
-		dev-libs/atk
-		dev-libs/glib:2
-		dev-libs/jansson
-		gtk3? ( x11-libs/gtk+:3 )
-		x11-libs/cairo
-		x11-libs/gdk-pixbuf[X]
-		x11-libs/gtk+:2
-		x11-libs/libX11
-		x11-libs/libXext
-		x11-libs/libXrandr
-		x11-libs/libXv
-		x11-libs/libXxf86vm
-		x11-libs/pango[X]
-	)
-	X? (
-		>=app-eselect/eselect-opengl-1.0.9
-		app-misc/pax-utils
-	)
-"
-DEPEND="
-	${COMMON}
-	kernel_linux? ( virtual/linux-sources )
-"
-RDEPEND="
-	${COMMON}
-	acpi? ( sys-power/acpid )
-	tools? ( !media-video/nvidia-settings )
-	X? (
-		<x11-base/xorg-server-1.18.99:=
-		>=x11-libs/libvdpau-1.0
-		multilib? (
-			>=x11-libs/libX11-1.6.2[abi_x86_32]
-			>=x11-libs/libXext-1.3.2[abi_x86_32]
-		)
-	)
-"
-
-QA_PREBUILT="opt/* usr/lib*"
-
-S=${WORKDIR}/
-
-pkg_pretend() {
-	if use amd64 && has_multilib_profile && \
-		[ "${DEFAULT_ABI}" != "amd64" ]; then
-		eerror "This ebuild doesn't currently support changing your default ABI"
-		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
-	fi
-
-	if use kernel_linux && kernel_is ge 4 5; then
-		ewarn "Gentoo supports kernels which are supported by NVIDIA"
-		ewarn "which are limited to the following kernels:"
-		ewarn "<sys-kernel/gentoo-sources-4.5"
-		ewarn "<sys-kernel/vanilla-sources-4.5"
-		ewarn ""
-		ewarn "You are free to utilize epatch_user to provide whatever"
-		ewarn "support you feel is appropriate, but will not receive"
-		ewarn "support as a result of those changes."
-		ewarn ""
-		ewarn "Do not file a bug report about this."
-		ewarn ""
-	fi
-
-	# Since Nvidia ships many different series of drivers, we need to give the user
-	# some kind of guidance as to what version they should install. This tries
-	# to point the user in the right direction but can't be perfect. check
-	# nvidia-driver.eclass
-	nvidia-driver-check-warning
-
-	# Kernel features/options to check for
-	CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
-	use x86 && CONFIG_CHECK+=" ~HIGHMEM"
-
-	# Now do the above checks
-	use kernel_linux && check_extra_config
-}
-
-pkg_setup() {
-	# try to turn off distcc and ccache for people that have a problem with it
-	export DISTCC_DISABLE=1
-	export CCACHE_DISABLE=1
-
-	if use driver && use kernel_linux; then
-		MODULE_NAMES="nvidia(video:${S}/kernel)"
-		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
-		use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel)"
-
-		# This needs to run after MODULE_NAMES (so that the eclass checks
-		# whether the kernel supports loadable modules) but before BUILD_PARAMS
-		# is set (so that KV_DIR is populated).
-		linux-mod_pkg_setup
-
-		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
-		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
-
-		# linux-mod_src_compile calls set_arch_to_kernel, which
-		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
-		# expects x86_64 or i386 and then converts it to x86
-		# later on in the build process
-		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
-	fi
-
-	if use kernel_linux && kernel_is lt 2 6 9; then
-		eerror "You must build this against 2.6.9 or higher kernels."
-	fi
-
-	# set variables to where files are in the package structure
-	if use kernel_FreeBSD; then
-		use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
-		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
-		NV_DOC="${S}/doc"
-		NV_OBJ="${S}/obj"
-		NV_SRC="${S}/src"
-		NV_MAN="${S}/x11/man"
-		NV_X11="${S}/obj"
-		NV_SOVER=1
-	elif use kernel_linux; then
-		NV_DOC="${S}"
-		NV_OBJ="${S}"
-		NV_SRC="${S}/kernel"
-		NV_MAN="${S}"
-		NV_X11="${S}"
-		NV_SOVER=${PV}
-	else
-		die "Could not determine proper NVIDIA package"
-	fi
-}
-
-src_prepare() {
-	if use pax_kernel; then
-		ewarn "Using PAX patches is not supported. You will be asked to"
-		ewarn "use a standard kernel should you have issues. Should you"
-		ewarn "need support with these patches, contact the PaX team."
-		epatch "${FILESDIR}"/${PN}-361.28-pax.patch
-	fi
-
-	# Allow user patches so they can support RC kernels and whatever else
-	epatch_user
-}
-
-src_compile() {
-	# This is already the default on Linux, as there's no toplevel Makefile, but
-	# on FreeBSD there's one and triggers the kernel module build, as we install
-	# it by itself, pass this.
-
-	cd "${NV_SRC}"
-	if use kernel_FreeBSD; then
-		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
-			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
-	elif use driver && use kernel_linux; then
-		MAKEOPTS=-j1 linux-mod_src_compile
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			AR="$(tc-getAR)" \
-			CC="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			RANLIB="$(tc-getRANLIB)" \
-			build-xnvctrl
-
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			CC="$(tc-getCC)" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LD="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			NVML_ENABLED=0 \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			NV_VERBOSE=1 \
-			STRIP_CMD=true
-	fi
-}
-
-# Install nvidia library:
-# the first parameter is the library to install
-# the second parameter is the provided soversion
-# the third parameter is the target directory if it is not /usr/lib
-donvidia() {
-	# Full path to library
-	nv_LIB="${1}"
-
-	# SOVER to use
-	nv_SOVER="$(scanelf -qF'%S#F' ${nv_LIB})"
-
-	# Where to install
-	nv_DEST="${2}"
-
-	# Get just the library name
-	nv_LIBNAME=$(basename "${nv_LIB}")
-
-	if [[ "${nv_DEST}" ]]; then
-		exeinto ${nv_DEST}
-		action="doexe"
-	else
-		nv_DEST="/usr/$(get_libdir)"
-		action="dolib.so"
-	fi
-
-	# Install the library
-	${action} ${nv_LIB} || die "failed to install ${nv_LIBNAME}"
-
-	# If the library has a SONAME and SONAME does not match the library name,
-	# then we need to create a symlink
-	if [[ ${nv_SOVER} ]] && ! [[ "${nv_SOVER}" = "${nv_LIBNAME}" ]]; then
-		dosym ${nv_LIBNAME} ${nv_DEST}/${nv_SOVER} \
-			|| die "failed to create ${nv_DEST}/${nv_SOVER} symlink"
-	fi
-
-	dosym ${nv_LIBNAME} ${nv_DEST}/${nv_LIBNAME/.so*/.so} \
-		|| die "failed to create ${nv_LIBNAME/.so*/.so} symlink"
-}
-
-src_install() {
-	if use driver && use kernel_linux; then
-		linux-mod_src_install
-
-		# Add the aliases
-		# This file is tweaked with the appropriate video group in
-		# pkg_preinst, see bug #491414
-		insinto /etc/modprobe.d
-		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
-		doins "${FILESDIR}"/nvidia-rmmod.conf
-
-		# Ensures that our device nodes are created when not using X
-		exeinto "$(get_udevdir)"
-		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
-		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
-	elif use kernel_FreeBSD; then
-		if use x86-fbsd; then
-			insinto /boot/modules
-			doins "${S}/src/nvidia.kld"
-		fi
-
-		exeinto /boot/modules
-		doexe "${S}/src/nvidia.ko"
-	fi
-
-	# NVIDIA kernel <-> userspace driver config lib
-	donvidia ${NV_OBJ}/libnvidia-cfg.so.${NV_SOVER}
-
-	# NVIDIA framebuffer capture library
-	donvidia ${NV_OBJ}/libnvidia-fbc.so.${NV_SOVER}
-
-	# NVIDIA video encode/decode <-> CUDA
-	if use kernel_linux; then
-		donvidia ${NV_OBJ}/libnvcuvid.so.${NV_SOVER}
-		donvidia ${NV_OBJ}/libnvidia-encode.so.${NV_SOVER}
-	fi
-
-	if use X; then
-		# Xorg DDX driver
-		insinto /usr/$(get_libdir)/xorg/modules/drivers
-		doins ${NV_X11}/nvidia_drv.so
-
-		# Xorg GLX driver
-		donvidia ${NV_X11}/libglx.so.${NV_SOVER} \
-			/usr/$(get_libdir)/opengl/nvidia/extensions
-
-		# Xorg nvidia.conf
-		if has_version '>=x11-base/xorg-server-1.16'; then
-			insinto /usr/share/X11/xorg.conf.d
-			newins {,50-}nvidia-drm-outputclass.conf
-		fi
-	fi
-
-	# OpenCL ICD for NVIDIA
-	if use kernel_linux; then
-		insinto /etc/OpenCL/vendors
-		doins ${NV_OBJ}/nvidia.icd
-	fi
-
-	# Documentation
-	dohtml ${NV_DOC}/html/*
-	if use kernel_FreeBSD; then
-		dodoc "${NV_DOC}/README"
-		use X && doman "${NV_MAN}/nvidia-xconfig.1"
-		use tools && doman "${NV_MAN}/nvidia-settings.1"
-	else
-		# Docs
-		newdoc "${NV_DOC}/README.txt" README
-		dodoc "${NV_DOC}/NVIDIA_Changelog"
-		doman "${NV_MAN}/nvidia-smi.1.gz"
-		use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
-		use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
-		doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
-	fi
-
-	# Helper Apps
-	exeinto /opt/bin/
-
-	if use X; then
-		doexe ${NV_OBJ}/nvidia-xconfig
-	fi
-
-	if use kernel_linux; then
-		doexe ${NV_OBJ}/nvidia-cuda-mps-control
-		doexe ${NV_OBJ}/nvidia-cuda-mps-server
-		doexe ${NV_OBJ}/nvidia-debugdump
-		doexe ${NV_OBJ}/nvidia-persistenced
-		doexe ${NV_OBJ}/nvidia-smi
-
-		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
-		doexe ${NV_OBJ}/nvidia-modprobe
-		fowners root:video /opt/bin/nvidia-modprobe
-		fperms 4710 /opt/bin/nvidia-modprobe
-		dosym /{opt,usr}/bin/nvidia-modprobe
-
-		doman nvidia-cuda-mps-control.1.gz
-		doman nvidia-modprobe.1.gz
-		doman nvidia-persistenced.1.gz
-		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
-		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
-		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src/ \
-			DESTDIR="${D}" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LIBDIR="${D}/usr/$(get_libdir)" \
-			PREFIX=/usr \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			install
-
-		if use static-libs; then
-			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
-
-			insinto /usr/include/NVCtrl
-			doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
-		fi
-
-		insinto /usr/share/nvidia/
-		doins nvidia-application-profiles-${PV}-key-documentation
-
-		insinto /etc/nvidia
-		newins \
-			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
-
-		# There is no icon in the FreeBSD tarball.
-		use kernel_FreeBSD || \
-			doicon ${NV_OBJ}/nvidia-settings.png
-
-		domenu "${FILESDIR}"/nvidia-settings.desktop
-
-		exeinto /etc/X11/xinit/xinitrc.d
-		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
-	fi
-
-	dobin ${NV_OBJ}/nvidia-bug-report.sh
-
-	if has_multilib_profile && use multilib; then
-		local OABI=${ABI}
-		for ABI in $(get_install_abis); do
-			src_install-libs
-		done
-		ABI=${OABI}
-		unset OABI
-	else
-		src_install-libs
-	fi
-
-	is_final_abi || die "failed to iterate through all ABIs"
-
-	readme.gentoo_create_doc
-}
-
-src_install-libs() {
-	local inslibdir=$(get_libdir)
-	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
-	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
-	local libdir=${NV_OBJ}
-
-	if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
-		libdir=${NV_OBJ}/32
-	fi
-
-	if use X; then
-		NV_GLX_LIBRARIES=(
-			"libEGL.so.1 ${GL_ROOT}"
-			"libEGL_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGL.so.$(usex compat ${NV_SOVER} 1.0.0) ${GL_ROOT}"
-			"libGLESv1_CM.so.1 ${GL_ROOT}"
-			"libGLESv1_CM_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLESv2.so.2 ${GL_ROOT}"
-			"libGLESv2_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLX.so.0 ${GL_ROOT}"
-			"libGLX_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLdispatch.so.0 ${GL_ROOT}"
-			"libOpenCL.so.1.0.0 ${CL_ROOT}"
-			"libOpenGL.so.0 ${GL_ROOT}"
-			"libcuda.so.${NV_SOVER}"
-			"libnvcuvid.so.${NV_SOVER}"
-			"libnvidia-compiler.so.${NV_SOVER}"
-			"libnvidia-eglcore.so.${NV_SOVER}"
-			"libnvidia-encode.so.${NV_SOVER}"
-			"libnvidia-fatbinaryloader.so.${NV_SOVER}"
-			"libnvidia-fbc.so.${NV_SOVER}"
-			"libnvidia-glcore.so.${NV_SOVER}"
-			"libnvidia-glsi.so.${NV_SOVER}"
-			"libnvidia-ifr.so.${NV_SOVER}"
-			"libnvidia-opencl.so.${NV_SOVER}"
-			"libnvidia-ptxjitcompiler.so.${NV_SOVER}"
-			"libvdpau_nvidia.so.${NV_SOVER}"
-		)
-
-		if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
-		then
-			NV_GLX_LIBRARIES+=( "libnvidia-wfb.so.${NV_SOVER}" )
-		fi
-
-		if use kernel_FreeBSD; then
-			NV_GLX_LIBRARIES+=( "libnvidia-tls.so.${NV_SOVER}" )
-		fi
-
-		if use kernel_linux; then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-ml.so.${NV_SOVER}"
-				"tls/libnvidia-tls.so.${NV_SOVER}"
-			)
-		fi
-
-		for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
-			donvidia ${libdir}/${NV_LIB}
-		done
-	fi
-}
-
-pkg_preinst() {
-	if use driver && use kernel_linux; then
-		linux-mod_pkg_preinst
-
-		local videogroup="$(egetent group video | cut -d ':' -f 3)"
-		if [ -z "${videogroup}" ]; then
-			eerror "Failed to determine the video group gid"
-			die "Failed to determine the video group gid"
-		else
-			sed -i \
-				-e "s:PACKAGE:${PF}:g" \
-				-e "s:VIDEOGID:${videogroup}:" \
-				"${D}"/etc/modprobe.d/nvidia.conf || die
-		fi
-	fi
-
-	# Clean the dynamic libGL stuff's home to ensure
-	# we dont have stale libs floating around
-	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ]; then
-		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
-	fi
-	# Make sure we nuke the old nvidia-glx's env.d file
-	if [ -e "${ROOT}"/etc/env.d/09nvidia ]; then
-		rm -f "${ROOT}"/etc/env.d/09nvidia
-	fi
-}
-
-pkg_postinst() {
-	use driver && use kernel_linux && linux-mod_pkg_postinst
-
-	# Switch to the nvidia implementation
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
-	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
-
-	readme.gentoo_print_elog
-
-	if ! use X; then
-		elog "You have elected to not install the X.org driver. Along with"
-		elog "this the OpenGL libraries and VDPAU libraries were not"
-		elog "installed. Additionally, once the driver is loaded your card"
-		elog "and fan will run at max speed which may not be desirable."
-		elog "Use the 'nvidia-smi' init script to have your card and fan"
-		elog "speed scale appropriately."
-		elog
-	fi
-	if ! use tools; then
-		elog "USE=tools controls whether the nvidia-settings application"
-		elog "is installed. If you would like to use it, enable that"
-		elog "flag and re-emerge this ebuild. Optionally you can install"
-		elog "media-video/nvidia-settings"
-		elog
-	fi
-}
-
-pkg_prerm() {
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}
-
-pkg_postrm() {
-	use driver && use kernel_linux && linux-mod_pkg_postrm
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-361.45.18-r1.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-361.45.18-r1.ebuild
deleted file mode 100644
index bf8d4b7c236..00000000000
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-361.45.18-r1.ebuild
+++ /dev/null
@@ -1,529 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-
-inherit eutils flag-o-matic linux-info linux-mod multilib-minimal nvidia-driver \
-	portability toolchain-funcs unpacker user udev
-
-NV_URI="http://us.download.nvidia.com/XFree86/"
-X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
-AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
-X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
-AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
-
-DESCRIPTION="NVIDIA Accelerated Graphics Driver"
-HOMEPAGE="http://www.nvidia.com/ http://www.nvidia.com/Download/Find.aspx"
-SRC_URI="
-	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
-	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
-	x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
-	x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
-	tools? ( ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2 )
-"
-
-LICENSE="GPL-2 NVIDIA-r2"
-SLOT="0/${PV%.*}"
-KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
-RESTRICT="bindist mirror"
-EMULTILIB_PKG="true"
-
-IUSE="acpi compat +driver gtk3 kernel_FreeBSD kernel_linux +kms multilib pax_kernel static-libs +tools uvm +X"
-REQUIRED_USE="
-	tools? ( X )
-	static-libs? ( tools )
-"
-
-COMMON="
-	app-eselect/eselect-opencl
-	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
-	tools? (
-		dev-libs/atk
-		dev-libs/glib:2
-		dev-libs/jansson
-		gtk3? (
-			x11-libs/gtk+:3
-		)
-		x11-libs/cairo
-		x11-libs/gdk-pixbuf[X]
-		x11-libs/gtk+:2
-		x11-libs/libX11
-		x11-libs/libXext
-		x11-libs/libXrandr
-		x11-libs/libXv
-		x11-libs/libXxf86vm
-		x11-libs/pango[X]
-	)
-	X? (
-		>=app-eselect/eselect-opengl-1.0.9
-		app-misc/pax-utils
-	)
-"
-DEPEND="
-	${COMMON}
-	kernel_linux? ( virtual/linux-sources )
-"
-RDEPEND="
-	${COMMON}
-	acpi? ( sys-power/acpid )
-	tools? ( !media-video/nvidia-settings )
-	X? (
-		<x11-base/xorg-server-1.18.99:=
-		>=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
-		>=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
-		>=x11-libs/libvdpau-1.0[${MULTILIB_USEDEP}]
-		sys-libs/zlib[${MULTILIB_USEDEP}]
-	)
-"
-
-QA_PREBUILT="opt/* usr/lib*"
-
-S=${WORKDIR}/
-
-pkg_pretend() {
-	if use amd64 && has_multilib_profile && \
-		[ "${DEFAULT_ABI}" != "amd64" ]; then
-		eerror "This ebuild doesn't currently support changing your default ABI"
-		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
-	fi
-
-	if use kernel_linux && kernel_is ge 4 5; then
-		ewarn "Gentoo supports kernels which are supported by NVIDIA"
-		ewarn "which are limited to the following kernels:"
-		ewarn "<sys-kernel/gentoo-sources-4.5"
-		ewarn "<sys-kernel/vanilla-sources-4.5"
-		ewarn ""
-		ewarn "You are free to utilize epatch_user to provide whatever"
-		ewarn "support you feel is appropriate, but will not receive"
-		ewarn "support as a result of those changes."
-		ewarn ""
-		ewarn "Do not file a bug report about this."
-		ewarn ""
-	fi
-
-	# Since Nvidia ships many different series of drivers, we need to give the user
-	# some kind of guidance as to what version they should install. This tries
-	# to point the user in the right direction but can't be perfect. check
-	# nvidia-driver.eclass
-	nvidia-driver-check-warning
-
-	# Kernel features/options to check for
-	CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
-	use x86 && CONFIG_CHECK+=" ~HIGHMEM"
-
-	# Now do the above checks
-	use kernel_linux && check_extra_config
-}
-
-pkg_setup() {
-	# try to turn off distcc and ccache for people that have a problem with it
-	export DISTCC_DISABLE=1
-	export CCACHE_DISABLE=1
-
-	if use driver && use kernel_linux; then
-		MODULE_NAMES="nvidia(video:${S}/kernel)"
-		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
-		use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel)"
-
-		# This needs to run after MODULE_NAMES (so that the eclass checks
-		# whether the kernel supports loadable modules) but before BUILD_PARAMS
-		# is set (so that KV_DIR is populated).
-		linux-mod_pkg_setup
-
-		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
-		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
-
-		# linux-mod_src_compile calls set_arch_to_kernel, which
-		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
-		# expects x86_64 or i386 and then converts it to x86
-		# later on in the build process
-		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
-	fi
-
-	if use kernel_linux && kernel_is lt 2 6 9; then
-		eerror "You must build this against 2.6.9 or higher kernels."
-	fi
-
-	# set variables to where files are in the package structure
-	if use kernel_FreeBSD; then
-		use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
-		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
-		NV_DOC="${S}/doc"
-		NV_OBJ="${S}/obj"
-		NV_SRC="${S}/src"
-		NV_MAN="${S}/x11/man"
-		NV_X11="${S}/obj"
-		NV_SOVER=1
-	elif use kernel_linux; then
-		NV_DOC="${S}"
-		NV_OBJ="${S}"
-		NV_SRC="${S}/kernel"
-		NV_MAN="${S}"
-		NV_X11="${S}"
-		NV_SOVER=${PV}
-	else
-		die "Could not determine proper NVIDIA package"
-	fi
-}
-
-src_prepare() {
-	if use pax_kernel; then
-		ewarn "Using PAX patches is not supported. You will be asked to"
-		ewarn "use a standard kernel should you have issues. Should you"
-		ewarn "need support with these patches, contact the PaX team."
-		epatch "${FILESDIR}"/${PN}-361.28-pax.patch
-	fi
-
-	# Allow user patches so they can support RC kernels and whatever else
-	epatch_user
-}
-
-src_compile() {
-	# This is already the default on Linux, as there's no toplevel Makefile, but
-	# on FreeBSD there's one and triggers the kernel module build, as we install
-	# it by itself, pass this.
-
-	cd "${NV_SRC}"
-	if use kernel_FreeBSD; then
-		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
-			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
-	elif use driver && use kernel_linux; then
-		MAKEOPTS=-j1 linux-mod_src_compile
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			AR="$(tc-getAR)" \
-			CC="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			RANLIB="$(tc-getRANLIB)" \
-			build-xnvctrl
-
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			CC="$(tc-getCC)" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LD="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			NVML_ENABLED=0 \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			NV_VERBOSE=1 \
-			STRIP_CMD=true
-	fi
-}
-
-# Install nvidia library:
-# the first parameter is the library to install
-# the second parameter is the provided soversion
-# the third parameter is the target directory if it is not /usr/lib
-donvidia() {
-	# Full path to library
-	nv_LIB="${1}"
-
-	# SOVER to use
-	nv_SOVER="$(scanelf -qF'%S#F' ${nv_LIB})"
-
-	# Where to install
-	nv_DEST="${2}"
-
-	# Get just the library name
-	nv_LIBNAME=$(basename "${nv_LIB}")
-
-	if [[ "${nv_DEST}" ]]; then
-		exeinto ${nv_DEST}
-		action="doexe"
-	else
-		nv_DEST="/usr/$(get_libdir)"
-		action="dolib.so"
-	fi
-
-	# Install the library
-	${action} ${nv_LIB} || die "failed to install ${nv_LIBNAME}"
-
-	# If the library has a SONAME and SONAME does not match the library name,
-	# then we need to create a symlink
-	if [[ ${nv_SOVER} ]] && ! [[ "${nv_SOVER}" = "${nv_LIBNAME}" ]]; then
-		dosym ${nv_LIBNAME} ${nv_DEST}/${nv_SOVER} \
-			|| die "failed to create ${nv_DEST}/${nv_SOVER} symlink"
-	fi
-
-	dosym ${nv_LIBNAME} ${nv_DEST}/${nv_LIBNAME/.so*/.so} \
-		|| die "failed to create ${nv_LIBNAME/.so*/.so} symlink"
-}
-
-src_install() {
-	if use driver && use kernel_linux; then
-		linux-mod_src_install
-
-		# Add the aliases
-		# This file is tweaked with the appropriate video group in
-		# pkg_preinst, see bug #491414
-		insinto /etc/modprobe.d
-		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
-		doins "${FILESDIR}"/nvidia-rmmod.conf
-
-		# Ensures that our device nodes are created when not using X
-		exeinto "$(get_udevdir)"
-		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
-		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
-	elif use kernel_FreeBSD; then
-		if use x86-fbsd; then
-			insinto /boot/modules
-			doins "${S}/src/nvidia.kld"
-		fi
-
-		exeinto /boot/modules
-		doexe "${S}/src/nvidia.ko"
-	fi
-
-	# NVIDIA kernel <-> userspace driver config lib
-	donvidia ${NV_OBJ}/libnvidia-cfg.so.${NV_SOVER}
-
-	# NVIDIA framebuffer capture library
-	donvidia ${NV_OBJ}/libnvidia-fbc.so.${NV_SOVER}
-
-	# NVIDIA video encode/decode <-> CUDA
-	if use kernel_linux; then
-		donvidia ${NV_OBJ}/libnvcuvid.so.${NV_SOVER}
-		donvidia ${NV_OBJ}/libnvidia-encode.so.${NV_SOVER}
-	fi
-
-	if use X; then
-		# Xorg DDX driver
-		insinto /usr/$(get_libdir)/xorg/modules/drivers
-		doins ${NV_X11}/nvidia_drv.so
-
-		# Xorg GLX driver
-		donvidia ${NV_X11}/libglx.so.${NV_SOVER} \
-			/usr/$(get_libdir)/opengl/nvidia/extensions
-
-		# Xorg nvidia.conf
-		if has_version '>=x11-base/xorg-server-1.16'; then
-			insinto /usr/share/X11/xorg.conf.d
-			newins {,50-}nvidia-drm-outputclass.conf
-		fi
-	fi
-
-	# OpenCL ICD for NVIDIA
-	if use kernel_linux; then
-		insinto /etc/OpenCL/vendors
-		doins ${NV_OBJ}/nvidia.icd
-	fi
-
-	# Documentation
-	dohtml ${NV_DOC}/html/*
-	if use kernel_FreeBSD; then
-		dodoc "${NV_DOC}/README"
-		use X && doman "${NV_MAN}/nvidia-xconfig.1"
-		use tools && doman "${NV_MAN}/nvidia-settings.1"
-	else
-		# Docs
-		newdoc "${NV_DOC}/README.txt" README
-		dodoc "${NV_DOC}/NVIDIA_Changelog"
-		doman "${NV_MAN}/nvidia-smi.1.gz"
-		use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
-		use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
-		doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
-	fi
-
-	# Helper Apps
-	exeinto /opt/bin/
-
-	if use X; then
-		doexe ${NV_OBJ}/nvidia-xconfig
-	fi
-
-	if use kernel_linux; then
-		doexe ${NV_OBJ}/nvidia-cuda-mps-control
-		doexe ${NV_OBJ}/nvidia-cuda-mps-server
-		doexe ${NV_OBJ}/nvidia-debugdump
-		doexe ${NV_OBJ}/nvidia-persistenced
-		doexe ${NV_OBJ}/nvidia-smi
-
-		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
-		doexe ${NV_OBJ}/nvidia-modprobe
-		fowners root:video /opt/bin/nvidia-modprobe
-		fperms 4710 /opt/bin/nvidia-modprobe
-		dosym /{opt,usr}/bin/nvidia-modprobe
-
-		doman nvidia-cuda-mps-control.1.gz
-		doman nvidia-modprobe.1.gz
-		doman nvidia-persistenced.1.gz
-		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
-		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
-		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src/ \
-			DESTDIR="${D}" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LIBDIR="${D}/usr/$(get_libdir)" \
-			PREFIX=/usr \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			install
-
-		if use static-libs; then
-			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
-
-			insinto /usr/include/NVCtrl
-			doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
-		fi
-
-		insinto /usr/share/nvidia/
-		doins nvidia-application-profiles-${PV}-key-documentation
-
-		insinto /etc/nvidia
-		newins \
-			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
-
-		# There is no icon in the FreeBSD tarball.
-		use kernel_FreeBSD || \
-			doicon ${NV_OBJ}/nvidia-settings.png
-
-		domenu "${FILESDIR}"/nvidia-settings.desktop
-
-		exeinto /etc/X11/xinit/xinitrc.d
-		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
-	fi
-
-	dobin ${NV_OBJ}/nvidia-bug-report.sh
-
-	if has_multilib_profile && use multilib; then
-		local OABI=${ABI}
-		for ABI in $(get_install_abis); do
-			src_install-libs
-		done
-		ABI=${OABI}
-		unset OABI
-	else
-		src_install-libs
-	fi
-
-	is_final_abi || die "failed to iterate through all ABIs"
-
-	readme.gentoo_create_doc
-}
-
-src_install-libs() {
-	local inslibdir=$(get_libdir)
-	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
-	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
-	local libdir=${NV_OBJ}
-
-	if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
-		libdir=${NV_OBJ}/32
-	fi
-
-	if use X; then
-		NV_GLX_LIBRARIES=(
-			"libEGL.so.1 ${GL_ROOT}"
-			"libEGL_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGL.so.$(usex compat ${NV_SOVER} 1.0.0) ${GL_ROOT}"
-			"libGLESv1_CM.so.1 ${GL_ROOT}"
-			"libGLESv1_CM_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLESv2.so.2 ${GL_ROOT}"
-			"libGLESv2_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLX.so.0 ${GL_ROOT}"
-			"libGLX_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLdispatch.so.0 ${GL_ROOT}"
-			"libOpenCL.so.1.0.0 ${CL_ROOT}"
-			"libOpenGL.so.0 ${GL_ROOT}"
-			"libcuda.so.${NV_SOVER}"
-			"libnvcuvid.so.${NV_SOVER}"
-			"libnvidia-compiler.so.${NV_SOVER}"
-			"libnvidia-eglcore.so.${NV_SOVER}"
-			"libnvidia-encode.so.${NV_SOVER}"
-			"libnvidia-fatbinaryloader.so.${NV_SOVER}"
-			"libnvidia-fbc.so.${NV_SOVER}"
-			"libnvidia-glcore.so.${NV_SOVER}"
-			"libnvidia-glsi.so.${NV_SOVER}"
-			"libnvidia-ifr.so.${NV_SOVER}"
-			"libnvidia-opencl.so.${NV_SOVER}"
-			"libnvidia-ptxjitcompiler.so.${NV_SOVER}"
-			"libvdpau_nvidia.so.${NV_SOVER}"
-		)
-
-		if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
-		then
-			NV_GLX_LIBRARIES+=( "libnvidia-wfb.so.${NV_SOVER}" )
-		fi
-
-		if use kernel_FreeBSD; then
-			NV_GLX_LIBRARIES+=( "libnvidia-tls.so.${NV_SOVER}" )
-		fi
-
-		if use kernel_linux; then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-ml.so.${NV_SOVER}"
-				"tls/libnvidia-tls.so.${NV_SOVER}"
-			)
-		fi
-
-		for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
-			donvidia ${libdir}/${NV_LIB}
-		done
-	fi
-}
-
-pkg_preinst() {
-	if use driver && use kernel_linux; then
-		linux-mod_pkg_preinst
-
-		local videogroup="$(egetent group video | cut -d ':' -f 3)"
-		if [ -z "${videogroup}" ]; then
-			eerror "Failed to determine the video group gid"
-			die "Failed to determine the video group gid"
-		else
-			sed -i \
-				-e "s:PACKAGE:${PF}:g" \
-				-e "s:VIDEOGID:${videogroup}:" \
-				"${D}"/etc/modprobe.d/nvidia.conf || die
-		fi
-	fi
-
-	# Clean the dynamic libGL stuff's home to ensure
-	# we dont have stale libs floating around
-	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ]; then
-		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
-	fi
-	# Make sure we nuke the old nvidia-glx's env.d file
-	if [ -e "${ROOT}"/etc/env.d/09nvidia ]; then
-		rm -f "${ROOT}"/etc/env.d/09nvidia
-	fi
-}
-
-pkg_postinst() {
-	use driver && use kernel_linux && linux-mod_pkg_postinst
-
-	# Switch to the nvidia implementation
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
-	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
-
-	readme.gentoo_print_elog
-
-	if ! use X; then
-		elog "You have elected to not install the X.org driver. Along with"
-		elog "this the OpenGL libraries and VDPAU libraries were not"
-		elog "installed. Additionally, once the driver is loaded your card"
-		elog "and fan will run at max speed which may not be desirable."
-		elog "Use the 'nvidia-smi' init script to have your card and fan"
-		elog "speed scale appropriately."
-		elog
-	fi
-	if ! use tools; then
-		elog "USE=tools controls whether the nvidia-settings application"
-		elog "is installed. If you would like to use it, enable that"
-		elog "flag and re-emerge this ebuild. Optionally you can install"
-		elog "media-video/nvidia-settings"
-		elog
-	fi
-}
-
-pkg_prerm() {
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}
-
-pkg_postrm() {
-	use driver && use kernel_linux && linux-mod_pkg_postrm
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-361.45.18.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-361.45.18.ebuild
deleted file mode 100644
index e8e413de669..00000000000
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-361.45.18.ebuild
+++ /dev/null
@@ -1,528 +0,0 @@
-# Copyright 1999-2016 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-
-inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \
-	portability toolchain-funcs unpacker user udev
-
-NV_URI="http://us.download.nvidia.com/XFree86/"
-X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
-AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
-X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
-AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
-
-DESCRIPTION="NVIDIA Accelerated Graphics Driver"
-HOMEPAGE="http://www.nvidia.com/ http://www.nvidia.com/Download/Find.aspx"
-SRC_URI="
-	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
-	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
-	x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
-	x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
-	tools? ( ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2 )
-"
-
-LICENSE="GPL-2 NVIDIA-r2"
-SLOT="0/${PV%.*}"
-KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
-RESTRICT="bindist mirror"
-EMULTILIB_PKG="true"
-
-IUSE="acpi compat +driver gtk3 kernel_FreeBSD kernel_linux +kms multilib pax_kernel static-libs +tools uvm +X"
-REQUIRED_USE="
-	tools? ( X )
-	static-libs? ( tools )
-"
-
-COMMON="
-	app-eselect/eselect-opencl
-	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
-	tools? (
-		dev-libs/atk
-		dev-libs/glib:2
-		dev-libs/jansson
-		gtk3? ( x11-libs/gtk+:3 )
-		x11-libs/cairo
-		x11-libs/gdk-pixbuf[X]
-		x11-libs/gtk+:2
-		x11-libs/libX11
-		x11-libs/libXext
-		x11-libs/libXrandr
-		x11-libs/libXv
-		x11-libs/libXxf86vm
-		x11-libs/pango[X]
-	)
-	X? (
-		>=app-eselect/eselect-opengl-1.0.9
-		app-misc/pax-utils
-	)
-"
-DEPEND="
-	${COMMON}
-	kernel_linux? ( virtual/linux-sources )
-"
-RDEPEND="
-	${COMMON}
-	acpi? ( sys-power/acpid )
-	tools? ( !media-video/nvidia-settings )
-	X? (
-		<x11-base/xorg-server-1.18.99:=
-		>=x11-libs/libvdpau-1.0
-		multilib? (
-			>=x11-libs/libX11-1.6.2[abi_x86_32]
-			>=x11-libs/libXext-1.3.2[abi_x86_32]
-		)
-	)
-"
-
-QA_PREBUILT="opt/* usr/lib*"
-
-S=${WORKDIR}/
-
-pkg_pretend() {
-	if use amd64 && has_multilib_profile && \
-		[ "${DEFAULT_ABI}" != "amd64" ]; then
-		eerror "This ebuild doesn't currently support changing your default ABI"
-		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
-	fi
-
-	if use kernel_linux && kernel_is ge 4 5; then
-		ewarn "Gentoo supports kernels which are supported by NVIDIA"
-		ewarn "which are limited to the following kernels:"
-		ewarn "<sys-kernel/gentoo-sources-4.5"
-		ewarn "<sys-kernel/vanilla-sources-4.5"
-		ewarn ""
-		ewarn "You are free to utilize epatch_user to provide whatever"
-		ewarn "support you feel is appropriate, but will not receive"
-		ewarn "support as a result of those changes."
-		ewarn ""
-		ewarn "Do not file a bug report about this."
-		ewarn ""
-	fi
-
-	# Since Nvidia ships many different series of drivers, we need to give the user
-	# some kind of guidance as to what version they should install. This tries
-	# to point the user in the right direction but can't be perfect. check
-	# nvidia-driver.eclass
-	nvidia-driver-check-warning
-
-	# Kernel features/options to check for
-	CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
-	use x86 && CONFIG_CHECK+=" ~HIGHMEM"
-
-	# Now do the above checks
-	use kernel_linux && check_extra_config
-}
-
-pkg_setup() {
-	# try to turn off distcc and ccache for people that have a problem with it
-	export DISTCC_DISABLE=1
-	export CCACHE_DISABLE=1
-
-	if use driver && use kernel_linux; then
-		MODULE_NAMES="nvidia(video:${S}/kernel)"
-		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
-		use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel)"
-
-		# This needs to run after MODULE_NAMES (so that the eclass checks
-		# whether the kernel supports loadable modules) but before BUILD_PARAMS
-		# is set (so that KV_DIR is populated).
-		linux-mod_pkg_setup
-
-		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
-		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
-
-		# linux-mod_src_compile calls set_arch_to_kernel, which
-		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
-		# expects x86_64 or i386 and then converts it to x86
-		# later on in the build process
-		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
-	fi
-
-	if use kernel_linux && kernel_is lt 2 6 9; then
-		eerror "You must build this against 2.6.9 or higher kernels."
-	fi
-
-	# set variables to where files are in the package structure
-	if use kernel_FreeBSD; then
-		use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
-		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
-		NV_DOC="${S}/doc"
-		NV_OBJ="${S}/obj"
-		NV_SRC="${S}/src"
-		NV_MAN="${S}/x11/man"
-		NV_X11="${S}/obj"
-		NV_SOVER=1
-	elif use kernel_linux; then
-		NV_DOC="${S}"
-		NV_OBJ="${S}"
-		NV_SRC="${S}/kernel"
-		NV_MAN="${S}"
-		NV_X11="${S}"
-		NV_SOVER=${PV}
-	else
-		die "Could not determine proper NVIDIA package"
-	fi
-}
-
-src_prepare() {
-	if use pax_kernel; then
-		ewarn "Using PAX patches is not supported. You will be asked to"
-		ewarn "use a standard kernel should you have issues. Should you"
-		ewarn "need support with these patches, contact the PaX team."
-		epatch "${FILESDIR}"/${PN}-361.28-pax.patch
-	fi
-
-	# Allow user patches so they can support RC kernels and whatever else
-	epatch_user
-}
-
-src_compile() {
-	# This is already the default on Linux, as there's no toplevel Makefile, but
-	# on FreeBSD there's one and triggers the kernel module build, as we install
-	# it by itself, pass this.
-
-	cd "${NV_SRC}"
-	if use kernel_FreeBSD; then
-		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
-			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
-	elif use driver && use kernel_linux; then
-		MAKEOPTS=-j1 linux-mod_src_compile
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			AR="$(tc-getAR)" \
-			CC="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			RANLIB="$(tc-getRANLIB)" \
-			build-xnvctrl
-
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			CC="$(tc-getCC)" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LD="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			NVML_ENABLED=0 \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			NV_VERBOSE=1 \
-			STRIP_CMD=true
-	fi
-}
-
-# Install nvidia library:
-# the first parameter is the library to install
-# the second parameter is the provided soversion
-# the third parameter is the target directory if it is not /usr/lib
-donvidia() {
-	# Full path to library
-	nv_LIB="${1}"
-
-	# SOVER to use
-	nv_SOVER="$(scanelf -qF'%S#F' ${nv_LIB})"
-
-	# Where to install
-	nv_DEST="${2}"
-
-	# Get just the library name
-	nv_LIBNAME=$(basename "${nv_LIB}")
-
-	if [[ "${nv_DEST}" ]]; then
-		exeinto ${nv_DEST}
-		action="doexe"
-	else
-		nv_DEST="/usr/$(get_libdir)"
-		action="dolib.so"
-	fi
-
-	# Install the library
-	${action} ${nv_LIB} || die "failed to install ${nv_LIBNAME}"
-
-	# If the library has a SONAME and SONAME does not match the library name,
-	# then we need to create a symlink
-	if [[ ${nv_SOVER} ]] && ! [[ "${nv_SOVER}" = "${nv_LIBNAME}" ]]; then
-		dosym ${nv_LIBNAME} ${nv_DEST}/${nv_SOVER} \
-			|| die "failed to create ${nv_DEST}/${nv_SOVER} symlink"
-	fi
-
-	dosym ${nv_LIBNAME} ${nv_DEST}/${nv_LIBNAME/.so*/.so} \
-		|| die "failed to create ${nv_LIBNAME/.so*/.so} symlink"
-}
-
-src_install() {
-	if use driver && use kernel_linux; then
-		linux-mod_src_install
-
-		# Add the aliases
-		# This file is tweaked with the appropriate video group in
-		# pkg_preinst, see bug #491414
-		insinto /etc/modprobe.d
-		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
-		doins "${FILESDIR}"/nvidia-rmmod.conf
-
-		# Ensures that our device nodes are created when not using X
-		exeinto "$(get_udevdir)"
-		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
-		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
-	elif use kernel_FreeBSD; then
-		if use x86-fbsd; then
-			insinto /boot/modules
-			doins "${S}/src/nvidia.kld"
-		fi
-
-		exeinto /boot/modules
-		doexe "${S}/src/nvidia.ko"
-	fi
-
-	# NVIDIA kernel <-> userspace driver config lib
-	donvidia ${NV_OBJ}/libnvidia-cfg.so.${NV_SOVER}
-
-	# NVIDIA framebuffer capture library
-	donvidia ${NV_OBJ}/libnvidia-fbc.so.${NV_SOVER}
-
-	# NVIDIA video encode/decode <-> CUDA
-	if use kernel_linux; then
-		donvidia ${NV_OBJ}/libnvcuvid.so.${NV_SOVER}
-		donvidia ${NV_OBJ}/libnvidia-encode.so.${NV_SOVER}
-	fi
-
-	if use X; then
-		# Xorg DDX driver
-		insinto /usr/$(get_libdir)/xorg/modules/drivers
-		doins ${NV_X11}/nvidia_drv.so
-
-		# Xorg GLX driver
-		donvidia ${NV_X11}/libglx.so.${NV_SOVER} \
-			/usr/$(get_libdir)/opengl/nvidia/extensions
-
-		# Xorg nvidia.conf
-		if has_version '>=x11-base/xorg-server-1.16'; then
-			insinto /usr/share/X11/xorg.conf.d
-			newins {,50-}nvidia-drm-outputclass.conf
-		fi
-	fi
-
-	# OpenCL ICD for NVIDIA
-	if use kernel_linux; then
-		insinto /etc/OpenCL/vendors
-		doins ${NV_OBJ}/nvidia.icd
-	fi
-
-	# Documentation
-	dohtml ${NV_DOC}/html/*
-	if use kernel_FreeBSD; then
-		dodoc "${NV_DOC}/README"
-		use X && doman "${NV_MAN}/nvidia-xconfig.1"
-		use tools && doman "${NV_MAN}/nvidia-settings.1"
-	else
-		# Docs
-		newdoc "${NV_DOC}/README.txt" README
-		dodoc "${NV_DOC}/NVIDIA_Changelog"
-		doman "${NV_MAN}/nvidia-smi.1.gz"
-		use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
-		use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
-		doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
-	fi
-
-	# Helper Apps
-	exeinto /opt/bin/
-
-	if use X; then
-		doexe ${NV_OBJ}/nvidia-xconfig
-	fi
-
-	if use kernel_linux; then
-		doexe ${NV_OBJ}/nvidia-cuda-mps-control
-		doexe ${NV_OBJ}/nvidia-cuda-mps-server
-		doexe ${NV_OBJ}/nvidia-debugdump
-		doexe ${NV_OBJ}/nvidia-persistenced
-		doexe ${NV_OBJ}/nvidia-smi
-
-		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
-		doexe ${NV_OBJ}/nvidia-modprobe
-		fowners root:video /opt/bin/nvidia-modprobe
-		fperms 4710 /opt/bin/nvidia-modprobe
-		dosym /{opt,usr}/bin/nvidia-modprobe
-
-		doman nvidia-cuda-mps-control.1.gz
-		doman nvidia-modprobe.1.gz
-		doman nvidia-persistenced.1.gz
-		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
-		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
-		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src/ \
-			DESTDIR="${D}" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LIBDIR="${D}/usr/$(get_libdir)" \
-			PREFIX=/usr \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			install
-
-		if use static-libs; then
-			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
-
-			insinto /usr/include/NVCtrl
-			doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
-		fi
-
-		insinto /usr/share/nvidia/
-		doins nvidia-application-profiles-${PV}-key-documentation
-
-		insinto /etc/nvidia
-		newins \
-			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
-
-		# There is no icon in the FreeBSD tarball.
-		use kernel_FreeBSD || \
-			doicon ${NV_OBJ}/nvidia-settings.png
-
-		domenu "${FILESDIR}"/nvidia-settings.desktop
-
-		exeinto /etc/X11/xinit/xinitrc.d
-		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
-	fi
-
-	dobin ${NV_OBJ}/nvidia-bug-report.sh
-
-	if has_multilib_profile && use multilib; then
-		local OABI=${ABI}
-		for ABI in $(get_install_abis); do
-			src_install-libs
-		done
-		ABI=${OABI}
-		unset OABI
-	else
-		src_install-libs
-	fi
-
-	is_final_abi || die "failed to iterate through all ABIs"
-
-	readme.gentoo_create_doc
-}
-
-src_install-libs() {
-	local inslibdir=$(get_libdir)
-	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
-	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
-	local libdir=${NV_OBJ}
-
-	if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
-		libdir=${NV_OBJ}/32
-	fi
-
-	if use X; then
-		NV_GLX_LIBRARIES=(
-			"libEGL.so.1 ${GL_ROOT}"
-			"libEGL_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGL.so.$(usex compat ${NV_SOVER} 1.0.0) ${GL_ROOT}"
-			"libGLESv1_CM.so.1 ${GL_ROOT}"
-			"libGLESv1_CM_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLESv2.so.2 ${GL_ROOT}"
-			"libGLESv2_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLX.so.0 ${GL_ROOT}"
-			"libGLX_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLdispatch.so.0 ${GL_ROOT}"
-			"libOpenCL.so.1.0.0 ${CL_ROOT}"
-			"libOpenGL.so.0 ${GL_ROOT}"
-			"libcuda.so.${NV_SOVER}"
-			"libnvcuvid.so.${NV_SOVER}"
-			"libnvidia-compiler.so.${NV_SOVER}"
-			"libnvidia-eglcore.so.${NV_SOVER}"
-			"libnvidia-encode.so.${NV_SOVER}"
-			"libnvidia-fatbinaryloader.so.${NV_SOVER}"
-			"libnvidia-fbc.so.${NV_SOVER}"
-			"libnvidia-glcore.so.${NV_SOVER}"
-			"libnvidia-glsi.so.${NV_SOVER}"
-			"libnvidia-ifr.so.${NV_SOVER}"
-			"libnvidia-opencl.so.${NV_SOVER}"
-			"libnvidia-ptxjitcompiler.so.${NV_SOVER}"
-			"libvdpau_nvidia.so.${NV_SOVER}"
-		)
-
-		if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
-		then
-			NV_GLX_LIBRARIES+=( "libnvidia-wfb.so.${NV_SOVER}" )
-		fi
-
-		if use kernel_FreeBSD; then
-			NV_GLX_LIBRARIES+=( "libnvidia-tls.so.${NV_SOVER}" )
-		fi
-
-		if use kernel_linux; then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-ml.so.${NV_SOVER}"
-				"tls/libnvidia-tls.so.${NV_SOVER}"
-			)
-		fi
-
-		for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
-			donvidia ${libdir}/${NV_LIB}
-		done
-	fi
-}
-
-pkg_preinst() {
-	if use driver && use kernel_linux; then
-		linux-mod_pkg_preinst
-
-		local videogroup="$(egetent group video | cut -d ':' -f 3)"
-		if [ -z "${videogroup}" ]; then
-			eerror "Failed to determine the video group gid"
-			die "Failed to determine the video group gid"
-		else
-			sed -i \
-				-e "s:PACKAGE:${PF}:g" \
-				-e "s:VIDEOGID:${videogroup}:" \
-				"${D}"/etc/modprobe.d/nvidia.conf || die
-		fi
-	fi
-
-	# Clean the dynamic libGL stuff's home to ensure
-	# we dont have stale libs floating around
-	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ]; then
-		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
-	fi
-	# Make sure we nuke the old nvidia-glx's env.d file
-	if [ -e "${ROOT}"/etc/env.d/09nvidia ]; then
-		rm -f "${ROOT}"/etc/env.d/09nvidia
-	fi
-}
-
-pkg_postinst() {
-	use driver && use kernel_linux && linux-mod_pkg_postinst
-
-	# Switch to the nvidia implementation
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
-	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
-
-	readme.gentoo_print_elog
-
-	if ! use X; then
-		elog "You have elected to not install the X.org driver. Along with"
-		elog "this the OpenGL libraries and VDPAU libraries were not"
-		elog "installed. Additionally, once the driver is loaded your card"
-		elog "and fan will run at max speed which may not be desirable."
-		elog "Use the 'nvidia-smi' init script to have your card and fan"
-		elog "speed scale appropriately."
-		elog
-	fi
-	if ! use tools; then
-		elog "USE=tools controls whether the nvidia-settings application"
-		elog "is installed. If you would like to use it, enable that"
-		elog "flag and re-emerge this ebuild. Optionally you can install"
-		elog "media-video/nvidia-settings"
-		elog
-	fi
-}
-
-pkg_prerm() {
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}
-
-pkg_postrm() {
-	use driver && use kernel_linux && linux-mod_pkg_postrm
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-364.19-r1.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-364.19-r1.ebuild
deleted file mode 100644
index 5ce6ae9fa3f..00000000000
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-364.19-r1.ebuild
+++ /dev/null
@@ -1,547 +0,0 @@
-# Copyright 1999-2016 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-
-inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \
-	portability toolchain-funcs unpacker user udev
-
-NV_URI="http://us.download.nvidia.com/XFree86/"
-X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
-AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
-X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
-AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
-
-DESCRIPTION="NVIDIA Accelerated Graphics Driver"
-HOMEPAGE="http://www.nvidia.com/ http://www.nvidia.com/Download/Find.aspx"
-SRC_URI="
-	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
-	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
-	x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
-	x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
-	tools? ( ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2 )
-"
-
-LICENSE="GPL-2 NVIDIA-r2"
-SLOT="0/${PV%.*}"
-KEYWORDS="-* amd64 x86 ~amd64-fbsd ~x86-fbsd"
-RESTRICT="bindist mirror"
-EMULTILIB_PKG="true"
-
-IUSE="acpi compat +driver gtk3 kernel_FreeBSD kernel_linux +kms multilib pax_kernel static-libs +tools uvm wayland +X"
-REQUIRED_USE="
-	tools? ( X )
-	static-libs? ( tools )
-"
-
-COMMON="
-	app-eselect/eselect-opencl
-	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
-	tools? (
-		dev-libs/atk
-		dev-libs/glib:2
-		dev-libs/jansson
-		gtk3? ( x11-libs/gtk+:3 )
-		x11-libs/cairo
-		x11-libs/gdk-pixbuf[X]
-		x11-libs/gtk+:2
-		x11-libs/libX11
-		x11-libs/libXext
-		x11-libs/libXrandr
-		x11-libs/libXv
-		x11-libs/libXxf86vm
-		x11-libs/pango[X]
-	)
-	X? (
-		>=app-eselect/eselect-opengl-1.0.9
-		app-misc/pax-utils
-	)
-"
-DEPEND="
-	${COMMON}
-	kernel_linux? ( virtual/linux-sources )
-"
-RDEPEND="
-	${COMMON}
-	acpi? ( sys-power/acpid )
-	tools? ( !media-video/nvidia-settings )
-	wayland? ( dev-libs/wayland )
-	X? (
-		<x11-base/xorg-server-1.18.99:=
-		>=x11-libs/libvdpau-1.0
-		multilib? (
-			>=x11-libs/libX11-1.6.2[abi_x86_32]
-			>=x11-libs/libXext-1.3.2[abi_x86_32]
-		)
-	)
-"
-
-QA_PREBUILT="opt/* usr/lib*"
-
-S=${WORKDIR}/
-
-pkg_pretend() {
-	if use amd64 && has_multilib_profile && \
-		[ "${DEFAULT_ABI}" != "amd64" ]; then
-		eerror "This ebuild doesn't currently support changing your default ABI"
-		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
-	fi
-
-	if use kernel_linux && kernel_is ge 4 6; then
-		ewarn "Gentoo supports kernels which are supported by NVIDIA"
-		ewarn "which are limited to the following kernels:"
-		ewarn "<sys-kernel/gentoo-sources-4.6"
-		ewarn "<sys-kernel/vanilla-sources-4.6"
-		ewarn ""
-		ewarn "You are free to utilize epatch_user to provide whatever"
-		ewarn "support you feel is appropriate, but will not receive"
-		ewarn "support as a result of those changes."
-		ewarn ""
-		ewarn "Do not file a bug report about this."
-		ewarn ""
-	fi
-
-	# Since Nvidia ships many different series of drivers, we need to give the user
-	# some kind of guidance as to what version they should install. This tries
-	# to point the user in the right direction but can't be perfect. check
-	# nvidia-driver.eclass
-	nvidia-driver-check-warning
-
-	# Kernel features/options to check for
-	CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
-	use x86 && CONFIG_CHECK+=" ~HIGHMEM"
-
-	# Now do the above checks
-	use kernel_linux && check_extra_config
-}
-
-pkg_setup() {
-	# try to turn off distcc and ccache for people that have a problem with it
-	export DISTCC_DISABLE=1
-	export CCACHE_DISABLE=1
-
-	if use driver && use kernel_linux; then
-		MODULE_NAMES="nvidia(video:${S}/kernel)"
-		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
-		use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel) nvidia-drm(video:${S}/kernel)"
-
-		# This needs to run after MODULE_NAMES (so that the eclass checks
-		# whether the kernel supports loadable modules) but before BUILD_PARAMS
-		# is set (so that KV_DIR is populated).
-		linux-mod_pkg_setup
-
-		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
-		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
-
-		# linux-mod_src_compile calls set_arch_to_kernel, which
-		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
-		# expects x86_64 or i386 and then converts it to x86
-		# later on in the build process
-		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
-	fi
-
-	if use kernel_linux && kernel_is lt 2 6 9; then
-		eerror "You must build this against 2.6.9 or higher kernels."
-	fi
-
-	# set variables to where files are in the package structure
-	if use kernel_FreeBSD; then
-		use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
-		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
-		NV_DOC="${S}/doc"
-		NV_OBJ="${S}/obj"
-		NV_SRC="${S}/src"
-		NV_MAN="${S}/x11/man"
-		NV_X11="${S}/obj"
-		NV_SOVER=1
-	elif use kernel_linux; then
-		NV_DOC="${S}"
-		NV_OBJ="${S}"
-		NV_SRC="${S}/kernel"
-		NV_MAN="${S}"
-		NV_X11="${S}"
-		NV_SOVER=${PV}
-	else
-		die "Could not determine proper NVIDIA package"
-	fi
-}
-
-src_prepare() {
-	if use pax_kernel; then
-		ewarn "Using PAX patches is not supported. You will be asked to"
-		ewarn "use a standard kernel should you have issues. Should you"
-		ewarn "need support with these patches, contact the PaX team."
-		epatch "${FILESDIR}"/${PN}-364.12-pax.patch
-	fi
-
-	# Allow user patches so they can support RC kernels and whatever else
-	epatch_user
-}
-
-src_compile() {
-	# This is already the default on Linux, as there's no toplevel Makefile, but
-	# on FreeBSD there's one and triggers the kernel module build, as we install
-	# it by itself, pass this.
-
-	cd "${NV_SRC}"
-	if use kernel_FreeBSD; then
-		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
-			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
-	elif use driver && use kernel_linux; then
-		MAKEOPTS=-j1 linux-mod_src_compile
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			AR="$(tc-getAR)" \
-			CC="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			NV_VERBOSE=1 \
-			RANLIB="$(tc-getRANLIB)" \
-			DO_STRIP= \
-			build-xnvctrl
-
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			CC="$(tc-getCC)" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LD="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			NVML_ENABLED=0 \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			NV_VERBOSE=1 \
-			DO_STRIP=
-	fi
-}
-
-# Install nvidia library:
-# the first parameter is the library to install
-# the second parameter is the provided soversion
-# the third parameter is the target directory if it is not /usr/lib
-donvidia() {
-	# Full path to library
-	nv_LIB="${1}"
-
-	# SOVER to use
-	nv_SOVER="$(scanelf -qF'%S#F' ${nv_LIB})"
-
-	# Where to install
-	nv_DEST="${2}"
-
-	# Get just the library name
-	nv_LIBNAME=$(basename "${nv_LIB}")
-
-	if [[ "${nv_DEST}" ]]; then
-		exeinto ${nv_DEST}
-		action="doexe"
-	else
-		nv_DEST="/usr/$(get_libdir)"
-		action="dolib.so"
-	fi
-
-	# Install the library
-	${action} ${nv_LIB} || die "failed to install ${nv_LIBNAME}"
-
-	# If the library has a SONAME and SONAME does not match the library name,
-	# then we need to create a symlink
-	if [[ ${nv_SOVER} ]] && ! [[ "${nv_SOVER}" = "${nv_LIBNAME}" ]]; then
-		dosym ${nv_LIBNAME} ${nv_DEST}/${nv_SOVER} \
-			|| die "failed to create ${nv_DEST}/${nv_SOVER} symlink"
-	fi
-
-	dosym ${nv_LIBNAME} ${nv_DEST}/${nv_LIBNAME/.so*/.so} \
-		|| die "failed to create ${nv_LIBNAME/.so*/.so} symlink"
-}
-
-src_install() {
-	if use driver && use kernel_linux; then
-		linux-mod_src_install
-
-		# Add the aliases
-		# This file is tweaked with the appropriate video group in
-		# pkg_preinst, see bug #491414
-		insinto /etc/modprobe.d
-		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
-		doins "${FILESDIR}"/nvidia-rmmod.conf
-
-		# Ensures that our device nodes are created when not using X
-		exeinto "$(get_udevdir)"
-		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
-		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
-	elif use kernel_FreeBSD; then
-		if use x86-fbsd; then
-			insinto /boot/modules
-			doins "${S}/src/nvidia.kld"
-		fi
-
-		exeinto /boot/modules
-		doexe "${S}/src/nvidia.ko"
-	fi
-
-	# NVIDIA kernel <-> userspace driver config lib
-	donvidia ${NV_OBJ}/libnvidia-cfg.so.${NV_SOVER}
-
-	# NVIDIA framebuffer capture library
-	donvidia ${NV_OBJ}/libnvidia-fbc.so.${NV_SOVER}
-
-	# NVIDIA video encode/decode <-> CUDA
-	if use kernel_linux; then
-		donvidia ${NV_OBJ}/libnvcuvid.so.${NV_SOVER}
-		donvidia ${NV_OBJ}/libnvidia-encode.so.${NV_SOVER}
-	fi
-
-	if use X; then
-		# Xorg DDX driver
-		insinto /usr/$(get_libdir)/xorg/modules/drivers
-		doins ${NV_X11}/nvidia_drv.so
-
-		# Xorg GLX driver
-		donvidia ${NV_X11}/libglx.so.${NV_SOVER} \
-			/usr/$(get_libdir)/opengl/nvidia/extensions
-
-		# Xorg nvidia.conf
-		if has_version '>=x11-base/xorg-server-1.16'; then
-			insinto /usr/share/X11/xorg.conf.d
-			newins {,50-}nvidia-drm-outputclass.conf
-		fi
-	fi
-
-	# OpenCL ICD for NVIDIA
-	if use kernel_linux; then
-		insinto /etc/OpenCL/vendors
-		doins ${NV_OBJ}/nvidia.icd
-	fi
-
-	# Documentation
-	dohtml ${NV_DOC}/html/*
-	if use kernel_FreeBSD; then
-		dodoc "${NV_DOC}/README"
-		use X && doman "${NV_MAN}/nvidia-xconfig.1"
-		use tools && doman "${NV_MAN}/nvidia-settings.1"
-	else
-		# Docs
-		newdoc "${NV_DOC}/README.txt" README
-		dodoc "${NV_DOC}/NVIDIA_Changelog"
-		doman "${NV_MAN}/nvidia-smi.1.gz"
-		use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
-		use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
-		doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
-	fi
-
-	# Helper Apps
-	exeinto /opt/bin/
-
-	if use X; then
-		doexe ${NV_OBJ}/nvidia-xconfig
-
-		insinto /etc/vulkan/icd.d
-		doins nvidia_icd.json
-	fi
-
-	if use kernel_linux; then
-		doexe ${NV_OBJ}/nvidia-cuda-mps-control
-		doexe ${NV_OBJ}/nvidia-cuda-mps-server
-		doexe ${NV_OBJ}/nvidia-debugdump
-		doexe ${NV_OBJ}/nvidia-persistenced
-		doexe ${NV_OBJ}/nvidia-smi
-
-		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
-		doexe ${NV_OBJ}/nvidia-modprobe
-		fowners root:video /opt/bin/nvidia-modprobe
-		fperms 4710 /opt/bin/nvidia-modprobe
-		dosym /{opt,usr}/bin/nvidia-modprobe
-
-		doman nvidia-cuda-mps-control.1.gz
-		doman nvidia-modprobe.1.gz
-		doman nvidia-persistenced.1.gz
-		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
-		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
-		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src/ \
-			DESTDIR="${D}" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LIBDIR="${D}/usr/$(get_libdir)" \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			NV_VERBOSE=1 \
-			PREFIX=/usr \
-			DO_STRIP= \
-			install
-
-		if use static-libs; then
-			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
-
-			insinto /usr/include/NVCtrl
-			doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
-		fi
-
-		insinto /usr/share/nvidia/
-		doins nvidia-application-profiles-${PV}-key-documentation
-
-		insinto /etc/nvidia
-		newins \
-			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
-
-		# There is no icon in the FreeBSD tarball.
-		use kernel_FreeBSD || \
-			doicon ${NV_OBJ}/nvidia-settings.png
-
-		domenu "${FILESDIR}"/nvidia-settings.desktop
-
-		exeinto /etc/X11/xinit/xinitrc.d
-		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
-	fi
-
-	dobin ${NV_OBJ}/nvidia-bug-report.sh
-
-	if has_multilib_profile && use multilib; then
-		local OABI=${ABI}
-		for ABI in $(get_install_abis); do
-			src_install-libs
-		done
-		ABI=${OABI}
-		unset OABI
-	else
-		src_install-libs
-	fi
-
-	is_final_abi || die "failed to iterate through all ABIs"
-
-	readme.gentoo_create_doc
-}
-
-src_install-libs() {
-	local inslibdir=$(get_libdir)
-	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
-	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
-	local libdir=${NV_OBJ}
-
-	if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
-		libdir=${NV_OBJ}/32
-	fi
-
-	if use X; then
-		NV_GLX_LIBRARIES=(
-			"libEGL.so.1 ${GL_ROOT}"
-			"libEGL_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGL.so.$(usex compat ${NV_SOVER} 1.0.0) ${GL_ROOT}"
-			"libGLESv1_CM.so.1 ${GL_ROOT}"
-			"libGLESv1_CM_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLESv2.so.2 ${GL_ROOT}"
-			"libGLESv2_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLX.so.0 ${GL_ROOT}"
-			"libGLX_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLdispatch.so.0 ${GL_ROOT}"
-			"libOpenCL.so.1.0.0 ${CL_ROOT}"
-			"libOpenGL.so.0 ${GL_ROOT}"
-			"libcuda.so.${NV_SOVER}"
-			"libnvcuvid.so.${NV_SOVER}"
-			"libnvidia-compiler.so.${NV_SOVER}"
-			"libnvidia-eglcore.so.${NV_SOVER}"
-			"libnvidia-encode.so.${NV_SOVER}"
-			"libnvidia-fatbinaryloader.so.${NV_SOVER}"
-			"libnvidia-fbc.so.${NV_SOVER}"
-			"libnvidia-glcore.so.${NV_SOVER}"
-			"libnvidia-glsi.so.${NV_SOVER}"
-			"libnvidia-ifr.so.${NV_SOVER}"
-			"libnvidia-opencl.so.${NV_SOVER}"
-			"libnvidia-ptxjitcompiler.so.${NV_SOVER}"
-			"libvdpau_nvidia.so.${NV_SOVER}"
-		)
-
-		if use wayland && has_multilib_profile && [[ ${ABI} == "amd64" ]];
-		then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-egl-wayland.so.${NV_SOVER}"
-			)
-		fi
-
-		if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
-		then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-wfb.so.${NV_SOVER}"
-			)
-		fi
-
-		if use kernel_FreeBSD; then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-tls.so.${NV_SOVER}"
-			)
-		fi
-
-		if use kernel_linux; then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-ml.so.${NV_SOVER}"
-				"tls/libnvidia-tls.so.${NV_SOVER}"
-			)
-		fi
-
-		for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
-			donvidia ${libdir}/${NV_LIB}
-		done
-	fi
-}
-
-pkg_preinst() {
-	if use driver && use kernel_linux; then
-		linux-mod_pkg_preinst
-
-		local videogroup="$(egetent group video | cut -d ':' -f 3)"
-		if [ -z "${videogroup}" ]; then
-			eerror "Failed to determine the video group gid"
-			die "Failed to determine the video group gid"
-		else
-			sed -i \
-				-e "s:PACKAGE:${PF}:g" \
-				-e "s:VIDEOGID:${videogroup}:" \
-				"${D}"/etc/modprobe.d/nvidia.conf || die
-		fi
-	fi
-
-	# Clean the dynamic libGL stuff's home to ensure
-	# we dont have stale libs floating around
-	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ]; then
-		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
-	fi
-	# Make sure we nuke the old nvidia-glx's env.d file
-	if [ -e "${ROOT}"/etc/env.d/09nvidia ]; then
-		rm -f "${ROOT}"/etc/env.d/09nvidia
-	fi
-}
-
-pkg_postinst() {
-	use driver && use kernel_linux && linux-mod_pkg_postinst
-
-	# Switch to the nvidia implementation
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
-	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
-
-	readme.gentoo_print_elog
-
-	if ! use X; then
-		elog "You have elected to not install the X.org driver. Along with"
-		elog "this the OpenGL libraries and VDPAU libraries were not"
-		elog "installed. Additionally, once the driver is loaded your card"
-		elog "and fan will run at max speed which may not be desirable."
-		elog "Use the 'nvidia-smi' init script to have your card and fan"
-		elog "speed scale appropriately."
-		elog
-	fi
-	if ! use tools; then
-		elog "USE=tools controls whether the nvidia-settings application"
-		elog "is installed. If you would like to use it, enable that"
-		elog "flag and re-emerge this ebuild. Optionally you can install"
-		elog "media-video/nvidia-settings"
-		elog
-	fi
-}
-
-pkg_prerm() {
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}
-
-pkg_postrm() {
-	use driver && use kernel_linux && linux-mod_pkg_postrm
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-364.19-r2.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-364.19-r2.ebuild
deleted file mode 100644
index a0179c22bb6..00000000000
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-364.19-r2.ebuild
+++ /dev/null
@@ -1,548 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-inherit eutils flag-o-matic linux-info linux-mod multilib-minimal nvidia-driver \
-	portability toolchain-funcs unpacker user udev
-
-NV_URI="http://us.download.nvidia.com/XFree86/"
-X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
-AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
-X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
-AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
-
-DESCRIPTION="NVIDIA Accelerated Graphics Driver"
-HOMEPAGE="http://www.nvidia.com/ http://www.nvidia.com/Download/Find.aspx"
-SRC_URI="
-	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
-	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
-	x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
-	x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
-	tools? ( ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2 )
-"
-
-LICENSE="GPL-2 NVIDIA-r2"
-SLOT="0/${PV%.*}"
-KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
-RESTRICT="bindist mirror"
-EMULTILIB_PKG="true"
-
-IUSE="acpi compat +driver gtk3 kernel_FreeBSD kernel_linux +kms multilib pax_kernel static-libs +tools uvm wayland +X"
-REQUIRED_USE="
-	tools? ( X )
-	static-libs? ( tools )
-"
-
-COMMON="
-	app-eselect/eselect-opencl
-	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
-	tools? (
-		dev-libs/atk
-		dev-libs/glib:2
-		dev-libs/jansson
-		gtk3? (
-			x11-libs/gtk+:3
-		)
-		x11-libs/cairo
-		x11-libs/gdk-pixbuf[X]
-		x11-libs/gtk+:2
-		x11-libs/libX11
-		x11-libs/libXext
-		x11-libs/libXrandr
-		x11-libs/libXv
-		x11-libs/libXxf86vm
-		x11-libs/pango[X]
-	)
-	X? (
-		>=app-eselect/eselect-opengl-1.0.9
-		app-misc/pax-utils
-	)
-"
-DEPEND="
-	${COMMON}
-	kernel_linux? ( virtual/linux-sources )
-"
-RDEPEND="
-	${COMMON}
-	acpi? ( sys-power/acpid )
-	tools? ( !media-video/nvidia-settings )
-	wayland? ( dev-libs/wayland[${MULTILIB_USEDEP}] )
-	X? (
-		<x11-base/xorg-server-1.18.99:=
-		>=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
-		>=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
-		>=x11-libs/libvdpau-1.0[${MULTILIB_USEDEP}]
-		sys-libs/zlib[${MULTILIB_USEDEP}]
-	)
-"
-
-QA_PREBUILT="opt/* usr/lib*"
-
-S=${WORKDIR}/
-
-pkg_pretend() {
-	if use amd64 && has_multilib_profile && \
-		[ "${DEFAULT_ABI}" != "amd64" ]; then
-		eerror "This ebuild doesn't currently support changing your default ABI"
-		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
-	fi
-
-	if use kernel_linux && kernel_is ge 4 6; then
-		ewarn "Gentoo supports kernels which are supported by NVIDIA"
-		ewarn "which are limited to the following kernels:"
-		ewarn "<sys-kernel/gentoo-sources-4.6"
-		ewarn "<sys-kernel/vanilla-sources-4.6"
-		ewarn ""
-		ewarn "You are free to utilize eapply_user to provide whatever"
-		ewarn "support you feel is appropriate, but will not receive"
-		ewarn "support as a result of those changes."
-		ewarn ""
-		ewarn "Do not file a bug report about this."
-		ewarn ""
-	fi
-
-	# Since Nvidia ships many different series of drivers, we need to give the user
-	# some kind of guidance as to what version they should install. This tries
-	# to point the user in the right direction but can't be perfect. check
-	# nvidia-driver.eclass
-	nvidia-driver-check-warning
-
-	# Kernel features/options to check for
-	CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
-	use x86 && CONFIG_CHECK+=" ~HIGHMEM"
-
-	# Now do the above checks
-	use kernel_linux && check_extra_config
-}
-
-pkg_setup() {
-	# try to turn off distcc and ccache for people that have a problem with it
-	export DISTCC_DISABLE=1
-	export CCACHE_DISABLE=1
-
-	if use driver && use kernel_linux; then
-		MODULE_NAMES="nvidia(video:${S}/kernel)"
-		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
-		use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel) nvidia-drm(video:${S}/kernel)"
-
-		# This needs to run after MODULE_NAMES (so that the eclass checks
-		# whether the kernel supports loadable modules) but before BUILD_PARAMS
-		# is set (so that KV_DIR is populated).
-		linux-mod_pkg_setup
-
-		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
-		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
-
-		# linux-mod_src_compile calls set_arch_to_kernel, which
-		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
-		# expects x86_64 or i386 and then converts it to x86
-		# later on in the build process
-		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
-	fi
-
-	if use kernel_linux && kernel_is lt 2 6 9; then
-		eerror "You must build this against 2.6.9 or higher kernels."
-	fi
-
-	# set variables to where files are in the package structure
-	if use kernel_FreeBSD; then
-		use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
-		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
-		NV_DOC="${S}/doc"
-		NV_OBJ="${S}/obj"
-		NV_SRC="${S}/src"
-		NV_MAN="${S}/x11/man"
-		NV_X11="${S}/obj"
-		NV_SOVER=1
-	elif use kernel_linux; then
-		NV_DOC="${S}"
-		NV_OBJ="${S}"
-		NV_SRC="${S}/kernel"
-		NV_MAN="${S}"
-		NV_X11="${S}"
-		NV_SOVER=${PV}
-	else
-		die "Could not determine proper NVIDIA package"
-	fi
-}
-
-src_prepare() {
-	if use pax_kernel; then
-		ewarn "Using PAX patches is not supported. You will be asked to"
-		ewarn "use a standard kernel should you have issues. Should you"
-		ewarn "need support with these patches, contact the PaX team."
-		eapply "${FILESDIR}"/${PN}-364.12-pax.patch
-	fi
-
-	# Allow user patches so they can support RC kernels and whatever else
-	eapply_user
-}
-
-src_compile() {
-	# This is already the default on Linux, as there's no toplevel Makefile, but
-	# on FreeBSD there's one and triggers the kernel module build, as we install
-	# it by itself, pass this.
-
-	cd "${NV_SRC}"
-	if use kernel_FreeBSD; then
-		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
-			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
-	elif use driver && use kernel_linux; then
-		MAKEOPTS=-j1 linux-mod_src_compile
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			AR="$(tc-getAR)" \
-			CC="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			NV_VERBOSE=1 \
-			RANLIB="$(tc-getRANLIB)" \
-			DO_STRIP= \
-			build-xnvctrl
-
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			CC="$(tc-getCC)" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LD="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			NVML_ENABLED=0 \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			NV_VERBOSE=1 \
-			DO_STRIP=
-	fi
-}
-
-# Install nvidia library:
-# the first parameter is the library to install
-# the second parameter is the provided soversion
-# the third parameter is the target directory if it is not /usr/lib
-donvidia() {
-	# Full path to library
-	nv_LIB="${1}"
-
-	# SOVER to use
-	nv_SOVER="$(scanelf -qF'%S#F' ${nv_LIB})"
-
-	# Where to install
-	nv_DEST="${2}"
-
-	# Get just the library name
-	nv_LIBNAME=$(basename "${nv_LIB}")
-
-	if [[ "${nv_DEST}" ]]; then
-		exeinto ${nv_DEST}
-		action="doexe"
-	else
-		nv_DEST="/usr/$(get_libdir)"
-		action="dolib.so"
-	fi
-
-	# Install the library
-	${action} ${nv_LIB} || die "failed to install ${nv_LIBNAME}"
-
-	# If the library has a SONAME and SONAME does not match the library name,
-	# then we need to create a symlink
-	if [[ ${nv_SOVER} ]] && ! [[ "${nv_SOVER}" = "${nv_LIBNAME}" ]]; then
-		dosym ${nv_LIBNAME} ${nv_DEST}/${nv_SOVER} \
-			|| die "failed to create ${nv_DEST}/${nv_SOVER} symlink"
-	fi
-
-	dosym ${nv_LIBNAME} ${nv_DEST}/${nv_LIBNAME/.so*/.so} \
-		|| die "failed to create ${nv_LIBNAME/.so*/.so} symlink"
-}
-
-src_install() {
-	if use driver && use kernel_linux; then
-		linux-mod_src_install
-
-		# Add the aliases
-		# This file is tweaked with the appropriate video group in
-		# pkg_preinst, see bug #491414
-		insinto /etc/modprobe.d
-		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
-		doins "${FILESDIR}"/nvidia-rmmod.conf
-
-		# Ensures that our device nodes are created when not using X
-		exeinto "$(get_udevdir)"
-		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
-		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
-	elif use kernel_FreeBSD; then
-		if use x86-fbsd; then
-			insinto /boot/modules
-			doins "${S}/src/nvidia.kld"
-		fi
-
-		exeinto /boot/modules
-		doexe "${S}/src/nvidia.ko"
-	fi
-
-	# NVIDIA kernel <-> userspace driver config lib
-	donvidia ${NV_OBJ}/libnvidia-cfg.so.${NV_SOVER}
-
-	# NVIDIA framebuffer capture library
-	donvidia ${NV_OBJ}/libnvidia-fbc.so.${NV_SOVER}
-
-	# NVIDIA video encode/decode <-> CUDA
-	if use kernel_linux; then
-		donvidia ${NV_OBJ}/libnvcuvid.so.${NV_SOVER}
-		donvidia ${NV_OBJ}/libnvidia-encode.so.${NV_SOVER}
-	fi
-
-	if use X; then
-		# Xorg DDX driver
-		insinto /usr/$(get_libdir)/xorg/modules/drivers
-		doins ${NV_X11}/nvidia_drv.so
-
-		# Xorg GLX driver
-		donvidia ${NV_X11}/libglx.so.${NV_SOVER} \
-			/usr/$(get_libdir)/opengl/nvidia/extensions
-
-		# Xorg nvidia.conf
-		if has_version '>=x11-base/xorg-server-1.16'; then
-			insinto /usr/share/X11/xorg.conf.d
-			newins {,50-}nvidia-drm-outputclass.conf
-		fi
-	fi
-
-	# OpenCL ICD for NVIDIA
-	if use kernel_linux; then
-		insinto /etc/OpenCL/vendors
-		doins ${NV_OBJ}/nvidia.icd
-	fi
-
-	# Documentation
-	dohtml ${NV_DOC}/html/*
-	if use kernel_FreeBSD; then
-		dodoc "${NV_DOC}/README"
-		use X && doman "${NV_MAN}/nvidia-xconfig.1"
-		use tools && doman "${NV_MAN}/nvidia-settings.1"
-	else
-		# Docs
-		newdoc "${NV_DOC}/README.txt" README
-		dodoc "${NV_DOC}/NVIDIA_Changelog"
-		doman "${NV_MAN}/nvidia-smi.1.gz"
-		use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
-		use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
-		doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
-	fi
-
-	# Helper Apps
-	exeinto /opt/bin/
-
-	if use X; then
-		doexe ${NV_OBJ}/nvidia-xconfig
-
-		insinto /etc/vulkan/icd.d
-		doins nvidia_icd.json
-	fi
-
-	if use kernel_linux; then
-		doexe ${NV_OBJ}/nvidia-cuda-mps-control
-		doexe ${NV_OBJ}/nvidia-cuda-mps-server
-		doexe ${NV_OBJ}/nvidia-debugdump
-		doexe ${NV_OBJ}/nvidia-persistenced
-		doexe ${NV_OBJ}/nvidia-smi
-
-		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
-		doexe ${NV_OBJ}/nvidia-modprobe
-		fowners root:video /opt/bin/nvidia-modprobe
-		fperms 4710 /opt/bin/nvidia-modprobe
-		dosym /{opt,usr}/bin/nvidia-modprobe
-
-		doman nvidia-cuda-mps-control.1.gz
-		doman nvidia-modprobe.1.gz
-		doman nvidia-persistenced.1.gz
-		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
-		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
-		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src/ \
-			DESTDIR="${D}" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LIBDIR="${D}/usr/$(get_libdir)" \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			NV_VERBOSE=1 \
-			PREFIX=/usr \
-			DO_STRIP= \
-			install
-
-		if use static-libs; then
-			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
-
-			insinto /usr/include/NVCtrl
-			doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
-		fi
-
-		insinto /usr/share/nvidia/
-		doins nvidia-application-profiles-${PV}-key-documentation
-
-		insinto /etc/nvidia
-		newins \
-			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
-
-		# There is no icon in the FreeBSD tarball.
-		use kernel_FreeBSD || \
-			doicon ${NV_OBJ}/nvidia-settings.png
-
-		domenu "${FILESDIR}"/nvidia-settings.desktop
-
-		exeinto /etc/X11/xinit/xinitrc.d
-		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
-	fi
-
-	dobin ${NV_OBJ}/nvidia-bug-report.sh
-
-	if has_multilib_profile && use multilib; then
-		local OABI=${ABI}
-		for ABI in $(get_install_abis); do
-			src_install-libs
-		done
-		ABI=${OABI}
-		unset OABI
-	else
-		src_install-libs
-	fi
-
-	is_final_abi || die "failed to iterate through all ABIs"
-
-	readme.gentoo_create_doc
-}
-
-src_install-libs() {
-	local inslibdir=$(get_libdir)
-	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
-	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
-	local libdir=${NV_OBJ}
-
-	if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
-		libdir=${NV_OBJ}/32
-	fi
-
-	if use X; then
-		NV_GLX_LIBRARIES=(
-			"libEGL.so.1 ${GL_ROOT}"
-			"libEGL_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGL.so.$(usex compat ${NV_SOVER} 1.0.0) ${GL_ROOT}"
-			"libGLESv1_CM.so.1 ${GL_ROOT}"
-			"libGLESv1_CM_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLESv2.so.2 ${GL_ROOT}"
-			"libGLESv2_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLX.so.0 ${GL_ROOT}"
-			"libGLX_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLdispatch.so.0 ${GL_ROOT}"
-			"libOpenCL.so.1.0.0 ${CL_ROOT}"
-			"libOpenGL.so.0 ${GL_ROOT}"
-			"libcuda.so.${NV_SOVER}"
-			"libnvcuvid.so.${NV_SOVER}"
-			"libnvidia-compiler.so.${NV_SOVER}"
-			"libnvidia-eglcore.so.${NV_SOVER}"
-			"libnvidia-encode.so.${NV_SOVER}"
-			"libnvidia-fatbinaryloader.so.${NV_SOVER}"
-			"libnvidia-fbc.so.${NV_SOVER}"
-			"libnvidia-glcore.so.${NV_SOVER}"
-			"libnvidia-glsi.so.${NV_SOVER}"
-			"libnvidia-ifr.so.${NV_SOVER}"
-			"libnvidia-opencl.so.${NV_SOVER}"
-			"libnvidia-ptxjitcompiler.so.${NV_SOVER}"
-			"libvdpau_nvidia.so.${NV_SOVER}"
-		)
-
-		if use wayland && has_multilib_profile && [[ ${ABI} == "amd64" ]];
-		then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-egl-wayland.so.${NV_SOVER}"
-			)
-		fi
-
-		if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
-		then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-wfb.so.${NV_SOVER}"
-			)
-		fi
-
-		if use kernel_FreeBSD; then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-tls.so.${NV_SOVER}"
-			)
-		fi
-
-		if use kernel_linux; then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-ml.so.${NV_SOVER}"
-				"tls/libnvidia-tls.so.${NV_SOVER}"
-			)
-		fi
-
-		for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
-			donvidia ${libdir}/${NV_LIB}
-		done
-	fi
-}
-
-pkg_preinst() {
-	if use driver && use kernel_linux; then
-		linux-mod_pkg_preinst
-
-		local videogroup="$(egetent group video | cut -d ':' -f 3)"
-		if [ -z "${videogroup}" ]; then
-			eerror "Failed to determine the video group gid"
-			die "Failed to determine the video group gid"
-		else
-			sed -i \
-				-e "s:PACKAGE:${PF}:g" \
-				-e "s:VIDEOGID:${videogroup}:" \
-				"${D}"/etc/modprobe.d/nvidia.conf || die
-		fi
-	fi
-
-	# Clean the dynamic libGL stuff's home to ensure
-	# we dont have stale libs floating around
-	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ]; then
-		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
-	fi
-	# Make sure we nuke the old nvidia-glx's env.d file
-	if [ -e "${ROOT}"/etc/env.d/09nvidia ]; then
-		rm -f "${ROOT}"/etc/env.d/09nvidia
-	fi
-}
-
-pkg_postinst() {
-	use driver && use kernel_linux && linux-mod_pkg_postinst
-
-	# Switch to the nvidia implementation
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
-	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
-
-	readme.gentoo_print_elog
-
-	if ! use X; then
-		elog "You have elected to not install the X.org driver. Along with"
-		elog "this the OpenGL libraries and VDPAU libraries were not"
-		elog "installed. Additionally, once the driver is loaded your card"
-		elog "and fan will run at max speed which may not be desirable."
-		elog "Use the 'nvidia-smi' init script to have your card and fan"
-		elog "speed scale appropriately."
-		elog
-	fi
-	if ! use tools; then
-		elog "USE=tools controls whether the nvidia-settings application"
-		elog "is installed. If you would like to use it, enable that"
-		elog "flag and re-emerge this ebuild. Optionally you can install"
-		elog "media-video/nvidia-settings"
-		elog
-	fi
-}
-
-pkg_prerm() {
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}
-
-pkg_postrm() {
-	use driver && use kernel_linux && linux-mod_pkg_postrm
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-367.57-r1.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-367.57-r1.ebuild
deleted file mode 100644
index a7576025aea..00000000000
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-367.57-r1.ebuild
+++ /dev/null
@@ -1,551 +0,0 @@
-# Copyright 1999-2016 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-
-inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \
-	portability toolchain-funcs unpacker user udev
-
-NV_URI="http://us.download.nvidia.com/XFree86/"
-X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
-AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
-ARM_NV_PACKAGE="NVIDIA-Linux-armv7l-gnueabihf-${PV}"
-X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
-AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
-
-DESCRIPTION="NVIDIA Accelerated Graphics Driver"
-HOMEPAGE="http://www.nvidia.com/ http://www.nvidia.com/Download/Find.aspx"
-SRC_URI="
-	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
-	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
-	arm? ( ${NV_URI}Linux-x86-ARM/${PV}/${ARM_NV_PACKAGE}.run )
-	x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
-	x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
-	tools? ( ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2 )
-"
-
-LICENSE="GPL-2 NVIDIA-r2"
-SLOT="0/${PV%.*}"
-KEYWORDS="-* amd64 x86 ~amd64-fbsd ~x86-fbsd"
-RESTRICT="bindist mirror"
-EMULTILIB_PKG="true"
-
-IUSE="acpi compat +driver gtk3 kernel_FreeBSD kernel_linux +kms multilib pax_kernel static-libs +tools uvm wayland +X"
-REQUIRED_USE="
-	tools? ( X )
-	static-libs? ( tools )
-"
-
-COMMON="
-	app-eselect/eselect-opencl
-	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
-	tools? (
-		dev-libs/atk
-		dev-libs/glib:2
-		dev-libs/jansson
-		gtk3? ( x11-libs/gtk+:3 )
-		x11-libs/cairo
-		x11-libs/gdk-pixbuf[X]
-		x11-libs/gtk+:2
-		x11-libs/libX11
-		x11-libs/libXext
-		x11-libs/libXrandr
-		x11-libs/libXv
-		x11-libs/libXxf86vm
-		x11-libs/pango[X]
-	)
-	X? (
-		>=app-eselect/eselect-opengl-1.0.9
-		app-misc/pax-utils
-	)
-"
-DEPEND="
-	${COMMON}
-	kernel_linux? ( virtual/linux-sources )
-"
-RDEPEND="
-	${COMMON}
-	acpi? ( sys-power/acpid )
-	tools? ( !media-video/nvidia-settings )
-	wayland? ( dev-libs/wayland )
-	X? (
-		<x11-base/xorg-server-1.18.99:=
-		>=x11-libs/libvdpau-1.0
-		multilib? (
-			>=x11-libs/libX11-1.6.2[abi_x86_32]
-			>=x11-libs/libXext-1.3.2[abi_x86_32]
-		)
-	)
-"
-
-QA_PREBUILT="opt/* usr/lib*"
-
-S=${WORKDIR}/
-
-pkg_pretend() {
-	if use amd64 && has_multilib_profile && \
-		[ "${DEFAULT_ABI}" != "amd64" ]; then
-		eerror "This ebuild doesn't currently support changing your default ABI"
-		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
-	fi
-
-	if use kernel_linux && kernel_is ge 4 9; then
-		ewarn "Gentoo supports kernels which are supported by NVIDIA"
-		ewarn "which are limited to the following kernels:"
-		ewarn "<sys-kernel/gentoo-sources-4.9"
-		ewarn "<sys-kernel/vanilla-sources-4.9"
-		ewarn ""
-		ewarn "You are free to utilize epatch_user to provide whatever"
-		ewarn "support you feel is appropriate, but will not receive"
-		ewarn "support as a result of those changes."
-		ewarn ""
-		ewarn "Do not file a bug report about this."
-		ewarn ""
-	fi
-
-	# Since Nvidia ships many different series of drivers, we need to give the user
-	# some kind of guidance as to what version they should install. This tries
-	# to point the user in the right direction but can't be perfect. check
-	# nvidia-driver.eclass
-	nvidia-driver-check-warning
-
-	# Kernel features/options to check for
-	CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
-	use x86 && CONFIG_CHECK+=" ~HIGHMEM"
-
-	# Now do the above checks
-	use kernel_linux && check_extra_config
-}
-
-pkg_setup() {
-	# try to turn off distcc and ccache for people that have a problem with it
-	export DISTCC_DISABLE=1
-	export CCACHE_DISABLE=1
-
-	if use driver && use kernel_linux; then
-		MODULE_NAMES="nvidia(video:${S}/kernel)"
-		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
-		use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel) nvidia-drm(video:${S}/kernel)"
-
-		# This needs to run after MODULE_NAMES (so that the eclass checks
-		# whether the kernel supports loadable modules) but before BUILD_PARAMS
-		# is set (so that KV_DIR is populated).
-		linux-mod_pkg_setup
-
-		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
-		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
-
-		# linux-mod_src_compile calls set_arch_to_kernel, which
-		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
-		# expects x86_64 or i386 and then converts it to x86
-		# later on in the build process
-		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
-	fi
-
-	if use kernel_linux && kernel_is lt 2 6 9; then
-		eerror "You must build this against 2.6.9 or higher kernels."
-	fi
-
-	# set variables to where files are in the package structure
-	if use kernel_FreeBSD; then
-		use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
-		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
-		NV_DOC="${S}/doc"
-		NV_OBJ="${S}/obj"
-		NV_SRC="${S}/src"
-		NV_MAN="${S}/x11/man"
-		NV_X11="${S}/obj"
-		NV_SOVER=1
-	elif use kernel_linux; then
-		NV_DOC="${S}"
-		NV_OBJ="${S}"
-		NV_SRC="${S}/kernel"
-		NV_MAN="${S}"
-		NV_X11="${S}"
-		NV_SOVER=${PV}
-	else
-		die "Could not determine proper NVIDIA package"
-	fi
-}
-
-src_prepare() {
-	epatch "${FILESDIR}"/${PN}-367.57-profiles-rc.patch
-
-	if use pax_kernel; then
-		ewarn "Using PAX patches is not supported. You will be asked to"
-		ewarn "use a standard kernel should you have issues. Should you"
-		ewarn "need support with these patches, contact the PaX team."
-		epatch "${FILESDIR}"/${PN}-367.57-pax.patch
-	fi
-
-	# Allow user patches so they can support RC kernels and whatever else
-	epatch_user
-}
-
-src_compile() {
-	# This is already the default on Linux, as there's no toplevel Makefile, but
-	# on FreeBSD there's one and triggers the kernel module build, as we install
-	# it by itself, pass this.
-
-	cd "${NV_SRC}"
-	if use kernel_FreeBSD; then
-		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
-			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
-	elif use driver && use kernel_linux; then
-		MAKEOPTS=-j1 linux-mod_src_compile
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			AR="$(tc-getAR)" \
-			CC="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			NV_VERBOSE=1 \
-			RANLIB="$(tc-getRANLIB)" \
-			DO_STRIP= \
-			build-xnvctrl
-
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			CC="$(tc-getCC)" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LD="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			NVML_ENABLED=0 \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			NV_VERBOSE=1 \
-			DO_STRIP=
-	fi
-}
-
-# Install nvidia library:
-# the first parameter is the library to install
-# the second parameter is the provided soversion
-# the third parameter is the target directory if it is not /usr/lib
-donvidia() {
-	# Full path to library
-	nv_LIB="${1}"
-
-	# SOVER to use
-	nv_SOVER="$(scanelf -qF'%S#F' ${nv_LIB})"
-
-	# Where to install
-	nv_DEST="${2}"
-
-	# Get just the library name
-	nv_LIBNAME=$(basename "${nv_LIB}")
-
-	if [[ "${nv_DEST}" ]]; then
-		exeinto ${nv_DEST}
-		action="doexe"
-	else
-		nv_DEST="/usr/$(get_libdir)"
-		action="dolib.so"
-	fi
-
-	# Install the library
-	${action} ${nv_LIB} || die "failed to install ${nv_LIBNAME}"
-
-	# If the library has a SONAME and SONAME does not match the library name,
-	# then we need to create a symlink
-	if [[ ${nv_SOVER} ]] && ! [[ "${nv_SOVER}" = "${nv_LIBNAME}" ]]; then
-		dosym ${nv_LIBNAME} ${nv_DEST}/${nv_SOVER} \
-			|| die "failed to create ${nv_DEST}/${nv_SOVER} symlink"
-	fi
-
-	dosym ${nv_LIBNAME} ${nv_DEST}/${nv_LIBNAME/.so*/.so} \
-		|| die "failed to create ${nv_LIBNAME/.so*/.so} symlink"
-}
-
-src_install() {
-	if use driver && use kernel_linux; then
-		linux-mod_src_install
-
-		# Add the aliases
-		# This file is tweaked with the appropriate video group in
-		# pkg_preinst, see bug #491414
-		insinto /etc/modprobe.d
-		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
-		doins "${FILESDIR}"/nvidia-rmmod.conf
-
-		# Ensures that our device nodes are created when not using X
-		exeinto "$(get_udevdir)"
-		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
-		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
-	elif use kernel_FreeBSD; then
-		if use x86-fbsd; then
-			insinto /boot/modules
-			doins "${S}/src/nvidia.kld"
-		fi
-
-		exeinto /boot/modules
-		doexe "${S}/src/nvidia.ko"
-	fi
-
-	# NVIDIA kernel <-> userspace driver config lib
-	donvidia ${NV_OBJ}/libnvidia-cfg.so.${NV_SOVER}
-
-	# NVIDIA framebuffer capture library
-	donvidia ${NV_OBJ}/libnvidia-fbc.so.${NV_SOVER}
-
-	# NVIDIA video encode/decode <-> CUDA
-	if use kernel_linux; then
-		donvidia ${NV_OBJ}/libnvcuvid.so.${NV_SOVER}
-		donvidia ${NV_OBJ}/libnvidia-encode.so.${NV_SOVER}
-	fi
-
-	if use X; then
-		# Xorg DDX driver
-		insinto /usr/$(get_libdir)/xorg/modules/drivers
-		doins ${NV_X11}/nvidia_drv.so
-
-		# Xorg GLX driver
-		donvidia ${NV_X11}/libglx.so.${NV_SOVER} \
-			/usr/$(get_libdir)/opengl/nvidia/extensions
-
-		# Xorg nvidia.conf
-		if has_version '>=x11-base/xorg-server-1.16'; then
-			insinto /usr/share/X11/xorg.conf.d
-			newins {,50-}nvidia-drm-outputclass.conf
-		fi
-	fi
-
-	# OpenCL ICD for NVIDIA
-	if use kernel_linux; then
-		insinto /etc/OpenCL/vendors
-		doins ${NV_OBJ}/nvidia.icd
-	fi
-
-	# Documentation
-	dohtml ${NV_DOC}/html/*
-	if use kernel_FreeBSD; then
-		dodoc "${NV_DOC}/README"
-		use X && doman "${NV_MAN}/nvidia-xconfig.1"
-		use tools && doman "${NV_MAN}/nvidia-settings.1"
-	else
-		# Docs
-		newdoc "${NV_DOC}/README.txt" README
-		dodoc "${NV_DOC}/NVIDIA_Changelog"
-		doman "${NV_MAN}/nvidia-smi.1.gz"
-		use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
-		use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
-		doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
-	fi
-
-	# Helper Apps
-	exeinto /opt/bin/
-
-	if use X; then
-		doexe ${NV_OBJ}/nvidia-xconfig
-
-		insinto /etc/vulkan/icd.d
-		doins nvidia_icd.json
-	fi
-
-	if use kernel_linux; then
-		doexe ${NV_OBJ}/nvidia-cuda-mps-control
-		doexe ${NV_OBJ}/nvidia-cuda-mps-server
-		doexe ${NV_OBJ}/nvidia-debugdump
-		doexe ${NV_OBJ}/nvidia-persistenced
-		doexe ${NV_OBJ}/nvidia-smi
-
-		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
-		doexe ${NV_OBJ}/nvidia-modprobe
-		fowners root:video /opt/bin/nvidia-modprobe
-		fperms 4710 /opt/bin/nvidia-modprobe
-		dosym /{opt,usr}/bin/nvidia-modprobe
-
-		doman nvidia-cuda-mps-control.1.gz
-		doman nvidia-modprobe.1.gz
-		doman nvidia-persistenced.1.gz
-		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
-		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
-		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src/ \
-			DESTDIR="${D}" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LIBDIR="${D}/usr/$(get_libdir)" \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			NV_VERBOSE=1 \
-			PREFIX=/usr \
-			DO_STRIP= \
-			install
-
-		if use static-libs; then
-			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
-
-			insinto /usr/include/NVCtrl
-			doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
-		fi
-
-		insinto /usr/share/nvidia/
-		doins nvidia-application-profiles-${PV}-key-documentation
-
-		insinto /etc/nvidia
-		newins \
-			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
-
-		# There is no icon in the FreeBSD tarball.
-		use kernel_FreeBSD || \
-			doicon ${NV_OBJ}/nvidia-settings.png
-
-		domenu "${FILESDIR}"/nvidia-settings.desktop
-
-		exeinto /etc/X11/xinit/xinitrc.d
-		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
-	fi
-
-	dobin ${NV_OBJ}/nvidia-bug-report.sh
-
-	if has_multilib_profile && use multilib; then
-		local OABI=${ABI}
-		for ABI in $(get_install_abis); do
-			src_install-libs
-		done
-		ABI=${OABI}
-		unset OABI
-	else
-		src_install-libs
-	fi
-
-	is_final_abi || die "failed to iterate through all ABIs"
-
-	readme.gentoo_create_doc
-}
-
-src_install-libs() {
-	local inslibdir=$(get_libdir)
-	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
-	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
-	local libdir=${NV_OBJ}
-
-	if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
-		libdir=${NV_OBJ}/32
-	fi
-
-	if use X; then
-		NV_GLX_LIBRARIES=(
-			"libEGL.so.1 ${GL_ROOT}"
-			"libEGL_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGL.so.$(usex compat ${NV_SOVER} 1.0.0) ${GL_ROOT}"
-			"libGLESv1_CM.so.1 ${GL_ROOT}"
-			"libGLESv1_CM_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLESv2.so.2 ${GL_ROOT}"
-			"libGLESv2_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLX.so.0 ${GL_ROOT}"
-			"libGLX_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLdispatch.so.0 ${GL_ROOT}"
-			"libOpenCL.so.1.0.0 ${CL_ROOT}"
-			"libOpenGL.so.0 ${GL_ROOT}"
-			"libcuda.so.${NV_SOVER}"
-			"libnvcuvid.so.${NV_SOVER}"
-			"libnvidia-compiler.so.${NV_SOVER}"
-			"libnvidia-eglcore.so.${NV_SOVER}"
-			"libnvidia-encode.so.${NV_SOVER}"
-			"libnvidia-fatbinaryloader.so.${NV_SOVER}"
-			"libnvidia-fbc.so.${NV_SOVER}"
-			"libnvidia-glcore.so.${NV_SOVER}"
-			"libnvidia-glsi.so.${NV_SOVER}"
-			"libnvidia-ifr.so.${NV_SOVER}"
-			"libnvidia-opencl.so.${NV_SOVER}"
-			"libnvidia-ptxjitcompiler.so.${NV_SOVER}"
-			"libvdpau_nvidia.so.${NV_SOVER}"
-		)
-
-		if use wayland && has_multilib_profile && [[ ${ABI} == "amd64" ]];
-		then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-egl-wayland.so.${NV_SOVER}"
-			)
-		fi
-
-		if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
-		then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-wfb.so.${NV_SOVER}"
-			)
-		fi
-
-		if use kernel_FreeBSD; then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-tls.so.${NV_SOVER}"
-			)
-		fi
-
-		if use kernel_linux; then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-ml.so.${NV_SOVER}"
-				"tls/libnvidia-tls.so.${NV_SOVER}"
-			)
-		fi
-
-		for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
-			donvidia ${libdir}/${NV_LIB}
-		done
-	fi
-}
-
-pkg_preinst() {
-	if use driver && use kernel_linux; then
-		linux-mod_pkg_preinst
-
-		local videogroup="$(egetent group video | cut -d ':' -f 3)"
-		if [ -z "${videogroup}" ]; then
-			eerror "Failed to determine the video group gid"
-			die "Failed to determine the video group gid"
-		else
-			sed -i \
-				-e "s:PACKAGE:${PF}:g" \
-				-e "s:VIDEOGID:${videogroup}:" \
-				"${D}"/etc/modprobe.d/nvidia.conf || die
-		fi
-	fi
-
-	# Clean the dynamic libGL stuff's home to ensure
-	# we dont have stale libs floating around
-	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ]; then
-		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
-	fi
-	# Make sure we nuke the old nvidia-glx's env.d file
-	if [ -e "${ROOT}"/etc/env.d/09nvidia ]; then
-		rm -f "${ROOT}"/etc/env.d/09nvidia
-	fi
-}
-
-pkg_postinst() {
-	use driver && use kernel_linux && linux-mod_pkg_postinst
-
-	# Switch to the nvidia implementation
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
-	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
-
-	readme.gentoo_print_elog
-
-	if ! use X; then
-		elog "You have elected to not install the X.org driver. Along with"
-		elog "this the OpenGL libraries and VDPAU libraries were not"
-		elog "installed. Additionally, once the driver is loaded your card"
-		elog "and fan will run at max speed which may not be desirable."
-		elog "Use the 'nvidia-smi' init script to have your card and fan"
-		elog "speed scale appropriately."
-		elog
-	fi
-	if ! use tools; then
-		elog "USE=tools controls whether the nvidia-settings application"
-		elog "is installed. If you would like to use it, enable that"
-		elog "flag and re-emerge this ebuild. Optionally you can install"
-		elog "media-video/nvidia-settings"
-		elog
-	fi
-}
-
-pkg_prerm() {
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}
-
-pkg_postrm() {
-	use driver && use kernel_linux && linux-mod_pkg_postrm
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-367.57-r2.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-367.57-r2.ebuild
deleted file mode 100644
index d7c31e087d5..00000000000
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-367.57-r2.ebuild
+++ /dev/null
@@ -1,552 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-
-inherit eutils flag-o-matic linux-info linux-mod multilib-minimal nvidia-driver \
-	portability toolchain-funcs unpacker user udev
-
-NV_URI="http://us.download.nvidia.com/XFree86/"
-X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
-AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
-ARM_NV_PACKAGE="NVIDIA-Linux-armv7l-gnueabihf-${PV}"
-X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
-AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
-
-DESCRIPTION="NVIDIA Accelerated Graphics Driver"
-HOMEPAGE="http://www.nvidia.com/ http://www.nvidia.com/Download/Find.aspx"
-SRC_URI="
-	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
-	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
-	arm? ( ${NV_URI}Linux-x86-ARM/${PV}/${ARM_NV_PACKAGE}.run )
-	x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
-	x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
-	tools? ( ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2 )
-"
-
-LICENSE="GPL-2 NVIDIA-r2"
-SLOT="0/${PV%.*}"
-KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
-RESTRICT="bindist mirror"
-EMULTILIB_PKG="true"
-
-IUSE="acpi compat +driver gtk3 kernel_FreeBSD kernel_linux +kms multilib pax_kernel static-libs +tools uvm wayland +X"
-REQUIRED_USE="
-	tools? ( X )
-	static-libs? ( tools )
-"
-
-COMMON="
-	app-eselect/eselect-opencl
-	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
-	tools? (
-		dev-libs/atk
-		dev-libs/glib:2
-		dev-libs/jansson
-		gtk3? (
-			x11-libs/gtk+:3
-		)
-		x11-libs/cairo
-		x11-libs/gdk-pixbuf[X]
-		x11-libs/gtk+:2
-		x11-libs/libX11
-		x11-libs/libXext
-		x11-libs/libXrandr
-		x11-libs/libXv
-		x11-libs/libXxf86vm
-		x11-libs/pango[X]
-	)
-	X? (
-		>=app-eselect/eselect-opengl-1.0.9
-		app-misc/pax-utils
-	)
-"
-DEPEND="
-	${COMMON}
-	kernel_linux? ( virtual/linux-sources )
-"
-RDEPEND="
-	${COMMON}
-	acpi? ( sys-power/acpid )
-	tools? ( !media-video/nvidia-settings )
-	wayland? ( dev-libs/wayland[${MULTILIB_USEDEP}] )
-	X? (
-		<x11-base/xorg-server-1.18.99:=
-		>=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
-		>=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
-		>=x11-libs/libvdpau-1.0[${MULTILIB_USEDEP}]
-		sys-libs/zlib[${MULTILIB_USEDEP}]
-	)
-"
-
-QA_PREBUILT="opt/* usr/lib*"
-
-S=${WORKDIR}/
-
-pkg_pretend() {
-	if use amd64 && has_multilib_profile && \
-		[ "${DEFAULT_ABI}" != "amd64" ]; then
-		eerror "This ebuild doesn't currently support changing your default ABI"
-		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
-	fi
-
-	if use kernel_linux && kernel_is ge 4 9; then
-		ewarn "Gentoo supports kernels which are supported by NVIDIA"
-		ewarn "which are limited to the following kernels:"
-		ewarn "<sys-kernel/gentoo-sources-4.9"
-		ewarn "<sys-kernel/vanilla-sources-4.9"
-		ewarn ""
-		ewarn "You are free to utilize epatch_user to provide whatever"
-		ewarn "support you feel is appropriate, but will not receive"
-		ewarn "support as a result of those changes."
-		ewarn ""
-		ewarn "Do not file a bug report about this."
-		ewarn ""
-	fi
-
-	# Since Nvidia ships many different series of drivers, we need to give the user
-	# some kind of guidance as to what version they should install. This tries
-	# to point the user in the right direction but can't be perfect. check
-	# nvidia-driver.eclass
-	nvidia-driver-check-warning
-
-	# Kernel features/options to check for
-	CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
-	use x86 && CONFIG_CHECK+=" ~HIGHMEM"
-
-	# Now do the above checks
-	use kernel_linux && check_extra_config
-}
-
-pkg_setup() {
-	# try to turn off distcc and ccache for people that have a problem with it
-	export DISTCC_DISABLE=1
-	export CCACHE_DISABLE=1
-
-	if use driver && use kernel_linux; then
-		MODULE_NAMES="nvidia(video:${S}/kernel)"
-		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
-		use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel) nvidia-drm(video:${S}/kernel)"
-
-		# This needs to run after MODULE_NAMES (so that the eclass checks
-		# whether the kernel supports loadable modules) but before BUILD_PARAMS
-		# is set (so that KV_DIR is populated).
-		linux-mod_pkg_setup
-
-		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
-		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
-
-		# linux-mod_src_compile calls set_arch_to_kernel, which
-		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
-		# expects x86_64 or i386 and then converts it to x86
-		# later on in the build process
-		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
-	fi
-
-	if use kernel_linux && kernel_is lt 2 6 9; then
-		eerror "You must build this against 2.6.9 or higher kernels."
-	fi
-
-	# set variables to where files are in the package structure
-	if use kernel_FreeBSD; then
-		use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
-		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
-		NV_DOC="${S}/doc"
-		NV_OBJ="${S}/obj"
-		NV_SRC="${S}/src"
-		NV_MAN="${S}/x11/man"
-		NV_X11="${S}/obj"
-		NV_SOVER=1
-	elif use kernel_linux; then
-		NV_DOC="${S}"
-		NV_OBJ="${S}"
-		NV_SRC="${S}/kernel"
-		NV_MAN="${S}"
-		NV_X11="${S}"
-		NV_SOVER=${PV}
-	else
-		die "Could not determine proper NVIDIA package"
-	fi
-}
-
-src_prepare() {
-	epatch "${FILESDIR}"/${PN}-367.57-profiles-rc.patch
-
-	if use pax_kernel; then
-		ewarn "Using PAX patches is not supported. You will be asked to"
-		ewarn "use a standard kernel should you have issues. Should you"
-		ewarn "need support with these patches, contact the PaX team."
-		epatch "${FILESDIR}"/${PN}-367.57-pax.patch
-	fi
-
-	# Allow user patches so they can support RC kernels and whatever else
-	epatch_user
-}
-
-src_compile() {
-	# This is already the default on Linux, as there's no toplevel Makefile, but
-	# on FreeBSD there's one and triggers the kernel module build, as we install
-	# it by itself, pass this.
-
-	cd "${NV_SRC}"
-	if use kernel_FreeBSD; then
-		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
-			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
-	elif use driver && use kernel_linux; then
-		MAKEOPTS=-j1 linux-mod_src_compile
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			AR="$(tc-getAR)" \
-			CC="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			NV_VERBOSE=1 \
-			RANLIB="$(tc-getRANLIB)" \
-			DO_STRIP= \
-			build-xnvctrl
-
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			CC="$(tc-getCC)" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LD="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			NVML_ENABLED=0 \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			NV_VERBOSE=1 \
-			DO_STRIP=
-	fi
-}
-
-# Install nvidia library:
-# the first parameter is the library to install
-# the second parameter is the provided soversion
-# the third parameter is the target directory if it is not /usr/lib
-donvidia() {
-	# Full path to library
-	nv_LIB="${1}"
-
-	# SOVER to use
-	nv_SOVER="$(scanelf -qF'%S#F' ${nv_LIB})"
-
-	# Where to install
-	nv_DEST="${2}"
-
-	# Get just the library name
-	nv_LIBNAME=$(basename "${nv_LIB}")
-
-	if [[ "${nv_DEST}" ]]; then
-		exeinto ${nv_DEST}
-		action="doexe"
-	else
-		nv_DEST="/usr/$(get_libdir)"
-		action="dolib.so"
-	fi
-
-	# Install the library
-	${action} ${nv_LIB} || die "failed to install ${nv_LIBNAME}"
-
-	# If the library has a SONAME and SONAME does not match the library name,
-	# then we need to create a symlink
-	if [[ ${nv_SOVER} ]] && ! [[ "${nv_SOVER}" = "${nv_LIBNAME}" ]]; then
-		dosym ${nv_LIBNAME} ${nv_DEST}/${nv_SOVER} \
-			|| die "failed to create ${nv_DEST}/${nv_SOVER} symlink"
-	fi
-
-	dosym ${nv_LIBNAME} ${nv_DEST}/${nv_LIBNAME/.so*/.so} \
-		|| die "failed to create ${nv_LIBNAME/.so*/.so} symlink"
-}
-
-src_install() {
-	if use driver && use kernel_linux; then
-		linux-mod_src_install
-
-		# Add the aliases
-		# This file is tweaked with the appropriate video group in
-		# pkg_preinst, see bug #491414
-		insinto /etc/modprobe.d
-		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
-		doins "${FILESDIR}"/nvidia-rmmod.conf
-
-		# Ensures that our device nodes are created when not using X
-		exeinto "$(get_udevdir)"
-		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
-		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
-	elif use kernel_FreeBSD; then
-		if use x86-fbsd; then
-			insinto /boot/modules
-			doins "${S}/src/nvidia.kld"
-		fi
-
-		exeinto /boot/modules
-		doexe "${S}/src/nvidia.ko"
-	fi
-
-	# NVIDIA kernel <-> userspace driver config lib
-	donvidia ${NV_OBJ}/libnvidia-cfg.so.${NV_SOVER}
-
-	# NVIDIA framebuffer capture library
-	donvidia ${NV_OBJ}/libnvidia-fbc.so.${NV_SOVER}
-
-	# NVIDIA video encode/decode <-> CUDA
-	if use kernel_linux; then
-		donvidia ${NV_OBJ}/libnvcuvid.so.${NV_SOVER}
-		donvidia ${NV_OBJ}/libnvidia-encode.so.${NV_SOVER}
-	fi
-
-	if use X; then
-		# Xorg DDX driver
-		insinto /usr/$(get_libdir)/xorg/modules/drivers
-		doins ${NV_X11}/nvidia_drv.so
-
-		# Xorg GLX driver
-		donvidia ${NV_X11}/libglx.so.${NV_SOVER} \
-			/usr/$(get_libdir)/opengl/nvidia/extensions
-
-		# Xorg nvidia.conf
-		if has_version '>=x11-base/xorg-server-1.16'; then
-			insinto /usr/share/X11/xorg.conf.d
-			newins {,50-}nvidia-drm-outputclass.conf
-		fi
-	fi
-
-	# OpenCL ICD for NVIDIA
-	if use kernel_linux; then
-		insinto /etc/OpenCL/vendors
-		doins ${NV_OBJ}/nvidia.icd
-	fi
-
-	# Documentation
-	dohtml ${NV_DOC}/html/*
-	if use kernel_FreeBSD; then
-		dodoc "${NV_DOC}/README"
-		use X && doman "${NV_MAN}/nvidia-xconfig.1"
-		use tools && doman "${NV_MAN}/nvidia-settings.1"
-	else
-		# Docs
-		newdoc "${NV_DOC}/README.txt" README
-		dodoc "${NV_DOC}/NVIDIA_Changelog"
-		doman "${NV_MAN}/nvidia-smi.1.gz"
-		use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
-		use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
-		doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
-	fi
-
-	# Helper Apps
-	exeinto /opt/bin/
-
-	if use X; then
-		doexe ${NV_OBJ}/nvidia-xconfig
-
-		insinto /etc/vulkan/icd.d
-		doins nvidia_icd.json
-	fi
-
-	if use kernel_linux; then
-		doexe ${NV_OBJ}/nvidia-cuda-mps-control
-		doexe ${NV_OBJ}/nvidia-cuda-mps-server
-		doexe ${NV_OBJ}/nvidia-debugdump
-		doexe ${NV_OBJ}/nvidia-persistenced
-		doexe ${NV_OBJ}/nvidia-smi
-
-		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
-		doexe ${NV_OBJ}/nvidia-modprobe
-		fowners root:video /opt/bin/nvidia-modprobe
-		fperms 4710 /opt/bin/nvidia-modprobe
-		dosym /{opt,usr}/bin/nvidia-modprobe
-
-		doman nvidia-cuda-mps-control.1.gz
-		doman nvidia-modprobe.1.gz
-		doman nvidia-persistenced.1.gz
-		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
-		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
-		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src/ \
-			DESTDIR="${D}" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LIBDIR="${D}/usr/$(get_libdir)" \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			NV_VERBOSE=1 \
-			PREFIX=/usr \
-			DO_STRIP= \
-			install
-
-		if use static-libs; then
-			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
-
-			insinto /usr/include/NVCtrl
-			doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
-		fi
-
-		insinto /usr/share/nvidia/
-		doins nvidia-application-profiles-${PV}-key-documentation
-
-		insinto /etc/nvidia
-		newins \
-			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
-
-		# There is no icon in the FreeBSD tarball.
-		use kernel_FreeBSD || \
-			doicon ${NV_OBJ}/nvidia-settings.png
-
-		domenu "${FILESDIR}"/nvidia-settings.desktop
-
-		exeinto /etc/X11/xinit/xinitrc.d
-		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
-	fi
-
-	dobin ${NV_OBJ}/nvidia-bug-report.sh
-
-	if has_multilib_profile && use multilib; then
-		local OABI=${ABI}
-		for ABI in $(get_install_abis); do
-			src_install-libs
-		done
-		ABI=${OABI}
-		unset OABI
-	else
-		src_install-libs
-	fi
-
-	is_final_abi || die "failed to iterate through all ABIs"
-
-	readme.gentoo_create_doc
-}
-
-src_install-libs() {
-	local inslibdir=$(get_libdir)
-	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
-	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
-	local libdir=${NV_OBJ}
-
-	if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
-		libdir=${NV_OBJ}/32
-	fi
-
-	if use X; then
-		NV_GLX_LIBRARIES=(
-			"libEGL.so.1 ${GL_ROOT}"
-			"libEGL_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGL.so.$(usex compat ${NV_SOVER} 1.0.0) ${GL_ROOT}"
-			"libGLESv1_CM.so.1 ${GL_ROOT}"
-			"libGLESv1_CM_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLESv2.so.2 ${GL_ROOT}"
-			"libGLESv2_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLX.so.0 ${GL_ROOT}"
-			"libGLX_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLdispatch.so.0 ${GL_ROOT}"
-			"libOpenCL.so.1.0.0 ${CL_ROOT}"
-			"libOpenGL.so.0 ${GL_ROOT}"
-			"libcuda.so.${NV_SOVER}"
-			"libnvcuvid.so.${NV_SOVER}"
-			"libnvidia-compiler.so.${NV_SOVER}"
-			"libnvidia-eglcore.so.${NV_SOVER}"
-			"libnvidia-encode.so.${NV_SOVER}"
-			"libnvidia-fatbinaryloader.so.${NV_SOVER}"
-			"libnvidia-fbc.so.${NV_SOVER}"
-			"libnvidia-glcore.so.${NV_SOVER}"
-			"libnvidia-glsi.so.${NV_SOVER}"
-			"libnvidia-ifr.so.${NV_SOVER}"
-			"libnvidia-opencl.so.${NV_SOVER}"
-			"libnvidia-ptxjitcompiler.so.${NV_SOVER}"
-			"libvdpau_nvidia.so.${NV_SOVER}"
-		)
-
-		if use wayland && has_multilib_profile && [[ ${ABI} == "amd64" ]];
-		then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-egl-wayland.so.${NV_SOVER}"
-			)
-		fi
-
-		if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
-		then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-wfb.so.${NV_SOVER}"
-			)
-		fi
-
-		if use kernel_FreeBSD; then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-tls.so.${NV_SOVER}"
-			)
-		fi
-
-		if use kernel_linux; then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-ml.so.${NV_SOVER}"
-				"tls/libnvidia-tls.so.${NV_SOVER}"
-			)
-		fi
-
-		for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
-			donvidia ${libdir}/${NV_LIB}
-		done
-	fi
-}
-
-pkg_preinst() {
-	if use driver && use kernel_linux; then
-		linux-mod_pkg_preinst
-
-		local videogroup="$(egetent group video | cut -d ':' -f 3)"
-		if [ -z "${videogroup}" ]; then
-			eerror "Failed to determine the video group gid"
-			die "Failed to determine the video group gid"
-		else
-			sed -i \
-				-e "s:PACKAGE:${PF}:g" \
-				-e "s:VIDEOGID:${videogroup}:" \
-				"${D}"/etc/modprobe.d/nvidia.conf || die
-		fi
-	fi
-
-	# Clean the dynamic libGL stuff's home to ensure
-	# we dont have stale libs floating around
-	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ]; then
-		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
-	fi
-	# Make sure we nuke the old nvidia-glx's env.d file
-	if [ -e "${ROOT}"/etc/env.d/09nvidia ]; then
-		rm -f "${ROOT}"/etc/env.d/09nvidia
-	fi
-}
-
-pkg_postinst() {
-	use driver && use kernel_linux && linux-mod_pkg_postinst
-
-	# Switch to the nvidia implementation
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
-	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
-
-	readme.gentoo_print_elog
-
-	if ! use X; then
-		elog "You have elected to not install the X.org driver. Along with"
-		elog "this the OpenGL libraries and VDPAU libraries were not"
-		elog "installed. Additionally, once the driver is loaded your card"
-		elog "and fan will run at max speed which may not be desirable."
-		elog "Use the 'nvidia-smi' init script to have your card and fan"
-		elog "speed scale appropriately."
-		elog
-	fi
-	if ! use tools; then
-		elog "USE=tools controls whether the nvidia-settings application"
-		elog "is installed. If you would like to use it, enable that"
-		elog "flag and re-emerge this ebuild. Optionally you can install"
-		elog "media-video/nvidia-settings"
-		elog
-	fi
-}
-
-pkg_prerm() {
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}
-
-pkg_postrm() {
-	use driver && use kernel_linux && linux-mod_pkg_postrm
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-370.28-r1.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-370.28-r1.ebuild
deleted file mode 100644
index 403c7b8d003..00000000000
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-370.28-r1.ebuild
+++ /dev/null
@@ -1,551 +0,0 @@
-# Copyright 1999-2016 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-
-inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \
-	portability toolchain-funcs unpacker user udev
-
-NV_URI="http://us.download.nvidia.com/XFree86/"
-X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
-AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
-ARM_NV_PACKAGE="NVIDIA-Linux-armv7l-gnueabihf-${PV}"
-X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
-AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
-
-DESCRIPTION="NVIDIA Accelerated Graphics Driver"
-HOMEPAGE="http://www.nvidia.com/ http://www.nvidia.com/Download/Find.aspx"
-SRC_URI="
-	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
-	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
-	arm? ( ${NV_URI}Linux-x86-ARM/${PV}/${ARM_NV_PACKAGE}.run )
-	x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
-	x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
-	tools? ( ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2 )
-"
-
-LICENSE="GPL-2 NVIDIA-r2"
-SLOT="0/${PV%.*}"
-KEYWORDS="-* amd64 x86 ~amd64-fbsd ~x86-fbsd"
-RESTRICT="bindist mirror"
-EMULTILIB_PKG="true"
-
-IUSE="acpi compat +driver gtk3 kernel_FreeBSD kernel_linux +kms multilib pax_kernel static-libs +tools uvm wayland +X"
-REQUIRED_USE="
-	tools? ( X )
-	static-libs? ( tools )
-"
-
-COMMON="
-	app-eselect/eselect-opencl
-	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
-	tools? (
-		dev-libs/atk
-		dev-libs/glib:2
-		dev-libs/jansson
-		gtk3? ( x11-libs/gtk+:3 )
-		x11-libs/cairo
-		x11-libs/gdk-pixbuf[X]
-		x11-libs/gtk+:2
-		x11-libs/libX11
-		x11-libs/libXext
-		x11-libs/libXrandr
-		x11-libs/libXv
-		x11-libs/libXxf86vm
-		x11-libs/pango[X]
-	)
-	X? (
-		>=app-eselect/eselect-opengl-1.0.9
-		app-misc/pax-utils
-	)
-"
-DEPEND="
-	${COMMON}
-	kernel_linux? ( virtual/linux-sources )
-"
-RDEPEND="
-	${COMMON}
-	acpi? ( sys-power/acpid )
-	tools? ( !media-video/nvidia-settings )
-	wayland? ( dev-libs/wayland )
-	X? (
-		<x11-base/xorg-server-1.18.99:=
-		>=x11-libs/libvdpau-1.0
-		multilib? (
-			>=x11-libs/libX11-1.6.2[abi_x86_32]
-			>=x11-libs/libXext-1.3.2[abi_x86_32]
-		)
-	)
-"
-
-QA_PREBUILT="opt/* usr/lib*"
-
-S=${WORKDIR}/
-
-pkg_pretend() {
-	if use amd64 && has_multilib_profile && \
-		[ "${DEFAULT_ABI}" != "amd64" ]; then
-		eerror "This ebuild doesn't currently support changing your default ABI"
-		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
-	fi
-
-	if use kernel_linux && kernel_is ge 4 8; then
-		ewarn "Gentoo supports kernels which are supported by NVIDIA"
-		ewarn "which are limited to the following kernels:"
-		ewarn "<sys-kernel/gentoo-sources-4.8"
-		ewarn "<sys-kernel/vanilla-sources-4.8"
-		ewarn ""
-		ewarn "You are free to utilize epatch_user to provide whatever"
-		ewarn "support you feel is appropriate, but will not receive"
-		ewarn "support as a result of those changes."
-		ewarn ""
-		ewarn "Do not file a bug report about this."
-		ewarn ""
-	fi
-
-	# Since Nvidia ships many different series of drivers, we need to give the user
-	# some kind of guidance as to what version they should install. This tries
-	# to point the user in the right direction but can't be perfect. check
-	# nvidia-driver.eclass
-	nvidia-driver-check-warning
-
-	# Kernel features/options to check for
-	CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
-	use x86 && CONFIG_CHECK+=" ~HIGHMEM"
-
-	# Now do the above checks
-	use kernel_linux && check_extra_config
-}
-
-pkg_setup() {
-	# try to turn off distcc and ccache for people that have a problem with it
-	export DISTCC_DISABLE=1
-	export CCACHE_DISABLE=1
-
-	if use driver && use kernel_linux; then
-		MODULE_NAMES="nvidia(video:${S}/kernel)"
-		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
-		use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel) nvidia-drm(video:${S}/kernel)"
-
-		# This needs to run after MODULE_NAMES (so that the eclass checks
-		# whether the kernel supports loadable modules) but before BUILD_PARAMS
-		# is set (so that KV_DIR is populated).
-		linux-mod_pkg_setup
-
-		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
-		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
-
-		# linux-mod_src_compile calls set_arch_to_kernel, which
-		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
-		# expects x86_64 or i386 and then converts it to x86
-		# later on in the build process
-		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
-	fi
-
-	if use kernel_linux && kernel_is lt 2 6 9; then
-		eerror "You must build this against 2.6.9 or higher kernels."
-	fi
-
-	# set variables to where files are in the package structure
-	if use kernel_FreeBSD; then
-		use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
-		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
-		NV_DOC="${S}/doc"
-		NV_OBJ="${S}/obj"
-		NV_SRC="${S}/src"
-		NV_MAN="${S}/x11/man"
-		NV_X11="${S}/obj"
-		NV_SOVER=1
-	elif use kernel_linux; then
-		NV_DOC="${S}"
-		NV_OBJ="${S}"
-		NV_SRC="${S}/kernel"
-		NV_MAN="${S}"
-		NV_X11="${S}"
-		NV_SOVER=${PV}
-	else
-		die "Could not determine proper NVIDIA package"
-	fi
-}
-
-src_prepare() {
-	epatch "${FILESDIR}"/${P}-profiles-rc.patch
-
-	if use pax_kernel; then
-		ewarn "Using PAX patches is not supported. You will be asked to"
-		ewarn "use a standard kernel should you have issues. Should you"
-		ewarn "need support with these patches, contact the PaX team."
-		epatch "${FILESDIR}"/${PN}-367.35-pax.patch
-	fi
-
-	# Allow user patches so they can support RC kernels and whatever else
-	epatch_user
-}
-
-src_compile() {
-	# This is already the default on Linux, as there's no toplevel Makefile, but
-	# on FreeBSD there's one and triggers the kernel module build, as we install
-	# it by itself, pass this.
-
-	cd "${NV_SRC}"
-	if use kernel_FreeBSD; then
-		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
-			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
-	elif use driver && use kernel_linux; then
-		MAKEOPTS=-j1 linux-mod_src_compile
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			AR="$(tc-getAR)" \
-			CC="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			NV_VERBOSE=1 \
-			RANLIB="$(tc-getRANLIB)" \
-			DO_STRIP= \
-			build-xnvctrl
-
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			CC="$(tc-getCC)" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LD="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			NVML_ENABLED=0 \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			NV_VERBOSE=1 \
-			DO_STRIP=
-	fi
-}
-
-# Install nvidia library:
-# the first parameter is the library to install
-# the second parameter is the provided soversion
-# the third parameter is the target directory if it is not /usr/lib
-donvidia() {
-	# Full path to library
-	nv_LIB="${1}"
-
-	# SOVER to use
-	nv_SOVER="$(scanelf -qF'%S#F' ${nv_LIB})"
-
-	# Where to install
-	nv_DEST="${2}"
-
-	# Get just the library name
-	nv_LIBNAME=$(basename "${nv_LIB}")
-
-	if [[ "${nv_DEST}" ]]; then
-		exeinto ${nv_DEST}
-		action="doexe"
-	else
-		nv_DEST="/usr/$(get_libdir)"
-		action="dolib.so"
-	fi
-
-	# Install the library
-	${action} ${nv_LIB} || die "failed to install ${nv_LIBNAME}"
-
-	# If the library has a SONAME and SONAME does not match the library name,
-	# then we need to create a symlink
-	if [[ ${nv_SOVER} ]] && ! [[ "${nv_SOVER}" = "${nv_LIBNAME}" ]]; then
-		dosym ${nv_LIBNAME} ${nv_DEST}/${nv_SOVER} \
-			|| die "failed to create ${nv_DEST}/${nv_SOVER} symlink"
-	fi
-
-	dosym ${nv_LIBNAME} ${nv_DEST}/${nv_LIBNAME/.so*/.so} \
-		|| die "failed to create ${nv_LIBNAME/.so*/.so} symlink"
-}
-
-src_install() {
-	if use driver && use kernel_linux; then
-		linux-mod_src_install
-
-		# Add the aliases
-		# This file is tweaked with the appropriate video group in
-		# pkg_preinst, see bug #491414
-		insinto /etc/modprobe.d
-		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
-		doins "${FILESDIR}"/nvidia-rmmod.conf
-
-		# Ensures that our device nodes are created when not using X
-		exeinto "$(get_udevdir)"
-		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
-		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
-	elif use kernel_FreeBSD; then
-		if use x86-fbsd; then
-			insinto /boot/modules
-			doins "${S}/src/nvidia.kld"
-		fi
-
-		exeinto /boot/modules
-		doexe "${S}/src/nvidia.ko"
-	fi
-
-	# NVIDIA kernel <-> userspace driver config lib
-	donvidia ${NV_OBJ}/libnvidia-cfg.so.${NV_SOVER}
-
-	# NVIDIA framebuffer capture library
-	donvidia ${NV_OBJ}/libnvidia-fbc.so.${NV_SOVER}
-
-	# NVIDIA video encode/decode <-> CUDA
-	if use kernel_linux; then
-		donvidia ${NV_OBJ}/libnvcuvid.so.${NV_SOVER}
-		donvidia ${NV_OBJ}/libnvidia-encode.so.${NV_SOVER}
-	fi
-
-	if use X; then
-		# Xorg DDX driver
-		insinto /usr/$(get_libdir)/xorg/modules/drivers
-		doins ${NV_X11}/nvidia_drv.so
-
-		# Xorg GLX driver
-		donvidia ${NV_X11}/libglx.so.${NV_SOVER} \
-			/usr/$(get_libdir)/opengl/nvidia/extensions
-
-		# Xorg nvidia.conf
-		if has_version '>=x11-base/xorg-server-1.16'; then
-			insinto /usr/share/X11/xorg.conf.d
-			newins {,50-}nvidia-drm-outputclass.conf
-		fi
-	fi
-
-	# OpenCL ICD for NVIDIA
-	if use kernel_linux; then
-		insinto /etc/OpenCL/vendors
-		doins ${NV_OBJ}/nvidia.icd
-	fi
-
-	# Documentation
-	dohtml ${NV_DOC}/html/*
-	if use kernel_FreeBSD; then
-		dodoc "${NV_DOC}/README"
-		use X && doman "${NV_MAN}/nvidia-xconfig.1"
-		use tools && doman "${NV_MAN}/nvidia-settings.1"
-	else
-		# Docs
-		newdoc "${NV_DOC}/README.txt" README
-		dodoc "${NV_DOC}/NVIDIA_Changelog"
-		doman "${NV_MAN}/nvidia-smi.1.gz"
-		use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
-		use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
-		doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
-	fi
-
-	# Helper Apps
-	exeinto /opt/bin/
-
-	if use X; then
-		doexe ${NV_OBJ}/nvidia-xconfig
-
-		insinto /etc/vulkan/icd.d
-		doins nvidia_icd.json
-	fi
-
-	if use kernel_linux; then
-		doexe ${NV_OBJ}/nvidia-cuda-mps-control
-		doexe ${NV_OBJ}/nvidia-cuda-mps-server
-		doexe ${NV_OBJ}/nvidia-debugdump
-		doexe ${NV_OBJ}/nvidia-persistenced
-		doexe ${NV_OBJ}/nvidia-smi
-
-		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
-		doexe ${NV_OBJ}/nvidia-modprobe
-		fowners root:video /opt/bin/nvidia-modprobe
-		fperms 4710 /opt/bin/nvidia-modprobe
-		dosym /{opt,usr}/bin/nvidia-modprobe
-
-		doman nvidia-cuda-mps-control.1.gz
-		doman nvidia-modprobe.1.gz
-		doman nvidia-persistenced.1.gz
-		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
-		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
-		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src/ \
-			DESTDIR="${D}" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LIBDIR="${D}/usr/$(get_libdir)" \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			NV_VERBOSE=1 \
-			PREFIX=/usr \
-			DO_STRIP= \
-			install
-
-		if use static-libs; then
-			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
-
-			insinto /usr/include/NVCtrl
-			doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
-		fi
-
-		insinto /usr/share/nvidia/
-		doins nvidia-application-profiles-${PV}-key-documentation
-
-		insinto /etc/nvidia
-		newins \
-			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
-
-		# There is no icon in the FreeBSD tarball.
-		use kernel_FreeBSD || \
-			doicon ${NV_OBJ}/nvidia-settings.png
-
-		domenu "${FILESDIR}"/nvidia-settings.desktop
-
-		exeinto /etc/X11/xinit/xinitrc.d
-		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
-	fi
-
-	dobin ${NV_OBJ}/nvidia-bug-report.sh
-
-	if has_multilib_profile && use multilib; then
-		local OABI=${ABI}
-		for ABI in $(get_install_abis); do
-			src_install-libs
-		done
-		ABI=${OABI}
-		unset OABI
-	else
-		src_install-libs
-	fi
-
-	is_final_abi || die "failed to iterate through all ABIs"
-
-	readme.gentoo_create_doc
-}
-
-src_install-libs() {
-	local inslibdir=$(get_libdir)
-	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
-	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
-	local libdir=${NV_OBJ}
-
-	if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
-		libdir=${NV_OBJ}/32
-	fi
-
-	if use X; then
-		NV_GLX_LIBRARIES=(
-			"libEGL.so.1 ${GL_ROOT}"
-			"libEGL_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGL.so.$(usex compat ${NV_SOVER} 1.0.0) ${GL_ROOT}"
-			"libGLESv1_CM.so.1 ${GL_ROOT}"
-			"libGLESv1_CM_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLESv2.so.2 ${GL_ROOT}"
-			"libGLESv2_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLX.so.0 ${GL_ROOT}"
-			"libGLX_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLdispatch.so.0 ${GL_ROOT}"
-			"libOpenCL.so.1.0.0 ${CL_ROOT}"
-			"libOpenGL.so.0 ${GL_ROOT}"
-			"libcuda.so.${NV_SOVER}"
-			"libnvcuvid.so.${NV_SOVER}"
-			"libnvidia-compiler.so.${NV_SOVER}"
-			"libnvidia-eglcore.so.${NV_SOVER}"
-			"libnvidia-encode.so.${NV_SOVER}"
-			"libnvidia-fatbinaryloader.so.${NV_SOVER}"
-			"libnvidia-fbc.so.${NV_SOVER}"
-			"libnvidia-glcore.so.${NV_SOVER}"
-			"libnvidia-glsi.so.${NV_SOVER}"
-			"libnvidia-ifr.so.${NV_SOVER}"
-			"libnvidia-opencl.so.${NV_SOVER}"
-			"libnvidia-ptxjitcompiler.so.${NV_SOVER}"
-			"libvdpau_nvidia.so.${NV_SOVER}"
-		)
-
-		if use wayland && has_multilib_profile && [[ ${ABI} == "amd64" ]];
-		then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-egl-wayland.so.${NV_SOVER}"
-			)
-		fi
-
-		if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
-		then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-wfb.so.${NV_SOVER}"
-			)
-		fi
-
-		if use kernel_FreeBSD; then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-tls.so.${NV_SOVER}"
-			)
-		fi
-
-		if use kernel_linux; then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-ml.so.${NV_SOVER}"
-				"tls/libnvidia-tls.so.${NV_SOVER}"
-			)
-		fi
-
-		for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
-			donvidia ${libdir}/${NV_LIB}
-		done
-	fi
-}
-
-pkg_preinst() {
-	if use driver && use kernel_linux; then
-		linux-mod_pkg_preinst
-
-		local videogroup="$(egetent group video | cut -d ':' -f 3)"
-		if [ -z "${videogroup}" ]; then
-			eerror "Failed to determine the video group gid"
-			die "Failed to determine the video group gid"
-		else
-			sed -i \
-				-e "s:PACKAGE:${PF}:g" \
-				-e "s:VIDEOGID:${videogroup}:" \
-				"${D}"/etc/modprobe.d/nvidia.conf || die
-		fi
-	fi
-
-	# Clean the dynamic libGL stuff's home to ensure
-	# we dont have stale libs floating around
-	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ]; then
-		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
-	fi
-	# Make sure we nuke the old nvidia-glx's env.d file
-	if [ -e "${ROOT}"/etc/env.d/09nvidia ]; then
-		rm -f "${ROOT}"/etc/env.d/09nvidia
-	fi
-}
-
-pkg_postinst() {
-	use driver && use kernel_linux && linux-mod_pkg_postinst
-
-	# Switch to the nvidia implementation
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
-	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
-
-	readme.gentoo_print_elog
-
-	if ! use X; then
-		elog "You have elected to not install the X.org driver. Along with"
-		elog "this the OpenGL libraries and VDPAU libraries were not"
-		elog "installed. Additionally, once the driver is loaded your card"
-		elog "and fan will run at max speed which may not be desirable."
-		elog "Use the 'nvidia-smi' init script to have your card and fan"
-		elog "speed scale appropriately."
-		elog
-	fi
-	if ! use tools; then
-		elog "USE=tools controls whether the nvidia-settings application"
-		elog "is installed. If you would like to use it, enable that"
-		elog "flag and re-emerge this ebuild. Optionally you can install"
-		elog "media-video/nvidia-settings"
-		elog
-	fi
-}
-
-pkg_prerm() {
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}
-
-pkg_postrm() {
-	use driver && use kernel_linux && linux-mod_pkg_postrm
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-370.28-r2.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-370.28-r2.ebuild
deleted file mode 100644
index 88425bac1ca..00000000000
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-370.28-r2.ebuild
+++ /dev/null
@@ -1,552 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-
-inherit eutils flag-o-matic linux-info linux-mod multilib-minimal nvidia-driver \
-	portability toolchain-funcs unpacker user udev
-
-NV_URI="http://us.download.nvidia.com/XFree86/"
-X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
-AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
-ARM_NV_PACKAGE="NVIDIA-Linux-armv7l-gnueabihf-${PV}"
-X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
-AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
-
-DESCRIPTION="NVIDIA Accelerated Graphics Driver"
-HOMEPAGE="http://www.nvidia.com/ http://www.nvidia.com/Download/Find.aspx"
-SRC_URI="
-	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
-	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
-	arm? ( ${NV_URI}Linux-x86-ARM/${PV}/${ARM_NV_PACKAGE}.run )
-	x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
-	x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
-	tools? ( ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2 )
-"
-
-LICENSE="GPL-2 NVIDIA-r2"
-SLOT="0/${PV%.*}"
-KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
-RESTRICT="bindist mirror"
-EMULTILIB_PKG="true"
-
-IUSE="acpi compat +driver gtk3 kernel_FreeBSD kernel_linux +kms multilib pax_kernel static-libs +tools uvm wayland +X"
-REQUIRED_USE="
-	tools? ( X )
-	static-libs? ( tools )
-"
-
-COMMON="
-	app-eselect/eselect-opencl
-	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
-	tools? (
-		dev-libs/atk
-		dev-libs/glib:2
-		dev-libs/jansson
-		gtk3? (
-			x11-libs/gtk+:3
-		)
-		x11-libs/cairo
-		x11-libs/gdk-pixbuf[X]
-		x11-libs/gtk+:2
-		x11-libs/libX11
-		x11-libs/libXext
-		x11-libs/libXrandr
-		x11-libs/libXv
-		x11-libs/libXxf86vm
-		x11-libs/pango[X]
-	)
-	X? (
-		>=app-eselect/eselect-opengl-1.0.9
-		app-misc/pax-utils
-	)
-"
-DEPEND="
-	${COMMON}
-	kernel_linux? ( virtual/linux-sources )
-"
-RDEPEND="
-	${COMMON}
-	acpi? ( sys-power/acpid )
-	tools? ( !media-video/nvidia-settings )
-	wayland? ( dev-libs/wayland[${MULTILIB_USEDEP}] )
-	X? (
-		<x11-base/xorg-server-1.18.99:=
-		>=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
-		>=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
-		>=x11-libs/libvdpau-1.0[${MULTILIB_USEDEP}]
-		sys-libs/zlib[${MULTILIB_USEDEP}]
-	)
-"
-
-QA_PREBUILT="opt/* usr/lib*"
-
-S=${WORKDIR}/
-
-pkg_pretend() {
-	if use amd64 && has_multilib_profile && \
-		[ "${DEFAULT_ABI}" != "amd64" ]; then
-		eerror "This ebuild doesn't currently support changing your default ABI"
-		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
-	fi
-
-	if use kernel_linux && kernel_is ge 4 8; then
-		ewarn "Gentoo supports kernels which are supported by NVIDIA"
-		ewarn "which are limited to the following kernels:"
-		ewarn "<sys-kernel/gentoo-sources-4.8"
-		ewarn "<sys-kernel/vanilla-sources-4.8"
-		ewarn ""
-		ewarn "You are free to utilize epatch_user to provide whatever"
-		ewarn "support you feel is appropriate, but will not receive"
-		ewarn "support as a result of those changes."
-		ewarn ""
-		ewarn "Do not file a bug report about this."
-		ewarn ""
-	fi
-
-	# Since Nvidia ships many different series of drivers, we need to give the user
-	# some kind of guidance as to what version they should install. This tries
-	# to point the user in the right direction but can't be perfect. check
-	# nvidia-driver.eclass
-	nvidia-driver-check-warning
-
-	# Kernel features/options to check for
-	CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
-	use x86 && CONFIG_CHECK+=" ~HIGHMEM"
-
-	# Now do the above checks
-	use kernel_linux && check_extra_config
-}
-
-pkg_setup() {
-	# try to turn off distcc and ccache for people that have a problem with it
-	export DISTCC_DISABLE=1
-	export CCACHE_DISABLE=1
-
-	if use driver && use kernel_linux; then
-		MODULE_NAMES="nvidia(video:${S}/kernel)"
-		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
-		use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel) nvidia-drm(video:${S}/kernel)"
-
-		# This needs to run after MODULE_NAMES (so that the eclass checks
-		# whether the kernel supports loadable modules) but before BUILD_PARAMS
-		# is set (so that KV_DIR is populated).
-		linux-mod_pkg_setup
-
-		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
-		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
-
-		# linux-mod_src_compile calls set_arch_to_kernel, which
-		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
-		# expects x86_64 or i386 and then converts it to x86
-		# later on in the build process
-		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
-	fi
-
-	if use kernel_linux && kernel_is lt 2 6 9; then
-		eerror "You must build this against 2.6.9 or higher kernels."
-	fi
-
-	# set variables to where files are in the package structure
-	if use kernel_FreeBSD; then
-		use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
-		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
-		NV_DOC="${S}/doc"
-		NV_OBJ="${S}/obj"
-		NV_SRC="${S}/src"
-		NV_MAN="${S}/x11/man"
-		NV_X11="${S}/obj"
-		NV_SOVER=1
-	elif use kernel_linux; then
-		NV_DOC="${S}"
-		NV_OBJ="${S}"
-		NV_SRC="${S}/kernel"
-		NV_MAN="${S}"
-		NV_X11="${S}"
-		NV_SOVER=${PV}
-	else
-		die "Could not determine proper NVIDIA package"
-	fi
-}
-
-src_prepare() {
-	epatch "${FILESDIR}"/${P}-profiles-rc.patch
-
-	if use pax_kernel; then
-		ewarn "Using PAX patches is not supported. You will be asked to"
-		ewarn "use a standard kernel should you have issues. Should you"
-		ewarn "need support with these patches, contact the PaX team."
-		epatch "${FILESDIR}"/${PN}-367.35-pax.patch
-	fi
-
-	# Allow user patches so they can support RC kernels and whatever else
-	epatch_user
-}
-
-src_compile() {
-	# This is already the default on Linux, as there's no toplevel Makefile, but
-	# on FreeBSD there's one and triggers the kernel module build, as we install
-	# it by itself, pass this.
-
-	cd "${NV_SRC}"
-	if use kernel_FreeBSD; then
-		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
-			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
-	elif use driver && use kernel_linux; then
-		MAKEOPTS=-j1 linux-mod_src_compile
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			AR="$(tc-getAR)" \
-			CC="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			NV_VERBOSE=1 \
-			RANLIB="$(tc-getRANLIB)" \
-			DO_STRIP= \
-			build-xnvctrl
-
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			CC="$(tc-getCC)" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LD="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			NVML_ENABLED=0 \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			NV_VERBOSE=1 \
-			DO_STRIP=
-	fi
-}
-
-# Install nvidia library:
-# the first parameter is the library to install
-# the second parameter is the provided soversion
-# the third parameter is the target directory if it is not /usr/lib
-donvidia() {
-	# Full path to library
-	nv_LIB="${1}"
-
-	# SOVER to use
-	nv_SOVER="$(scanelf -qF'%S#F' ${nv_LIB})"
-
-	# Where to install
-	nv_DEST="${2}"
-
-	# Get just the library name
-	nv_LIBNAME=$(basename "${nv_LIB}")
-
-	if [[ "${nv_DEST}" ]]; then
-		exeinto ${nv_DEST}
-		action="doexe"
-	else
-		nv_DEST="/usr/$(get_libdir)"
-		action="dolib.so"
-	fi
-
-	# Install the library
-	${action} ${nv_LIB} || die "failed to install ${nv_LIBNAME}"
-
-	# If the library has a SONAME and SONAME does not match the library name,
-	# then we need to create a symlink
-	if [[ ${nv_SOVER} ]] && ! [[ "${nv_SOVER}" = "${nv_LIBNAME}" ]]; then
-		dosym ${nv_LIBNAME} ${nv_DEST}/${nv_SOVER} \
-			|| die "failed to create ${nv_DEST}/${nv_SOVER} symlink"
-	fi
-
-	dosym ${nv_LIBNAME} ${nv_DEST}/${nv_LIBNAME/.so*/.so} \
-		|| die "failed to create ${nv_LIBNAME/.so*/.so} symlink"
-}
-
-src_install() {
-	if use driver && use kernel_linux; then
-		linux-mod_src_install
-
-		# Add the aliases
-		# This file is tweaked with the appropriate video group in
-		# pkg_preinst, see bug #491414
-		insinto /etc/modprobe.d
-		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
-		doins "${FILESDIR}"/nvidia-rmmod.conf
-
-		# Ensures that our device nodes are created when not using X
-		exeinto "$(get_udevdir)"
-		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
-		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
-	elif use kernel_FreeBSD; then
-		if use x86-fbsd; then
-			insinto /boot/modules
-			doins "${S}/src/nvidia.kld"
-		fi
-
-		exeinto /boot/modules
-		doexe "${S}/src/nvidia.ko"
-	fi
-
-	# NVIDIA kernel <-> userspace driver config lib
-	donvidia ${NV_OBJ}/libnvidia-cfg.so.${NV_SOVER}
-
-	# NVIDIA framebuffer capture library
-	donvidia ${NV_OBJ}/libnvidia-fbc.so.${NV_SOVER}
-
-	# NVIDIA video encode/decode <-> CUDA
-	if use kernel_linux; then
-		donvidia ${NV_OBJ}/libnvcuvid.so.${NV_SOVER}
-		donvidia ${NV_OBJ}/libnvidia-encode.so.${NV_SOVER}
-	fi
-
-	if use X; then
-		# Xorg DDX driver
-		insinto /usr/$(get_libdir)/xorg/modules/drivers
-		doins ${NV_X11}/nvidia_drv.so
-
-		# Xorg GLX driver
-		donvidia ${NV_X11}/libglx.so.${NV_SOVER} \
-			/usr/$(get_libdir)/opengl/nvidia/extensions
-
-		# Xorg nvidia.conf
-		if has_version '>=x11-base/xorg-server-1.16'; then
-			insinto /usr/share/X11/xorg.conf.d
-			newins {,50-}nvidia-drm-outputclass.conf
-		fi
-	fi
-
-	# OpenCL ICD for NVIDIA
-	if use kernel_linux; then
-		insinto /etc/OpenCL/vendors
-		doins ${NV_OBJ}/nvidia.icd
-	fi
-
-	# Documentation
-	dohtml ${NV_DOC}/html/*
-	if use kernel_FreeBSD; then
-		dodoc "${NV_DOC}/README"
-		use X && doman "${NV_MAN}/nvidia-xconfig.1"
-		use tools && doman "${NV_MAN}/nvidia-settings.1"
-	else
-		# Docs
-		newdoc "${NV_DOC}/README.txt" README
-		dodoc "${NV_DOC}/NVIDIA_Changelog"
-		doman "${NV_MAN}/nvidia-smi.1.gz"
-		use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
-		use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
-		doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
-	fi
-
-	# Helper Apps
-	exeinto /opt/bin/
-
-	if use X; then
-		doexe ${NV_OBJ}/nvidia-xconfig
-
-		insinto /etc/vulkan/icd.d
-		doins nvidia_icd.json
-	fi
-
-	if use kernel_linux; then
-		doexe ${NV_OBJ}/nvidia-cuda-mps-control
-		doexe ${NV_OBJ}/nvidia-cuda-mps-server
-		doexe ${NV_OBJ}/nvidia-debugdump
-		doexe ${NV_OBJ}/nvidia-persistenced
-		doexe ${NV_OBJ}/nvidia-smi
-
-		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
-		doexe ${NV_OBJ}/nvidia-modprobe
-		fowners root:video /opt/bin/nvidia-modprobe
-		fperms 4710 /opt/bin/nvidia-modprobe
-		dosym /{opt,usr}/bin/nvidia-modprobe
-
-		doman nvidia-cuda-mps-control.1.gz
-		doman nvidia-modprobe.1.gz
-		doman nvidia-persistenced.1.gz
-		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
-		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
-		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src/ \
-			DESTDIR="${D}" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LIBDIR="${D}/usr/$(get_libdir)" \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			NV_VERBOSE=1 \
-			PREFIX=/usr \
-			DO_STRIP= \
-			install
-
-		if use static-libs; then
-			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
-
-			insinto /usr/include/NVCtrl
-			doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
-		fi
-
-		insinto /usr/share/nvidia/
-		doins nvidia-application-profiles-${PV}-key-documentation
-
-		insinto /etc/nvidia
-		newins \
-			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
-
-		# There is no icon in the FreeBSD tarball.
-		use kernel_FreeBSD || \
-			doicon ${NV_OBJ}/nvidia-settings.png
-
-		domenu "${FILESDIR}"/nvidia-settings.desktop
-
-		exeinto /etc/X11/xinit/xinitrc.d
-		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
-	fi
-
-	dobin ${NV_OBJ}/nvidia-bug-report.sh
-
-	if has_multilib_profile && use multilib; then
-		local OABI=${ABI}
-		for ABI in $(get_install_abis); do
-			src_install-libs
-		done
-		ABI=${OABI}
-		unset OABI
-	else
-		src_install-libs
-	fi
-
-	is_final_abi || die "failed to iterate through all ABIs"
-
-	readme.gentoo_create_doc
-}
-
-src_install-libs() {
-	local inslibdir=$(get_libdir)
-	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
-	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
-	local libdir=${NV_OBJ}
-
-	if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
-		libdir=${NV_OBJ}/32
-	fi
-
-	if use X; then
-		NV_GLX_LIBRARIES=(
-			"libEGL.so.1 ${GL_ROOT}"
-			"libEGL_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGL.so.$(usex compat ${NV_SOVER} 1.0.0) ${GL_ROOT}"
-			"libGLESv1_CM.so.1 ${GL_ROOT}"
-			"libGLESv1_CM_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLESv2.so.2 ${GL_ROOT}"
-			"libGLESv2_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLX.so.0 ${GL_ROOT}"
-			"libGLX_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLdispatch.so.0 ${GL_ROOT}"
-			"libOpenCL.so.1.0.0 ${CL_ROOT}"
-			"libOpenGL.so.0 ${GL_ROOT}"
-			"libcuda.so.${NV_SOVER}"
-			"libnvcuvid.so.${NV_SOVER}"
-			"libnvidia-compiler.so.${NV_SOVER}"
-			"libnvidia-eglcore.so.${NV_SOVER}"
-			"libnvidia-encode.so.${NV_SOVER}"
-			"libnvidia-fatbinaryloader.so.${NV_SOVER}"
-			"libnvidia-fbc.so.${NV_SOVER}"
-			"libnvidia-glcore.so.${NV_SOVER}"
-			"libnvidia-glsi.so.${NV_SOVER}"
-			"libnvidia-ifr.so.${NV_SOVER}"
-			"libnvidia-opencl.so.${NV_SOVER}"
-			"libnvidia-ptxjitcompiler.so.${NV_SOVER}"
-			"libvdpau_nvidia.so.${NV_SOVER}"
-		)
-
-		if use wayland && has_multilib_profile && [[ ${ABI} == "amd64" ]];
-		then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-egl-wayland.so.${NV_SOVER}"
-			)
-		fi
-
-		if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
-		then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-wfb.so.${NV_SOVER}"
-			)
-		fi
-
-		if use kernel_FreeBSD; then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-tls.so.${NV_SOVER}"
-			)
-		fi
-
-		if use kernel_linux; then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-ml.so.${NV_SOVER}"
-				"tls/libnvidia-tls.so.${NV_SOVER}"
-			)
-		fi
-
-		for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
-			donvidia ${libdir}/${NV_LIB}
-		done
-	fi
-}
-
-pkg_preinst() {
-	if use driver && use kernel_linux; then
-		linux-mod_pkg_preinst
-
-		local videogroup="$(egetent group video | cut -d ':' -f 3)"
-		if [ -z "${videogroup}" ]; then
-			eerror "Failed to determine the video group gid"
-			die "Failed to determine the video group gid"
-		else
-			sed -i \
-				-e "s:PACKAGE:${PF}:g" \
-				-e "s:VIDEOGID:${videogroup}:" \
-				"${D}"/etc/modprobe.d/nvidia.conf || die
-		fi
-	fi
-
-	# Clean the dynamic libGL stuff's home to ensure
-	# we dont have stale libs floating around
-	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ]; then
-		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
-	fi
-	# Make sure we nuke the old nvidia-glx's env.d file
-	if [ -e "${ROOT}"/etc/env.d/09nvidia ]; then
-		rm -f "${ROOT}"/etc/env.d/09nvidia
-	fi
-}
-
-pkg_postinst() {
-	use driver && use kernel_linux && linux-mod_pkg_postinst
-
-	# Switch to the nvidia implementation
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
-	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
-
-	readme.gentoo_print_elog
-
-	if ! use X; then
-		elog "You have elected to not install the X.org driver. Along with"
-		elog "this the OpenGL libraries and VDPAU libraries were not"
-		elog "installed. Additionally, once the driver is loaded your card"
-		elog "and fan will run at max speed which may not be desirable."
-		elog "Use the 'nvidia-smi' init script to have your card and fan"
-		elog "speed scale appropriately."
-		elog
-	fi
-	if ! use tools; then
-		elog "USE=tools controls whether the nvidia-settings application"
-		elog "is installed. If you would like to use it, enable that"
-		elog "flag and re-emerge this ebuild. Optionally you can install"
-		elog "media-video/nvidia-settings"
-		elog
-	fi
-}
-
-pkg_prerm() {
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}
-
-pkg_postrm() {
-	use driver && use kernel_linux && linux-mod_pkg_postrm
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: x11-drivers/nvidia-drivers/, x11-drivers/nvidia-drivers/files/
@ 2017-05-06 10:59 Jeroen Roovers
  0 siblings, 0 replies; 33+ messages in thread
From: Jeroen Roovers @ 2017-05-06 10:59 UTC (permalink / raw
  To: gentoo-commits

commit:     c9cce43bb376d482a4baceb903169e651c01cc60
Author:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
AuthorDate: Sat May  6 10:59:42 2017 +0000
Commit:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
CommitDate: Sat May  6 10:59:42 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c9cce43b

x11-drivers/nvidia-drivers: Version bump.

Package-Manager: Portage-2.3.5, Repoman-2.3.2

 x11-drivers/nvidia-drivers/Manifest                |   6 +
 .../files/nvidia-drivers-375.66-profiles-rc.patch  |  11 +
 .../nvidia-drivers/nvidia-drivers-375.66.ebuild    | 558 +++++++++++++++++++++
 3 files changed, 575 insertions(+)

diff --git a/x11-drivers/nvidia-drivers/Manifest b/x11-drivers/nvidia-drivers/Manifest
index 71dece4bcd5..b65d8778385 100644
--- a/x11-drivers/nvidia-drivers/Manifest
+++ b/x11-drivers/nvidia-drivers/Manifest
@@ -2,21 +2,25 @@ DIST NVIDIA-FreeBSD-x86-173.14.39.tar.gz 20038266 SHA256 63a922ce4c5b676b4cb1ace
 DIST NVIDIA-FreeBSD-x86-304.135.tar.gz 35092250 SHA256 3bcecc26c67588174bcee96b25f4f70265f463e4b3eb85d83363977acf3b6d33 SHA512 2e8e8b6cc02bcb44fcfc5f7b378cfe104669d2092e5191261c800bb458281e4ae269d8ae3f7230f5e1432004d55120e063166ead5d91d80b96eb158f7927b34a WHIRLPOOL b42379f450630f20ece6f3af95b9f02d8c91121454d9c883f23cbb7a46e2099c41de2f15663932befb218eea856cb0a861fc34b19f3e84061cd0fa4f4c8722e6
 DIST NVIDIA-FreeBSD-x86-340.102.tar.gz 12057262 SHA256 d3edf43d6fc518869c35ae8d98ab5d55b86ade71127956ef66b201f60bc5dfe8 SHA512 bf15e68b1eee85e83474aaa480096991eac7506481f1192b53e0e10ff891f177c50c1492c51fb68ce0af3c5ccc54dad60edc90ec42b156e8338e51b9f9542520 WHIRLPOOL 6eb5df57b709ea2c3ab1c81d7a186fd106ff019400d66bc68c91da12d27b0b365e2f1b44c6d41cd45f605a813be1b88d587fcd7b3513c251e3248dc2f243d529
 DIST NVIDIA-FreeBSD-x86-375.39.tar.gz 59111267 SHA256 ca39ab55716516bbca62fc888ec786745a8df7f346e68703f54e1a42afad733e SHA512 8f5bf9ffc731ca90a2604b80c3974ee123a12d7db9ee9be1811f5e78711798d7a29737a3651406c1c5e24a197d50f2f2fc39d94c8d11f9700900ef13266a5bf7 WHIRLPOOL e6ce83478238b2f6497ed48688531a6ba4bf78baa2d376e6c8a0f04b35039ed1532a4618f8a53c60ab0778330313ca1e9eecb836a4ade4c5b006844386d4b23f
+DIST NVIDIA-FreeBSD-x86-375.66.tar.gz 59154988 SHA256 b664c4796626213e7bee4cace75bf576ffa2943ca26a0414bcf598c8e6ff5614 SHA512 b034d8bb569d7b4f277aabef9d82c7928c345c27fd25b77d5d843f0e587c9e3f641e1860f4459a06ab3e1e68460743d04553ce919b4c8ecd2a3b624875c78c52 WHIRLPOOL 9385aca80b3cf3d00a1b7686a43edcc5c9d7fb20a7223c0642676cb1d084a1cfc19b1e32babfb72b397e651cf3a0ef1adf71f45fc4a8f826476b68407c00497d
 DIST NVIDIA-FreeBSD-x86-378.13.tar.gz 59610253 SHA256 aca461f050950f1a3a81137ec8adf2057deaa20ad166bdd4ce8f3e34616e7a98 SHA512 a0101201089df2bbf5bdc4ded2228dd989da6a47da31c3ec8d55916b1ff3457924555f82c7381934745fdc1b1f8f78e3fc10e5089279eb13423628dbfe560c6b WHIRLPOOL ac67d07d3ffb0959f685b7d59de152ba8fc97e11c30ed3f1a200511bcaf3de1cd1879147f37fde66a1c8d13dd327aac8a9ac78d42cc9656ef79e3180897aaef1
 DIST NVIDIA-FreeBSD-x86-381.09.tar.gz 60127992 SHA256 054930012cd51657dda3d4d12acbd33c5861d2abdc25d6a3b90bd3358b13b89a SHA512 222844b74eca79457e0814a6409b5ce8bdc50c26d44c4442d2afc0803fb9d079ce1d4aa84675a570550ce215f828fa474deb7e884a8dc41dab947de97d67b802 WHIRLPOOL 4ed9a366d4f8a608ad524a0441d436a327120d5ae8294ba37d75f20f1ea50c2fa1fc4e9449e325ae56ddfc62fe2846126cc7685284bd758ec62a9c065fd16b41
 DIST NVIDIA-FreeBSD-x86-96.43.23.tar.gz 15463464 SHA256 18d855db8381eda1a6cf548c9e5095fc5bb8694bf1d6e24fc1072fba4e54cd78 SHA512 42d7b1b76cdb3b23680363e565614a22112162a5dd3639cb804fe670c0c3f3f23595bbefa3f78afdc6a8ca848446dee853c7a355f2c96a0d01b354753ba2785c WHIRLPOOL f8e59ce521990cd9edee441e73f973f074db492952807a0931e362102874cddbb47604ff5c5eb20a0cbde27f9b6d4e440dd12cc2e5a20c9cb65bf3c0b3e62511
 DIST NVIDIA-FreeBSD-x86_64-304.135.tar.gz 36144428 SHA256 0e415045b96bb272150d35d72c4a17c3d8e7b593dc7ffc577f6f25cc04f9de95 SHA512 8939f0153e7dc98ed147c79a042731461f87582ef46c4762afadf6a5e1cd0ca32ca99415a3819f7e5abefb2df5c59731454e80873d3d622b73f27e75518c8793 WHIRLPOOL e8689e07f12e169f9abad243111bcddee7796826f0028d29bb5eb340649696a3688a74068f07f52d6764fba9924ddd1dba18e8ae442654fffa9b902ccbde2c7f
 DIST NVIDIA-FreeBSD-x86_64-340.102.tar.gz 60862932 SHA256 6d1108c2e8d1b25eb16cd8dc4eb221f2a20d2e4c39a515c0b5809fb407991f94 SHA512 fddef644937093550f9e5dfc25dc5cb81280785735c2d11f644b5eece8144b23bc88a353534ca95e925f54da9131ed5dd7460b72e554b6625df33e243476588f WHIRLPOOL 0b19ef96124768b8cafb0211a79f8ba6e3d04d9289d5194a59fdaa4eb15ab898c103346892007d9fd6eac75d6d503cd9724ab8f60bd7cf28fee2f9307b03d70b
 DIST NVIDIA-FreeBSD-x86_64-375.39.tar.gz 58308585 SHA256 0d58c450b3391cf28655f15505aaca8d011590efe5dd3ebc6a3212a9d7597b17 SHA512 2b9e4fe4c850c59050d6f586be743e6e9511d12ee3e5f760b6c6ef5ff2084b7bc147267a7844191db1bfab842806a47054ce8f7534d5fee614efbf08e1faaca4 WHIRLPOOL fe195242a1a3657609eb9ea0eda27daa22fcc40beaa35e3cfcda575978361f68da27a46411ad38a93bef333bba91c06b911545d4d14f19b3dd2d085ae7012408
+DIST NVIDIA-FreeBSD-x86_64-375.66.tar.gz 58343065 SHA256 f6977d58d57818c27989d0c87dff0bdcb348a57ac18e0607ba03fa7489caa089 SHA512 7a222192c04c6cc3fb7818caebb45b4f4e3c9f702bcc14400cc9a7d3d83daae40ff254b70b3845a44fa120b702734b4619f5d4c5a8d25300becfc5f73710f3e9 WHIRLPOOL c77b5457bf4c053baefe1cf676baf47b318cfbfb8c323a8f6d270a36d8119d7843d5e28313c0b011feb9f19aea430d3f37e5b7798304ec174b996871876445e1
 DIST NVIDIA-FreeBSD-x86_64-378.13.tar.gz 58779963 SHA256 451b9e4b2da86609c760a9a133efa8d37d844ad036299689f007c90463a7ca39 SHA512 34cfc383ba196ecec2cd27fc12bf30dd58f8782b73414e7b4c182e832ae0dce1f8c017afbb2101d7525d4e321f80cac49d3b578a8fc0cf88be9310f4deb77057 WHIRLPOOL 23929abd50467f267cf6b7d58a49fc6f667036b7e92363cc05b021790d0d5ebc61e181c3b2e7c32a6338328cfcc05311d74112b005d638c0295b2c6189dfa3b8
 DIST NVIDIA-FreeBSD-x86_64-381.09.tar.gz 59304654 SHA256 f15f8bb7029813d1cc550b61be5d92103bec7aa3528f976b84a2abe56e84f334 SHA512 16f3140ac89f072c0b2ece66e8a87cc60725fdc789b1fc11cd55add1a38e7ba310aaea69030d9b9e6451915a83355b4fab7090cec133d8deb5dc4317e3b13390 WHIRLPOOL bdd2f52010975fe4b41e48f8f2141ee80a99129e02970f4031faacb4f780905be56293de47b32f8f4d045cc07d4a11a9e3d280b51540cfd9aad4b6d98d5fb0aa
 DIST NVIDIA-Linux-armv7l-gnueabihf-375.39.run 25350238 SHA256 52f512bbb3e2d5747df9b294667df9975564408c5ce4f3124aca7dba4355a3a9 SHA512 d888ab0c81c53138eec06e25be683798b5459a6862affa92429feb1e63fcd4cd7ac76bd78eff8c1bef245a25a6a7eb77994ad99c15ed65e8be1a64b3e4c45030 WHIRLPOOL 5714fdcd9e226a336e0abd46bd8a91eef486fc14de543a98d284b3ae3955e924dbde10a08144309b6c0b4e19fcb011bffb8c046a05cbe05f6123b22d270e2939
+DIST NVIDIA-Linux-armv7l-gnueabihf-375.66.run 26668661 SHA256 eb9ac4a3e7dad9f1a149eb04a4d6668b73b75b0e12cca41f12ac52db3e39981b SHA512 fa60b385f7ae79de28e6cb452c249c26a6dbec72f0ab1f31fa89fbea937e5bb13303b32e275384d834b524e58d47fb18497e0920657307a89f9cebe8aef96909 WHIRLPOOL c34e92a43601240dca0dfd2d14f75ce828b12c2da80dbafaf67c6437ba54dc214ca69ce0d0f1a8bef883539ec8430761055b0cf60d9a4502544b39d98bae9648
 DIST NVIDIA-Linux-armv7l-gnueabihf-378.13.run 26514235 SHA256 399abf527d84e4b4d01ea66e0de4a1f9b1b39871b180ef3bf99c4718ebe3db91 SHA512 253786a821df85fa926ae842114321b3c70502f887ea7c2b6790dfe3836039ee5d390e6722ca8785904ec6487e465916923d3042dc6191b3b4522c3161b80cb0 WHIRLPOOL 154b13ecb368716980ab779894942831c13e4b2d47c1d5765ab14590663b34be1571df7934e1277c9a29cdfe93e209a04e2a9fed2830c407a42547433fd9e721
 DIST NVIDIA-Linux-armv7l-gnueabihf-381.09.run 27017323 SHA256 bbef638bafd7e7e65a3f71de837605142040b5c6bf8bb23dfe114c5e96339311 SHA512 fb99016c1e1d4919e85679279a163631814615913c6ddb3f1b847afd5b8df106a739118987fd3e932659a287f7c3e0bf3852ae574b0c8fd0bd16a9060fc0affb WHIRLPOOL d414f6ddf7e42e01107a3ba4956893e096aa604a515c47c650177683486b9d2dfd0d59a7e492ad2eb61b28f5d8f9d7e9c8bee463bafb9862af73abfa5fd34a37
 DIST NVIDIA-Linux-x86-173.14.39-pkg0.run 15134997 SHA256 a09935f37121ed3db8ae3da63a0d8e9d4348a19c859811c9fe44d6ce8e3eab23 SHA512 e24e15ccec725d3cbca502c2b77061776a81ef92917a950adec4ff6bdc34f10903aa654433177ea74be0dade4af81c5380d5710d375a5ea445940d06154bde93 WHIRLPOOL fce3d8e4f6cdf698f5a057514b6fe220bb1011025bdce5bd4cf0e424fb4d306d38251b6726bda03f290ea8137d5a95ed418cf8751722879f9042462abd9181b6
 DIST NVIDIA-Linux-x86-304.135.run 41202842 SHA256 5cb0a191ddca7b4c72b3c26cd57b7d719878ce628d24b5b026a0e5c8d3a00d93 SHA512 c2645cc9a6f23641d8b6da51e72e203980068c05e365fcc73b32322a6875ce95e81f4e0d893276e14e84e93464488539c16db6b3be04f5324cf7d7a12bb557f8 WHIRLPOOL 79d0d0badd36c94f3d48eef2c40184ee876bf78e153b18e73521fbe756cd78248da38405e7c08abbfa400ee8cd8150d81987bd7f45501937a77c39f7fc9a0ee6
 DIST NVIDIA-Linux-x86-340.102.run 38779756 SHA256 61b13d5dae0f6f5d788a4d8c4c98e8d971d19cb90b606058060d007946248828 SHA512 bea700c925a6044fcded40324bb389c5fa1aadc40831f685a76e7b0ded11161f492960950c201467e564d157dcbe0c330d13a2014f51d0073002c5a262a6f0ca WHIRLPOOL f7a3e3c5f8bb9eedf0a93104564d3d9c3eabc39a807c47e87f84373f89513afcafecb94e602b12fd24f872971f2d16a5f945326c670a6eebcd9ffcdcb70cb99e
 DIST NVIDIA-Linux-x86-375.39.run 44434734 SHA256 7f33f6572c5c5c57df71531749c7339309a2097918375685ea8018826cf19456 SHA512 0f4e784f69f7b4c4696b62779892d8e77aef0adb701dcf5e844027e3a1870aa56bb913bc05f30b079c2519bdda87fa0096d612e9d74ea35b97882fc54fa5d2ca WHIRLPOOL 1d1e6a49d86a72f38d3c84a0b75735c9b64b0bbc75bc54e91318b316298609dd34ab3affff5795fedba44133536e22bf287a76d8271bf0cee990204a383e8a93
+DIST NVIDIA-Linux-x86-375.66.run 44495924 SHA256 29220e249a308f89c2a6fa48be6a0009d58f082d07d3fedfbf4ab0015559f14c SHA512 9f890529cba18197dfb340cefdbb058fd7d4edae39c1ef19a398aaba782e66993257a9f3e93b3f43eb51463492644c0cdf2c5a4af612d6401ebc5427783ef94a WHIRLPOOL bc323f86c99c83f2e3ad3b28f47adfb483988dbcc8e828aedf0e57d1a98a0b7aaf93055076abe2c92f614744309ff47a76edbeb38567cf1daa04c85094abe3dd
 DIST NVIDIA-Linux-x86-378.13.run 44397547 SHA256 05e62a6098aac7373438ee381072253a861d56522f74948c2b714e20e69a46b1 SHA512 b96d2558a1003a3c66cade3a1e16abd34d855c0e27cdebacdc0495e0ba3cd5c68bb84cc5f81bff1b9ddce36ac52e0dc125c56d868b77d7c8e2f606d559b13b4a WHIRLPOOL e8231978664cec766813821c0f363ef437ba627debc2d2664164fe44c344c480c50799710dbeeee782fdacdb66b16317d69a9dec4f21d347dc40e471201b3ed1
 DIST NVIDIA-Linux-x86-381.09.run 44942491 SHA256 c39805e6610f710d16acf57c9d09cb5504d33c557e634e632079d46f18da4268 SHA512 868d4adcb5b19577aa044a0b978dc57d2771d8f17d9ab8e1a87fdc4f24f6868430d763a91fa5643789aaa34a8c8819b7a8bc102fafb275b4dd5ea5034cbd529d WHIRLPOOL 7c2c782d2c6d5cd64efe7097ab24f330b69dbd02ddcbfebb90de9d8d0573e18b2a4293b32135c3e1a6697fb1b597fda9029684bab9659702bd78e499204c4168
 DIST NVIDIA-Linux-x86-96.43.23-pkg0.run 11504817 SHA256 51e6adf4ba73071622045fc37169f80db3ae3e784dff53b29d35146a04042142 SHA512 bed5726e57637481fe4e3c03a65ec14fe949f00860e729ebde408f4fd861d7bfdc296a78bc2f5d42e8b282db09f4bbde1e0545df7228fa20227080dc4b868ba7 WHIRLPOOL 6d4fd1786c11f4e326cc3101d0bb1a2f8b63c25c3dd59f10188f8355759e2861ce44fd53d60258b513d5a1d6124d0f91ba8edf4d3668b6feabfb3e8d585f14fe
@@ -24,11 +28,13 @@ DIST NVIDIA-Linux-x86_64-173.14.39-pkg2.run 21100833 SHA256 15a953666d5681ba54c9
 DIST NVIDIA-Linux-x86_64-304.135.run 69766944 SHA256 706269a507995544a24d24b3386d8f7bddbad3ce52167fae0da9e00dad8ab588 SHA512 1b444eb4af219506c88fdc78746eca1afb8571017858cb387d8546f1950d6d82c1077c74e9bda9ccebb0e42bc5cb4d50d9b8c01989ae4cb52c3fc069304b7ab5 WHIRLPOOL 1fdb38f634ad8e41e37e1fb7d84ffb22566b4c5e182aa90f6a034db99c251864759909ad0b9db77ed08645c0da50362e40bc37574f526d58bb3eece7c37772a6
 DIST NVIDIA-Linux-x86_64-340.102.run 69960567 SHA256 2b96d2f26c00405471e0ce10dca0b6639e91aeb43f7c5aadbdae28445a28df5a SHA512 eead5b6f18afd5384f30f36a9ef569dea7d6ca1dbc590f63d603694bcc6a8bf251942b36ca606cfd5e6775ef180cd564f3cf226a3f4c04d7ed354204fec15577 WHIRLPOOL 6596a178aa35ac841bf287fa1372f6748cda0430c6b4bcd18fa63d63030331df59e75d4a3dde63f28a6fa15cdfaa90d27136c96e9abe81fb05202f00430ecaa9
 DIST NVIDIA-Linux-x86_64-375.39.run 77264092 SHA256 91be5a20841678d671f32074e2901791fe12c00ce1f3b6b3c4199ce302da85a7 SHA512 9a7e865db44f8e65be257b26250adcdf6f3dfac4e164f14a42b8e03c576016dfedf152d6a6cb84fb3ae9930d2b4ba472a63cf32d557395ff7fa429d9b8c9ccd0 WHIRLPOOL 03a27813464847958d9d2adb0bc260e31c6458df18e567c4c36e1eac5f7288108f88147cf1115f360b159a6d0ab459692abb35a79879e19fec2db30709802df1
+DIST NVIDIA-Linux-x86_64-375.66.run 75096990 SHA256 59e37f570ba5f3d7148028e96684d77f347d49a54e3722189782fc9b17d201c0 SHA512 518534816da3e20e9b539e19b0e93340b6141aebe76989139aa130883106a68da74f9ef3692419e0b3c111a7c50ceb20e45ecdde53af78c7c709b4d51acb5164 WHIRLPOOL b09f2f0b32735e761e7508091d3e83c3b6f3224213a0cf7d83df914d581ef390a110cd2015dbec8cfb5f87ff1e0924d2d93335f8f9862ed65f6da867c236bd25
 DIST NVIDIA-Linux-x86_64-378.13.run 76239469 SHA256 3de379249ef25a8c10a24be2718bf1cb2e338da204e37874c4a0c66dbcdf42ee SHA512 2f6789aa0a400c035c0a074631dc5c26abb4f8a62efe928ca3a2865b89d29acfc09c27f23a664e438275e4bfd25c261745d4d495f9aca5f54ee6c53a389059d2 WHIRLPOOL 6e8dcc7be0981591f377babbd9e1430fddeac9a42291f36a95243d418882bc8b38a1e692e2fd62d4b785feca93165e54a64c015bd99193c699831465f512b180
 DIST NVIDIA-Linux-x86_64-381.09.run 78235493 SHA256 04ec99f6d621adc464314adc82a92009e071a301a773487df7f460333e04e98c SHA512 c5344088efbb7cddfca16459d593d8478ea31101946a94d23f55d24878c92b936ee4cac50b0538f63b9e472724f78c6f8c7e8d7b8463cab56624c9f16eb0a979 WHIRLPOOL 825e48070a6e23e5546ec0a3600589f521e69136519afe8ff5dfd9c34d75c3856833fd8388e29905be362ed1944cb9b5f4030c61c4ce01e87d2102b1c6d605fc
 DIST NVIDIA-Linux-x86_64-96.43.23-pkg2.run 15962375 SHA256 ce8d8253e7dab7da63fbdac449ebf190cd0c10cbfffea0f8d0165515f851bc64 SHA512 04bec1187a6024a2b9839f008ec829281f1f2602dae2e639030bc385943186506bcaa2b46a230b2ab87f9217190841abc62f9e2d6395ab5559623389c31c6563 WHIRLPOOL 0651c44a51a1a06fcff5bfddbf9c3e408977e03263c7fe806cb6c01f9fe92f716dfe4e5190ffe1048bde72fcffdc8bca8267e74dd43ba5c9dfb22b6201fcc2bb
 DIST nvidia-settings-304.135.tar.bz2 1480857 SHA256 f5431a6547d7727506b72616156c18f927a89c0702e7f939b5043fdb66e4faf8 SHA512 ce77819c223d02bc5330a57047b45cf9022159b0d03b3fb1572a64aebbcb5872312acef3f56e2574acc4c2c92eae9ac6e602327fd2658c47f2b97c69cf61ebfb WHIRLPOOL 5fc6c4ada22d8a1b0cade4049691c013a5dfa0a7777d7789f310d363c9c4ed5cb724acc153ec562fcc2266228325096e3f733e8f1517a74c047388a4361d25d8
 DIST nvidia-settings-340.102.tar.bz2 1550093 SHA256 2895d4e2597a6ea0c425d74c7a0808775065f5cf58397fbbe6e626b00c60a55a SHA512 1ab190d8bcba7cc39d47f38db2bee28fab48d48c9a6674c9ff29ea3f51103e13746ee1df2d30581bd8259fc1104fed90b36cba88907bb2f202c931d256eab66a WHIRLPOOL 58105b371bc7156c2749f4bf85377f06fca71eb0a933721d70987aa53bb6c94494de3be25363ccf326105ca475405dcd7c884ceb6158df352ac6cc70dcffbf7e
 DIST nvidia-settings-375.39.tar.bz2 1618873 SHA256 e5965788368c85e8a83db27d725ea9492068d0e79f961b22fe38d22f090e0839 SHA512 de6dc16850f032f228313582c83e27fefcb045261cb8b5fdef428cca5264307ef58a5e78d91fe3624a39ab2a4361e3939d4b6592c32837a1f43caf381120bed8 WHIRLPOOL 100102effcb2fb04976f6ecadd23631b5ea28206076fdac24f2ae481c96e6856239295c65e2e527d7c9558d97f3f5a25e6c48907cb41eff0a23ee6d878790716
+DIST nvidia-settings-375.66.tar.bz2 1619575 SHA256 b0c08edf062fcdf76ddfe526949fe6c32359b8f9aeb5b70e7d97118ebd57ed2e SHA512 c5c129815ca9950692c3316c5d675e5cb771b2d7dd8408471dccd7546c3962fb14c640bf09863fc12dd21dc07ca5fdf09cf17187672bb9c88efaded0c8091c12 WHIRLPOOL 7feadadc74461d1e32904158ff29f1bb37c2faadd9150ae6d8f6a7f68e48394442b52a5cba33ade5fc470506d837dd66ed50af326a97f0407c9f98029de7ec5a
 DIST nvidia-settings-378.13.tar.bz2 1618011 SHA256 b23f931e3107897ff73c57ce02aa77e8e1dc95559bfa338e898126731a230023 SHA512 a12352c92fd4f56002bda2b07e8cddd5573af98521ec3495cd428b784eb368c9f2cb40f9b4372400ba1ea67c9349c6a9b4f7c218ede2d0d5dabb08325eda9844 WHIRLPOOL d143ae5fd3d09e235aca4d5f95d87d9ab0e3adee4aab5496fba89bcc75903dae5a604f76e9b34331f561dcc8e9aa222ee91e6e15ce91635cefc1e4e40eb8097f
 DIST nvidia-settings-381.09.tar.bz2 1629331 SHA256 a25bcc37c49628b7f370eacd97365709f0897cf526e9d5e6b7e8c8c95813c805 SHA512 fda87a25a8ebdf63146bf246063e2744aeaa64cd0ae05f6a167ebaede0fa80430d0529f255f0ae956874ff5526ffe6d6daa4783bad634f659a308e0fe16d7fe0 WHIRLPOOL 755b1280790b403a7233ef47425318dd8e150d11f4afe62c597a62197674628488bc4d3a94992a91daa9312a744370cf414911bf0b979708ebf6ae6c531fa478

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-375.66-profiles-rc.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-375.66-profiles-rc.patch
new file mode 100644
index 00000000000..33e77f300af
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-375.66-profiles-rc.patch
@@ -0,0 +1,11 @@
+--- a/nvidia-application-profiles-375.66-rc
++++ b/nvidia-application-profiles-375.66-rc
+@@ -48,7 +48,7 @@
+         {
+           "name" : "NoEnforceShaderInputOutputMatching",
+           "settings" : [ "GLShaderPortabilityWarnings", false ]
+-        },
++        }
+     ],
+     "rules" : [
+         {

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-375.66.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-375.66.ebuild
new file mode 100644
index 00000000000..8b5438308c2
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-375.66.ebuild
@@ -0,0 +1,558 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit eutils flag-o-matic linux-info linux-mod multilib-minimal nvidia-driver \
+	portability toolchain-funcs unpacker user udev
+
+NV_URI="http://http.download.nvidia.com/XFree86/"
+X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
+AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
+ARM_NV_PACKAGE="NVIDIA-Linux-armv7l-gnueabihf-${PV}"
+X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
+AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
+
+DESCRIPTION="NVIDIA Accelerated Graphics Driver"
+HOMEPAGE="http://www.nvidia.com/ http://www.nvidia.com/Download/Find.aspx"
+SRC_URI="
+	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
+	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
+	arm? ( ${NV_URI}Linux-x86-ARM/${PV}/${ARM_NV_PACKAGE}.run )
+	x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
+	x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
+	tools? (
+		${NV_URI}nvidia-settings/nvidia-settings-${PV}.tar.bz2
+	)
+"
+
+LICENSE="GPL-2 NVIDIA-r2"
+SLOT="0/${PV%.*}"
+KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
+RESTRICT="bindist mirror"
+EMULTILIB_PKG="true"
+
+IUSE="acpi compat +driver gtk3 kernel_FreeBSD kernel_linux +kms multilib pax_kernel static-libs +tools uvm wayland +X"
+REQUIRED_USE="
+	tools? ( X )
+	static-libs? ( tools )
+"
+
+COMMON="
+	app-eselect/eselect-opencl
+	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
+	tools? (
+		dev-libs/atk
+		dev-libs/glib:2
+		dev-libs/jansson
+		gtk3? (
+			x11-libs/gtk+:3
+		)
+		x11-libs/cairo
+		x11-libs/gdk-pixbuf[X]
+		x11-libs/gtk+:2
+		x11-libs/libX11
+		x11-libs/libXext
+		x11-libs/libXrandr
+		x11-libs/libXv
+		x11-libs/libXxf86vm
+		x11-libs/pango[X]
+	)
+	X? (
+		>=app-eselect/eselect-opengl-1.0.9
+		app-misc/pax-utils
+	)
+"
+DEPEND="
+	${COMMON}
+	kernel_linux? ( virtual/linux-sources )
+"
+RDEPEND="
+	${COMMON}
+	acpi? ( sys-power/acpid )
+	tools? ( !media-video/nvidia-settings )
+	wayland? ( dev-libs/wayland[${MULTILIB_USEDEP}] )
+	X? (
+		<x11-base/xorg-server-1.19.99:=
+		>=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
+		>=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
+		>=x11-libs/libvdpau-1.0[${MULTILIB_USEDEP}]
+		sys-libs/zlib[${MULTILIB_USEDEP}]
+	)
+"
+
+QA_PREBUILT="opt/* usr/lib*"
+
+S=${WORKDIR}/
+
+pkg_pretend() {
+	if use amd64 && has_multilib_profile && \
+		[ "${DEFAULT_ABI}" != "amd64" ]; then
+		eerror "This ebuild doesn't currently support changing your default ABI"
+		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
+	fi
+
+	if use kernel_linux && kernel_is ge 4 12; then
+		ewarn "Gentoo supports kernels which are supported by NVIDIA"
+		ewarn "which are limited to the following kernels:"
+		ewarn "<sys-kernel/gentoo-sources-4.12"
+		ewarn "<sys-kernel/vanilla-sources-4.12"
+		ewarn ""
+		ewarn "You are free to utilize epatch_user to provide whatever"
+		ewarn "support you feel is appropriate, but will not receive"
+		ewarn "support as a result of those changes."
+		ewarn ""
+		ewarn "Do not file a bug report about this."
+		ewarn ""
+	fi
+
+	# Since Nvidia ships many different series of drivers, we need to give the user
+	# some kind of guidance as to what version they should install. This tries
+	# to point the user in the right direction but can't be perfect. check
+	# nvidia-driver.eclass
+	nvidia-driver-check-warning
+
+	# Kernel features/options to check for
+	CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
+	use x86 && CONFIG_CHECK+=" ~HIGHMEM"
+
+	# Now do the above checks
+	use kernel_linux && check_extra_config
+}
+
+pkg_setup() {
+	# try to turn off distcc and ccache for people that have a problem with it
+	export DISTCC_DISABLE=1
+	export CCACHE_DISABLE=1
+
+	if use driver && use kernel_linux; then
+		MODULE_NAMES="nvidia(video:${S}/kernel)"
+		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
+		use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel) nvidia-drm(video:${S}/kernel)"
+
+		# This needs to run after MODULE_NAMES (so that the eclass checks
+		# whether the kernel supports loadable modules) but before BUILD_PARAMS
+		# is set (so that KV_DIR is populated).
+		linux-mod_pkg_setup
+
+		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
+		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
+
+		# linux-mod_src_compile calls set_arch_to_kernel, which
+		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
+		# expects x86_64 or i386 and then converts it to x86
+		# later on in the build process
+		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
+	fi
+
+	if use kernel_linux && kernel_is lt 2 6 9; then
+		eerror "You must build this against 2.6.9 or higher kernels."
+	fi
+
+	# set variables to where files are in the package structure
+	if use kernel_FreeBSD; then
+		use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
+		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
+		NV_DOC="${S}/doc"
+		NV_OBJ="${S}/obj"
+		NV_SRC="${S}/src"
+		NV_MAN="${S}/x11/man"
+		NV_X11="${S}/obj"
+		NV_SOVER=1
+	elif use kernel_linux; then
+		NV_DOC="${S}"
+		NV_OBJ="${S}"
+		NV_SRC="${S}/kernel"
+		NV_MAN="${S}"
+		NV_X11="${S}"
+		NV_SOVER=${PV}
+	else
+		die "Could not determine proper NVIDIA package"
+	fi
+}
+
+src_prepare() {
+	eapply "${FILESDIR}"/${P}-profiles-rc.patch
+
+	if use pax_kernel; then
+		ewarn "Using PAX patches is not supported. You will be asked to"
+		ewarn "use a standard kernel should you have issues. Should you"
+		ewarn "need support with these patches, contact the PaX team."
+		eapply "${FILESDIR}"/${PN}-375.20-pax.patch
+	fi
+
+	# Allow user patches so they can support RC kernels and whatever else
+	eapply_user
+}
+
+src_compile() {
+	# This is already the default on Linux, as there's no toplevel Makefile, but
+	# on FreeBSD there's one and triggers the kernel module build, as we install
+	# it by itself, pass this.
+
+	cd "${NV_SRC}"
+	if use kernel_FreeBSD; then
+		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
+			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
+	elif use driver && use kernel_linux; then
+		MAKEOPTS=-j1 linux-mod_src_compile
+	fi
+
+	if use tools; then
+		emake -C "${S}"/nvidia-settings-${PV}/src \
+			AR="$(tc-getAR)" \
+			CC="$(tc-getCC)" \
+			LIBDIR="$(get_libdir)" \
+			NV_VERBOSE=1 \
+			RANLIB="$(tc-getRANLIB)" \
+			DO_STRIP= \
+			build-xnvctrl
+
+		emake -C "${S}"/nvidia-settings-${PV}/src \
+			CC="$(tc-getCC)" \
+			GTK3_AVAILABLE=$(usex gtk3 1 0) \
+			LD="$(tc-getCC)" \
+			LIBDIR="$(get_libdir)" \
+			NVML_ENABLED=0 \
+			NV_USE_BUNDLED_LIBJANSSON=0 \
+			NV_VERBOSE=1 \
+			DO_STRIP=
+	fi
+}
+
+# Install nvidia library:
+# the first parameter is the library to install
+# the second parameter is the provided soversion
+# the third parameter is the target directory if it is not /usr/lib
+donvidia() {
+	# Full path to library
+	nv_LIB="${1}"
+
+	# SOVER to use
+	nv_SOVER="$(scanelf -qF'%S#F' ${nv_LIB})"
+
+	# Where to install
+	nv_DEST="${2}"
+
+	# Get just the library name
+	nv_LIBNAME=$(basename "${nv_LIB}")
+
+	if [[ "${nv_DEST}" ]]; then
+		exeinto ${nv_DEST}
+		action="doexe"
+	else
+		nv_DEST="/usr/$(get_libdir)"
+		action="dolib.so"
+	fi
+
+	# Install the library
+	${action} ${nv_LIB} || die "failed to install ${nv_LIBNAME}"
+
+	# If the library has a SONAME and SONAME does not match the library name,
+	# then we need to create a symlink
+	if [[ ${nv_SOVER} ]] && ! [[ "${nv_SOVER}" = "${nv_LIBNAME}" ]]; then
+		dosym ${nv_LIBNAME} ${nv_DEST}/${nv_SOVER} \
+			|| die "failed to create ${nv_DEST}/${nv_SOVER} symlink"
+	fi
+
+	dosym ${nv_LIBNAME} ${nv_DEST}/${nv_LIBNAME/.so*/.so} \
+		|| die "failed to create ${nv_LIBNAME/.so*/.so} symlink"
+}
+
+src_install() {
+	if use driver && use kernel_linux; then
+		linux-mod_src_install
+
+		# Add the aliases
+		# This file is tweaked with the appropriate video group in
+		# pkg_preinst, see bug #491414
+		insinto /etc/modprobe.d
+		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
+		doins "${FILESDIR}"/nvidia-rmmod.conf
+
+		# Ensures that our device nodes are created when not using X
+		exeinto "$(get_udevdir)"
+		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
+		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
+	elif use kernel_FreeBSD; then
+		if use x86-fbsd; then
+			insinto /boot/modules
+			doins "${S}/src/nvidia.kld"
+		fi
+
+		exeinto /boot/modules
+		doexe "${S}/src/nvidia.ko"
+	fi
+
+	# NVIDIA kernel <-> userspace driver config lib
+	donvidia ${NV_OBJ}/libnvidia-cfg.so.${NV_SOVER}
+
+	# NVIDIA framebuffer capture library
+	donvidia ${NV_OBJ}/libnvidia-fbc.so.${NV_SOVER}
+
+	# NVIDIA video encode/decode <-> CUDA
+	if use kernel_linux; then
+		donvidia ${NV_OBJ}/libnvcuvid.so.${NV_SOVER}
+		donvidia ${NV_OBJ}/libnvidia-encode.so.${NV_SOVER}
+	fi
+
+	if use X; then
+		# Xorg DDX driver
+		insinto /usr/$(get_libdir)/xorg/modules/drivers
+		doins ${NV_X11}/nvidia_drv.so
+
+		# Xorg GLX driver
+		donvidia ${NV_X11}/libglx.so.${NV_SOVER} \
+			/usr/$(get_libdir)/opengl/nvidia/extensions
+
+		# Xorg nvidia.conf
+		if has_version '>=x11-base/xorg-server-1.16'; then
+			insinto /usr/share/X11/xorg.conf.d
+			newins {,50-}nvidia-drm-outputclass.conf
+		fi
+
+		insinto /usr/share/glvnd/egl_vendor.d
+		doins ${NV_X11}/10_nvidia.json
+	fi
+
+	# OpenCL ICD for NVIDIA
+	if use kernel_linux; then
+		insinto /etc/OpenCL/vendors
+		doins ${NV_OBJ}/nvidia.icd
+	fi
+
+	# Documentation
+	if use kernel_FreeBSD; then
+		dodoc "${NV_DOC}/README"
+		use X && doman "${NV_MAN}/nvidia-xconfig.1"
+		use tools && doman "${NV_MAN}/nvidia-settings.1"
+	else
+		# Docs
+		newdoc "${NV_DOC}/README.txt" README
+		dodoc "${NV_DOC}/NVIDIA_Changelog"
+		doman "${NV_MAN}/nvidia-smi.1.gz"
+		use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
+		use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
+		doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
+	fi
+
+	docinto html
+	dodoc -r ${NV_DOC}/html/*
+
+	# Helper Apps
+	exeinto /opt/bin/
+
+	if use X; then
+		doexe ${NV_OBJ}/nvidia-xconfig
+
+		insinto /etc/vulkan/icd.d
+		doins nvidia_icd.json
+	fi
+
+	if use kernel_linux; then
+		doexe ${NV_OBJ}/nvidia-cuda-mps-control
+		doexe ${NV_OBJ}/nvidia-cuda-mps-server
+		doexe ${NV_OBJ}/nvidia-debugdump
+		doexe ${NV_OBJ}/nvidia-persistenced
+		doexe ${NV_OBJ}/nvidia-smi
+
+		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
+		doexe ${NV_OBJ}/nvidia-modprobe
+		fowners root:video /opt/bin/nvidia-modprobe
+		fperms 4710 /opt/bin/nvidia-modprobe
+		dosym /{opt,usr}/bin/nvidia-modprobe
+
+		doman nvidia-cuda-mps-control.1.gz
+		doman nvidia-modprobe.1.gz
+		doman nvidia-persistenced.1.gz
+		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
+		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
+		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
+	fi
+
+	if use tools; then
+		emake -C "${S}"/nvidia-settings-${PV}/src/ \
+			DESTDIR="${D}" \
+			GTK3_AVAILABLE=$(usex gtk3 1 0) \
+			LIBDIR="${D}/usr/$(get_libdir)" \
+			NV_USE_BUNDLED_LIBJANSSON=0 \
+			NV_VERBOSE=1 \
+			PREFIX=/usr \
+			DO_STRIP= \
+			install
+
+		if use static-libs; then
+			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
+
+			insinto /usr/include/NVCtrl
+			doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
+		fi
+
+		insinto /usr/share/nvidia/
+		doins nvidia-application-profiles-${PV}-key-documentation
+
+		insinto /etc/nvidia
+		newins \
+			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
+
+		# There is no icon in the FreeBSD tarball.
+		use kernel_FreeBSD || \
+			doicon ${NV_OBJ}/nvidia-settings.png
+
+		domenu "${FILESDIR}"/nvidia-settings.desktop
+
+		exeinto /etc/X11/xinit/xinitrc.d
+		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
+	fi
+
+	dobin ${NV_OBJ}/nvidia-bug-report.sh
+
+	if has_multilib_profile && use multilib; then
+		local OABI=${ABI}
+		for ABI in $(get_install_abis); do
+			src_install-libs
+		done
+		ABI=${OABI}
+		unset OABI
+	else
+		src_install-libs
+	fi
+
+	is_final_abi || die "failed to iterate through all ABIs"
+
+	readme.gentoo_create_doc
+}
+
+src_install-libs() {
+	local inslibdir=$(get_libdir)
+	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
+	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
+	local libdir=${NV_OBJ}
+
+	if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
+		libdir=${NV_OBJ}/32
+	fi
+
+	if use X; then
+		NV_GLX_LIBRARIES=(
+			"libEGL.so.$(usex compat ${NV_SOVER} 1) ${GL_ROOT}"
+			"libEGL_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGL.so.$(usex compat ${NV_SOVER} 1.0.0) ${GL_ROOT}"
+			"libGLESv1_CM.so.1 ${GL_ROOT}"
+			"libGLESv1_CM_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGLESv2.so.2 ${GL_ROOT}"
+			"libGLESv2_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGLX.so.0 ${GL_ROOT}"
+			"libGLX_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGLdispatch.so.0 ${GL_ROOT}"
+			"libOpenCL.so.1.0.0 ${CL_ROOT}"
+			"libOpenGL.so.0 ${GL_ROOT}"
+			"libcuda.so.${NV_SOVER}"
+			"libnvcuvid.so.${NV_SOVER}"
+			"libnvidia-compiler.so.${NV_SOVER}"
+			"libnvidia-eglcore.so.${NV_SOVER}"
+			"libnvidia-encode.so.${NV_SOVER}"
+			"libnvidia-fatbinaryloader.so.${NV_SOVER}"
+			"libnvidia-fbc.so.${NV_SOVER}"
+			"libnvidia-glcore.so.${NV_SOVER}"
+			"libnvidia-glsi.so.${NV_SOVER}"
+			"libnvidia-ifr.so.${NV_SOVER}"
+			"libnvidia-opencl.so.${NV_SOVER}"
+			"libnvidia-ptxjitcompiler.so.${NV_SOVER}"
+			"libvdpau_nvidia.so.${NV_SOVER}"
+		)
+
+		if use wayland && has_multilib_profile && [[ ${ABI} == "amd64" ]];
+		then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-egl-wayland.so.${NV_SOVER}"
+			)
+		fi
+
+		if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
+		then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-wfb.so.${NV_SOVER}"
+			)
+		fi
+
+		if use kernel_FreeBSD; then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-tls.so.${NV_SOVER}"
+			)
+		fi
+
+		if use kernel_linux; then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-ml.so.${NV_SOVER}"
+				"tls/libnvidia-tls.so.${NV_SOVER}"
+			)
+		fi
+
+		for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
+			donvidia ${libdir}/${NV_LIB}
+		done
+	fi
+}
+
+pkg_preinst() {
+	if use driver && use kernel_linux; then
+		linux-mod_pkg_preinst
+
+		local videogroup="$(egetent group video | cut -d ':' -f 3)"
+		if [ -z "${videogroup}" ]; then
+			eerror "Failed to determine the video group gid"
+			die "Failed to determine the video group gid"
+		else
+			sed -i \
+				-e "s:PACKAGE:${PF}:g" \
+				-e "s:VIDEOGID:${videogroup}:" \
+				"${D}"/etc/modprobe.d/nvidia.conf || die
+		fi
+	fi
+
+	# Clean the dynamic libGL stuff's home to ensure
+	# we dont have stale libs floating around
+	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ]; then
+		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
+	fi
+	# Make sure we nuke the old nvidia-glx's env.d file
+	if [ -e "${ROOT}"/etc/env.d/09nvidia ]; then
+		rm -f "${ROOT}"/etc/env.d/09nvidia
+	fi
+}
+
+pkg_postinst() {
+	use driver && use kernel_linux && linux-mod_pkg_postinst
+
+	# Switch to the nvidia implementation
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
+	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
+
+	readme.gentoo_print_elog
+
+	if ! use X; then
+		elog "You have elected to not install the X.org driver. Along with"
+		elog "this the OpenGL libraries and VDPAU libraries were not"
+		elog "installed. Additionally, once the driver is loaded your card"
+		elog "and fan will run at max speed which may not be desirable."
+		elog "Use the 'nvidia-smi' init script to have your card and fan"
+		elog "speed scale appropriately."
+		elog
+	fi
+	if ! use tools; then
+		elog "USE=tools controls whether the nvidia-settings application"
+		elog "is installed. If you would like to use it, enable that"
+		elog "flag and re-emerge this ebuild. Optionally you can install"
+		elog "media-video/nvidia-settings"
+		elog
+	fi
+}
+
+pkg_prerm() {
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+	use driver && use kernel_linux && linux-mod_pkg_postrm
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: x11-drivers/nvidia-drivers/, x11-drivers/nvidia-drivers/files/
@ 2017-09-27 16:11 Jeroen Roovers
  0 siblings, 0 replies; 33+ messages in thread
From: Jeroen Roovers @ 2017-09-27 16:11 UTC (permalink / raw
  To: gentoo-commits

commit:     b29df90d1b5d2929c26f42feec6964b0dd5829fc
Author:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 27 16:10:30 2017 +0000
Commit:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
CommitDate: Wed Sep 27 16:11:10 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b29df90d

x11-drivers/nvidia-drivers: Version bump.

Package-Manager: Portage-2.3.10, Repoman-2.3.3

 x11-drivers/nvidia-drivers/Manifest                |   6 +
 .../files/nvidia-drivers-375.82-profiles-rc.patch  |  11 +
 .../nvidia-drivers/nvidia-drivers-375.82.ebuild    | 569 +++++++++++++++++++++
 3 files changed, 586 insertions(+)

diff --git a/x11-drivers/nvidia-drivers/Manifest b/x11-drivers/nvidia-drivers/Manifest
index 6ba3b6ba9d1..a224ca98cd0 100644
--- a/x11-drivers/nvidia-drivers/Manifest
+++ b/x11-drivers/nvidia-drivers/Manifest
@@ -5,6 +5,7 @@ DIST NVIDIA-FreeBSD-x86-340.102.tar.gz 12057262 SHA256 d3edf43d6fc518869c35ae8d9
 DIST NVIDIA-FreeBSD-x86-340.104.tar.gz 60305172 SHA256 28c5fdd306e50c3e9ef23f68a63c90be0717231595fa3fec700b00117ba990e1 SHA512 051bb0e0be3a70f3d3265c493c96a1ac249730ce2c1b4a97f7fb4797daa92af066f2bb88b922a80e4a7f5d3e5d37e0ec8ac3f9fdda77e68c905ef55f47ccbc8e WHIRLPOOL 8212e5ff3dafc18e9caad5ce68b7c4eb1881fdfaf64cf7e63bda2d69464e8972097f6cb5be2672bb0a7fad307a44acd0732b77a005e479147fe21f901dab8afa
 DIST NVIDIA-FreeBSD-x86-375.39.tar.gz 59111267 SHA256 ca39ab55716516bbca62fc888ec786745a8df7f346e68703f54e1a42afad733e SHA512 8f5bf9ffc731ca90a2604b80c3974ee123a12d7db9ee9be1811f5e78711798d7a29737a3651406c1c5e24a197d50f2f2fc39d94c8d11f9700900ef13266a5bf7 WHIRLPOOL e6ce83478238b2f6497ed48688531a6ba4bf78baa2d376e6c8a0f04b35039ed1532a4618f8a53c60ab0778330313ca1e9eecb836a4ade4c5b006844386d4b23f
 DIST NVIDIA-FreeBSD-x86-375.66.tar.gz 59154988 SHA256 b664c4796626213e7bee4cace75bf576ffa2943ca26a0414bcf598c8e6ff5614 SHA512 b034d8bb569d7b4f277aabef9d82c7928c345c27fd25b77d5d843f0e587c9e3f641e1860f4459a06ab3e1e68460743d04553ce919b4c8ecd2a3b624875c78c52 WHIRLPOOL 9385aca80b3cf3d00a1b7686a43edcc5c9d7fb20a7223c0642676cb1d084a1cfc19b1e32babfb72b397e651cf3a0ef1adf71f45fc4a8f826476b68407c00497d
+DIST NVIDIA-FreeBSD-x86-375.82.tar.gz 59566154 SHA256 4a5c17bf40f2edc475fadd08ddb2db169f51d8871c62723b082dd9041d801aa5 SHA512 6747bf6d6278c6ed0828c6fdcad5353e516f28384609a3f0a885966707eebb096926a876c17843bfa7626a01a6d4e0ab12c781faf9ac0291771b195c9eb13d85 WHIRLPOOL 8da17a8e56e7cd831da3544633352f74c053bc376fb2d0d803232c035c8bdc98e2e3688b4954ec7875cf30ec303df296d206e155c5dabf1f05e7fe6af9679e3a
 DIST NVIDIA-FreeBSD-x86-378.13.tar.gz 59610253 SHA256 aca461f050950f1a3a81137ec8adf2057deaa20ad166bdd4ce8f3e34616e7a98 SHA512 a0101201089df2bbf5bdc4ded2228dd989da6a47da31c3ec8d55916b1ff3457924555f82c7381934745fdc1b1f8f78e3fc10e5089279eb13423628dbfe560c6b WHIRLPOOL ac67d07d3ffb0959f685b7d59de152ba8fc97e11c30ed3f1a200511bcaf3de1cd1879147f37fde66a1c8d13dd327aac8a9ac78d42cc9656ef79e3180897aaef1
 DIST NVIDIA-FreeBSD-x86-381.22.tar.gz 60112159 SHA256 f309408941c7d393fe51b2356bd424791558b70f8f17f8856fbbefb1bcf74138 SHA512 ffe5882051fad081854e7b7fefe86a4da55b263b2ca217664991a7e0d84ff2f22d62a37c89afd578f3c99c12be897e5db7a3d1c71c747df655af8e220eb983fa WHIRLPOOL 42bd9205e28d067b1f7417607da21cd66411cefbd1cec74807bbdcee2255e758df2eb15f79a0c3fe1dde7d9f010cfcf648bb6a5890b4637ea7f799cc0810340d
 DIST NVIDIA-FreeBSD-x86-384.59.tar.gz 63257550 SHA256 0ae4aeb3beab6be586cd76f193d03ee7aa7397c66bfcdc84ab6629f808543bb0 SHA512 00598c3fe0d2361e0a8cf945fee19edb884c3bba059000d5103ea45c1f36a06238017752130ac7d8cdca0a7be87109dbb76b5cd318a5263495cbf0b91fc45fb9 WHIRLPOOL 12a9d4d5fbe5af9370e40ecea9fff7b9ffd868da988dd69bc9ad9b27529401a7f910f7013cb1a3765b5edd175c9c97eab0ecdce858c44adf5d8e6450ddcb38ee
@@ -17,6 +18,7 @@ DIST NVIDIA-FreeBSD-x86_64-340.102.tar.gz 60862932 SHA256 6d1108c2e8d1b25eb16cd8
 DIST NVIDIA-FreeBSD-x86_64-340.104.tar.gz 61176133 SHA256 93b8ff6dacf1aa9f3b47af7bbcc09397ead6614edff46c85f2f1c5d5aec9a59d SHA512 d7535527fb9ffc820509da8d0b159c70627c72a7182c354448851a334fcd5b8835046d0e9812079af2fa92de0f3fce299a67e70ef50697a2a1f33b8d995e7f73 WHIRLPOOL 942075e9075879eb4656ee1ca612a0500f90d824cfc77018ee9e2dff804341f5fcd853e200deb0525fd0ecc394d99b15f31f6203854d0a4b0103c187961a74d6
 DIST NVIDIA-FreeBSD-x86_64-375.39.tar.gz 58308585 SHA256 0d58c450b3391cf28655f15505aaca8d011590efe5dd3ebc6a3212a9d7597b17 SHA512 2b9e4fe4c850c59050d6f586be743e6e9511d12ee3e5f760b6c6ef5ff2084b7bc147267a7844191db1bfab842806a47054ce8f7534d5fee614efbf08e1faaca4 WHIRLPOOL fe195242a1a3657609eb9ea0eda27daa22fcc40beaa35e3cfcda575978361f68da27a46411ad38a93bef333bba91c06b911545d4d14f19b3dd2d085ae7012408
 DIST NVIDIA-FreeBSD-x86_64-375.66.tar.gz 58343065 SHA256 f6977d58d57818c27989d0c87dff0bdcb348a57ac18e0607ba03fa7489caa089 SHA512 7a222192c04c6cc3fb7818caebb45b4f4e3c9f702bcc14400cc9a7d3d83daae40ff254b70b3845a44fa120b702734b4619f5d4c5a8d25300becfc5f73710f3e9 WHIRLPOOL c77b5457bf4c053baefe1cf676baf47b318cfbfb8c323a8f6d270a36d8119d7843d5e28313c0b011feb9f19aea430d3f37e5b7798304ec174b996871876445e1
+DIST NVIDIA-FreeBSD-x86_64-375.82.tar.gz 58748290 SHA256 e58490883350a1bb713cdfafb31c377a33033f1a92b61a4111bf31e721d2e65d SHA512 5e2b42ff63e06219764db8187203ce1a2c3c8b478be31fc713ef396e8f8d46def9b2631d7989866740bd0c6a81bbf5d2ed083c14cfa7171c0d993553ca6f431c WHIRLPOOL ae9392648677d229ac920ad74ca1b59f330ffdb51b4a445b8c6f0efe95430810d5041f6d61ffa97350f9b167ab18a3a96c115a19b5aff7d390aec43de95d76cb
 DIST NVIDIA-FreeBSD-x86_64-378.13.tar.gz 58779963 SHA256 451b9e4b2da86609c760a9a133efa8d37d844ad036299689f007c90463a7ca39 SHA512 34cfc383ba196ecec2cd27fc12bf30dd58f8782b73414e7b4c182e832ae0dce1f8c017afbb2101d7525d4e321f80cac49d3b578a8fc0cf88be9310f4deb77057 WHIRLPOOL 23929abd50467f267cf6b7d58a49fc6f667036b7e92363cc05b021790d0d5ebc61e181c3b2e7c32a6338328cfcc05311d74112b005d638c0295b2c6189dfa3b8
 DIST NVIDIA-FreeBSD-x86_64-381.22.tar.gz 59284579 SHA256 f63001f380055da84eec7aaeddc13442a004ca6979adbfec46d3efac4bad7116 SHA512 51c5a87fabe87ec7f2589ed97d97447b127ecb5fe501c60bc7c9fce74141c127f4f9bb820d2a9b34fb56db436476d0cb18a73845ab4e7ec2315d4975c8ce4e32 WHIRLPOOL 40e1c62b9c8b1d5b20eaa1737285e1ce01e912b013c1aae7c9167e6d240cce5a461fd955e5583065a206abf6d6b195c8916464ce1dd4a53bb5ee94de3679373e
 DIST NVIDIA-FreeBSD-x86_64-384.59.tar.gz 62465295 SHA256 325612d3fa039b34f6f6e817eccfa03ef0b45346acf14e5d6daf01a6d4f4241b SHA512 ac2dac82e24e192812dd2f0c3c33d5ae06e41ec8f8f23c26a4d617e92494cb5509c9499c934355823261daa1ab9e98f68b804efadff86e99cf7d093b8125875c WHIRLPOOL a4bf1c3980699ab355788063ba184ab142ba8f0efd2398c38f9e1def875558bb67fb8d92df761da56ff84464d5b38eef7962f36219b7c311ad05d9d3dbe56fe8
@@ -24,6 +26,7 @@ DIST NVIDIA-FreeBSD-x86_64-384.69.tar.gz 62681463 SHA256 d312cfa6892c83cf8fcf055
 DIST NVIDIA-FreeBSD-x86_64-384.90.tar.gz 62724143 SHA256 b213fe40c3df81a8391bfa81fd2763a878f28e846c8dcd65fd922ad6dbbeb3e5 SHA512 0077ba72301b65fb898fa180d77ff6abcb2a78e62c3528e3afbdfb679248f34e6a00faefeec713e7cc4a7daa7c15e6039090e5dbb047d6a9f2cff38c2e8afdb9 WHIRLPOOL bbf04cf8603a1cce37eeefd918f7252bd024098c4a2b12d3513391e3d793c6cc0d82b0ba0018409fb16dfec2a7d3cd1dfa6711eb7a6afc7e0afa3f4601b05f53
 DIST NVIDIA-Linux-armv7l-gnueabihf-375.39.run 25350238 SHA256 52f512bbb3e2d5747df9b294667df9975564408c5ce4f3124aca7dba4355a3a9 SHA512 d888ab0c81c53138eec06e25be683798b5459a6862affa92429feb1e63fcd4cd7ac76bd78eff8c1bef245a25a6a7eb77994ad99c15ed65e8be1a64b3e4c45030 WHIRLPOOL 5714fdcd9e226a336e0abd46bd8a91eef486fc14de543a98d284b3ae3955e924dbde10a08144309b6c0b4e19fcb011bffb8c046a05cbe05f6123b22d270e2939
 DIST NVIDIA-Linux-armv7l-gnueabihf-375.66.run 26668661 SHA256 eb9ac4a3e7dad9f1a149eb04a4d6668b73b75b0e12cca41f12ac52db3e39981b SHA512 fa60b385f7ae79de28e6cb452c249c26a6dbec72f0ab1f31fa89fbea937e5bb13303b32e275384d834b524e58d47fb18497e0920657307a89f9cebe8aef96909 WHIRLPOOL c34e92a43601240dca0dfd2d14f75ce828b12c2da80dbafaf67c6437ba54dc214ca69ce0d0f1a8bef883539ec8430761055b0cf60d9a4502544b39d98bae9648
+DIST NVIDIA-Linux-armv7l-gnueabihf-375.82.run 26650801 SHA256 d3419a636806915e809ccefd4a0566f3e21bf15ee21f39f1bf9411b041d48f05 SHA512 28554f1c24fe63c9257c0de3e84e4e739a45bf1c20ec7a53bc2c1b69b4e2355675061491ef5b03f3ae489cf623e553cfa68442f5536f137837327036d1c53d63 WHIRLPOOL f793a6eb559302289a01e39072927a45d1afb01ea086944ef243acf14000c989ecb4df26b55079764ad98c581ef5ae64d50ff7913c27895e0e216e9ffb25dea1
 DIST NVIDIA-Linux-armv7l-gnueabihf-378.13.run 26514235 SHA256 399abf527d84e4b4d01ea66e0de4a1f9b1b39871b180ef3bf99c4718ebe3db91 SHA512 253786a821df85fa926ae842114321b3c70502f887ea7c2b6790dfe3836039ee5d390e6722ca8785904ec6487e465916923d3042dc6191b3b4522c3161b80cb0 WHIRLPOOL 154b13ecb368716980ab779894942831c13e4b2d47c1d5765ab14590663b34be1571df7934e1277c9a29cdfe93e209a04e2a9fed2830c407a42547433fd9e721
 DIST NVIDIA-Linux-armv7l-gnueabihf-381.22.run 26815484 SHA256 246272d7da8f60564f4a0776fb3af82652add9e0ced8f856dc6530f97e97a748 SHA512 934cda37c7aed26243b5b661122e1c060de5b4df890aaf2295b6650dddea37cb4f0e3f0bebddb00b5d687b66ab5e028a203195c4d4ad3379593babda42febe77 WHIRLPOOL 33f5f0b0a9463419a2dcc6b2d6026607e28b13982fd0e26ffa797d9ba3ea6aab045b52523a653aea8378d31cd787628db1707c33df61c5d9b9943c07dde209aa
 DIST NVIDIA-Linux-armv7l-gnueabihf-384.59.run 28594162 SHA256 d77e90d34f1110208716c9cb1a208cc066ac5beb6055c5c9ffed538a534b34c2 SHA512 7ac7f42d5e203e22603682660e0e641f08aa9321ff7be0421d23a19af0b9d8d9efe53d4194ff65467fbb419910d64fe711d5b2a1583de987f3e73c1827bea2fe WHIRLPOOL b703954018f3139f2c92d72cc6f04a5a676fe7f75fb38c6b4782adb673f84f1df4ad73360a635df121ba9f7d0e364b79c018271909af286b5c7a042e2205749f
@@ -36,6 +39,7 @@ DIST NVIDIA-Linux-x86-340.102.run 38779756 SHA256 61b13d5dae0f6f5d788a4d8c4c98e8
 DIST NVIDIA-Linux-x86-340.104.run 38823602 SHA256 e39015f8e2c6c87037be340fd1899f703ac15356c5694ad8187cd67e71491cd1 SHA512 8dacd5345a5794e862f4106ab9e8e402defa7883dd176c243d019209b560fe955d7576a13936364c01c5a249f15df58208308c9378c12c3438784376e5fb806c WHIRLPOOL 8ec9722a0f986c902483c0a88db336f8bf6710e713f20606f309ee5682f6cc1d384054ea057720faff0eab211c69a30ca297a3776b67f3b8712e36bdcd298d38
 DIST NVIDIA-Linux-x86-375.39.run 44434734 SHA256 7f33f6572c5c5c57df71531749c7339309a2097918375685ea8018826cf19456 SHA512 0f4e784f69f7b4c4696b62779892d8e77aef0adb701dcf5e844027e3a1870aa56bb913bc05f30b079c2519bdda87fa0096d612e9d74ea35b97882fc54fa5d2ca WHIRLPOOL 1d1e6a49d86a72f38d3c84a0b75735c9b64b0bbc75bc54e91318b316298609dd34ab3affff5795fedba44133536e22bf287a76d8271bf0cee990204a383e8a93
 DIST NVIDIA-Linux-x86-375.66.run 44495924 SHA256 29220e249a308f89c2a6fa48be6a0009d58f082d07d3fedfbf4ab0015559f14c SHA512 9f890529cba18197dfb340cefdbb058fd7d4edae39c1ef19a398aaba782e66993257a9f3e93b3f43eb51463492644c0cdf2c5a4af612d6401ebc5427783ef94a WHIRLPOOL bc323f86c99c83f2e3ad3b28f47adfb483988dbcc8e828aedf0e57d1a98a0b7aaf93055076abe2c92f614744309ff47a76edbeb38567cf1daa04c85094abe3dd
+DIST NVIDIA-Linux-x86-375.82.run 44633335 SHA256 620629a35b1773e7eefddb9ea7982a4a75ecf65c1ea6f7ba83b94a84b269f561 SHA512 cbd6edd7490e0e5ef9dd2020c18eb5f75412993e06b9c4f1919f49a8ffdc36131a96d868ab51691fb5c4a661e826b000ec93363c9b168304f6498014e300bf24 WHIRLPOOL e32fc6ab5a76b1b5ccaebebaa1a46a99bdc25eefd824e095fe07b8bf30dc0644cf6e55c54b0d33cc89de598e8c154b5f285b0db863a8e7384923f3e716504b9c
 DIST NVIDIA-Linux-x86-378.13.run 44397547 SHA256 05e62a6098aac7373438ee381072253a861d56522f74948c2b714e20e69a46b1 SHA512 b96d2558a1003a3c66cade3a1e16abd34d855c0e27cdebacdc0495e0ba3cd5c68bb84cc5f81bff1b9ddce36ac52e0dc125c56d868b77d7c8e2f606d559b13b4a WHIRLPOOL e8231978664cec766813821c0f363ef437ba627debc2d2664164fe44c344c480c50799710dbeeee782fdacdb66b16317d69a9dec4f21d347dc40e471201b3ed1
 DIST NVIDIA-Linux-x86-381.22.run 42931990 SHA256 7b7dd6ee1c871dc5367fc207bba65077c3820a683decbfe6126fc70c0d1b9d08 SHA512 15723bfa25b0f39224ad5098c784a292abe4bf1daafaeb2f1df910bbab466e666b848b12e50b0bdd45f83e2d81957425a63501550b3dc5eb8fe3e576a8a10d22 WHIRLPOOL c01bec46411e3fc7f29cb38c6a16c8d50a3979cac1ce6a9e58feeb5878f6388f955cb95e0ecf71482c0fe9c1f57c989ecee6825bf921a0cf95c242f0a1ed3c23
 DIST NVIDIA-Linux-x86-384.59.run 47228533 SHA256 0c17658a4f874df43c02b521cd0a1357dfe2ea0b553be6b47ebae2e45323916c SHA512 09ceccb8c5bc136bb8ba75b8a15fc0cc08eb3680b6c5233b3dca4a1c55d14461d9adee2c686baff4173c8947c0bbc6dd52fcff5c1715a157015ecf4e802b214b WHIRLPOOL 72c05dfd9524a6551cf36fb2d1a8314414d756ee78735882aafee3c9f22ce906afacdcd0c38d781ff7056e330b14f71e5419fabdfa2811bd9cf7035e40ed0127
@@ -49,6 +53,7 @@ DIST NVIDIA-Linux-x86_64-340.102.run 69960567 SHA256 2b96d2f26c00405471e0ce10dca
 DIST NVIDIA-Linux-x86_64-340.104.run 70085947 SHA256 baf131979e3eafb65239aa1863751d5893906eeb617ce7fb37253d69fa2b66a2 SHA512 3f7609e7a736ba7d77f96ea5561789113878c5cb85b2970ad5ae63acdd09c0f5bc6449a5ed7d948f85d684870dcc2b479c4e0d7d750a47dfd716940de72dba3f WHIRLPOOL a1ed77fea5740ae68ea1f226fbb2b6601394f23f475da4d18da55c022f5a83daf87241c9a06051607dfd301bcfb5885d1672da838bd436fc506b993b762e1c69
 DIST NVIDIA-Linux-x86_64-375.39.run 77264092 SHA256 91be5a20841678d671f32074e2901791fe12c00ce1f3b6b3c4199ce302da85a7 SHA512 9a7e865db44f8e65be257b26250adcdf6f3dfac4e164f14a42b8e03c576016dfedf152d6a6cb84fb3ae9930d2b4ba472a63cf32d557395ff7fa429d9b8c9ccd0 WHIRLPOOL 03a27813464847958d9d2adb0bc260e31c6458df18e567c4c36e1eac5f7288108f88147cf1115f360b159a6d0ab459692abb35a79879e19fec2db30709802df1
 DIST NVIDIA-Linux-x86_64-375.66.run 75096990 SHA256 59e37f570ba5f3d7148028e96684d77f347d49a54e3722189782fc9b17d201c0 SHA512 518534816da3e20e9b539e19b0e93340b6141aebe76989139aa130883106a68da74f9ef3692419e0b3c111a7c50ceb20e45ecdde53af78c7c709b4d51acb5164 WHIRLPOOL b09f2f0b32735e761e7508091d3e83c3b6f3224213a0cf7d83df914d581ef390a110cd2015dbec8cfb5f87ff1e0924d2d93335f8f9862ed65f6da867c236bd25
+DIST NVIDIA-Linux-x86_64-375.82.run 77461911 SHA256 11c40ea70d13d5b251531875afa264a2347f2fd122f7fd68c71d50861c7df2c3 SHA512 6da63b807d6dd7cc8ac2b794d5c9ab8383e3c0ce6a47adc600941545509fb40b5f06344781afc895bd83f2780b2bce187994df5684db2890f50b41adfee8f910 WHIRLPOOL e95000830bde425b61c3c7f9f1e99eff10ae26b2467afd35aebb95735182cf4f3b56900f0c6e808616089121138fa17b3c83ceec414fde379676815f67bd9cc8
 DIST NVIDIA-Linux-x86_64-378.13.run 76239469 SHA256 3de379249ef25a8c10a24be2718bf1cb2e338da204e37874c4a0c66dbcdf42ee SHA512 2f6789aa0a400c035c0a074631dc5c26abb4f8a62efe928ca3a2865b89d29acfc09c27f23a664e438275e4bfd25c261745d4d495f9aca5f54ee6c53a389059d2 WHIRLPOOL 6e8dcc7be0981591f377babbd9e1430fddeac9a42291f36a95243d418882bc8b38a1e692e2fd62d4b785feca93165e54a64c015bd99193c699831465f512b180
 DIST NVIDIA-Linux-x86_64-381.22.run 76581130 SHA256 1a3ea8a19fbf650774e5ecd86caa5ef950971958226ed04020b0e6e29b4dd28d SHA512 669a3dd0896d68ba8eef4689b01971b92ec1c54e6cf2a9ff8d3f281ae9f2fe402f079e76109b65e698d76798bcc7a9bb43da9d128fec59ac1fafafd1c4a1e42c WHIRLPOOL 6e80c1fa813bf2930c3d47198e0e382c96ed5c5bc7ba9713e55e61e3fe2ab12c7b28526b4940b15b74e19169c1579151272bdc4033641158012c8f6a56736c3b
 DIST NVIDIA-Linux-x86_64-384.59.run 81794848 SHA256 7b53bdee6e396cb271b57f77455fe5c561e655ca3fbba015dae0de3d6c11542b SHA512 e31c8e08b43131f6ed6c092a7e9086a1fc029ae06b3ec3cd059e939e890b177fc782414114dc432142354c96d1fddf43d90b20da03308fa7a96dc2830fade786 WHIRLPOOL 5816ccc8e6e7b1d0f7f3c8404e917fc5a6d6488e0a69a6b00e5b965926ba236dc770364528007e2af190d2a5f586d3a60328871e76291e4eee83a04bedda46f8
@@ -61,6 +66,7 @@ DIST nvidia-settings-340.102.tar.bz2 1550093 SHA256 2895d4e2597a6ea0c425d74c7a08
 DIST nvidia-settings-340.104.tar.bz2 1549760 SHA256 b3eb8335dc6476bf5804f936f725320e2ca0d8d19ba7f5a4f35134ba6bc477ef SHA512 d4277ef0ce87ee7baf2c5155ca8d93e8db2483329053c541b6a605653f4a6883aad81ebdc45b4c60aa78b72bd4c6c88e5b1327cc4cd2f540fcee8dbd7edc3e53 WHIRLPOOL 4ef3ceb3f069c4b61f3a0c1557951a93890fc287bfa34ffca215c06bcd0c88537238f2b576ece9d42ad718e1d314eb0e7675922e900767d07d25574f805b2609
 DIST nvidia-settings-375.39.tar.gz 2112268 SHA256 71b651872f2f56dcb6f2c0498543da22027d71d0d5dce3b6a4e98425d0ec6d4c SHA512 e445bbdbfcca70b3e1f478219d3f13c5bea543e3b4d5c4a986f3e97ffd6d0c7cf78da98991316b81924b05d201f1dba48deec6263e0c28a2fb6d520008e390a2 WHIRLPOOL 6191581851e43ece748d670731566fbdeae77446cc54be1d48caf5c4f66e543409266ca54c1aca06a72ce4dfc9fa5a47a6d66783234a3a84d388a8b11e43cffa
 DIST nvidia-settings-375.66.tar.gz 2114252 SHA256 3a93d845be4a94f03e9768ee78d9f24ef8bd302e30b66e81a5a784356dcc36e9 SHA512 93933a86faa3525d99176e08a8dd943b06b7c4236e85636a765e2a1476d3f22afbfc1066208987542fc5dd26c9bb3239a75838add8c64f6abc4cdea5c02338e5 WHIRLPOOL d1c36169edf682c2a2872122a9d42654cd88f36048cdaf9b6ab6c13276301eb545f04092bc39d52c35890d11ad4acd3eb48f013b16ccfa8f3d5ce32f251b690b
+DIST nvidia-settings-375.82.tar.gz 2114647 SHA256 11cc6afaa2472520090d966910fc1b0465c6cc903fe05ed80b3f54924a106b69 SHA512 7a374be56c8be52767d73a048029d9e55dc2abcf2f6a97eb4931544c927c85a1103a206be9e8d1ffcef36fec2caf2416f33699ad4d51e7dca17e4e844c37a595 WHIRLPOOL 2eb7de30119615460ffa4f37cd35f515e493c34b4c7e8d110b64a17bd919f32372f601f8418acbeb6021adb37528c5ad09da8678c569e72dddf9eff174b88c06
 DIST nvidia-settings-378.13.tar.gz 2112676 SHA256 a446ec3553f3fd16f60a0cf42cf9cf078cb3911595bb518649c489334422e85a SHA512 6f5fda9c54b067e21f2c869bcfb7c799c99f584d769020cb15e8764f59183e6a6469919ec48bce47be2144910d0004a9ca221df4a9e4fa9ab9f18710b36fa420 WHIRLPOOL 2eb475a8808bdc8380eb92c4189f2ca5aabc839d466efaaaeef6737aa8a75014e3252fd3d4a1344cede268c3bafa52ddb07057aa500ac6f626382e220326474b
 DIST nvidia-settings-381.22.tar.gz 2127491 SHA256 83cade551b43055bf93d7ca7e5911a4c61a9e7bea7d88b4c57aa885e82165e29 SHA512 79cd41b9c0e63b69574caddb62437132810ecb4cd07b90899976ae8535948f28d72021fc9a6969559909cf0f7a5d411b0202782970d64a82c636e7738c9d5681 WHIRLPOOL dfd0a4c568aa6ff1946fbe7c68f0c8cf8721c46bbe5dc82987ed900ca4b275781e7d1784e3094472ad9748c4008b5639791dcf51993b73aaeb03ce9a8e3a524c
 DIST nvidia-settings-384.59.tar.gz 2133723 SHA256 2ba5d254b2cbc35aca7862f6d7cbac8b6aabd9c082f7feaff7fba7b3a6a32caf SHA512 5556858f02f5d2b7a5b2fb6073902e98dc7d39267186cc47b810f07463e8507162bdffdf20f15e569766f05b411376a9002796979fc35a01b30aed821f0c3c47 WHIRLPOOL fcfd47ef9b5c3b9b40d62f3f7ec801d65c4efb99756dc727d5c050b1ae12a6fface409188b041c97b6e2d6daa3011d6e0b09cea6b1d7bee48907df38ce02101b

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-375.82-profiles-rc.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-375.82-profiles-rc.patch
new file mode 100644
index 00000000000..552f0d6df0e
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-375.82-profiles-rc.patch
@@ -0,0 +1,11 @@
+--- a/nvidia-application-profiles-375.82-rc
++++ b/nvidia-application-profiles-375.82-rc
+@@ -48,7 +48,7 @@
+         {
+           "name" : "NoEnforceShaderInputOutputMatching",
+           "settings" : [ "GLShaderPortabilityWarnings", false ]
+-        },
++        }
+     ],
+     "rules" : [
+         {

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-375.82.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-375.82.ebuild
new file mode 100644
index 00000000000..59ee6f6b715
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-375.82.ebuild
@@ -0,0 +1,569 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit eutils flag-o-matic linux-info linux-mod multilib-minimal nvidia-driver \
+	portability toolchain-funcs unpacker user udev
+
+NV_URI="http://http.download.nvidia.com/XFree86/"
+X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
+AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
+ARM_NV_PACKAGE="NVIDIA-Linux-armv7l-gnueabihf-${PV}"
+X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
+AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
+
+DESCRIPTION="NVIDIA Accelerated Graphics Driver"
+HOMEPAGE="http://www.nvidia.com/ http://www.nvidia.com/Download/Find.aspx"
+SRC_URI="
+	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
+	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
+	arm? ( ${NV_URI}Linux-32bit-ARM/${PV}/${ARM_NV_PACKAGE}.run )
+	x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
+	x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
+	tools? (
+		https://github.com/NVIDIA/nvidia-settings/archive/${PV}.tar.gz -> nvidia-settings-${PV}.tar.gz
+	)
+"
+
+LICENSE="GPL-2 NVIDIA-r2"
+SLOT="0/${PV%.*}"
+KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
+RESTRICT="bindist mirror"
+EMULTILIB_PKG="true"
+
+IUSE="acpi compat +driver gtk3 kernel_FreeBSD kernel_linux +kms multilib pax_kernel static-libs +tools uvm wayland +X"
+REQUIRED_USE="
+	tools? ( X )
+	static-libs? ( tools )
+"
+
+COMMON="
+	app-eselect/eselect-opencl
+	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
+	tools? (
+		dev-libs/atk
+		dev-libs/glib:2
+		dev-libs/jansson
+		gtk3? (
+			x11-libs/gtk+:3
+		)
+		x11-libs/cairo
+		x11-libs/gdk-pixbuf[X]
+		x11-libs/gtk+:2
+		x11-libs/libX11
+		x11-libs/libXext
+		x11-libs/libXrandr
+		x11-libs/libXv
+		x11-libs/libXxf86vm
+		x11-libs/pango[X]
+	)
+	X? (
+		>=app-eselect/eselect-opengl-1.0.9
+		app-misc/pax-utils
+	)
+"
+DEPEND="
+	${COMMON}
+	kernel_linux? ( virtual/linux-sources )
+"
+RDEPEND="
+	${COMMON}
+	acpi? ( sys-power/acpid )
+	tools? ( !media-video/nvidia-settings )
+	wayland? ( dev-libs/wayland[${MULTILIB_USEDEP}] )
+	X? (
+		<x11-base/xorg-server-1.19.99:=
+		>=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
+		>=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
+		>=x11-libs/libvdpau-1.0[${MULTILIB_USEDEP}]
+		sys-libs/zlib[${MULTILIB_USEDEP}]
+	)
+"
+
+QA_PREBUILT="opt/* usr/lib*"
+
+S=${WORKDIR}/
+
+nvidia_drivers_versions_check() {
+	if use amd64 && has_multilib_profile && \
+		[ "${DEFAULT_ABI}" != "amd64" ]; then
+		eerror "This ebuild doesn't currently support changing your default ABI"
+		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
+	fi
+
+	if use kernel_linux && kernel_is ge 4 12; then
+		ewarn "Gentoo supports kernels which are supported by NVIDIA"
+		ewarn "which are limited to the following kernels:"
+		ewarn "<sys-kernel/gentoo-sources-4.12"
+		ewarn "<sys-kernel/vanilla-sources-4.12"
+		ewarn ""
+		ewarn "You are free to utilize epatch_user to provide whatever"
+		ewarn "support you feel is appropriate, but will not receive"
+		ewarn "support as a result of those changes."
+		ewarn ""
+		ewarn "Do not file a bug report about this."
+		ewarn ""
+	fi
+
+	# Since Nvidia ships many different series of drivers, we need to give the user
+	# some kind of guidance as to what version they should install. This tries
+	# to point the user in the right direction but can't be perfect. check
+	# nvidia-driver.eclass
+	nvidia-driver-check-warning
+
+	# Kernel features/options to check for
+	CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
+	use x86 && CONFIG_CHECK+=" ~HIGHMEM"
+
+	# Now do the above checks
+	use kernel_linux && check_extra_config
+}
+
+pkg_pretend() {
+	nvidia_drivers_versions_check
+}
+
+pkg_setup() {
+	nvidia_drivers_versions_check
+
+	# try to turn off distcc and ccache for people that have a problem with it
+	export DISTCC_DISABLE=1
+	export CCACHE_DISABLE=1
+
+	if use driver && use kernel_linux; then
+		MODULE_NAMES="nvidia(video:${S}/kernel)"
+		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
+		use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel) nvidia-drm(video:${S}/kernel)"
+
+		# This needs to run after MODULE_NAMES (so that the eclass checks
+		# whether the kernel supports loadable modules) but before BUILD_PARAMS
+		# is set (so that KV_DIR is populated).
+		linux-mod_pkg_setup
+
+		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
+		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
+
+		# linux-mod_src_compile calls set_arch_to_kernel, which
+		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
+		# expects x86_64 or i386 and then converts it to x86
+		# later on in the build process
+		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
+	fi
+
+	if use kernel_linux && kernel_is lt 2 6 9; then
+		eerror "You must build this against 2.6.9 or higher kernels."
+	fi
+
+	# set variables to where files are in the package structure
+	if use kernel_FreeBSD; then
+		use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
+		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
+		NV_DOC="${S}/doc"
+		NV_OBJ="${S}/obj"
+		NV_SRC="${S}/src"
+		NV_MAN="${S}/x11/man"
+		NV_X11="${S}/obj"
+		NV_SOVER=1
+	elif use kernel_linux; then
+		NV_DOC="${S}"
+		NV_OBJ="${S}"
+		NV_SRC="${S}/kernel"
+		NV_MAN="${S}"
+		NV_X11="${S}"
+		NV_SOVER=${PV}
+	else
+		die "Could not determine proper NVIDIA package"
+	fi
+}
+
+src_prepare() {
+	eapply "${FILESDIR}"/${P}-profiles-rc.patch
+
+	if use pax_kernel; then
+		ewarn "Using PAX patches is not supported. You will be asked to"
+		ewarn "use a standard kernel should you have issues. Should you"
+		ewarn "need support with these patches, contact the PaX team."
+		eapply "${FILESDIR}"/${PN}-375.20-pax.patch
+	fi
+
+	local man_file
+	for man_file in "${NV_MAN}"/*1.gz; do
+		gunzip $man_file || die
+	done
+
+	# Allow user patches so they can support RC kernels and whatever else
+	eapply_user
+}
+
+src_compile() {
+	# This is already the default on Linux, as there's no toplevel Makefile, but
+	# on FreeBSD there's one and triggers the kernel module build, as we install
+	# it by itself, pass this.
+
+	cd "${NV_SRC}"
+	if use kernel_FreeBSD; then
+		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
+			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
+	elif use driver && use kernel_linux; then
+		MAKEOPTS=-j1 linux-mod_src_compile
+	fi
+
+	if use tools; then
+		emake -C "${S}"/nvidia-settings-${PV}/src \
+			AR="$(tc-getAR)" \
+			CC="$(tc-getCC)" \
+			LIBDIR="$(get_libdir)" \
+			NV_VERBOSE=1 \
+			RANLIB="$(tc-getRANLIB)" \
+			DO_STRIP= \
+			build-xnvctrl
+
+		emake -C "${S}"/nvidia-settings-${PV}/src \
+			CC="$(tc-getCC)" \
+			GTK3_AVAILABLE=$(usex gtk3 1 0) \
+			LD="$(tc-getCC)" \
+			LIBDIR="$(get_libdir)" \
+			NVML_ENABLED=0 \
+			NV_USE_BUNDLED_LIBJANSSON=0 \
+			NV_VERBOSE=1 \
+			DO_STRIP=
+	fi
+}
+
+# Install nvidia library:
+# the first parameter is the library to install
+# the second parameter is the provided soversion
+# the third parameter is the target directory if it is not /usr/lib
+donvidia() {
+	# Full path to library
+	nv_LIB="${1}"
+
+	# SOVER to use
+	nv_SOVER="$(scanelf -qF'%S#F' ${nv_LIB})"
+
+	# Where to install
+	nv_DEST="${2}"
+
+	# Get just the library name
+	nv_LIBNAME=$(basename "${nv_LIB}")
+
+	if [[ "${nv_DEST}" ]]; then
+		exeinto ${nv_DEST}
+		action="doexe"
+	else
+		nv_DEST="/usr/$(get_libdir)"
+		action="dolib.so"
+	fi
+
+	# Install the library
+	${action} ${nv_LIB} || die "failed to install ${nv_LIBNAME}"
+
+	# If the library has a SONAME and SONAME does not match the library name,
+	# then we need to create a symlink
+	if [[ ${nv_SOVER} ]] && ! [[ "${nv_SOVER}" = "${nv_LIBNAME}" ]]; then
+		dosym ${nv_LIBNAME} ${nv_DEST}/${nv_SOVER} \
+			|| die "failed to create ${nv_DEST}/${nv_SOVER} symlink"
+	fi
+
+	dosym ${nv_LIBNAME} ${nv_DEST}/${nv_LIBNAME/.so*/.so} \
+		|| die "failed to create ${nv_LIBNAME/.so*/.so} symlink"
+}
+
+src_install() {
+	if use driver && use kernel_linux; then
+		linux-mod_src_install
+
+		# Add the aliases
+		# This file is tweaked with the appropriate video group in
+		# pkg_preinst, see bug #491414
+		insinto /etc/modprobe.d
+		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
+		doins "${FILESDIR}"/nvidia-rmmod.conf
+
+		# Ensures that our device nodes are created when not using X
+		exeinto "$(get_udevdir)"
+		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
+		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
+	elif use kernel_FreeBSD; then
+		if use x86-fbsd; then
+			insinto /boot/modules
+			doins "${S}/src/nvidia.kld"
+		fi
+
+		exeinto /boot/modules
+		doexe "${S}/src/nvidia.ko"
+	fi
+
+	# NVIDIA kernel <-> userspace driver config lib
+	donvidia "${NV_OBJ}"/libnvidia-cfg.so.${NV_SOVER}
+
+	# NVIDIA framebuffer capture library
+	donvidia "${NV_OBJ}"/libnvidia-fbc.so.${NV_SOVER}
+
+	# NVIDIA video encode/decode <-> CUDA
+	if use kernel_linux; then
+		donvidia "${NV_OBJ}"/libnvcuvid.so.${NV_SOVER}
+		donvidia "${NV_OBJ}"/libnvidia-encode.so.${NV_SOVER}
+	fi
+
+	if use X; then
+		# Xorg DDX driver
+		insinto /usr/$(get_libdir)/xorg/modules/drivers
+		doins "${NV_X11}"/nvidia_drv.so
+
+		# Xorg GLX driver
+		donvidia "${NV_X11}"/libglx.so.${NV_SOVER} \
+			/usr/$(get_libdir)/opengl/nvidia/extensions
+
+		# Xorg nvidia.conf
+		if has_version '>=x11-base/xorg-server-1.16'; then
+			insinto /usr/share/X11/xorg.conf.d
+			newins {,50-}nvidia-drm-outputclass.conf
+		fi
+
+		insinto /usr/share/glvnd/egl_vendor.d
+		doins "${NV_X11}"/10_nvidia.json
+	fi
+
+	# OpenCL ICD for NVIDIA
+	if use kernel_linux; then
+		insinto /etc/OpenCL/vendors
+		doins "${NV_OBJ}"/nvidia.icd
+	fi
+
+	# Documentation
+	if use kernel_FreeBSD; then
+		dodoc "${NV_DOC}"/README
+		use X && doman "${NV_MAN}"/nvidia-xconfig.1
+		use tools && doman "${NV_MAN}"/nvidia-settings.1
+	else
+		# Docs
+		newdoc "${NV_DOC}"/README.txt README
+		dodoc "${NV_DOC}"/NVIDIA_Changelog
+		doman "${NV_MAN}"/nvidia-smi.1
+		use X && doman "${NV_MAN}"/nvidia-xconfig.1
+		use tools && doman "${NV_MAN}"/nvidia-settings.1
+		doman "${NV_MAN}"/nvidia-cuda-mps-control.1
+	fi
+
+	docinto html
+	dodoc -r "${NV_DOC}"/html/*
+
+	# Helper Apps
+	exeinto /opt/bin/
+
+	if use X; then
+		doexe "${NV_OBJ}"/nvidia-xconfig
+
+		insinto /etc/vulkan/icd.d
+		doins nvidia_icd.json
+	fi
+
+	if use kernel_linux; then
+		doexe "${NV_OBJ}"/nvidia-cuda-mps-control
+		doexe "${NV_OBJ}"/nvidia-cuda-mps-server
+		doexe "${NV_OBJ}"/nvidia-debugdump
+		doexe "${NV_OBJ}"/nvidia-persistenced
+		doexe "${NV_OBJ}"/nvidia-smi
+
+		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
+		doexe "${NV_OBJ}"/nvidia-modprobe
+		fowners root:video /opt/bin/nvidia-modprobe
+		fperms 4710 /opt/bin/nvidia-modprobe
+		dosym /{opt,usr}/bin/nvidia-modprobe
+
+		doman nvidia-cuda-mps-control.1
+		doman nvidia-modprobe.1
+		doman nvidia-persistenced.1
+		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
+		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
+		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
+	fi
+
+	if use tools; then
+		emake -C "${S}"/nvidia-settings-${PV}/src/ \
+			DESTDIR="${D}" \
+			GTK3_AVAILABLE=$(usex gtk3 1 0) \
+			LIBDIR="${D}/usr/$(get_libdir)" \
+			NV_USE_BUNDLED_LIBJANSSON=0 \
+			NV_VERBOSE=1 \
+			PREFIX=/usr \
+			DO_STRIP= \
+			install
+
+		if use static-libs; then
+			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
+
+			insinto /usr/include/NVCtrl
+			doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
+		fi
+
+		insinto /usr/share/nvidia/
+		doins nvidia-application-profiles-${PV}-key-documentation
+
+		insinto /etc/nvidia
+		newins \
+			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
+
+		# There is no icon in the FreeBSD tarball.
+		use kernel_FreeBSD || \
+			doicon "${NV_OBJ}"/nvidia-settings.png
+
+		domenu "${FILESDIR}"/nvidia-settings.desktop
+
+		exeinto /etc/X11/xinit/xinitrc.d
+		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
+	fi
+
+	dobin "${NV_OBJ}"/nvidia-bug-report.sh
+
+	if has_multilib_profile && use multilib; then
+		local OABI=${ABI}
+		for ABI in $(get_install_abis); do
+			src_install-libs
+		done
+		ABI=${OABI}
+		unset OABI
+	else
+		src_install-libs
+	fi
+
+	is_final_abi || die "failed to iterate through all ABIs"
+
+	readme.gentoo_create_doc
+}
+
+src_install-libs() {
+	local inslibdir=$(get_libdir)
+	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
+	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
+	local nv_libdir="${NV_OBJ}"
+
+	if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
+		nv_libdir="${NV_OBJ}"/32
+	fi
+
+	if use X; then
+		NV_GLX_LIBRARIES=(
+			"libEGL.so.$(usex compat ${NV_SOVER} 1) ${GL_ROOT}"
+			"libEGL_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGL.so.$(usex compat ${NV_SOVER} 1.0.0) ${GL_ROOT}"
+			"libGLESv1_CM.so.1 ${GL_ROOT}"
+			"libGLESv1_CM_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGLESv2.so.2 ${GL_ROOT}"
+			"libGLESv2_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGLX.so.0 ${GL_ROOT}"
+			"libGLX_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGLdispatch.so.0 ${GL_ROOT}"
+			"libOpenCL.so.1.0.0 ${CL_ROOT}"
+			"libOpenGL.so.0 ${GL_ROOT}"
+			"libcuda.so.${NV_SOVER}"
+			"libnvcuvid.so.${NV_SOVER}"
+			"libnvidia-compiler.so.${NV_SOVER}"
+			"libnvidia-eglcore.so.${NV_SOVER}"
+			"libnvidia-encode.so.${NV_SOVER}"
+			"libnvidia-fatbinaryloader.so.${NV_SOVER}"
+			"libnvidia-fbc.so.${NV_SOVER}"
+			"libnvidia-glcore.so.${NV_SOVER}"
+			"libnvidia-glsi.so.${NV_SOVER}"
+			"libnvidia-ifr.so.${NV_SOVER}"
+			"libnvidia-opencl.so.${NV_SOVER}"
+			"libnvidia-ptxjitcompiler.so.${NV_SOVER}"
+			"libvdpau_nvidia.so.${NV_SOVER}"
+		)
+
+		if use wayland && has_multilib_profile && [[ ${ABI} == "amd64" ]];
+		then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-egl-wayland.so.${NV_SOVER}"
+			)
+		fi
+
+		if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
+		then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-wfb.so.${NV_SOVER}"
+			)
+		fi
+
+		if use kernel_FreeBSD; then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-tls.so.${NV_SOVER}"
+			)
+		fi
+
+		if use kernel_linux; then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-ml.so.${NV_SOVER}"
+				"tls/libnvidia-tls.so.${NV_SOVER}"
+			)
+		fi
+
+		for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
+			donvidia "${nv_libdir}"/${NV_LIB}
+		done
+	fi
+}
+
+pkg_preinst() {
+	if use driver && use kernel_linux; then
+		linux-mod_pkg_preinst
+
+		local videogroup="$(egetent group video | cut -d ':' -f 3)"
+		if [ -z "${videogroup}" ]; then
+			eerror "Failed to determine the video group gid"
+			die "Failed to determine the video group gid"
+		else
+			sed -i \
+				-e "s:PACKAGE:${PF}:g" \
+				-e "s:VIDEOGID:${videogroup}:" \
+				"${D}"/etc/modprobe.d/nvidia.conf || die
+		fi
+	fi
+
+	# Clean the dynamic libGL stuff's home to ensure
+	# we dont have stale libs floating around
+	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ]; then
+		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
+	fi
+	# Make sure we nuke the old nvidia-glx's env.d file
+	if [ -e "${ROOT}"/etc/env.d/09nvidia ]; then
+		rm -f "${ROOT}"/etc/env.d/09nvidia
+	fi
+}
+
+pkg_postinst() {
+	use driver && use kernel_linux && linux-mod_pkg_postinst
+
+	# Switch to the nvidia implementation
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
+	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
+
+	readme.gentoo_print_elog
+
+	if ! use X; then
+		elog "You have elected to not install the X.org driver. Along with"
+		elog "this the OpenGL libraries and VDPAU libraries were not"
+		elog "installed. Additionally, once the driver is loaded your card"
+		elog "and fan will run at max speed which may not be desirable."
+		elog "Use the 'nvidia-smi' init script to have your card and fan"
+		elog "speed scale appropriately."
+		elog
+	fi
+	if ! use tools; then
+		elog "USE=tools controls whether the nvidia-settings application"
+		elog "is installed. If you would like to use it, enable that"
+		elog "flag and re-emerge this ebuild. Optionally you can install"
+		elog "media-video/nvidia-settings"
+		elog
+	fi
+}
+
+pkg_prerm() {
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+	use driver && use kernel_linux && linux-mod_pkg_postrm
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: x11-drivers/nvidia-drivers/, x11-drivers/nvidia-drivers/files/
@ 2017-10-07  9:44 Jeroen Roovers
  0 siblings, 0 replies; 33+ messages in thread
From: Jeroen Roovers @ 2017-10-07  9:44 UTC (permalink / raw
  To: gentoo-commits

commit:     21d2f921ba010607b6c4f8e8e6ce85a3843391b3
Author:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
AuthorDate: Sat Oct  7 09:43:45 2017 +0000
Commit:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
CommitDate: Sat Oct  7 09:44:16 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=21d2f921

x11-drivers/nvidia-drivers: Version bump.

Package-Manager: Portage-2.3.11, Repoman-2.3.3

 x11-drivers/nvidia-drivers/Manifest                |   6 +
 .../files/nvidia-drivers-387.12-linker.patch       |  22 +
 .../nvidia-drivers/nvidia-drivers-387.12.ebuild    | 582 +++++++++++++++++++++
 3 files changed, 610 insertions(+)

diff --git a/x11-drivers/nvidia-drivers/Manifest b/x11-drivers/nvidia-drivers/Manifest
index b7e851dfe7d..320bbc5bf58 100644
--- a/x11-drivers/nvidia-drivers/Manifest
+++ b/x11-drivers/nvidia-drivers/Manifest
@@ -5,6 +5,7 @@ DIST NVIDIA-FreeBSD-x86-375.82.tar.gz 59566154 SHA256 4a5c17bf40f2edc475fadd08dd
 DIST NVIDIA-FreeBSD-x86-378.13.tar.gz 59610253 SHA256 aca461f050950f1a3a81137ec8adf2057deaa20ad166bdd4ce8f3e34616e7a98 SHA512 a0101201089df2bbf5bdc4ded2228dd989da6a47da31c3ec8d55916b1ff3457924555f82c7381934745fdc1b1f8f78e3fc10e5089279eb13423628dbfe560c6b WHIRLPOOL ac67d07d3ffb0959f685b7d59de152ba8fc97e11c30ed3f1a200511bcaf3de1cd1879147f37fde66a1c8d13dd327aac8a9ac78d42cc9656ef79e3180897aaef1
 DIST NVIDIA-FreeBSD-x86-381.22.tar.gz 60112159 SHA256 f309408941c7d393fe51b2356bd424791558b70f8f17f8856fbbefb1bcf74138 SHA512 ffe5882051fad081854e7b7fefe86a4da55b263b2ca217664991a7e0d84ff2f22d62a37c89afd578f3c99c12be897e5db7a3d1c71c747df655af8e220eb983fa WHIRLPOOL 42bd9205e28d067b1f7417607da21cd66411cefbd1cec74807bbdcee2255e758df2eb15f79a0c3fe1dde7d9f010cfcf648bb6a5890b4637ea7f799cc0810340d
 DIST NVIDIA-FreeBSD-x86-384.90.tar.gz 63539967 SHA256 84a307e03c7db1eb230538e46c45640f815750141cb3d6bd6cb3f3e68381c31e SHA512 16e333a846f47618f6e732d89bd92fda628c02b28784226a879f23147df764c540c96d2fe517dea465a7d07022df676a009aec22bb09c4439b9ea8b0351c6996 WHIRLPOOL 8ec2fdcdf841a20abb579a65e6e18d1ea405a6edad98a57a9b1baa807d4725b3812b6d540ea6f31b84ae28a12a1117e903f258e8f80d93d5dfff52de0eea8920
+DIST NVIDIA-FreeBSD-x86-387.12.tar.gz 64054985 SHA256 33d78d0c4f58c55d7caeec6ef1f5a6d63e910ff0720264e0c3e56ba45f067275 SHA512 fa92275e4e1795fd91515ca4cd20cb21dfcb273043f115795fdf82f6c39d2ead80848e8b44b711be6a769de2b93bc91f857084dab8f1d1f4cad5245c9bf84913 WHIRLPOOL d3a8a5ed52d91b2d6d5cbe5548fc714d40a0cb85de0d5b4c9094922d01832c5156a593eb79d17e26a91bc5734a80f2ad267f32332f95f16f3ed148cbb1c9327b
 DIST NVIDIA-FreeBSD-x86-96.43.23.tar.gz 15463464 SHA256 18d855db8381eda1a6cf548c9e5095fc5bb8694bf1d6e24fc1072fba4e54cd78 SHA512 42d7b1b76cdb3b23680363e565614a22112162a5dd3639cb804fe670c0c3f3f23595bbefa3f78afdc6a8ca848446dee853c7a355f2c96a0d01b354753ba2785c WHIRLPOOL f8e59ce521990cd9edee441e73f973f074db492952807a0931e362102874cddbb47604ff5c5eb20a0cbde27f9b6d4e440dd12cc2e5a20c9cb65bf3c0b3e62511
 DIST NVIDIA-FreeBSD-x86_64-304.137.tar.gz 36474676 SHA256 231693189e1bdf5c1dd02315cde5ef9ed6c0854564314438f2f40f9788a34120 SHA512 f0ae7ccea417aceedf34bfb9c96fd79b31cbf74a8fa59d5199b0ad7b81b8a4aeb66cd4801a45cc37f836979cb4267aa69e08517beaa9b8cb9c66a477d02ef8de WHIRLPOOL 9eb9036d64bd52ccbc8ce641da57c34ec9165d1f74293bec21be6d874cc8338f785d68a45ae2e8cd1161a34b2c95246c9b5504bdf810dfbfae1814ad35eb6a1e
 DIST NVIDIA-FreeBSD-x86_64-340.104.tar.gz 61176133 SHA256 93b8ff6dacf1aa9f3b47af7bbcc09397ead6614edff46c85f2f1c5d5aec9a59d SHA512 d7535527fb9ffc820509da8d0b159c70627c72a7182c354448851a334fcd5b8835046d0e9812079af2fa92de0f3fce299a67e70ef50697a2a1f33b8d995e7f73 WHIRLPOOL 942075e9075879eb4656ee1ca612a0500f90d824cfc77018ee9e2dff804341f5fcd853e200deb0525fd0ecc394d99b15f31f6203854d0a4b0103c187961a74d6
@@ -12,10 +13,12 @@ DIST NVIDIA-FreeBSD-x86_64-375.82.tar.gz 58748290 SHA256 e58490883350a1bb713cdfa
 DIST NVIDIA-FreeBSD-x86_64-378.13.tar.gz 58779963 SHA256 451b9e4b2da86609c760a9a133efa8d37d844ad036299689f007c90463a7ca39 SHA512 34cfc383ba196ecec2cd27fc12bf30dd58f8782b73414e7b4c182e832ae0dce1f8c017afbb2101d7525d4e321f80cac49d3b578a8fc0cf88be9310f4deb77057 WHIRLPOOL 23929abd50467f267cf6b7d58a49fc6f667036b7e92363cc05b021790d0d5ebc61e181c3b2e7c32a6338328cfcc05311d74112b005d638c0295b2c6189dfa3b8
 DIST NVIDIA-FreeBSD-x86_64-381.22.tar.gz 59284579 SHA256 f63001f380055da84eec7aaeddc13442a004ca6979adbfec46d3efac4bad7116 SHA512 51c5a87fabe87ec7f2589ed97d97447b127ecb5fe501c60bc7c9fce74141c127f4f9bb820d2a9b34fb56db436476d0cb18a73845ab4e7ec2315d4975c8ce4e32 WHIRLPOOL 40e1c62b9c8b1d5b20eaa1737285e1ce01e912b013c1aae7c9167e6d240cce5a461fd955e5583065a206abf6d6b195c8916464ce1dd4a53bb5ee94de3679373e
 DIST NVIDIA-FreeBSD-x86_64-384.90.tar.gz 62724143 SHA256 b213fe40c3df81a8391bfa81fd2763a878f28e846c8dcd65fd922ad6dbbeb3e5 SHA512 0077ba72301b65fb898fa180d77ff6abcb2a78e62c3528e3afbdfb679248f34e6a00faefeec713e7cc4a7daa7c15e6039090e5dbb047d6a9f2cff38c2e8afdb9 WHIRLPOOL bbf04cf8603a1cce37eeefd918f7252bd024098c4a2b12d3513391e3d793c6cc0d82b0ba0018409fb16dfec2a7d3cd1dfa6711eb7a6afc7e0afa3f4601b05f53
+DIST NVIDIA-FreeBSD-x86_64-387.12.tar.gz 63216500 SHA256 d5fe2ee00f496186ce75700eccf95092fc162db1df1c5bdf0dfebb27c4b46d1b SHA512 d2bed412f8db842671d4092b8adc62cfbf2fc5f90560ece109a14965e2e09b73edb3bb06069a779de7988b038697655b9ede7cc4072bcdd3b35a34cf6bb145d5 WHIRLPOOL 8e239043ea7c78560fe30ae57a92925d3badf2c9463718245857b2539b2ff04af4c06e883148ed46dc543b4c15827eb8f231f7fd25640048d09c732fdf59bfe9
 DIST NVIDIA-Linux-armv7l-gnueabihf-375.82.run 26650801 SHA256 d3419a636806915e809ccefd4a0566f3e21bf15ee21f39f1bf9411b041d48f05 SHA512 28554f1c24fe63c9257c0de3e84e4e739a45bf1c20ec7a53bc2c1b69b4e2355675061491ef5b03f3ae489cf623e553cfa68442f5536f137837327036d1c53d63 WHIRLPOOL f793a6eb559302289a01e39072927a45d1afb01ea086944ef243acf14000c989ecb4df26b55079764ad98c581ef5ae64d50ff7913c27895e0e216e9ffb25dea1
 DIST NVIDIA-Linux-armv7l-gnueabihf-378.13.run 26514235 SHA256 399abf527d84e4b4d01ea66e0de4a1f9b1b39871b180ef3bf99c4718ebe3db91 SHA512 253786a821df85fa926ae842114321b3c70502f887ea7c2b6790dfe3836039ee5d390e6722ca8785904ec6487e465916923d3042dc6191b3b4522c3161b80cb0 WHIRLPOOL 154b13ecb368716980ab779894942831c13e4b2d47c1d5765ab14590663b34be1571df7934e1277c9a29cdfe93e209a04e2a9fed2830c407a42547433fd9e721
 DIST NVIDIA-Linux-armv7l-gnueabihf-381.22.run 26815484 SHA256 246272d7da8f60564f4a0776fb3af82652add9e0ced8f856dc6530f97e97a748 SHA512 934cda37c7aed26243b5b661122e1c060de5b4df890aaf2295b6650dddea37cb4f0e3f0bebddb00b5d687b66ab5e028a203195c4d4ad3379593babda42febe77 WHIRLPOOL 33f5f0b0a9463419a2dcc6b2d6026607e28b13982fd0e26ffa797d9ba3ea6aab045b52523a653aea8378d31cd787628db1707c33df61c5d9b9943c07dde209aa
 DIST NVIDIA-Linux-armv7l-gnueabihf-384.90.run 29044581 SHA256 d154bff89275a8781c68dd3ca27a66bb6ebf0c77a4b42418cdd43c6f3500e365 SHA512 4d6f23c1ce4ce26520aa49955959833d630a398df0826cf9b0c1109103fc3c4da1d7c19d1cc826116562bcbfca933f291b300bea377e91f72f15c97e0c6d68f0 WHIRLPOOL b709ec3288803124d1c2caf98d0ec68a23dcae6ac8affece55faa1613985621cd427f90d0f80ecba4fa00b797044b21022f9ab9feca09948d42e9dd1cf2f49fa
+DIST NVIDIA-Linux-armv7l-gnueabihf-387.12.run 29236798 SHA256 3e5ec3398475f15a90fc8f84793ff2c377dbfc05518773c4418307f8476f7e3d SHA512 819d2be341f6615d8ef3b3568a978f9e636723b319a7349f606aa8ca24021dc01d470a314a69efcde328d2f2b5546d35f2d7c633d216bb9137d8820e5f26c9dc WHIRLPOOL 05bc698a24eac81883b5d95637f84fc947d34162f35dadfc5e692dc0e0156176463ecdda38a5098c977f3046581a72f0b8740e6fd6328ad4fc23fb1b250f5703
 DIST NVIDIA-Linux-x86-173.14.39-pkg0.run 15134997 SHA256 a09935f37121ed3db8ae3da63a0d8e9d4348a19c859811c9fe44d6ce8e3eab23 SHA512 e24e15ccec725d3cbca502c2b77061776a81ef92917a950adec4ff6bdc34f10903aa654433177ea74be0dade4af81c5380d5710d375a5ea445940d06154bde93 WHIRLPOOL fce3d8e4f6cdf698f5a057514b6fe220bb1011025bdce5bd4cf0e424fb4d306d38251b6726bda03f290ea8137d5a95ed418cf8751722879f9042462abd9181b6
 DIST NVIDIA-Linux-x86-304.137.run 41504115 SHA256 ca98379fc2090bdfe8b74113d6ac7bcc7eadbd86a489c3c4ec4cd5ba9f6064f8 SHA512 021c5a88d50489aa0a1c7eac14259e23542b93578ae339995a2e38b786d06d239968c07933cab3fb78a922cffc7e213d6fa3fe07e34065a9c7f03e24f8729370 WHIRLPOOL a514bfaa4bb07121ee9194848573b4879e016c5df2c94aecd4410363e386c743d7a2559cc52b5ea7c984afa50360117f930b7db39aade489ed325a43a843aebf
 DIST NVIDIA-Linux-x86-340.104.run 38823602 SHA256 e39015f8e2c6c87037be340fd1899f703ac15356c5694ad8187cd67e71491cd1 SHA512 8dacd5345a5794e862f4106ab9e8e402defa7883dd176c243d019209b560fe955d7576a13936364c01c5a249f15df58208308c9378c12c3438784376e5fb806c WHIRLPOOL 8ec9722a0f986c902483c0a88db336f8bf6710e713f20606f309ee5682f6cc1d384054ea057720faff0eab211c69a30ca297a3776b67f3b8712e36bdcd298d38
@@ -23,6 +26,7 @@ DIST NVIDIA-Linux-x86-375.82.run 44633335 SHA256 620629a35b1773e7eefddb9ea7982a4
 DIST NVIDIA-Linux-x86-378.13.run 44397547 SHA256 05e62a6098aac7373438ee381072253a861d56522f74948c2b714e20e69a46b1 SHA512 b96d2558a1003a3c66cade3a1e16abd34d855c0e27cdebacdc0495e0ba3cd5c68bb84cc5f81bff1b9ddce36ac52e0dc125c56d868b77d7c8e2f606d559b13b4a WHIRLPOOL e8231978664cec766813821c0f363ef437ba627debc2d2664164fe44c344c480c50799710dbeeee782fdacdb66b16317d69a9dec4f21d347dc40e471201b3ed1
 DIST NVIDIA-Linux-x86-381.22.run 42931990 SHA256 7b7dd6ee1c871dc5367fc207bba65077c3820a683decbfe6126fc70c0d1b9d08 SHA512 15723bfa25b0f39224ad5098c784a292abe4bf1daafaeb2f1df910bbab466e666b848b12e50b0bdd45f83e2d81957425a63501550b3dc5eb8fe3e576a8a10d22 WHIRLPOOL c01bec46411e3fc7f29cb38c6a16c8d50a3979cac1ce6a9e58feeb5878f6388f955cb95e0ecf71482c0fe9c1f57c989ecee6825bf921a0cf95c242f0a1ed3c23
 DIST NVIDIA-Linux-x86-384.90.run 46518269 SHA256 97a667de9fd7fdaa2f47b75d4049394224788931c2df2848de3f5553de810057 SHA512 4376be6ade4380f8416a7d07a77b2e71bf07f62488c6887d2023973ca57574a0c6d294327159d4a0cf12400e4156b48fa989e3a80615cefd25d918e6d558784f WHIRLPOOL 27c080472f1bb733d6bcfd1a6f2e1bbeb126fa7a9aa76b0dc1db9bdbf770951403fdce06ab1209b68839ce3ec9954bacf92ff6f96b263d9c1c22ff82dd3209b7
+DIST NVIDIA-Linux-x86-387.12.run 46889733 SHA256 aabac19b2bbc30ab9fb01954328633ff08b5aa5c2996f03722dd0806b247d536 SHA512 aa88bed1bbde790779b270b331b6a5f6008259f46291076c67cb22bc79c23dc1bf29177a7ce040784d986988b768c0574cd2ad28d71a0759873b13a68fcaa7f8 WHIRLPOOL 39aafb97d69c88f15b60b1ade91fb33e2985532b55e85cc5e470fb440bcad6d6102ac148c79279c98e2a6d674c4ce84116452c4339e4e43a8ad51c06d9b9cb13
 DIST NVIDIA-Linux-x86-96.43.23-pkg0.run 11504817 SHA256 51e6adf4ba73071622045fc37169f80db3ae3e784dff53b29d35146a04042142 SHA512 bed5726e57637481fe4e3c03a65ec14fe949f00860e729ebde408f4fd861d7bfdc296a78bc2f5d42e8b282db09f4bbde1e0545df7228fa20227080dc4b868ba7 WHIRLPOOL 6d4fd1786c11f4e326cc3101d0bb1a2f8b63c25c3dd59f10188f8355759e2861ce44fd53d60258b513d5a1d6124d0f91ba8edf4d3668b6feabfb3e8d585f14fe
 DIST NVIDIA-Linux-x86_64-173.14.39-pkg2.run 21100833 SHA256 15a953666d5681ba54c97498b578ffd286a1dc96d605f3b02110f3f99813100e SHA512 a65cd496e6ed57f771c3d99f37f616a1242d97844f6faef7a807825ad899c0e536a99fde397020839f0857883b934032f9491024f3047a6b06d3eea1f5d77713 WHIRLPOOL dc5f243b7d1de7e2d1b7f005e018a2940d63335b11a7c83c234b348b7a1839e9131169d2ea928bd8c2f549a4535149b03e16e6c94d59dfa745f7f904ff790a45
 DIST NVIDIA-Linux-x86_64-304.137.run 70087133 SHA256 eb1f56db3a2bea13e3ccde7b5ae14abe8cd6c6dbe69af4c71c68a623cc96e3e2 SHA512 d7fae1e486005ffa2f2bf7f14f901bf5156fc784407a9acfea584f49bdab92ff5f4d0fb66c4c5b2800a461fc06aebb7d760bcb59f69ce4f2cb4e03e11816b3e9 WHIRLPOOL d6dee3634b0d6052c8fbaedc6e24c893af9c9d4f0f0a7836827bfaf26313f3877f398e6cfd22c27527c30dd37347206375d9c7e642cdc9a43a682bc787b1122b
@@ -31,6 +35,7 @@ DIST NVIDIA-Linux-x86_64-375.82.run 77461911 SHA256 11c40ea70d13d5b251531875afa2
 DIST NVIDIA-Linux-x86_64-378.13.run 76239469 SHA256 3de379249ef25a8c10a24be2718bf1cb2e338da204e37874c4a0c66dbcdf42ee SHA512 2f6789aa0a400c035c0a074631dc5c26abb4f8a62efe928ca3a2865b89d29acfc09c27f23a664e438275e4bfd25c261745d4d495f9aca5f54ee6c53a389059d2 WHIRLPOOL 6e8dcc7be0981591f377babbd9e1430fddeac9a42291f36a95243d418882bc8b38a1e692e2fd62d4b785feca93165e54a64c015bd99193c699831465f512b180
 DIST NVIDIA-Linux-x86_64-381.22.run 76581130 SHA256 1a3ea8a19fbf650774e5ecd86caa5ef950971958226ed04020b0e6e29b4dd28d SHA512 669a3dd0896d68ba8eef4689b01971b92ec1c54e6cf2a9ff8d3f281ae9f2fe402f079e76109b65e698d76798bcc7a9bb43da9d128fec59ac1fafafd1c4a1e42c WHIRLPOOL 6e80c1fa813bf2930c3d47198e0e382c96ed5c5bc7ba9713e55e61e3fe2ab12c7b28526b4940b15b74e19169c1579151272bdc4033641158012c8f6a56736c3b
 DIST NVIDIA-Linux-x86_64-384.90.run 80833580 SHA256 0ddf6820f2fcca3ec3021e42a028f8bc08bca123fcea4c0c3f41c8c0ffa5febd SHA512 f47d3bad9229c837c37a75ed5b189f688c8d05230762f58494f0e744610ea19046cae4cd61d0f3b63d4e1cde50590497f600ef36a48f65f489e4c2067a05d0d3 WHIRLPOOL 36d7ddbacbb8945457ef912ca46181786e4bc48677df42a4340824fe3dc169b231ea140a75dd31dc3052b08f272d1fef1a92868527e65850593299e75dd0d116
+DIST NVIDIA-Linux-x86_64-387.12.run 81766492 SHA256 0c167561403278a14d5b4ef0a2b1ddaa6b561ecccd020e7359a41cf8702b3630 SHA512 42cfc64529b84515140128a65439a4cbcf1912e9fd1fb2eaecb6e480a83b94f1123d14c41e439463b04babffe4010468aaa0d7511cc9c82ba23143356b1a51c3 WHIRLPOOL cbf6a3f0c5c4ff8a4b9c2d4b1849a24bc46800ae83e194c4105450299054c7bd16833d408e848ca9b28a30b76d2bb90290b4a6599e0d9564aade3806e19ab032
 DIST NVIDIA-Linux-x86_64-96.43.23-pkg2.run 15962375 SHA256 ce8d8253e7dab7da63fbdac449ebf190cd0c10cbfffea0f8d0165515f851bc64 SHA512 04bec1187a6024a2b9839f008ec829281f1f2602dae2e639030bc385943186506bcaa2b46a230b2ab87f9217190841abc62f9e2d6395ab5559623389c31c6563 WHIRLPOOL 0651c44a51a1a06fcff5bfddbf9c3e408977e03263c7fe806cb6c01f9fe92f716dfe4e5190ffe1048bde72fcffdc8bca8267e74dd43ba5c9dfb22b6201fcc2bb
 DIST nvidia-settings-304.137.tar.bz2 1481361 SHA256 b1de2296add50c2c67f8c0e08ae231ca707edb15c1b3db517c4b4d69b0b3bf44 SHA512 676d1f70c9a78ee234f5f1a283412430a386fa604de211afba02806a45906c5e246a002989b724d74752178d28c92a268de1c98d4c87876797d991253f16b0cc WHIRLPOOL d5f57bb3d72906fe3b387a05c454ecd4fe4f59a6c4536baebff3a3840498b85a2b44ed3a44a91a561b3c56690e8d0943b3ba9fddd219b6948e22a4cdbf79c203
 DIST nvidia-settings-340.104.tar.bz2 1549760 SHA256 b3eb8335dc6476bf5804f936f725320e2ca0d8d19ba7f5a4f35134ba6bc477ef SHA512 d4277ef0ce87ee7baf2c5155ca8d93e8db2483329053c541b6a605653f4a6883aad81ebdc45b4c60aa78b72bd4c6c88e5b1327cc4cd2f540fcee8dbd7edc3e53 WHIRLPOOL 4ef3ceb3f069c4b61f3a0c1557951a93890fc287bfa34ffca215c06bcd0c88537238f2b576ece9d42ad718e1d314eb0e7675922e900767d07d25574f805b2609
@@ -38,3 +43,4 @@ DIST nvidia-settings-375.82.tar.gz 2114647 SHA256 11cc6afaa2472520090d966910fc1b
 DIST nvidia-settings-378.13.tar.gz 2112676 SHA256 a446ec3553f3fd16f60a0cf42cf9cf078cb3911595bb518649c489334422e85a SHA512 6f5fda9c54b067e21f2c869bcfb7c799c99f584d769020cb15e8764f59183e6a6469919ec48bce47be2144910d0004a9ca221df4a9e4fa9ab9f18710b36fa420 WHIRLPOOL 2eb475a8808bdc8380eb92c4189f2ca5aabc839d466efaaaeef6737aa8a75014e3252fd3d4a1344cede268c3bafa52ddb07057aa500ac6f626382e220326474b
 DIST nvidia-settings-381.22.tar.gz 2127491 SHA256 83cade551b43055bf93d7ca7e5911a4c61a9e7bea7d88b4c57aa885e82165e29 SHA512 79cd41b9c0e63b69574caddb62437132810ecb4cd07b90899976ae8535948f28d72021fc9a6969559909cf0f7a5d411b0202782970d64a82c636e7738c9d5681 WHIRLPOOL dfd0a4c568aa6ff1946fbe7c68f0c8cf8721c46bbe5dc82987ed900ca4b275781e7d1784e3094472ad9748c4008b5639791dcf51993b73aaeb03ce9a8e3a524c
 DIST nvidia-settings-384.90.tar.gz 2137511 SHA256 eca3d2bf55e680ca1726163035dbe39655b9eec21d3c953dda4a67818d3908ec SHA512 d5c78844af1e0faaefd523347dc3dd3f17a49e9d0ac87b64b4177f06743ff7e06e1a3e454ad54e805c1f976cced6b7f45bfa851334005e58f84f8401b26202af WHIRLPOOL 957c9d6f66e647f181367e02eaff71fcf1772f5468bdb1986da593d08713960d4f4be7a7a99bb991e9a2c44a002293a505c18afae23422c9353a1fec51f40b7c
+DIST nvidia-settings-387.12.tar.gz 1265918 SHA256 77e420d8583bdee5d3b379117fc516b2039622355ccaefbe54c939c76b8dd730 SHA512 d21b93758300080c1c9de945b138402ac0e5a914a05d8691f8aa8bdce47d15b06b623ffdf1edd6794fa2698f56d4c02d049638d4de213c43fab4e91b26fc4de7 WHIRLPOOL 5e478c27730d439a0aef81940e54da5de616e4b0693cffa1e3e457b193bfce1efe5df8790b07abc8babc20550a3eda38794108dd991716b73b1971be07f1699d

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-387.12-linker.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-387.12-linker.patch
new file mode 100644
index 00000000000..4bf84e66856
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-387.12-linker.patch
@@ -0,0 +1,22 @@
+--- a/nvidia-settings-387.12/utils.mk
++++ b/nvidia-settings-387.12/utils.mk
+@@ -475,7 +475,7 @@
+ define READ_ONLY_OBJECT_FROM_FILE_RULE
+   $$(OUTPUTDIR)/$$(notdir $(1)).o: $(1)
+ 	$(at_if_quiet)cd $$(dir $(1)); \
+-	$$(call quiet_cmd_no_at,LD) -r -z noexecstack --format=binary \
++	$$(call quiet_cmd_no_at,NVLD) -r -z noexecstack --format=binary \
+ 	    $$(notdir $(1)) -o $$(OUTPUTDIR_ABSOLUTE)/$$(notdir $$@)
+ 	$$(call quiet_cmd,OBJCOPY) \
+ 	    --rename-section .data=.rodata,contents,alloc,load,data,readonly \
+--- a/nvidia-settings-387.12/src/libXNVCtrl/utils.mk
++++ b/nvidia-settings-387.12/src/libXNVCtrl/utils.mk
+@@ -475,7 +475,7 @@
+ define READ_ONLY_OBJECT_FROM_FILE_RULE
+   $$(OUTPUTDIR)/$$(notdir $(1)).o: $(1)
+ 	$(at_if_quiet)cd $$(dir $(1)); \
+-	$$(call quiet_cmd_no_at,LD) -r -z noexecstack --format=binary \
++	$$(call quiet_cmd_no_at,NVLD) -r -z noexecstack --format=binary \
+ 	    $$(notdir $(1)) -o $$(OUTPUTDIR_ABSOLUTE)/$$(notdir $$@)
+ 	$$(call quiet_cmd,OBJCOPY) \
+ 	    --rename-section .data=.rodata,contents,alloc,load,data,readonly \

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-387.12.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-387.12.ebuild
new file mode 100644
index 00000000000..4a8856fbf47
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-387.12.ebuild
@@ -0,0 +1,582 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit eutils flag-o-matic linux-info linux-mod multilib-minimal nvidia-driver \
+	portability toolchain-funcs unpacker user udev
+
+NV_URI="http://http.download.nvidia.com/XFree86/"
+X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
+AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
+ARM_NV_PACKAGE="NVIDIA-Linux-armv7l-gnueabihf-${PV}"
+X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
+AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
+
+DESCRIPTION="NVIDIA Accelerated Graphics Driver"
+HOMEPAGE="http://www.nvidia.com/ http://www.nvidia.com/Download/Find.aspx"
+SRC_URI="
+	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
+	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
+	arm? ( ${NV_URI}Linux-32bit-ARM/${PV}/${ARM_NV_PACKAGE}.run )
+	x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
+	x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
+	tools? (
+		https://github.com/NVIDIA/nvidia-settings/archive/${PV}.tar.gz -> nvidia-settings-${PV}.tar.gz
+	)
+"
+
+LICENSE="GPL-2 NVIDIA-r2"
+SLOT="0/${PV%.*}"
+KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
+RESTRICT="bindist mirror"
+EMULTILIB_PKG="true"
+
+IUSE="acpi compat +driver gtk3 kernel_FreeBSD kernel_linux +kms multilib pax_kernel static-libs +tools uvm wayland +X"
+REQUIRED_USE="
+	tools? ( X )
+	static-libs? ( tools )
+"
+
+COMMON="
+	app-eselect/eselect-opencl
+	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
+	tools? (
+		dev-libs/atk
+		dev-libs/glib:2
+		dev-libs/jansson
+		gtk3? (
+			x11-libs/gtk+:3
+		)
+		x11-libs/cairo
+		x11-libs/gdk-pixbuf[X]
+		x11-libs/gtk+:2
+		x11-libs/libX11
+		x11-libs/libXext
+		x11-libs/libXrandr
+		x11-libs/libXv
+		x11-libs/libXxf86vm
+		x11-libs/pango[X]
+	)
+	X? (
+		>=app-eselect/eselect-opengl-1.0.9
+		app-misc/pax-utils
+	)
+"
+DEPEND="
+	${COMMON}
+	kernel_linux? ( virtual/linux-sources )
+	tools? ( sys-apps/dbus )
+"
+RDEPEND="
+	${COMMON}
+	acpi? ( sys-power/acpid )
+	tools? ( !media-video/nvidia-settings )
+	wayland? ( dev-libs/wayland[${MULTILIB_USEDEP}] )
+	X? (
+		<x11-base/xorg-server-1.19.99:=
+		>=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
+		>=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
+		>=x11-libs/libvdpau-1.0[${MULTILIB_USEDEP}]
+		sys-libs/zlib[${MULTILIB_USEDEP}]
+	)
+"
+QA_PREBUILT="opt/* usr/lib*"
+S=${WORKDIR}/
+PATCHES=(
+	"${FILESDIR}"/${P}-linker.patch
+)
+
+nvidia_drivers_versions_check() {
+	if use amd64 && has_multilib_profile && \
+		[ "${DEFAULT_ABI}" != "amd64" ]; then
+		eerror "This ebuild doesn't currently support changing your default ABI"
+		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
+	fi
+
+	if use kernel_linux && kernel_is ge 4 14; then
+		ewarn "Gentoo supports kernels which are supported by NVIDIA"
+		ewarn "which are limited to the following kernels:"
+		ewarn "<sys-kernel/gentoo-sources-4.14"
+		ewarn "<sys-kernel/vanilla-sources-4.14"
+		ewarn ""
+		ewarn "You are free to utilize epatch_user to provide whatever"
+		ewarn "support you feel is appropriate, but will not receive"
+		ewarn "support as a result of those changes."
+		ewarn ""
+		ewarn "Do not file a bug report about this."
+		ewarn ""
+	fi
+
+	# Since Nvidia ships many different series of drivers, we need to give the user
+	# some kind of guidance as to what version they should install. This tries
+	# to point the user in the right direction but can't be perfect. check
+	# nvidia-driver.eclass
+	nvidia-driver-check-warning
+
+	# Kernel features/options to check for
+	CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
+	use x86 && CONFIG_CHECK+=" ~HIGHMEM"
+
+	# Now do the above checks
+	use kernel_linux && check_extra_config
+}
+
+pkg_pretend() {
+	nvidia_drivers_versions_check
+}
+
+pkg_setup() {
+	nvidia_drivers_versions_check
+
+	# try to turn off distcc and ccache for people that have a problem with it
+	export DISTCC_DISABLE=1
+	export CCACHE_DISABLE=1
+
+	if use driver && use kernel_linux; then
+		MODULE_NAMES="nvidia(video:${S}/kernel)"
+		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
+		use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel) nvidia-drm(video:${S}/kernel)"
+
+		# This needs to run after MODULE_NAMES (so that the eclass checks
+		# whether the kernel supports loadable modules) but before BUILD_PARAMS
+		# is set (so that KV_DIR is populated).
+		linux-mod_pkg_setup
+
+		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
+		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
+
+		# linux-mod_src_compile calls set_arch_to_kernel, which
+		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
+		# expects x86_64 or i386 and then converts it to x86
+		# later on in the build process
+		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
+	fi
+
+	if use kernel_linux && kernel_is lt 2 6 9; then
+		eerror "You must build this against 2.6.9 or higher kernels."
+	fi
+
+	# set variables to where files are in the package structure
+	if use kernel_FreeBSD; then
+		use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
+		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
+		NV_DOC="${S}/doc"
+		NV_OBJ="${S}/obj"
+		NV_SRC="${S}/src"
+		NV_MAN="${S}/x11/man"
+		NV_X11="${S}/obj"
+		NV_SOVER=1
+	elif use kernel_linux; then
+		NV_DOC="${S}"
+		NV_OBJ="${S}"
+		NV_SRC="${S}/kernel"
+		NV_MAN="${S}"
+		NV_X11="${S}"
+		NV_SOVER=${PV}
+	else
+		die "Could not determine proper NVIDIA package"
+	fi
+}
+
+src_prepare() {
+	if use pax_kernel; then
+		ewarn "Using PAX patches is not supported. You will be asked to"
+		ewarn "use a standard kernel should you have issues. Should you"
+		ewarn "need support with these patches, contact the PaX team."
+		eapply "${FILESDIR}"/${PN}-375.20-pax.patch
+	fi
+
+	local man_file
+	for man_file in "${NV_MAN}"/*1.gz; do
+		gunzip $man_file || die
+	done
+
+	# Allow user patches so they can support RC kernels and whatever else
+	default
+
+	if ! [ -f nvidia_icd.json ]; then
+		cp nvidia_icd.json.template nvidia_icd.json || die
+		sed -i -e 's:__NV_VK_ICD__:libGLX_nvidia.so.0:g' nvidia_icd.json || die
+	fi
+}
+
+src_compile() {
+	# This is already the default on Linux, as there's no toplevel Makefile, but
+	# on FreeBSD there's one and triggers the kernel module build, as we install
+	# it by itself, pass this.
+
+	cd "${NV_SRC}"
+	if use kernel_FreeBSD; then
+		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
+			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
+	elif use driver && use kernel_linux; then
+		MAKEOPTS=-j1 linux-mod_src_compile
+	fi
+
+	if use tools; then
+		emake -C "${S}"/nvidia-settings-${PV}/src \
+			AR="$(tc-getAR)" \
+			CC="$(tc-getCC)" \
+			DO_STRIP= \
+			LD="$(tc-getCC)" \
+			LIBDIR="$(get_libdir)" \
+			NVLD="$(tc-getLD)" \
+			NV_VERBOSE=1 \
+			RANLIB="$(tc-getRANLIB)" \
+			build-xnvctrl
+
+		emake -C "${S}"/nvidia-settings-${PV}/src \
+			CC="$(tc-getCC)" \
+			DO_STRIP= \
+			GTK3_AVAILABLE=$(usex gtk3 1 0) \
+			LD="$(tc-getCC)" \
+			LIBDIR="$(get_libdir)" \
+			NVLD="$(tc-getLD)" \
+			NVML_ENABLED=0 \
+			NV_USE_BUNDLED_LIBJANSSON=0 \
+			NV_VERBOSE=1
+	fi
+}
+
+# Install nvidia library:
+# the first parameter is the library to install
+# the second parameter is the provided soversion
+# the third parameter is the target directory if it is not /usr/lib
+donvidia() {
+	# Full path to library
+	nv_LIB="${1}"
+
+	# SOVER to use
+	nv_SOVER="$(scanelf -qF'%S#F' ${nv_LIB})"
+
+	# Where to install
+	nv_DEST="${2}"
+
+	# Get just the library name
+	nv_LIBNAME=$(basename "${nv_LIB}")
+
+	if [[ "${nv_DEST}" ]]; then
+		exeinto ${nv_DEST}
+		action="doexe"
+	else
+		nv_DEST="/usr/$(get_libdir)"
+		action="dolib.so"
+	fi
+
+	# Install the library
+	${action} ${nv_LIB} || die "failed to install ${nv_LIBNAME}"
+
+	# If the library has a SONAME and SONAME does not match the library name,
+	# then we need to create a symlink
+	if [[ ${nv_SOVER} ]] && ! [[ "${nv_SOVER}" = "${nv_LIBNAME}" ]]; then
+		dosym ${nv_LIBNAME} ${nv_DEST}/${nv_SOVER} \
+			|| die "failed to create ${nv_DEST}/${nv_SOVER} symlink"
+	fi
+
+	dosym ${nv_LIBNAME} ${nv_DEST}/${nv_LIBNAME/.so*/.so} \
+		|| die "failed to create ${nv_LIBNAME/.so*/.so} symlink"
+}
+
+src_install() {
+	if use driver && use kernel_linux; then
+		linux-mod_src_install
+
+		# Add the aliases
+		# This file is tweaked with the appropriate video group in
+		# pkg_preinst, see bug #491414
+		insinto /etc/modprobe.d
+		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
+		doins "${FILESDIR}"/nvidia-rmmod.conf
+
+		# Ensures that our device nodes are created when not using X
+		exeinto "$(get_udevdir)"
+		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
+		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
+	elif use kernel_FreeBSD; then
+		if use x86-fbsd; then
+			insinto /boot/modules
+			doins "${S}/src/nvidia.kld"
+		fi
+
+		exeinto /boot/modules
+		doexe "${S}/src/nvidia.ko"
+	fi
+
+	# NVIDIA kernel <-> userspace driver config lib
+	donvidia ${NV_OBJ}/libnvidia-cfg.so.${NV_SOVER}
+
+	# NVIDIA framebuffer capture library
+	donvidia ${NV_OBJ}/libnvidia-fbc.so.${NV_SOVER}
+
+	# NVIDIA video encode/decode <-> CUDA
+	if use kernel_linux; then
+		donvidia ${NV_OBJ}/libnvcuvid.so.${NV_SOVER}
+		donvidia ${NV_OBJ}/libnvidia-encode.so.${NV_SOVER}
+	fi
+
+	if use X; then
+		# Xorg DDX driver
+		insinto /usr/$(get_libdir)/xorg/modules/drivers
+		doins ${NV_X11}/nvidia_drv.so
+
+		# Xorg GLX driver
+		donvidia ${NV_X11}/libglx.so.${NV_SOVER} \
+			/usr/$(get_libdir)/opengl/nvidia/extensions
+
+		# Xorg nvidia.conf
+		if has_version '>=x11-base/xorg-server-1.16'; then
+			insinto /usr/share/X11/xorg.conf.d
+			newins {,50-}nvidia-drm-outputclass.conf
+		fi
+
+		insinto /usr/share/glvnd/egl_vendor.d
+		doins ${NV_X11}/10_nvidia.json
+	fi
+
+	if use wayland; then
+		insinto /usr/share/egl/egl_external_platform.d
+		doins ${NV_X11}/10_nvidia_wayland.json
+	fi
+
+	# OpenCL ICD for NVIDIA
+	if use kernel_linux; then
+		insinto /etc/OpenCL/vendors
+		doins ${NV_OBJ}/nvidia.icd
+	fi
+
+	# Documentation
+	if use kernel_FreeBSD; then
+		dodoc "${NV_DOC}/README"
+		use X && doman "${NV_MAN}"/nvidia-xconfig.1
+		use tools && doman "${NV_MAN}"/nvidia-settings.1
+	else
+		# Docs
+		newdoc "${NV_DOC}/README.txt" README
+		dodoc "${NV_DOC}/NVIDIA_Changelog"
+		doman "${NV_MAN}"/nvidia-smi.1
+		use X && doman "${NV_MAN}"/nvidia-xconfig.1
+		use tools && doman "${NV_MAN}"/nvidia-settings.1
+		doman "${NV_MAN}"/nvidia-cuda-mps-control.1
+	fi
+
+	docinto html
+	dodoc -r ${NV_DOC}/html/*
+
+	# Helper Apps
+	exeinto /opt/bin/
+
+	if use X; then
+		doexe ${NV_OBJ}/nvidia-xconfig
+
+		insinto /etc/vulkan/icd.d
+		doins nvidia_icd.json
+	fi
+
+	if use kernel_linux; then
+		doexe ${NV_OBJ}/nvidia-cuda-mps-control
+		doexe ${NV_OBJ}/nvidia-cuda-mps-server
+		doexe ${NV_OBJ}/nvidia-debugdump
+		doexe ${NV_OBJ}/nvidia-persistenced
+		doexe ${NV_OBJ}/nvidia-smi
+
+		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
+		doexe ${NV_OBJ}/nvidia-modprobe
+		fowners root:video /opt/bin/nvidia-modprobe
+		fperms 4710 /opt/bin/nvidia-modprobe
+		dosym /{opt,usr}/bin/nvidia-modprobe
+
+		doman nvidia-cuda-mps-control.1
+		doman nvidia-modprobe.1
+		doman nvidia-persistenced.1
+		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
+		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
+		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
+	fi
+
+	if use tools; then
+		emake -C "${S}"/nvidia-settings-${PV}/src/ \
+			DESTDIR="${D}" \
+			GTK3_AVAILABLE=$(usex gtk3 1 0) \
+			LIBDIR="${D}/usr/$(get_libdir)" \
+			NV_USE_BUNDLED_LIBJANSSON=0 \
+			NV_VERBOSE=1 \
+			PREFIX=/usr \
+			DO_STRIP= \
+			install
+
+		if use static-libs; then
+			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
+
+			insinto /usr/include/NVCtrl
+			doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
+		fi
+
+		insinto /usr/share/nvidia/
+		doins nvidia-application-profiles-${PV}-key-documentation
+
+		insinto /etc/nvidia
+		newins \
+			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
+
+		# There is no icon in the FreeBSD tarball.
+		use kernel_FreeBSD || \
+			doicon ${NV_OBJ}/nvidia-settings.png
+
+		domenu "${FILESDIR}"/nvidia-settings.desktop
+
+		exeinto /etc/X11/xinit/xinitrc.d
+		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
+	fi
+
+	dobin ${NV_OBJ}/nvidia-bug-report.sh
+
+	if has_multilib_profile && use multilib; then
+		local OABI=${ABI}
+		for ABI in $(get_install_abis); do
+			src_install-libs
+		done
+		ABI=${OABI}
+		unset OABI
+	else
+		src_install-libs
+	fi
+
+	is_final_abi || die "failed to iterate through all ABIs"
+
+	readme.gentoo_create_doc
+}
+
+src_install-libs() {
+	local inslibdir=$(get_libdir)
+	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
+	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
+	local nv_libdir="${NV_OBJ}"
+
+	if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
+		nv_libdir="${NV_OBJ}"/32
+	fi
+
+	if use X; then
+		NV_GLX_LIBRARIES=(
+			"libEGL.so.$(usex compat ${NV_SOVER} 1) ${GL_ROOT}"
+			"libEGL_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGL.so.$(usex compat ${NV_SOVER} 1.0.0) ${GL_ROOT}"
+			"libGLESv1_CM.so.1 ${GL_ROOT}"
+			"libGLESv1_CM_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGLESv2.so.2 ${GL_ROOT}"
+			"libGLESv2_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGLX.so.0 ${GL_ROOT}"
+			"libGLX_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGLdispatch.so.0 ${GL_ROOT}"
+			"libOpenCL.so.1.0.0 ${CL_ROOT}"
+			"libOpenGL.so.0 ${GL_ROOT}"
+			"libcuda.so.${NV_SOVER}"
+			"libnvcuvid.so.${NV_SOVER}"
+			"libnvidia-compiler.so.${NV_SOVER}"
+			"libnvidia-eglcore.so.${NV_SOVER}"
+			"libnvidia-encode.so.${NV_SOVER}"
+			"libnvidia-fatbinaryloader.so.${NV_SOVER}"
+			"libnvidia-fbc.so.${NV_SOVER}"
+			"libnvidia-glcore.so.${NV_SOVER}"
+			"libnvidia-glsi.so.${NV_SOVER}"
+			"libnvidia-ifr.so.${NV_SOVER}"
+			"libnvidia-opencl.so.${NV_SOVER}"
+			"libnvidia-ptxjitcompiler.so.${NV_SOVER}"
+			"libvdpau_nvidia.so.${NV_SOVER}"
+		)
+
+		if use wayland && has_multilib_profile && [[ ${ABI} == "amd64" ]];
+		then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-egl-wayland.so.1.0.2"
+			)
+		fi
+
+		if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
+		then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-wfb.so.${NV_SOVER}"
+			)
+		fi
+
+		if use kernel_FreeBSD; then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-tls.so.${NV_SOVER}"
+			)
+		fi
+
+		if use kernel_linux; then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-ml.so.${NV_SOVER}"
+				"tls/libnvidia-tls.so.${NV_SOVER}"
+			)
+		fi
+
+		for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
+			donvidia "${nv_libdir}"/${NV_LIB}
+		done
+	fi
+}
+
+pkg_preinst() {
+	if use driver && use kernel_linux; then
+		linux-mod_pkg_preinst
+
+		local videogroup="$(egetent group video | cut -d ':' -f 3)"
+		if [ -z "${videogroup}" ]; then
+			eerror "Failed to determine the video group gid"
+			die "Failed to determine the video group gid"
+		else
+			sed -i \
+				-e "s:PACKAGE:${PF}:g" \
+				-e "s:VIDEOGID:${videogroup}:" \
+				"${D}"/etc/modprobe.d/nvidia.conf || die
+		fi
+	fi
+
+	# Clean the dynamic libGL stuff's home to ensure
+	# we dont have stale libs floating around
+	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ]; then
+		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
+	fi
+	# Make sure we nuke the old nvidia-glx's env.d file
+	if [ -e "${ROOT}"/etc/env.d/09nvidia ]; then
+		rm -f "${ROOT}"/etc/env.d/09nvidia
+	fi
+}
+
+pkg_postinst() {
+	use driver && use kernel_linux && linux-mod_pkg_postinst
+
+	# Switch to the nvidia implementation
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
+	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
+
+	readme.gentoo_print_elog
+
+	if ! use X; then
+		elog "You have elected to not install the X.org driver. Along with"
+		elog "this the OpenGL libraries and VDPAU libraries were not"
+		elog "installed. Additionally, once the driver is loaded your card"
+		elog "and fan will run at max speed which may not be desirable."
+		elog "Use the 'nvidia-smi' init script to have your card and fan"
+		elog "speed scale appropriately."
+		elog
+	fi
+	if ! use tools; then
+		elog "USE=tools controls whether the nvidia-settings application"
+		elog "is installed. If you would like to use it, enable that"
+		elog "flag and re-emerge this ebuild. Optionally you can install"
+		elog "media-video/nvidia-settings"
+		elog
+	fi
+}
+
+pkg_prerm() {
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+	use driver && use kernel_linux && linux-mod_pkg_postrm
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: x11-drivers/nvidia-drivers/, x11-drivers/nvidia-drivers/files/
@ 2017-10-31 11:26 Jeroen Roovers
  0 siblings, 0 replies; 33+ messages in thread
From: Jeroen Roovers @ 2017-10-31 11:26 UTC (permalink / raw
  To: gentoo-commits

commit:     416670f6b86ed1a15582f3ca78027affc46667b7
Author:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 31 11:26:06 2017 +0000
Commit:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
CommitDate: Tue Oct 31 11:26:23 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=416670f6

x11-drivers/nvidia-drivers: Version bump.

Package-Manager: Portage-2.3.13, Repoman-2.3.4

 x11-drivers/nvidia-drivers/Manifest                |   6 +
 .../files/nvidia-drivers-387.22-linker.patch       |  22 +
 .../nvidia-drivers/nvidia-drivers-387.22.ebuild    | 580 +++++++++++++++++++++
 3 files changed, 608 insertions(+)

diff --git a/x11-drivers/nvidia-drivers/Manifest b/x11-drivers/nvidia-drivers/Manifest
index 320bbc5bf58..68634749ae3 100644
--- a/x11-drivers/nvidia-drivers/Manifest
+++ b/x11-drivers/nvidia-drivers/Manifest
@@ -6,6 +6,7 @@ DIST NVIDIA-FreeBSD-x86-378.13.tar.gz 59610253 SHA256 aca461f050950f1a3a81137ec8
 DIST NVIDIA-FreeBSD-x86-381.22.tar.gz 60112159 SHA256 f309408941c7d393fe51b2356bd424791558b70f8f17f8856fbbefb1bcf74138 SHA512 ffe5882051fad081854e7b7fefe86a4da55b263b2ca217664991a7e0d84ff2f22d62a37c89afd578f3c99c12be897e5db7a3d1c71c747df655af8e220eb983fa WHIRLPOOL 42bd9205e28d067b1f7417607da21cd66411cefbd1cec74807bbdcee2255e758df2eb15f79a0c3fe1dde7d9f010cfcf648bb6a5890b4637ea7f799cc0810340d
 DIST NVIDIA-FreeBSD-x86-384.90.tar.gz 63539967 SHA256 84a307e03c7db1eb230538e46c45640f815750141cb3d6bd6cb3f3e68381c31e SHA512 16e333a846f47618f6e732d89bd92fda628c02b28784226a879f23147df764c540c96d2fe517dea465a7d07022df676a009aec22bb09c4439b9ea8b0351c6996 WHIRLPOOL 8ec2fdcdf841a20abb579a65e6e18d1ea405a6edad98a57a9b1baa807d4725b3812b6d540ea6f31b84ae28a12a1117e903f258e8f80d93d5dfff52de0eea8920
 DIST NVIDIA-FreeBSD-x86-387.12.tar.gz 64054985 SHA256 33d78d0c4f58c55d7caeec6ef1f5a6d63e910ff0720264e0c3e56ba45f067275 SHA512 fa92275e4e1795fd91515ca4cd20cb21dfcb273043f115795fdf82f6c39d2ead80848e8b44b711be6a769de2b93bc91f857084dab8f1d1f4cad5245c9bf84913 WHIRLPOOL d3a8a5ed52d91b2d6d5cbe5548fc714d40a0cb85de0d5b4c9094922d01832c5156a593eb79d17e26a91bc5734a80f2ad267f32332f95f16f3ed148cbb1c9327b
+DIST NVIDIA-FreeBSD-x86-387.22.tar.gz 64162390 SHA256 5fed73da108ec20df386ac50db087040214aec363d042e6e64c579af71975f3d SHA512 3fb704aaa4080072e920dd19cd3492eb30e31ea2426e7f73939fd53072a92ace3dfbdbf582ca5c19bc27d1a52fbd6f9ab918c7f265e3c0a9c5e0905ad156548b WHIRLPOOL abe3f065a232029ed865bd13dcc150f41705a75ad50627f384bb4ddfbf1d5625912b0958fe0313b3125e5fd9ec217a91feab3ca14aea9f0d13e8fc4a692e3f27
 DIST NVIDIA-FreeBSD-x86-96.43.23.tar.gz 15463464 SHA256 18d855db8381eda1a6cf548c9e5095fc5bb8694bf1d6e24fc1072fba4e54cd78 SHA512 42d7b1b76cdb3b23680363e565614a22112162a5dd3639cb804fe670c0c3f3f23595bbefa3f78afdc6a8ca848446dee853c7a355f2c96a0d01b354753ba2785c WHIRLPOOL f8e59ce521990cd9edee441e73f973f074db492952807a0931e362102874cddbb47604ff5c5eb20a0cbde27f9b6d4e440dd12cc2e5a20c9cb65bf3c0b3e62511
 DIST NVIDIA-FreeBSD-x86_64-304.137.tar.gz 36474676 SHA256 231693189e1bdf5c1dd02315cde5ef9ed6c0854564314438f2f40f9788a34120 SHA512 f0ae7ccea417aceedf34bfb9c96fd79b31cbf74a8fa59d5199b0ad7b81b8a4aeb66cd4801a45cc37f836979cb4267aa69e08517beaa9b8cb9c66a477d02ef8de WHIRLPOOL 9eb9036d64bd52ccbc8ce641da57c34ec9165d1f74293bec21be6d874cc8338f785d68a45ae2e8cd1161a34b2c95246c9b5504bdf810dfbfae1814ad35eb6a1e
 DIST NVIDIA-FreeBSD-x86_64-340.104.tar.gz 61176133 SHA256 93b8ff6dacf1aa9f3b47af7bbcc09397ead6614edff46c85f2f1c5d5aec9a59d SHA512 d7535527fb9ffc820509da8d0b159c70627c72a7182c354448851a334fcd5b8835046d0e9812079af2fa92de0f3fce299a67e70ef50697a2a1f33b8d995e7f73 WHIRLPOOL 942075e9075879eb4656ee1ca612a0500f90d824cfc77018ee9e2dff804341f5fcd853e200deb0525fd0ecc394d99b15f31f6203854d0a4b0103c187961a74d6
@@ -14,11 +15,13 @@ DIST NVIDIA-FreeBSD-x86_64-378.13.tar.gz 58779963 SHA256 451b9e4b2da86609c760a9a
 DIST NVIDIA-FreeBSD-x86_64-381.22.tar.gz 59284579 SHA256 f63001f380055da84eec7aaeddc13442a004ca6979adbfec46d3efac4bad7116 SHA512 51c5a87fabe87ec7f2589ed97d97447b127ecb5fe501c60bc7c9fce74141c127f4f9bb820d2a9b34fb56db436476d0cb18a73845ab4e7ec2315d4975c8ce4e32 WHIRLPOOL 40e1c62b9c8b1d5b20eaa1737285e1ce01e912b013c1aae7c9167e6d240cce5a461fd955e5583065a206abf6d6b195c8916464ce1dd4a53bb5ee94de3679373e
 DIST NVIDIA-FreeBSD-x86_64-384.90.tar.gz 62724143 SHA256 b213fe40c3df81a8391bfa81fd2763a878f28e846c8dcd65fd922ad6dbbeb3e5 SHA512 0077ba72301b65fb898fa180d77ff6abcb2a78e62c3528e3afbdfb679248f34e6a00faefeec713e7cc4a7daa7c15e6039090e5dbb047d6a9f2cff38c2e8afdb9 WHIRLPOOL bbf04cf8603a1cce37eeefd918f7252bd024098c4a2b12d3513391e3d793c6cc0d82b0ba0018409fb16dfec2a7d3cd1dfa6711eb7a6afc7e0afa3f4601b05f53
 DIST NVIDIA-FreeBSD-x86_64-387.12.tar.gz 63216500 SHA256 d5fe2ee00f496186ce75700eccf95092fc162db1df1c5bdf0dfebb27c4b46d1b SHA512 d2bed412f8db842671d4092b8adc62cfbf2fc5f90560ece109a14965e2e09b73edb3bb06069a779de7988b038697655b9ede7cc4072bcdd3b35a34cf6bb145d5 WHIRLPOOL 8e239043ea7c78560fe30ae57a92925d3badf2c9463718245857b2539b2ff04af4c06e883148ed46dc543b4c15827eb8f231f7fd25640048d09c732fdf59bfe9
+DIST NVIDIA-FreeBSD-x86_64-387.22.tar.gz 63326641 SHA256 d060a35e51a31335c28f0e856eae7a5258894e5e62b3aea3c474bc637eb90221 SHA512 ba4fe402f4dc7a5760af2f753cfcb7bf383d78df07c8ab7e53f22b6515c089f493abb4885adb23c119b4a8a9d5f83cbe248ef5877033a9a0c09c3ba59874f777 WHIRLPOOL 0ea74504795126fe3a52d6cdba74321a0e52c42180f6e1946d3b8ad36f19794c83d4eba5b9855264d9e0597cc2d20c68bb2fc2c485e9ae147d99afaf192ab721
 DIST NVIDIA-Linux-armv7l-gnueabihf-375.82.run 26650801 SHA256 d3419a636806915e809ccefd4a0566f3e21bf15ee21f39f1bf9411b041d48f05 SHA512 28554f1c24fe63c9257c0de3e84e4e739a45bf1c20ec7a53bc2c1b69b4e2355675061491ef5b03f3ae489cf623e553cfa68442f5536f137837327036d1c53d63 WHIRLPOOL f793a6eb559302289a01e39072927a45d1afb01ea086944ef243acf14000c989ecb4df26b55079764ad98c581ef5ae64d50ff7913c27895e0e216e9ffb25dea1
 DIST NVIDIA-Linux-armv7l-gnueabihf-378.13.run 26514235 SHA256 399abf527d84e4b4d01ea66e0de4a1f9b1b39871b180ef3bf99c4718ebe3db91 SHA512 253786a821df85fa926ae842114321b3c70502f887ea7c2b6790dfe3836039ee5d390e6722ca8785904ec6487e465916923d3042dc6191b3b4522c3161b80cb0 WHIRLPOOL 154b13ecb368716980ab779894942831c13e4b2d47c1d5765ab14590663b34be1571df7934e1277c9a29cdfe93e209a04e2a9fed2830c407a42547433fd9e721
 DIST NVIDIA-Linux-armv7l-gnueabihf-381.22.run 26815484 SHA256 246272d7da8f60564f4a0776fb3af82652add9e0ced8f856dc6530f97e97a748 SHA512 934cda37c7aed26243b5b661122e1c060de5b4df890aaf2295b6650dddea37cb4f0e3f0bebddb00b5d687b66ab5e028a203195c4d4ad3379593babda42febe77 WHIRLPOOL 33f5f0b0a9463419a2dcc6b2d6026607e28b13982fd0e26ffa797d9ba3ea6aab045b52523a653aea8378d31cd787628db1707c33df61c5d9b9943c07dde209aa
 DIST NVIDIA-Linux-armv7l-gnueabihf-384.90.run 29044581 SHA256 d154bff89275a8781c68dd3ca27a66bb6ebf0c77a4b42418cdd43c6f3500e365 SHA512 4d6f23c1ce4ce26520aa49955959833d630a398df0826cf9b0c1109103fc3c4da1d7c19d1cc826116562bcbfca933f291b300bea377e91f72f15c97e0c6d68f0 WHIRLPOOL b709ec3288803124d1c2caf98d0ec68a23dcae6ac8affece55faa1613985621cd427f90d0f80ecba4fa00b797044b21022f9ab9feca09948d42e9dd1cf2f49fa
 DIST NVIDIA-Linux-armv7l-gnueabihf-387.12.run 29236798 SHA256 3e5ec3398475f15a90fc8f84793ff2c377dbfc05518773c4418307f8476f7e3d SHA512 819d2be341f6615d8ef3b3568a978f9e636723b319a7349f606aa8ca24021dc01d470a314a69efcde328d2f2b5546d35f2d7c633d216bb9137d8820e5f26c9dc WHIRLPOOL 05bc698a24eac81883b5d95637f84fc947d34162f35dadfc5e692dc0e0156176463ecdda38a5098c977f3046581a72f0b8740e6fd6328ad4fc23fb1b250f5703
+DIST NVIDIA-Linux-armv7l-gnueabihf-387.22.run 29112014 SHA256 dd13e3a4848858f6ed41caa6256b0e24bb396a94c213ee5dd239ce6e266203fe SHA512 e304105f90d9957589598eb8ee5abe9783c7e5c58f9c66aa8378047852b2a129f0ea8fab2ed319cfcfaade8ced87b02f02080b42d4089bbc41b5877763ab9b8f WHIRLPOOL dc287f7f64f99a143655e40794ba795b6dc5d2fb4a5b40116aadd5a277a1861c40005aac4aa4648582a9fa7ae58aad827343a39a057154718e4ec359409f3362
 DIST NVIDIA-Linux-x86-173.14.39-pkg0.run 15134997 SHA256 a09935f37121ed3db8ae3da63a0d8e9d4348a19c859811c9fe44d6ce8e3eab23 SHA512 e24e15ccec725d3cbca502c2b77061776a81ef92917a950adec4ff6bdc34f10903aa654433177ea74be0dade4af81c5380d5710d375a5ea445940d06154bde93 WHIRLPOOL fce3d8e4f6cdf698f5a057514b6fe220bb1011025bdce5bd4cf0e424fb4d306d38251b6726bda03f290ea8137d5a95ed418cf8751722879f9042462abd9181b6
 DIST NVIDIA-Linux-x86-304.137.run 41504115 SHA256 ca98379fc2090bdfe8b74113d6ac7bcc7eadbd86a489c3c4ec4cd5ba9f6064f8 SHA512 021c5a88d50489aa0a1c7eac14259e23542b93578ae339995a2e38b786d06d239968c07933cab3fb78a922cffc7e213d6fa3fe07e34065a9c7f03e24f8729370 WHIRLPOOL a514bfaa4bb07121ee9194848573b4879e016c5df2c94aecd4410363e386c743d7a2559cc52b5ea7c984afa50360117f930b7db39aade489ed325a43a843aebf
 DIST NVIDIA-Linux-x86-340.104.run 38823602 SHA256 e39015f8e2c6c87037be340fd1899f703ac15356c5694ad8187cd67e71491cd1 SHA512 8dacd5345a5794e862f4106ab9e8e402defa7883dd176c243d019209b560fe955d7576a13936364c01c5a249f15df58208308c9378c12c3438784376e5fb806c WHIRLPOOL 8ec9722a0f986c902483c0a88db336f8bf6710e713f20606f309ee5682f6cc1d384054ea057720faff0eab211c69a30ca297a3776b67f3b8712e36bdcd298d38
@@ -27,6 +30,7 @@ DIST NVIDIA-Linux-x86-378.13.run 44397547 SHA256 05e62a6098aac7373438ee381072253
 DIST NVIDIA-Linux-x86-381.22.run 42931990 SHA256 7b7dd6ee1c871dc5367fc207bba65077c3820a683decbfe6126fc70c0d1b9d08 SHA512 15723bfa25b0f39224ad5098c784a292abe4bf1daafaeb2f1df910bbab466e666b848b12e50b0bdd45f83e2d81957425a63501550b3dc5eb8fe3e576a8a10d22 WHIRLPOOL c01bec46411e3fc7f29cb38c6a16c8d50a3979cac1ce6a9e58feeb5878f6388f955cb95e0ecf71482c0fe9c1f57c989ecee6825bf921a0cf95c242f0a1ed3c23
 DIST NVIDIA-Linux-x86-384.90.run 46518269 SHA256 97a667de9fd7fdaa2f47b75d4049394224788931c2df2848de3f5553de810057 SHA512 4376be6ade4380f8416a7d07a77b2e71bf07f62488c6887d2023973ca57574a0c6d294327159d4a0cf12400e4156b48fa989e3a80615cefd25d918e6d558784f WHIRLPOOL 27c080472f1bb733d6bcfd1a6f2e1bbeb126fa7a9aa76b0dc1db9bdbf770951403fdce06ab1209b68839ce3ec9954bacf92ff6f96b263d9c1c22ff82dd3209b7
 DIST NVIDIA-Linux-x86-387.12.run 46889733 SHA256 aabac19b2bbc30ab9fb01954328633ff08b5aa5c2996f03722dd0806b247d536 SHA512 aa88bed1bbde790779b270b331b6a5f6008259f46291076c67cb22bc79c23dc1bf29177a7ce040784d986988b768c0574cd2ad28d71a0759873b13a68fcaa7f8 WHIRLPOOL 39aafb97d69c88f15b60b1ade91fb33e2985532b55e85cc5e470fb440bcad6d6102ac148c79279c98e2a6d674c4ce84116452c4339e4e43a8ad51c06d9b9cb13
+DIST NVIDIA-Linux-x86-387.22.run 47013877 SHA256 39544f0a677838a4fb09668d48b91eadd6ba5babecb0aa0cef41c303b0a4649b SHA512 865c5024957ade2c8361b198cbc6600f469612fe0336e3a0bfaf56e4240999367f2066837c0b354af4821ab2531d05eddf3f2a0957eacc2eca0dd7cada4929b4 WHIRLPOOL 2c93bf14c218f37ef8813f28efb0c3bf6484d7fd5e5d93efbd66b1754a31eb90158b1beaaf8df6771f09985eae17efb9d3b15ecd8898ace4930046605252c59e
 DIST NVIDIA-Linux-x86-96.43.23-pkg0.run 11504817 SHA256 51e6adf4ba73071622045fc37169f80db3ae3e784dff53b29d35146a04042142 SHA512 bed5726e57637481fe4e3c03a65ec14fe949f00860e729ebde408f4fd861d7bfdc296a78bc2f5d42e8b282db09f4bbde1e0545df7228fa20227080dc4b868ba7 WHIRLPOOL 6d4fd1786c11f4e326cc3101d0bb1a2f8b63c25c3dd59f10188f8355759e2861ce44fd53d60258b513d5a1d6124d0f91ba8edf4d3668b6feabfb3e8d585f14fe
 DIST NVIDIA-Linux-x86_64-173.14.39-pkg2.run 21100833 SHA256 15a953666d5681ba54c97498b578ffd286a1dc96d605f3b02110f3f99813100e SHA512 a65cd496e6ed57f771c3d99f37f616a1242d97844f6faef7a807825ad899c0e536a99fde397020839f0857883b934032f9491024f3047a6b06d3eea1f5d77713 WHIRLPOOL dc5f243b7d1de7e2d1b7f005e018a2940d63335b11a7c83c234b348b7a1839e9131169d2ea928bd8c2f549a4535149b03e16e6c94d59dfa745f7f904ff790a45
 DIST NVIDIA-Linux-x86_64-304.137.run 70087133 SHA256 eb1f56db3a2bea13e3ccde7b5ae14abe8cd6c6dbe69af4c71c68a623cc96e3e2 SHA512 d7fae1e486005ffa2f2bf7f14f901bf5156fc784407a9acfea584f49bdab92ff5f4d0fb66c4c5b2800a461fc06aebb7d760bcb59f69ce4f2cb4e03e11816b3e9 WHIRLPOOL d6dee3634b0d6052c8fbaedc6e24c893af9c9d4f0f0a7836827bfaf26313f3877f398e6cfd22c27527c30dd37347206375d9c7e642cdc9a43a682bc787b1122b
@@ -36,6 +40,7 @@ DIST NVIDIA-Linux-x86_64-378.13.run 76239469 SHA256 3de379249ef25a8c10a24be2718b
 DIST NVIDIA-Linux-x86_64-381.22.run 76581130 SHA256 1a3ea8a19fbf650774e5ecd86caa5ef950971958226ed04020b0e6e29b4dd28d SHA512 669a3dd0896d68ba8eef4689b01971b92ec1c54e6cf2a9ff8d3f281ae9f2fe402f079e76109b65e698d76798bcc7a9bb43da9d128fec59ac1fafafd1c4a1e42c WHIRLPOOL 6e80c1fa813bf2930c3d47198e0e382c96ed5c5bc7ba9713e55e61e3fe2ab12c7b28526b4940b15b74e19169c1579151272bdc4033641158012c8f6a56736c3b
 DIST NVIDIA-Linux-x86_64-384.90.run 80833580 SHA256 0ddf6820f2fcca3ec3021e42a028f8bc08bca123fcea4c0c3f41c8c0ffa5febd SHA512 f47d3bad9229c837c37a75ed5b189f688c8d05230762f58494f0e744610ea19046cae4cd61d0f3b63d4e1cde50590497f600ef36a48f65f489e4c2067a05d0d3 WHIRLPOOL 36d7ddbacbb8945457ef912ca46181786e4bc48677df42a4340824fe3dc169b231ea140a75dd31dc3052b08f272d1fef1a92868527e65850593299e75dd0d116
 DIST NVIDIA-Linux-x86_64-387.12.run 81766492 SHA256 0c167561403278a14d5b4ef0a2b1ddaa6b561ecccd020e7359a41cf8702b3630 SHA512 42cfc64529b84515140128a65439a4cbcf1912e9fd1fb2eaecb6e480a83b94f1123d14c41e439463b04babffe4010468aaa0d7511cc9c82ba23143356b1a51c3 WHIRLPOOL cbf6a3f0c5c4ff8a4b9c2d4b1849a24bc46800ae83e194c4105450299054c7bd16833d408e848ca9b28a30b76d2bb90290b4a6599e0d9564aade3806e19ab032
+DIST NVIDIA-Linux-x86_64-387.22.run 81850060 SHA256 aa6ad3586607bf23ffc13af7dd4dc3be3d62be90d05a2eb8ea6e2eb2f5af0ec4 SHA512 f695b8d3cb0707afd078f88aa5a211230cdceb4603571371d9c4322d540e43875a9c22e000d2734c9094f32752f71464b790c3c7e79778529d737487dc387f65 WHIRLPOOL 0e22f7a9dfcf14972c6bf5590277e849a16abd0eff73ab4532fbad3d5f33349cf02780b6bd64e7ff4adabb2cddfb0df32db3a5234ecdaa3babae99273b08b3c0
 DIST NVIDIA-Linux-x86_64-96.43.23-pkg2.run 15962375 SHA256 ce8d8253e7dab7da63fbdac449ebf190cd0c10cbfffea0f8d0165515f851bc64 SHA512 04bec1187a6024a2b9839f008ec829281f1f2602dae2e639030bc385943186506bcaa2b46a230b2ab87f9217190841abc62f9e2d6395ab5559623389c31c6563 WHIRLPOOL 0651c44a51a1a06fcff5bfddbf9c3e408977e03263c7fe806cb6c01f9fe92f716dfe4e5190ffe1048bde72fcffdc8bca8267e74dd43ba5c9dfb22b6201fcc2bb
 DIST nvidia-settings-304.137.tar.bz2 1481361 SHA256 b1de2296add50c2c67f8c0e08ae231ca707edb15c1b3db517c4b4d69b0b3bf44 SHA512 676d1f70c9a78ee234f5f1a283412430a386fa604de211afba02806a45906c5e246a002989b724d74752178d28c92a268de1c98d4c87876797d991253f16b0cc WHIRLPOOL d5f57bb3d72906fe3b387a05c454ecd4fe4f59a6c4536baebff3a3840498b85a2b44ed3a44a91a561b3c56690e8d0943b3ba9fddd219b6948e22a4cdbf79c203
 DIST nvidia-settings-340.104.tar.bz2 1549760 SHA256 b3eb8335dc6476bf5804f936f725320e2ca0d8d19ba7f5a4f35134ba6bc477ef SHA512 d4277ef0ce87ee7baf2c5155ca8d93e8db2483329053c541b6a605653f4a6883aad81ebdc45b4c60aa78b72bd4c6c88e5b1327cc4cd2f540fcee8dbd7edc3e53 WHIRLPOOL 4ef3ceb3f069c4b61f3a0c1557951a93890fc287bfa34ffca215c06bcd0c88537238f2b576ece9d42ad718e1d314eb0e7675922e900767d07d25574f805b2609
@@ -44,3 +49,4 @@ DIST nvidia-settings-378.13.tar.gz 2112676 SHA256 a446ec3553f3fd16f60a0cf42cf9cf
 DIST nvidia-settings-381.22.tar.gz 2127491 SHA256 83cade551b43055bf93d7ca7e5911a4c61a9e7bea7d88b4c57aa885e82165e29 SHA512 79cd41b9c0e63b69574caddb62437132810ecb4cd07b90899976ae8535948f28d72021fc9a6969559909cf0f7a5d411b0202782970d64a82c636e7738c9d5681 WHIRLPOOL dfd0a4c568aa6ff1946fbe7c68f0c8cf8721c46bbe5dc82987ed900ca4b275781e7d1784e3094472ad9748c4008b5639791dcf51993b73aaeb03ce9a8e3a524c
 DIST nvidia-settings-384.90.tar.gz 2137511 SHA256 eca3d2bf55e680ca1726163035dbe39655b9eec21d3c953dda4a67818d3908ec SHA512 d5c78844af1e0faaefd523347dc3dd3f17a49e9d0ac87b64b4177f06743ff7e06e1a3e454ad54e805c1f976cced6b7f45bfa851334005e58f84f8401b26202af WHIRLPOOL 957c9d6f66e647f181367e02eaff71fcf1772f5468bdb1986da593d08713960d4f4be7a7a99bb991e9a2c44a002293a505c18afae23422c9353a1fec51f40b7c
 DIST nvidia-settings-387.12.tar.gz 1265918 SHA256 77e420d8583bdee5d3b379117fc516b2039622355ccaefbe54c939c76b8dd730 SHA512 d21b93758300080c1c9de945b138402ac0e5a914a05d8691f8aa8bdce47d15b06b623ffdf1edd6794fa2698f56d4c02d049638d4de213c43fab4e91b26fc4de7 WHIRLPOOL 5e478c27730d439a0aef81940e54da5de616e4b0693cffa1e3e457b193bfce1efe5df8790b07abc8babc20550a3eda38794108dd991716b73b1971be07f1699d
+DIST nvidia-settings-387.22.tar.gz 1267587 SHA256 ad120f2a48b7e9fdb7e37603c39d2fb531a5b606bce57a3eb1c92c309dcf47fa SHA512 dae157a54d0e48e94776db95927d27fca0370c7ffa67d79ce6fa372ce40bd766c081a65cd090a532c311a8f727beca6d0d9fcd526dc7791b2c73d4193854439b WHIRLPOOL 8537053a27f98df02e5a74f7c93c8071238f2f23c25f5e33c75cde70fa11bacd985786372e349958318b069a129f3291f05cb3cd01e784547bf15262a8fe1508

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-387.22-linker.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-387.22-linker.patch
new file mode 100644
index 00000000000..364d99b5a88
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-387.22-linker.patch
@@ -0,0 +1,22 @@
+--- a/nvidia-settings-387.22/utils.mk
++++ b/nvidia-settings-387.22/utils.mk
+@@ -475,7 +475,7 @@
+ define READ_ONLY_OBJECT_FROM_FILE_RULE
+   $$(OUTPUTDIR)/$$(notdir $(1)).o: $(1)
+ 	$(at_if_quiet)cd $$(dir $(1)); \
+-	$$(call quiet_cmd_no_at,LD) -r -z noexecstack --format=binary \
++	$$(call quiet_cmd_no_at,NVLD) -r -z noexecstack --format=binary \
+ 	    $$(notdir $(1)) -o $$(OUTPUTDIR_ABSOLUTE)/$$(notdir $$@)
+ 	$$(call quiet_cmd,OBJCOPY) \
+ 	    --rename-section .data=.rodata,contents,alloc,load,data,readonly \
+--- a/nvidia-settings-387.22/src/libXNVCtrl/utils.mk
++++ b/nvidia-settings-387.22/src/libXNVCtrl/utils.mk
+@@ -475,7 +475,7 @@
+ define READ_ONLY_OBJECT_FROM_FILE_RULE
+   $$(OUTPUTDIR)/$$(notdir $(1)).o: $(1)
+ 	$(at_if_quiet)cd $$(dir $(1)); \
+-	$$(call quiet_cmd_no_at,LD) -r -z noexecstack --format=binary \
++	$$(call quiet_cmd_no_at,NVLD) -r -z noexecstack --format=binary \
+ 	    $$(notdir $(1)) -o $$(OUTPUTDIR_ABSOLUTE)/$$(notdir $$@)
+ 	$$(call quiet_cmd,OBJCOPY) \
+ 	    --rename-section .data=.rodata,contents,alloc,load,data,readonly \

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-387.22.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-387.22.ebuild
new file mode 100644
index 00000000000..5974954b8d6
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-387.22.ebuild
@@ -0,0 +1,580 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit eutils flag-o-matic linux-info linux-mod multilib-minimal nvidia-driver \
+	portability toolchain-funcs unpacker user udev
+
+NV_URI="http://http.download.nvidia.com/XFree86/"
+X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
+AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
+ARM_NV_PACKAGE="NVIDIA-Linux-armv7l-gnueabihf-${PV}"
+X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
+AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
+
+DESCRIPTION="NVIDIA Accelerated Graphics Driver"
+HOMEPAGE="http://www.nvidia.com/ http://www.nvidia.com/Download/Find.aspx"
+SRC_URI="
+	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
+	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
+	arm? ( ${NV_URI}Linux-32bit-ARM/${PV}/${ARM_NV_PACKAGE}.run )
+	x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
+	x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
+	tools? (
+		https://github.com/NVIDIA/nvidia-settings/archive/${PV}.tar.gz -> nvidia-settings-${PV}.tar.gz
+	)
+"
+
+LICENSE="GPL-2 NVIDIA-r2"
+SLOT="0/${PV%.*}"
+KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
+RESTRICT="bindist mirror"
+EMULTILIB_PKG="true"
+
+IUSE="acpi compat +driver gtk3 kernel_FreeBSD kernel_linux +kms multilib pax_kernel static-libs +tools uvm wayland +X"
+REQUIRED_USE="
+	tools? ( X )
+	static-libs? ( tools )
+"
+
+COMMON="
+	app-eselect/eselect-opencl
+	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
+	tools? (
+		dev-libs/atk
+		dev-libs/glib:2
+		dev-libs/jansson
+		gtk3? (
+			x11-libs/gtk+:3
+		)
+		x11-libs/cairo
+		x11-libs/gdk-pixbuf[X]
+		x11-libs/gtk+:2
+		x11-libs/libX11
+		x11-libs/libXext
+		x11-libs/libXrandr
+		x11-libs/libXv
+		x11-libs/libXxf86vm
+		x11-libs/pango[X]
+	)
+	X? (
+		>=app-eselect/eselect-opengl-1.0.9
+		app-misc/pax-utils
+	)
+"
+DEPEND="
+	${COMMON}
+	kernel_linux? ( virtual/linux-sources )
+	tools? ( sys-apps/dbus )
+"
+RDEPEND="
+	${COMMON}
+	acpi? ( sys-power/acpid )
+	tools? ( !media-video/nvidia-settings )
+	wayland? ( dev-libs/wayland[${MULTILIB_USEDEP}] )
+	X? (
+		<x11-base/xorg-server-1.19.99:=
+		>=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
+		>=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
+		>=x11-libs/libvdpau-1.0[${MULTILIB_USEDEP}]
+		sys-libs/zlib[${MULTILIB_USEDEP}]
+	)
+"
+QA_PREBUILT="opt/* usr/lib*"
+S=${WORKDIR}/
+
+nvidia_drivers_versions_check() {
+	if use amd64 && has_multilib_profile && \
+		[ "${DEFAULT_ABI}" != "amd64" ]; then
+		eerror "This ebuild doesn't currently support changing your default ABI"
+		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
+	fi
+
+	if use kernel_linux && kernel_is ge 4 14; then
+		ewarn "Gentoo supports kernels which are supported by NVIDIA"
+		ewarn "which are limited to the following kernels:"
+		ewarn "<sys-kernel/gentoo-sources-4.14"
+		ewarn "<sys-kernel/vanilla-sources-4.14"
+		ewarn ""
+		ewarn "You are free to utilize epatch_user to provide whatever"
+		ewarn "support you feel is appropriate, but will not receive"
+		ewarn "support as a result of those changes."
+		ewarn ""
+		ewarn "Do not file a bug report about this."
+		ewarn ""
+	fi
+
+	# Since Nvidia ships many different series of drivers, we need to give the user
+	# some kind of guidance as to what version they should install. This tries
+	# to point the user in the right direction but can't be perfect. check
+	# nvidia-driver.eclass
+	nvidia-driver-check-warning
+
+	# Kernel features/options to check for
+	CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
+	use x86 && CONFIG_CHECK+=" ~HIGHMEM"
+
+	# Now do the above checks
+	use kernel_linux && check_extra_config
+}
+
+pkg_pretend() {
+	nvidia_drivers_versions_check
+}
+
+pkg_setup() {
+	nvidia_drivers_versions_check
+
+	# try to turn off distcc and ccache for people that have a problem with it
+	export DISTCC_DISABLE=1
+	export CCACHE_DISABLE=1
+
+	if use driver && use kernel_linux; then
+		MODULE_NAMES="nvidia(video:${S}/kernel)"
+		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
+		use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel) nvidia-drm(video:${S}/kernel)"
+
+		# This needs to run after MODULE_NAMES (so that the eclass checks
+		# whether the kernel supports loadable modules) but before BUILD_PARAMS
+		# is set (so that KV_DIR is populated).
+		linux-mod_pkg_setup
+
+		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
+		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
+
+		# linux-mod_src_compile calls set_arch_to_kernel, which
+		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
+		# expects x86_64 or i386 and then converts it to x86
+		# later on in the build process
+		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
+	fi
+
+	if use kernel_linux && kernel_is lt 2 6 9; then
+		eerror "You must build this against 2.6.9 or higher kernels."
+	fi
+
+	# set variables to where files are in the package structure
+	if use kernel_FreeBSD; then
+		use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
+		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
+		NV_DOC="${S}/doc"
+		NV_OBJ="${S}/obj"
+		NV_SRC="${S}/src"
+		NV_MAN="${S}/x11/man"
+		NV_X11="${S}/obj"
+		NV_SOVER=1
+	elif use kernel_linux; then
+		NV_DOC="${S}"
+		NV_OBJ="${S}"
+		NV_SRC="${S}/kernel"
+		NV_MAN="${S}"
+		NV_X11="${S}"
+		NV_SOVER=${PV}
+	else
+		die "Could not determine proper NVIDIA package"
+	fi
+}
+
+src_prepare() {
+	if use pax_kernel; then
+		ewarn "Using PAX patches is not supported. You will be asked to"
+		ewarn "use a standard kernel should you have issues. Should you"
+		ewarn "need support with these patches, contact the PaX team."
+		eapply "${FILESDIR}"/${PN}-375.20-pax.patch
+	fi
+
+	local man_file
+	for man_file in "${NV_MAN}"/*1.gz; do
+		gunzip $man_file || die
+	done
+
+	use tools && eapply "${FILESDIR}"/${P}-linker.patch
+
+	default
+
+	if ! [ -f nvidia_icd.json ]; then
+		cp nvidia_icd.json.template nvidia_icd.json || die
+		sed -i -e 's:__NV_VK_ICD__:libGLX_nvidia.so.0:g' nvidia_icd.json || die
+	fi
+}
+
+src_compile() {
+	# This is already the default on Linux, as there's no toplevel Makefile, but
+	# on FreeBSD there's one and triggers the kernel module build, as we install
+	# it by itself, pass this.
+
+	cd "${NV_SRC}"
+	if use kernel_FreeBSD; then
+		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
+			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
+	elif use driver && use kernel_linux; then
+		MAKEOPTS=-j1 linux-mod_src_compile
+	fi
+
+	if use tools; then
+		emake -C "${S}"/nvidia-settings-${PV}/src \
+			AR="$(tc-getAR)" \
+			CC="$(tc-getCC)" \
+			DO_STRIP= \
+			LD="$(tc-getCC)" \
+			LIBDIR="$(get_libdir)" \
+			NVLD="$(tc-getLD)" \
+			NV_VERBOSE=1 \
+			RANLIB="$(tc-getRANLIB)" \
+			build-xnvctrl
+
+		emake -C "${S}"/nvidia-settings-${PV}/src \
+			CC="$(tc-getCC)" \
+			DO_STRIP= \
+			GTK3_AVAILABLE=$(usex gtk3 1 0) \
+			LD="$(tc-getCC)" \
+			LIBDIR="$(get_libdir)" \
+			NVLD="$(tc-getLD)" \
+			NVML_ENABLED=0 \
+			NV_USE_BUNDLED_LIBJANSSON=0 \
+			NV_VERBOSE=1
+	fi
+}
+
+# Install nvidia library:
+# the first parameter is the library to install
+# the second parameter is the provided soversion
+# the third parameter is the target directory if it is not /usr/lib
+donvidia() {
+	# Full path to library
+	nv_LIB="${1}"
+
+	# SOVER to use
+	nv_SOVER="$(scanelf -qF'%S#F' ${nv_LIB})"
+
+	# Where to install
+	nv_DEST="${2}"
+
+	# Get just the library name
+	nv_LIBNAME=$(basename "${nv_LIB}")
+
+	if [[ "${nv_DEST}" ]]; then
+		exeinto ${nv_DEST}
+		action="doexe"
+	else
+		nv_DEST="/usr/$(get_libdir)"
+		action="dolib.so"
+	fi
+
+	# Install the library
+	${action} ${nv_LIB} || die "failed to install ${nv_LIBNAME}"
+
+	# If the library has a SONAME and SONAME does not match the library name,
+	# then we need to create a symlink
+	if [[ ${nv_SOVER} ]] && ! [[ "${nv_SOVER}" = "${nv_LIBNAME}" ]]; then
+		dosym ${nv_LIBNAME} ${nv_DEST}/${nv_SOVER} \
+			|| die "failed to create ${nv_DEST}/${nv_SOVER} symlink"
+	fi
+
+	dosym ${nv_LIBNAME} ${nv_DEST}/${nv_LIBNAME/.so*/.so} \
+		|| die "failed to create ${nv_LIBNAME/.so*/.so} symlink"
+}
+
+src_install() {
+	if use driver && use kernel_linux; then
+		linux-mod_src_install
+
+		# Add the aliases
+		# This file is tweaked with the appropriate video group in
+		# pkg_preinst, see bug #491414
+		insinto /etc/modprobe.d
+		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
+		doins "${FILESDIR}"/nvidia-rmmod.conf
+
+		# Ensures that our device nodes are created when not using X
+		exeinto "$(get_udevdir)"
+		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
+		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
+	elif use kernel_FreeBSD; then
+		if use x86-fbsd; then
+			insinto /boot/modules
+			doins "${S}/src/nvidia.kld"
+		fi
+
+		exeinto /boot/modules
+		doexe "${S}/src/nvidia.ko"
+	fi
+
+	# NVIDIA kernel <-> userspace driver config lib
+	donvidia ${NV_OBJ}/libnvidia-cfg.so.${NV_SOVER}
+
+	# NVIDIA framebuffer capture library
+	donvidia ${NV_OBJ}/libnvidia-fbc.so.${NV_SOVER}
+
+	# NVIDIA video encode/decode <-> CUDA
+	if use kernel_linux; then
+		donvidia ${NV_OBJ}/libnvcuvid.so.${NV_SOVER}
+		donvidia ${NV_OBJ}/libnvidia-encode.so.${NV_SOVER}
+	fi
+
+	if use X; then
+		# Xorg DDX driver
+		insinto /usr/$(get_libdir)/xorg/modules/drivers
+		doins ${NV_X11}/nvidia_drv.so
+
+		# Xorg GLX driver
+		donvidia ${NV_X11}/libglx.so.${NV_SOVER} \
+			/usr/$(get_libdir)/opengl/nvidia/extensions
+
+		# Xorg nvidia.conf
+		if has_version '>=x11-base/xorg-server-1.16'; then
+			insinto /usr/share/X11/xorg.conf.d
+			newins {,50-}nvidia-drm-outputclass.conf
+		fi
+
+		insinto /usr/share/glvnd/egl_vendor.d
+		doins ${NV_X11}/10_nvidia.json
+	fi
+
+	if use wayland; then
+		insinto /usr/share/egl/egl_external_platform.d
+		doins ${NV_X11}/10_nvidia_wayland.json
+	fi
+
+	# OpenCL ICD for NVIDIA
+	if use kernel_linux; then
+		insinto /etc/OpenCL/vendors
+		doins ${NV_OBJ}/nvidia.icd
+	fi
+
+	# Documentation
+	if use kernel_FreeBSD; then
+		dodoc "${NV_DOC}/README"
+		use X && doman "${NV_MAN}"/nvidia-xconfig.1
+		use tools && doman "${NV_MAN}"/nvidia-settings.1
+	else
+		# Docs
+		newdoc "${NV_DOC}/README.txt" README
+		dodoc "${NV_DOC}/NVIDIA_Changelog"
+		doman "${NV_MAN}"/nvidia-smi.1
+		use X && doman "${NV_MAN}"/nvidia-xconfig.1
+		use tools && doman "${NV_MAN}"/nvidia-settings.1
+		doman "${NV_MAN}"/nvidia-cuda-mps-control.1
+	fi
+
+	docinto html
+	dodoc -r ${NV_DOC}/html/*
+
+	# Helper Apps
+	exeinto /opt/bin/
+
+	if use X; then
+		doexe ${NV_OBJ}/nvidia-xconfig
+
+		insinto /etc/vulkan/icd.d
+		doins nvidia_icd.json
+	fi
+
+	if use kernel_linux; then
+		doexe ${NV_OBJ}/nvidia-cuda-mps-control
+		doexe ${NV_OBJ}/nvidia-cuda-mps-server
+		doexe ${NV_OBJ}/nvidia-debugdump
+		doexe ${NV_OBJ}/nvidia-persistenced
+		doexe ${NV_OBJ}/nvidia-smi
+
+		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
+		doexe ${NV_OBJ}/nvidia-modprobe
+		fowners root:video /opt/bin/nvidia-modprobe
+		fperms 4710 /opt/bin/nvidia-modprobe
+		dosym /{opt,usr}/bin/nvidia-modprobe
+
+		doman nvidia-cuda-mps-control.1
+		doman nvidia-modprobe.1
+		doman nvidia-persistenced.1
+		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
+		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
+		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
+	fi
+
+	if use tools; then
+		emake -C "${S}"/nvidia-settings-${PV}/src/ \
+			DESTDIR="${D}" \
+			GTK3_AVAILABLE=$(usex gtk3 1 0) \
+			LIBDIR="${D}/usr/$(get_libdir)" \
+			NV_USE_BUNDLED_LIBJANSSON=0 \
+			NV_VERBOSE=1 \
+			PREFIX=/usr \
+			DO_STRIP= \
+			install
+
+		if use static-libs; then
+			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
+
+			insinto /usr/include/NVCtrl
+			doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
+		fi
+
+		insinto /usr/share/nvidia/
+		doins nvidia-application-profiles-${PV}-key-documentation
+
+		insinto /etc/nvidia
+		newins \
+			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
+
+		# There is no icon in the FreeBSD tarball.
+		use kernel_FreeBSD || \
+			doicon ${NV_OBJ}/nvidia-settings.png
+
+		domenu "${FILESDIR}"/nvidia-settings.desktop
+
+		exeinto /etc/X11/xinit/xinitrc.d
+		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
+	fi
+
+	dobin ${NV_OBJ}/nvidia-bug-report.sh
+
+	if has_multilib_profile && use multilib; then
+		local OABI=${ABI}
+		for ABI in $(get_install_abis); do
+			src_install-libs
+		done
+		ABI=${OABI}
+		unset OABI
+	else
+		src_install-libs
+	fi
+
+	is_final_abi || die "failed to iterate through all ABIs"
+
+	readme.gentoo_create_doc
+}
+
+src_install-libs() {
+	local inslibdir=$(get_libdir)
+	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
+	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
+	local nv_libdir="${NV_OBJ}"
+
+	if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
+		nv_libdir="${NV_OBJ}"/32
+	fi
+
+	if use X; then
+		NV_GLX_LIBRARIES=(
+			"libEGL.so.$(usex compat ${NV_SOVER} 1) ${GL_ROOT}"
+			"libEGL_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGL.so.$(usex compat ${NV_SOVER} 1.0.0) ${GL_ROOT}"
+			"libGLESv1_CM.so.1 ${GL_ROOT}"
+			"libGLESv1_CM_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGLESv2.so.2 ${GL_ROOT}"
+			"libGLESv2_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGLX.so.0 ${GL_ROOT}"
+			"libGLX_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGLdispatch.so.0 ${GL_ROOT}"
+			"libOpenCL.so.1.0.0 ${CL_ROOT}"
+			"libOpenGL.so.0 ${GL_ROOT}"
+			"libcuda.so.${NV_SOVER}"
+			"libnvcuvid.so.${NV_SOVER}"
+			"libnvidia-compiler.so.${NV_SOVER}"
+			"libnvidia-eglcore.so.${NV_SOVER}"
+			"libnvidia-encode.so.${NV_SOVER}"
+			"libnvidia-fatbinaryloader.so.${NV_SOVER}"
+			"libnvidia-fbc.so.${NV_SOVER}"
+			"libnvidia-glcore.so.${NV_SOVER}"
+			"libnvidia-glsi.so.${NV_SOVER}"
+			"libnvidia-ifr.so.${NV_SOVER}"
+			"libnvidia-opencl.so.${NV_SOVER}"
+			"libnvidia-ptxjitcompiler.so.${NV_SOVER}"
+			"libvdpau_nvidia.so.${NV_SOVER}"
+		)
+
+		if use wayland && has_multilib_profile && [[ ${ABI} == "amd64" ]];
+		then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-egl-wayland.so.1.0.2"
+			)
+		fi
+
+		if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
+		then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-wfb.so.${NV_SOVER}"
+			)
+		fi
+
+		if use kernel_FreeBSD; then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-tls.so.${NV_SOVER}"
+			)
+		fi
+
+		if use kernel_linux; then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-ml.so.${NV_SOVER}"
+				"tls/libnvidia-tls.so.${NV_SOVER}"
+			)
+		fi
+
+		for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
+			donvidia "${nv_libdir}"/${NV_LIB}
+		done
+	fi
+}
+
+pkg_preinst() {
+	if use driver && use kernel_linux; then
+		linux-mod_pkg_preinst
+
+		local videogroup="$(egetent group video | cut -d ':' -f 3)"
+		if [ -z "${videogroup}" ]; then
+			eerror "Failed to determine the video group gid"
+			die "Failed to determine the video group gid"
+		else
+			sed -i \
+				-e "s:PACKAGE:${PF}:g" \
+				-e "s:VIDEOGID:${videogroup}:" \
+				"${D}"/etc/modprobe.d/nvidia.conf || die
+		fi
+	fi
+
+	# Clean the dynamic libGL stuff's home to ensure
+	# we dont have stale libs floating around
+	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ]; then
+		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
+	fi
+	# Make sure we nuke the old nvidia-glx's env.d file
+	if [ -e "${ROOT}"/etc/env.d/09nvidia ]; then
+		rm -f "${ROOT}"/etc/env.d/09nvidia
+	fi
+}
+
+pkg_postinst() {
+	use driver && use kernel_linux && linux-mod_pkg_postinst
+
+	# Switch to the nvidia implementation
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
+	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
+
+	readme.gentoo_print_elog
+
+	if ! use X; then
+		elog "You have elected to not install the X.org driver. Along with"
+		elog "this the OpenGL libraries and VDPAU libraries were not"
+		elog "installed. Additionally, once the driver is loaded your card"
+		elog "and fan will run at max speed which may not be desirable."
+		elog "Use the 'nvidia-smi' init script to have your card and fan"
+		elog "speed scale appropriately."
+		elog
+	fi
+	if ! use tools; then
+		elog "USE=tools controls whether the nvidia-settings application"
+		elog "is installed. If you would like to use it, enable that"
+		elog "flag and re-emerge this ebuild. Optionally you can install"
+		elog "media-video/nvidia-settings"
+		elog
+	fi
+}
+
+pkg_prerm() {
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+	use driver && use kernel_linux && linux-mod_pkg_postrm
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: x11-drivers/nvidia-drivers/, x11-drivers/nvidia-drivers/files/
@ 2018-06-30  8:17 Jeroen Roovers
  0 siblings, 0 replies; 33+ messages in thread
From: Jeroen Roovers @ 2018-06-30  8:17 UTC (permalink / raw
  To: gentoo-commits

commit:     733b1885864d366f072bf1575d6a04b02ac803a0
Author:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 30 08:16:48 2018 +0000
Commit:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
CommitDate: Sat Jun 30 08:17:03 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=733b1885

x11-drivers/nvidia-drivers: Old.

Package-Manager: Portage-2.3.41, Repoman-2.3.9

 x11-drivers/nvidia-drivers/Manifest                |  17 -
 x11-drivers/nvidia-drivers/files/nvidia-uvm.conf   |   3 -
 .../nvidia-drivers/nvidia-drivers-340.106.ebuild   | 529 -------------------
 .../nvidia-drivers/nvidia-drivers-390.48.ebuild    | 587 ---------------------
 .../nvidia-drivers/nvidia-drivers-390.59.ebuild    | 587 ---------------------
 5 files changed, 1723 deletions(-)

diff --git a/x11-drivers/nvidia-drivers/Manifest b/x11-drivers/nvidia-drivers/Manifest
index 214e8d690b4..f99b1acc2a9 100644
--- a/x11-drivers/nvidia-drivers/Manifest
+++ b/x11-drivers/nvidia-drivers/Manifest
@@ -1,24 +1,18 @@
 DIST NVIDIA-FreeBSD-x86-304.137.tar.gz 35399011 BLAKE2B 823726e4a54f029a47b4c473718099b97d0364b19ac73d36111c0e3552af9a896f60c2aef0eac05d84eb7386fd32ff0a33b2b26d572b6803fddf3c9df0443caa SHA512 9bab183289461d915371b7b5b34e66fdfe8ffff945806dbdf00e0e1cc7242f7b74a0acfc6ed24c3643a6d51edc837cd905ba3b224c30040b0f40d662dc6e7a6d
-DIST NVIDIA-FreeBSD-x86-340.106.tar.gz 60296006 BLAKE2B e980bd75b35cc17379865a0ffd45fef99fc7e732bddf8cfa11f021ee74acb31c732ec1993f56425308fc7346b7a5476e5f067c0a43ee71601e8a13e3951abcf6 SHA512 ae7ab9e6744b215adf4dd07c701b94f2446a7c8d9e576d5fe840f1c26cb23bc0f5b4288095efbb096ae62941a45c938af6ecf9258211c7824d2c3f8316301209
 DIST NVIDIA-FreeBSD-x86-340.107.tar.gz 60305952 BLAKE2B b634bfd610653f1c546b68e87d934c5d0e25a2e5be6df15e0cb6016793274b4cf08577669e61c35976f3482da2221b05797459b2814965bcfdbf519c8a6d2681 SHA512 fe09e1b3dd870a07b4edd163d302e2d98f00e139d05a8fa627c292182b61d2bd9b37eb746d639ba592dcf90fecedc57430cf1ef76b6522785ffcb3fd46fe9ba0
 DIST NVIDIA-FreeBSD-x86-375.82.tar.gz 59566154 BLAKE2B b888b08cd434899ff73f04a855b47f9416ab247f63023f742dff55e9249d20b8da07bc5cd42e6d555cd9a8ecc62c97821ae09dce1986f0ac2384a16a70c7f181 SHA512 6747bf6d6278c6ed0828c6fdcad5353e516f28384609a3f0a885966707eebb096926a876c17843bfa7626a01a6d4e0ab12c781faf9ac0291771b195c9eb13d85
 DIST NVIDIA-FreeBSD-x86-378.13.tar.gz 59610253 BLAKE2B 723b392b869dd5cc9244cfe9df371fc6df6b4ebc4c1f01082fd79b2bbd0cbf4e670cfb69511f1773d28f6fc51a8801777dd6e3066f50fc96888a9efa467e459e SHA512 a0101201089df2bbf5bdc4ded2228dd989da6a47da31c3ec8d55916b1ff3457924555f82c7381934745fdc1b1f8f78e3fc10e5089279eb13423628dbfe560c6b
 DIST NVIDIA-FreeBSD-x86-381.22.tar.gz 60112159 BLAKE2B 4a61e9a09218eb7d259f82d0a43fee313754004c8716e921b9a83a3e87fff9a291450bef5d7304b2a7ddf5750a830fb7c5cc9dab890dac4a714354265ca25034 SHA512 ffe5882051fad081854e7b7fefe86a4da55b263b2ca217664991a7e0d84ff2f22d62a37c89afd578f3c99c12be897e5db7a3d1c71c747df655af8e220eb983fa
 DIST NVIDIA-FreeBSD-x86-384.130.tar.gz 63719036 BLAKE2B 971006aec05f5bb8f815420f5e1a62103119ae0192a275cc4df3034c20908ebcb8d5a886e030ec06a854102a79e2b31d53c2fcbf3450cb7fa0d9e1f64eeb835f SHA512 54d6d0776190d12f2562fe0ffdf82661fb8a0a4d3d575386a19f5dd5890a7ae4d2ad6704253e7cded62a9a0e1880f1bee9e6bf3aeeb8ce7a265a3d077b0c8018
 DIST NVIDIA-FreeBSD-x86-387.34.tar.gz 64228643 BLAKE2B 80011df5d037cd0a2a6faccf6c990e6019cb85c906c1410d4dde033a8a945ecd46e80a1315e46dc05fa47003eb328c6b8e8e41e18dce60942e645c0e6b813717 SHA512 875648459a149d506b20eb7105e73086e1fb51dddfbd8b484b8cc4793682c088ba16b3d374b0e807738f7aa7489dd9eab2449f70bc9feefeec0bf3a88025b9ef
-DIST NVIDIA-FreeBSD-x86-390.48.tar.gz 64254145 BLAKE2B ce668715fbec4f54eb9946fc2f5be56c132da8a2a65678b8aac0e3c0a55f60298212be4a5f6eca90a75d50ce3b9831521d02e7bd004d5c3c61fb5a460c7dc00a SHA512 7255d628be927f17f1108dae458d2d3844b46c42f460bdeac3dbb1dec6b5bf76d2790752e8bfaae35e11d49adb2a43ed1d8fc6a9325152490a21dac8e5c1734c
-DIST NVIDIA-FreeBSD-x86-390.59.tar.gz 64274727 BLAKE2B b032578a38544103e92a19f433d5a86a615605f3a78902df38de2ac3c6179f322c9fb507618a548f4c11f51c9fbb8e07a9519acde86be7123c07a403a76b40c7 SHA512 bd44d5a772a3f52984617742f686567adc0e9b143b2014f1d95f59f8461c30ae650429aac3e92d24540881bc9093cb8a522c4d06a2b71e1309848a7dc7f7d5c7
 DIST NVIDIA-FreeBSD-x86-390.67.tar.gz 64289180 BLAKE2B 1a4d9bea63e8a925af641074a7b49ab7c841055a771d99586c56809a54c438917f0af5a3a4236d594ee4a03bd1cf7e22f62e1b487e309173a9662db659f74acb SHA512 e3c3f9b93e07fd0f16ff1a62c4adfc61b827785f1bd482482bc58aa75bd3df4f66f24e826bf4f41ad08ca8a9600e6f9fb4542f8ce8e4cfe81b06cef955cdbbae
 DIST NVIDIA-FreeBSD-x86_64-304.137.tar.gz 36474676 BLAKE2B bd75e2916d34f76566d838406419991a860118830366f0297fa63baade3a99f637dae601d6bc6a051596222f2715297dffbf9b81ff5478b030741e6c8a09bc13 SHA512 f0ae7ccea417aceedf34bfb9c96fd79b31cbf74a8fa59d5199b0ad7b81b8a4aeb66cd4801a45cc37f836979cb4267aa69e08517beaa9b8cb9c66a477d02ef8de
-DIST NVIDIA-FreeBSD-x86_64-340.106.tar.gz 61169129 BLAKE2B 0a8e0deb883025d20df5165f39042bcee5d75ea78b19733cff014448c8d62022dbb98af2adebd13485e281a52c9a1c4986ae020b4eb6a821a411836e7333d4f1 SHA512 c2d0a0b1856522b28243697db22ad99d8521b00d9dfa2da724f2ee243b545b7dbf24319d9a0939855bab29251f001063391a760bd3db750bf9950ce1f9376847
 DIST NVIDIA-FreeBSD-x86_64-340.107.tar.gz 61179967 BLAKE2B c12c7c07c090fd7bca78a30082890d0b0330dde07ce9beacdb94fad97d40e9ff9e1413fc36fd94116821137e74076d99a82ab85ecd0a8e16d52b47abeb747802 SHA512 661a4cc79a0adc9a1abebfb3567c26e69628266794b5b539c112112a0989760ea1ea2d8c35a5fe7539b579d4e9cef2685e3e1d12fc7031cd6d1b743c23eadc52
 DIST NVIDIA-FreeBSD-x86_64-375.82.tar.gz 58748290 BLAKE2B 629d65b71270d1c0d94c71e4215a72f0e49bb82e68ebb93fd4b14cd56a2031674458764f4c3e2e3dec7379ec0d5ed9212c8d09a64e4361f40352e52aa9b57de5 SHA512 5e2b42ff63e06219764db8187203ce1a2c3c8b478be31fc713ef396e8f8d46def9b2631d7989866740bd0c6a81bbf5d2ed083c14cfa7171c0d993553ca6f431c
 DIST NVIDIA-FreeBSD-x86_64-378.13.tar.gz 58779963 BLAKE2B d0a165dab740b25e1d97050e4dfc9f916ae17159eb4e4b79e068a4cd6ec3e2bc146d061abb4a411847cbb0d987253f86327e67ffd6efaf725c4fa4dce27e4fa9 SHA512 34cfc383ba196ecec2cd27fc12bf30dd58f8782b73414e7b4c182e832ae0dce1f8c017afbb2101d7525d4e321f80cac49d3b578a8fc0cf88be9310f4deb77057
 DIST NVIDIA-FreeBSD-x86_64-381.22.tar.gz 59284579 BLAKE2B 45703b5658c586fe2fbfaf84a54a591a7d25e836195c47c43375b74a730c1a7aa4dd7bd17d13e7194b37d51da0f11540da1bee564e1c27351ecc6915e65012d5 SHA512 51c5a87fabe87ec7f2589ed97d97447b127ecb5fe501c60bc7c9fce74141c127f4f9bb820d2a9b34fb56db436476d0cb18a73845ab4e7ec2315d4975c8ce4e32
 DIST NVIDIA-FreeBSD-x86_64-384.130.tar.gz 62901704 BLAKE2B 50be9af398f88caa012a7af702ed3d150bd4d0e5aca862dab09f30038906d79254999079983fe242dfe8158549e25f3a49ea8ad07114d8d3bcd01c8a076e8c8f SHA512 ad1a32f8268003d165570137947f517c82074b0851b86a1928f016de95f3dacef4d48f4873f00d603d49b44fe2b99d65295ed4e655d4b16f71c284994a1ea148
 DIST NVIDIA-FreeBSD-x86_64-387.34.tar.gz 63387097 BLAKE2B 53689ba098b4a4de08dca056618ea533c92d17137ec954dea0ae71e1b2c825c021979871e4ff82c820be0a78d3c365f282b760940ebe2caa1ca5bfd2453e178e SHA512 0a905ee72ee6f4e9c941e5dd1f7cddf96bfb20c6da32fd05599258e1bb154f68463d775ba8ff4f67f0d4b8e637e9ed9624fc9a4873a1f2621dc86732f0d6d70d
-DIST NVIDIA-FreeBSD-x86_64-390.48.tar.gz 63583858 BLAKE2B bce8b6b7c739b5aec98ff919f3b6171d73f70179d6af6d7883b574d815e69de7bad9f0d774e4176385bee31181ff9e6ea510115aebe912909ea86bd9cc825aef SHA512 7de36ad359a0640982467fe1178f33a4694cf5f8ec8385cc01ecd6947c5e83e4d603b7b3c90cb6ad96c4e78c1af1bab99e74f70690540dab3a22f4b77cf14434
-DIST NVIDIA-FreeBSD-x86_64-390.59.tar.gz 63602262 BLAKE2B c06a5b4b9b27ff74c2a4b09aa3a7c9a987415126600addcd203f6edac2470a3d7aa33964507aa5a309290372bdd27663225aff0801f009d6bdcddfcdf44bdf8a SHA512 8820350aab2b26c98fccfc2e6e41db99a4ee3f0c54610d14b084d07ac4f9ab4c5bd5b0132e3d06dbdd3cd112c425e65620a310e5a0db114f6c115d4cc09a5bf6
 DIST NVIDIA-FreeBSD-x86_64-390.67.tar.gz 63611003 BLAKE2B 093d61fa03a64e6c61920cb23cf0d269a8933a6533dcb22c35c390d3b054a77aa0127e9c78df102ce4ba6ac333c194e6494e4700552159a798042cceeec1ce07 SHA512 c25bcc91147491762155cd6189b8b39de7529c16fc4aa30d454caf3338f11e1429c53575190f3a0afd05a77dd4a31407f941cff5608bb81a0df9b49c558b364e
 DIST NVIDIA-FreeBSD-x86_64-396.24.tar.gz 60839222 BLAKE2B 4baa266d945525a8f43d69e14df1b045d5a2e7212eb3a92208f8efb454642e657ea3cf00a9e625ef5efa9f54c8a9e2f87ef4847696368de13b88a0721364d9af SHA512 28c456cfc9f779bed84d671e104f2ea68940053aed2dc7964390e84ec553a9062be6b5108a78f123c129c25548a7b3027060da67417c64f857b23c95ae9f908b
 DIST NVIDIA-Linux-armv7l-gnueabihf-375.82.run 26650801 BLAKE2B 31446667065c56b48f6a3e737afe29a4517459d3462138136bffe383bc6fe514d6e80b49c391c27edc96b8abc3da3dd4d6ee3f3dca17f3c9a0f1cdf0e72cf099 SHA512 28554f1c24fe63c9257c0de3e84e4e739a45bf1c20ec7a53bc2c1b69b4e2355675061491ef5b03f3ae489cf623e553cfa68442f5536f137837327036d1c53d63
@@ -26,41 +20,30 @@ DIST NVIDIA-Linux-armv7l-gnueabihf-378.13.run 26514235 BLAKE2B 2b3c540704496a290
 DIST NVIDIA-Linux-armv7l-gnueabihf-381.22.run 26815484 BLAKE2B e5f0241b07d1e54edea2025dd30061d1018c68cc2c7136c507eb894bbad5be3d0724494e2b9f33d1f8f60da4904999bbb964e6f2e78d045d7cd86bcd46b7f6d0 SHA512 934cda37c7aed26243b5b661122e1c060de5b4df890aaf2295b6650dddea37cb4f0e3f0bebddb00b5d687b66ab5e028a203195c4d4ad3379593babda42febe77
 DIST NVIDIA-Linux-armv7l-gnueabihf-384.130.run 28899034 BLAKE2B 4f104243e87d0688d5f234bcadeb501914394ca5ae29c0f7ca7ae8038982c7df14652a1b85fb62a3466a6d4f7cda95c9726367bfd8ab1bf0b73f3fa617418276 SHA512 bd7be99881295f4ddf92b8c6791c4315c7b8699cdd346247dd54dfeb48ee61a40597483379922f5e3d0b28c9b9b9e75dca91c535e4695ebe57734c26f1484f61
 DIST NVIDIA-Linux-armv7l-gnueabihf-387.34.run 29406773 BLAKE2B af27fb1bfa8e432c83220f88c57219d572dfab2d3624c8702759a747f25ff962dba7c39028af5746e04c913c9a53dfbec8a46801bfa7e38df65a8823c4858cca SHA512 cb631dc3b851d84881dfcabee776c68a935853d03f21595acfea84a3efbc85276070f9d0958c0bcced1e66f42f25ecf3fd7d615c715274130ca24426da678c2e
-DIST NVIDIA-Linux-armv7l-gnueabihf-390.48.run 28693609 BLAKE2B 7d26448fc72ddb6919582557ac6e7ee6b23acfd441b62cea2bcafa79a75e15ea2c583d6462abd3f18b08ca150dcaae6e881ebe4b7ede84a1e32bc6da4675c380 SHA512 36a8857a586edee40e6b5c5c19fef3464a00b1f13b0e06fbde83bd1e17ac40ee3d6fda1c8c5cb52f8987b35c79226bebbee07bf05c5bf11c42388dcee76999a2
-DIST NVIDIA-Linux-armv7l-gnueabihf-390.59.run 28693336 BLAKE2B faf5ee3885838ae27606a5ddb24232e625c156d487fc91786c4b1f2f606e3e2c10ef6b3a286214ba1977773536bf6cc327a12012ef53555be5759e325b3004b7 SHA512 afa990f24928c70927c997c2a0a699f4cd536e7e5685a02d9911d720ea36b27a61eb5707a07c54b56d93f4b984eb6a3a5d3ada49c3bc0e6ad401a7b7524628b6
 DIST NVIDIA-Linux-armv7l-gnueabihf-390.67.run 28708012 BLAKE2B 2b6d44b5a2ec9da9cda70a2b79bac25f3f0ffb6da6facdd7f361d280d83503861cdec55bc881554a985c26bc03b00d16418e80da77ea8883e5c48bde1550a6bc SHA512 0e1175424ac0c1b301d41a9af2c5c507e7d86959e4424f17249d404c31d45563985b59d440b3ecb827ef9cd5b0c872b143a8c965d26b227f99dbb9b6615dbae7
 DIST NVIDIA-Linux-x86-304.137.run 41504115 BLAKE2B 5938d4df818947e5576172c0ee9bfa42a2fc49a7a7a2b14128cf3b967dfea6d4523901b33283284d450cfadc2c6d72a82a1533b27ebb4b542b6b1454fe8ae960 SHA512 021c5a88d50489aa0a1c7eac14259e23542b93578ae339995a2e38b786d06d239968c07933cab3fb78a922cffc7e213d6fa3fe07e34065a9c7f03e24f8729370
-DIST NVIDIA-Linux-x86-340.106.run 38816967 BLAKE2B b3ab5613359b43eaace36de9a8ab753df954bdf60e5acfe168e270474e0dc400acd46b5dcec809fad3d59babdf52988b3b5a8c20e8a0253b6388b7eb60ff4ba1 SHA512 923da7d61ef89a7bd83e0223c72fcdc556ef31cb97015a129a3adbdc3aad29dbf49f6fd23dc5188a53722e22cf4ba35c6a98e6ca9fdc6c24bb72ab87153d8bc4
 DIST NVIDIA-Linux-x86-340.107.run 39016798 BLAKE2B 2632c8f257d0cf7c5b9294eb2c0b763eee6feb60eacc316024655971e4d067c4af6548aab3b7b2b295792b064f3f3ac3e6403a2ecfa096761d308dfb6b2569b8 SHA512 0add713942bcdb639d19b5c36f5e0cea14f9e07490191d46dfeba0515ede7700fd8e9467ec531d38329fe1e76bf45905e70e0d440e7bc2dc79c1d767eab03338
 DIST NVIDIA-Linux-x86-375.82.run 44633335 BLAKE2B 55392ba748108b47994bf272829a6476dfc23f7756e0c18d56c8e4d827968196ee70e521c2e6307c134ca0c85d59715db777583fb07c8e06ae7325d586a8117b SHA512 cbd6edd7490e0e5ef9dd2020c18eb5f75412993e06b9c4f1919f49a8ffdc36131a96d868ab51691fb5c4a661e826b000ec93363c9b168304f6498014e300bf24
 DIST NVIDIA-Linux-x86-378.13.run 44397547 BLAKE2B 5b45bdceba75e214028b9f59a3655482ac1ac2b51cc0a6ea22927e5143b47c670db7078ed898e04663feb9fd495165954c90df5ee3afca00155dcc2ae6a97dc8 SHA512 b96d2558a1003a3c66cade3a1e16abd34d855c0e27cdebacdc0495e0ba3cd5c68bb84cc5f81bff1b9ddce36ac52e0dc125c56d868b77d7c8e2f606d559b13b4a
 DIST NVIDIA-Linux-x86-381.22.run 42931990 BLAKE2B cf1ae154854860557bf3e4a50216f1373ff66a45535e7beec67392b1cd1d40a02d758fa3e1cfa0462145b912430b0d1a3b6de3e6d6ede8aa1f484ea0ab46f816 SHA512 15723bfa25b0f39224ad5098c784a292abe4bf1daafaeb2f1df910bbab466e666b848b12e50b0bdd45f83e2d81957425a63501550b3dc5eb8fe3e576a8a10d22
 DIST NVIDIA-Linux-x86-384.130.run 47539521 BLAKE2B d0b84aa6e0a41d7202cce247a419adad5c94d0d98feb83594644d8e0a9426d0c07a5b5889297bc830c7456a4e8cc165a3b23c004e83cabad1000bf5a6e1a147a SHA512 0ed01818606eb7309811a3cb0ae71e9906e318d579dfd85bafcbae498a27f801836c1f1eefee6791ec5d9c6a4c41d244c43b8329583ae4991b45171cac99638d
 DIST NVIDIA-Linux-x86-387.34.run 47797853 BLAKE2B 4ae211ee00e09fe385f24e05cfac3af28447ec18e7a7f53e7f310c210ec22f60094be087aae45d0ea99c90214a07d3c46ce6867984ac0ff6e56559693fcdf148 SHA512 ba9362123a75f85a0a5a9dcc95c06bcb350a8dff2db864db30a73172db44006fa39eee8e23cf959ab2012b61b922d1f0d7ab225329815737819f27d1be300b95
-DIST NVIDIA-Linux-x86-390.48.run 47374800 BLAKE2B a17c85d141a5442cb9f5df7cd58d4f377f9deb74e214009af9d3e9a845c6d13910f33206e1d546eb9f8287f4ddcee7ba139acb86d02703c7bca33946d5b015c4 SHA512 9d80616abbf1f95c89bb3e6bda864708adc887a62ccdf8865e956c305bb013b0e54ffb3f495805363ee60a9115ab5fb38adf1534750a6afb69a457a4d034daeb
-DIST NVIDIA-Linux-x86-390.59.run 47889407 BLAKE2B cb849703e3b2d50b1169708b6037a1243dc16ea5e86ecd15ce1ca2a9754c09d59ca3f43500902261bcd7e468e3ca21d5f3f2d95905d716a7df838a92862f1094 SHA512 14ba06303c28715032a9efe30010b39a5b0a8f40e3e0abc86ddfc6cb4d686ce4bc2db8bfc2bb3d7a5f4de9648178d2fd54b966277900d95bd20dab8dec487385
 DIST NVIDIA-Linux-x86-390.67.run 47706619 BLAKE2B c9ddefd702bcf987e62c27a77fdab87de62da8b1bb3e836607cb3746c3acfb7ee931e6c1cbd8a8c33d6724436cb54573b7d1a3dfa1e183627980e2b9b69cc4ad SHA512 177ad1a4ae52fc00001461e65e264fe9f9bf0dc5e8974391311cb80f8bcfa309f12bf1bcb4b162684a01416cfbbaa76d3b81dff3fb08ff2f5e8644255cc22987
 DIST NVIDIA-Linux-x86_64-304.137.run 70087133 BLAKE2B 8db0ade7cf64231ae11e6fc55a16a68a2f7b11a8bb7debb49799fee96eba06a3062b97fe539b093727623a1ed1067282813de047c2aeb89d93bf35a97c71aac5 SHA512 d7fae1e486005ffa2f2bf7f14f901bf5156fc784407a9acfea584f49bdab92ff5f4d0fb66c4c5b2800a461fc06aebb7d760bcb59f69ce4f2cb4e03e11816b3e9
-DIST NVIDIA-Linux-x86_64-340.106.run 69987642 BLAKE2B 9b5644a58169557bda2ca6b367909bbbbe9c94ab869a91a4df8f8446a1e66f051f8b9c67e10d809d7e7a319fb318be3c5d0f35862cb315fdaf5623ce8794efb5 SHA512 64474a2dc664142868125df3562ccb676cef02659c5e45d570a2f00f2ab172ba3e61ea6ca42faade1747516c9a0c8b2c4e7cd3037ee90fb072b0c5cae45431bc
 DIST NVIDIA-Linux-x86_64-340.107.run 70233686 BLAKE2B 821a2672dcc3b546fbb3f826230fb06741503d75b06f72cb407dd3c9de4f2cbd150bff34e554dca8aa86e7f6bf64ce4f7f9b52976799a477c6c2659aaa5bb4d3 SHA512 51df9370526732db099a8a925d35cdf1317ae2b0ab2c130eaf82373f25186165b4af7d44f71e51e2a68f7d07c7ae3f441a6c6c4be8467003b15dc770c4f4e89b
 DIST NVIDIA-Linux-x86_64-375.82.run 77461911 BLAKE2B e7f32bdf1672d98a1fe98c82d80a08dd6f63b3c859df4c60124977dae19520a21e4239ff7be6c272243d4af9416320b5e166d8f100979daa0d005ea2a44fc16d SHA512 6da63b807d6dd7cc8ac2b794d5c9ab8383e3c0ce6a47adc600941545509fb40b5f06344781afc895bd83f2780b2bce187994df5684db2890f50b41adfee8f910
 DIST NVIDIA-Linux-x86_64-378.13.run 76239469 BLAKE2B 0f2be330645f8d9d2828fa6d159f9e41ef09bb32805f94cf3fa255f088a8c6f4c25add584787bd1ed64756ef75821f7143c14330718cc5f5ac3cbcf8b7c3bae4 SHA512 2f6789aa0a400c035c0a074631dc5c26abb4f8a62efe928ca3a2865b89d29acfc09c27f23a664e438275e4bfd25c261745d4d495f9aca5f54ee6c53a389059d2
 DIST NVIDIA-Linux-x86_64-381.22.run 76581130 BLAKE2B fdb5912a775b56edf7dd784b640997fe683d0a32d57db6079dc5466a1a8dc1354cd31ff86aa1e993e0a33163e4c18f6a7aa990e334448ad069db3a5ffc4f1ffa SHA512 669a3dd0896d68ba8eef4689b01971b92ec1c54e6cf2a9ff8d3f281ae9f2fe402f079e76109b65e698d76798bcc7a9bb43da9d128fec59ac1fafafd1c4a1e42c
 DIST NVIDIA-Linux-x86_64-384.130.run 82260837 BLAKE2B 55b6f3627680c881821f5d20f05cb6c7941b1deebf28f22f6712cac73d07e6202507c9f3b98eb8fc59ca8ed0c6aaa4819db5fc5a331f4505887dac6f31774335 SHA512 301fa7d9d73a0654e0090bf4bae98896388c1f52453f1b886e320e36765dc529f802c509a2d518714f2b348df59f9c9048e01b3874819bde4f53cf98aaa2cfff
 DIST NVIDIA-Linux-x86_64-387.34.run 82784271 BLAKE2B b7140d5d6a693892df50b3ad2e20387673dec6b5ac609cc0300bdc4b4a93ca94849255699126e4d55e67f10e488bfe6008e987197ea239b1a1b643b4ae5c7808 SHA512 6742768f1258a028c9ba56ad1d72f27d7eea4b6bfd324ba29c7f057ab5819816bd728aeaf2a8058031dadcd4c51bc6d08f0e0e0e26c68ed57955e90d68ac5a4b
-DIST NVIDIA-Linux-x86_64-390.48.run 81341723 BLAKE2B 0b787e7f667bf1edb6e5c4c1bfc7c6bea2546208148f84f044c405a857bdbee5c8fbeb4ce325375acf32b4d27d8a10c7f18fbcd880afe1e1e06f31997642c092 SHA512 47f4bcc0d88d1e80ed0c03cacde96301b1c657bec88935ee2edf9b96726620f70c747a174f1a8725b56f4812961878c01df02c249ac4810dc4aedf62d1152a7f
-DIST NVIDIA-Linux-x86_64-390.59.run 82725283 BLAKE2B dd7670d5b3919b0e092491967af0784ff29f4779131d89f12faf15dc2b16c329473dfadc228f4c7a1edf9b7f440a053aee8b2cb9c1f0a125ba74c314fd2208c8 SHA512 083bc6ee0b1b3ca9f48ad87a0fab24f55317451a63e50ff93a45ba39e3bf893a8c063b0d5e796c1b10652306328479422a361495682f0b5af63608bf9a6fa4d3
 DIST NVIDIA-Linux-x86_64-390.67.run 82272406 BLAKE2B b0aafce048e6cf62fde5d86a2829788575709250783922d7a77c48c978dcc36961e83e2c8335ae634bef11e75e92000ffa6c5fdca56a2e6213b152f8f06cd702 SHA512 51478099a0f28674b04e87e26e0e142a0e55cc089e325de791f6b3ed99ef8d7bab074cd97e5e5144d046e970616201b0eba59f55ad958e3c435311d40e3e8dae
 DIST NVIDIA-Linux-x86_64-396.24.run 86545234 BLAKE2B be297b4585275362608cb5119c9f7f77bcf7895bd1320603cb5f8034ee5f1dfa6d0150e58d4a11dd4656b50476d6cb6a372c18db54d33fdd685250ceb0793d3f SHA512 dfe837804d01e903cdf980353add0227362771cd252e4a7d8aff99fc489e5535edfda51ed1a20b9d60e23f1a9e7312f23309c59c67ff0a09a9b9214e52f09077
 DIST nvidia-settings-304.137.tar.bz2 1481361 BLAKE2B cf52a55a34eeb03a685a683487af6a198ba467dd8ba9983cc75624a37a226373cd931d98e8448b7b8ed430c54be2118c7b240ed2a9100b19bec5e832e2f6cdad SHA512 676d1f70c9a78ee234f5f1a283412430a386fa604de211afba02806a45906c5e246a002989b724d74752178d28c92a268de1c98d4c87876797d991253f16b0cc
-DIST nvidia-settings-340.106.tar.bz2 1549841 BLAKE2B 3419467424bc05a4a36f588e326eac4214250686f54c6c440c9a46bab80b15dee77e65d5880ed4338c0fc421306844d20a4dda0d5151a8d49441ef5048ab9bf6 SHA512 670f8469d5127f0966794ed822492f16f7a84656530d0b96f1ccdc915e6c588e9f1417b7ce1cc741df256383292820affaa10784ab748575f4adf2f98f961a27
 DIST nvidia-settings-340.107.tar.bz2 1549413 BLAKE2B 127442ee2c35ceec47ab4f103bdd2d0278c621fcb9be47051111f6f8728ef5699bdc95fe33a3812a807c38c4868b04c2176e2ed218a422171d2a88ac0c00de96 SHA512 593e7e83aa350a3a7beaaa32aca8660d7e203f6f2e460a6e6eabcdc092087f9917ee4e6d141e37ad4e3b0a1b9908c085e4a71d2f579e481a03bbd1c6f75ca776
 DIST nvidia-settings-375.82.tar.gz 2114647 BLAKE2B 26413fde8397e748fae362984039286c53a7fe104228452f3188b5e77b084ff4bf00131e77359ff5e92dfc325680c1f662950175cf806403d2a524ba86158f51 SHA512 7a374be56c8be52767d73a048029d9e55dc2abcf2f6a97eb4931544c927c85a1103a206be9e8d1ffcef36fec2caf2416f33699ad4d51e7dca17e4e844c37a595
 DIST nvidia-settings-378.13.tar.gz 2112676 BLAKE2B 7e3e7c20986c184ddb08808706902f332451df1ab5b0cc295de70c6c26706b067ba6ef96c4e4a68c935ee704ed031cb829c25aa325c6dd2f1ed0423cf5c1aec5 SHA512 6f5fda9c54b067e21f2c869bcfb7c799c99f584d769020cb15e8764f59183e6a6469919ec48bce47be2144910d0004a9ca221df4a9e4fa9ab9f18710b36fa420
 DIST nvidia-settings-381.22.tar.gz 2127491 BLAKE2B 7721ed9df7c01671a56a720e75768c80debe8520aed5a838e1e1d365651db2ae42b0cd21801c60aa18944f8d4751fadac206a388f1cf107a03a25ccb8aeb5c5f SHA512 79cd41b9c0e63b69574caddb62437132810ecb4cd07b90899976ae8535948f28d72021fc9a6969559909cf0f7a5d411b0202782970d64a82c636e7738c9d5681
 DIST nvidia-settings-384.130.tar.bz2 1633217 BLAKE2B ffc1381e680e94aee95752074c39163e48082615f92c6184c01fc7d21e20bf18308d30960db0db602baf89b34fdd295a715692446d21fb2491056ec707e8b844 SHA512 3d878552a78234347f4e51920e8358e56b42d595375e8fd2b0520c3495b02d6fc3877d4346354145c420acd79ff1e9607c312330b2a2e27781a3a576f8860939
 DIST nvidia-settings-387.34.tar.gz 1267616 BLAKE2B 62d2fd329417f54bf384918889603921065e0ef6d4fb691e914534a75ab0062a17d8f886c593cf772d29bb6b56ce30aaf7b1548191b2f9ad5fbee71770ed5308 SHA512 559c859c0740575ab93edce013587250b98d7d2cd55198b5103fe97423d31ed9f113d83c240c402404de88074c285a07e46342538610d3d5dade7bed59d60090
-DIST nvidia-settings-390.48.tar.bz2 1109673 BLAKE2B 5aae2556185cc3a1fdb0f0bf051108661c53868a41d38b46223e4e63447c57971bc565059f107e8a4474356bffecce359966621f463d529c6fc59b5d6706cf26 SHA512 8252f5258e0a3533645d78b8be6c08c5362421423bf4c8e648a4c11ecc1ea2ab56eca07e51e5064dcfa1e4d61b64f837728091bf3ce244526baef58eaf20f1b9
-DIST nvidia-settings-390.59.tar.bz2 1109110 BLAKE2B 5e8fe1da1c8866af1e54bf19875788fa9dffc574bbf34726aab5a8a701ce5335e006f924767ae3f65dcb217f94f00cbf0a1a7bd58c0522041b0b7aac7c9bc7e1 SHA512 67fae068eba7c2d34dcd3fcb8b3c57ebd26664a27a239e52bbdcd1a59d4285a93f022fe72a8dc8694bf604345219b77c70c3ba1303e2bc59d0acd6ff5f5f677d
 DIST nvidia-settings-390.67.tar.bz2 1109133 BLAKE2B 3ac68f374d439c900ddbaa5eda9e3499b0f2b82871155d97319184feed0259a54d9c703d6ce98f03c15a5f47c9aa90f0684c298c7c380dbd112a67a3f89044e9 SHA512 b14df52ebf4640030ecc3a99aa42c97c361ba2c4c777a28813ab83e4ba120693b898a760846e2da33b81fc9ce2a6505c67e818ab3dc6fc580bb6cccbfcab695c
 DIST nvidia-settings-396.24.tar.bz2 1115673 BLAKE2B 5b0bd156505e99a5b788fc61458c902cc1760d999b18c8c6309986d8c315eabc65cb2fea9ef6a823acbe57c4a11bf67938575afffb36fea91320416fe40a7507 SHA512 841470a324bb09683fcd863474f987a525a38213432be3bf4288a48671c674692f44642d260f3d2d0710e485e323153f867d0bda4cfa9b11d0e3c61a36370353

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-uvm.conf b/x11-drivers/nvidia-drivers/files/nvidia-uvm.conf
deleted file mode 100644
index 222c5ba3926..00000000000
--- a/x11-drivers/nvidia-drivers/files/nvidia-uvm.conf
+++ /dev/null
@@ -1,3 +0,0 @@
-# Nvidia UVM support
-
-remove nvidia modprobe -r --ignore-remove nvidia-uvm nvidia

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-340.106.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-340.106.ebuild
deleted file mode 100644
index cb601342d6e..00000000000
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-340.106.ebuild
+++ /dev/null
@@ -1,529 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-inherit eutils flag-o-matic linux-info linux-mod multilib-minimal nvidia-driver \
-	portability toolchain-funcs unpacker user udev
-
-NV_URI="http://http.download.nvidia.com/XFree86/"
-X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
-AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
-X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
-AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
-
-DESCRIPTION="NVIDIA Accelerated Graphics Driver"
-HOMEPAGE="http://www.nvidia.com/ http://www.nvidia.com/Download/Find.aspx"
-SRC_URI="
-	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
-	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
-	x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
-	x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
-	tools? ( ${NV_URI}nvidia-settings/nvidia-settings-${PV}.tar.bz2 )
-"
-
-LICENSE="GPL-2 NVIDIA-r2"
-SLOT="0/${PV%.*}"
-KEYWORDS="-* amd64 x86 ~amd64-fbsd ~x86-fbsd"
-IUSE="acpi multilib kernel_FreeBSD kernel_linux pax_kernel static-libs +tools +X uvm"
-RESTRICT="bindist mirror"
-EMULTILIB_PKG="true"
-
-COMMON="
-	app-eselect/eselect-opencl
-	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
-	tools? (
-		dev-libs/atk
-		dev-libs/glib:2
-		dev-libs/jansson
-		x11-libs/gdk-pixbuf[X]
-		>=x11-libs/gtk+-2.4:2
-		x11-libs/libX11
-		x11-libs/libXext
-		x11-libs/pango[X]
-	)
-	X? (
-		>=app-eselect/eselect-opengl-1.0.9
-	)
-"
-DEPEND="
-	${COMMON}
-	app-arch/xz-utils
-	kernel_linux? ( virtual/linux-sources )
-"
-RDEPEND="
-	${COMMON}
-	acpi? ( sys-power/acpid )
-	tools? ( !media-video/nvidia-settings )
-	X? (
-		<x11-base/xorg-server-1.19.99:=
-		>=x11-libs/libvdpau-0.3-r1
-		sys-libs/zlib[${MULTILIB_USEDEP}]
-		multilib? (
-			>=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
-			>=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
-		)
-	)
-"
-
-REQUIRED_USE="tools? ( X )"
-
-QA_PREBUILT="opt/* usr/lib*"
-
-S=${WORKDIR}/
-
-nvidia_drivers_versions_check() {
-	if use amd64 && has_multilib_profile && \
-		[ "${DEFAULT_ABI}" != "amd64" ]; then
-		eerror "This ebuild doesn't currently support changing your default ABI"
-		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
-	fi
-
-	if use kernel_linux && kernel_is ge 4 11; then
-		ewarn "Gentoo supports kernels which are supported by NVIDIA"
-		ewarn "which are limited to the following kernels:"
-		ewarn "<sys-kernel/gentoo-sources-4.11"
-		ewarn "<sys-kernel/vanilla-sources-4.11"
-		ewarn ""
-		ewarn "You are free to utilize eapply_user to provide whatever"
-		ewarn "support you feel is appropriate, but will not receive"
-		ewarn "support as a result of those changes."
-		ewarn ""
-		ewarn "Do not file a bug report about this."
-		ewarn ""
-	fi
-
-	# Since Nvidia ships many different series of drivers, we need to give the user
-	# some kind of guidance as to what version they should install. This tries
-	# to point the user in the right direction but can't be perfect. check
-	# nvidia-driver.eclass
-	nvidia-driver-check-warning
-
-	# Kernel features/options to check for
-	CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
-	use x86 && CONFIG_CHECK+=" ~HIGHMEM"
-
-	# Now do the above checks
-	use kernel_linux && check_extra_config
-}
-
-pkg_pretend() {
-	nvidia_drivers_versions_check
-}
-
-pkg_setup() {
-	nvidia_drivers_versions_check
-
-	# try to turn off distcc and ccache for people that have a problem with it
-	export DISTCC_DISABLE=1
-	export CCACHE_DISABLE=1
-
-	if use kernel_linux; then
-		MODULE_NAMES="nvidia(video:${S}/kernel)"
-		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel/uvm)"
-
-		# This needs to run after MODULE_NAMES (so that the eclass checks
-		# whether the kernel supports loadable modules) but before BUILD_PARAMS
-		# is set (so that KV_DIR is populated).
-		linux-mod_pkg_setup
-
-		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
-		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC)"
-
-		# linux-mod_src_compile calls set_arch_to_kernel, which
-		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
-		# expects x86_64 or i386 and then converts it to x86
-		# later on in the build process
-		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
-	fi
-
-	# set variables to where files are in the package structure
-	if use kernel_FreeBSD; then
-		use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
-		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
-		NV_DOC="${S}/doc"
-		NV_OBJ="${S}/obj"
-		NV_SRC="${S}/src"
-		NV_MAN="${S}/x11/man"
-		NV_X11="${S}/obj"
-		NV_SOVER=1
-	elif use kernel_linux; then
-		NV_DOC="${S}"
-		NV_OBJ="${S}"
-		NV_SRC="${S}/kernel"
-		NV_MAN="${S}"
-		NV_X11="${S}"
-		NV_SOVER=${PV}
-	else
-		die "Could not determine proper NVIDIA package"
-	fi
-}
-
-src_prepare() {
-	# Please add a brief description for every added patch
-
-	if use kernel_linux; then
-		if kernel_is lt 2 6 9 ; then
-			eerror "You must build this against 2.6.9 or higher kernels."
-		fi
-
-		# If greater than 2.6.5 use M= instead of SUBDIR=
-#		convert_to_m "${NV_SRC}"/Makefile.kbuild
-	fi
-
-	if use pax_kernel; then
-		ewarn "Using PAX patches is not supported. You will be asked to"
-		ewarn "use a standard kernel should you have issues. Should you"
-		ewarn "need support with these patches, contact the PaX team."
-		eapply "${FILESDIR}"/${PN}-331.13-pax-usercopy.patch
-		eapply "${FILESDIR}"/${PN}-337.12-pax-constify.patch
-	fi
-
-	local man_file
-	for man_file in "${NV_MAN}"/*1.gz; do
-		gunzip $man_file || die
-	done
-
-	# Allow user patches so they can support RC kernels and whatever else
-	eapply_user
-}
-
-src_compile() {
-	# This is already the default on Linux, as there's no toplevel Makefile, but
-	# on FreeBSD there's one and triggers the kernel module build, as we install
-	# it by itself, pass this.
-
-	cd "${NV_SRC}"
-	if use kernel_FreeBSD; then
-		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
-			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
-	elif use kernel_linux; then
-		use uvm && MAKEOPTS=-j1
-		linux-mod_src_compile
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src/libXNVCtrl clean
-		emake -C "${S}"/nvidia-settings-${PV}/src/libXNVCtrl \
-			AR="$(tc-getAR)" \
-			CC="$(tc-getCC)" \
-			RANLIB="$(tc-getRANLIB)" \
-			libXNVCtrl.a
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			AR="$(tc-getAR)" \
-			CC="$(tc-getCC)" \
-			LD="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			NVML_ENABLED=0 \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			NV_VERBOSE=1 \
-			RANLIB="$(tc-getRANLIB)" \
-			STRIP_CMD=true
-	fi
-}
-
-# Install nvidia library:
-# the first parameter is the library to install
-# the second parameter is the provided soversion
-# the third parameter is the target directory if its not /usr/lib
-donvidia() {
-	# Full path to library minus SOVER
-	MY_LIB="$1"
-
-	# SOVER to use
-	MY_SOVER="$2"
-
-	# Where to install
-	MY_DEST="$3"
-
-	if [[ -z "${MY_DEST}" ]]; then
-		MY_DEST="/usr/$(get_libdir)"
-		action="dolib.so"
-	else
-		exeinto ${MY_DEST}
-		action="doexe"
-	fi
-
-	# Get just the library name
-	libname=$(basename $1)
-
-	# Install the library with the correct SOVER
-	${action} ${MY_LIB}.${MY_SOVER} || \
-		die "failed to install ${libname}"
-
-	# If SOVER wasn't 1, then we need to create a .1 symlink
-	if [[ "${MY_SOVER}" != "1" ]]; then
-		dosym ${libname}.${MY_SOVER} \
-			${MY_DEST}/${libname}.1 || \
-			die "failed to create ${libname} symlink"
-	fi
-
-	# Always create the symlink from the raw lib to the .1
-	dosym ${libname}.1 \
-		${MY_DEST}/${libname} || \
-		die "failed to create ${libname} symlink"
-}
-
-src_install() {
-	if use kernel_linux; then
-		linux-mod_src_install
-
-		# Add the aliases
-		# This file is tweaked with the appropriate video group in
-		# pkg_preinst, see bug #491414
-		insinto /etc/modprobe.d
-		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
-		use uvm && doins "${FILESDIR}"/nvidia-uvm.conf
-
-		# Ensures that our device nodes are created when not using X
-		exeinto "$(get_udevdir)"
-		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
-		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
-	elif use kernel_FreeBSD; then
-		if use x86-fbsd; then
-			insinto /boot/modules
-			doins "${S}/src/nvidia.kld"
-		fi
-
-		exeinto /boot/modules
-		doexe "${S}/src/nvidia.ko"
-	fi
-
-	# NVIDIA kernel <-> userspace driver config lib
-	donvidia "${NV_OBJ}"/libnvidia-cfg.so ${NV_SOVER}
-
-	# NVIDIA framebuffer capture library
-	donvidia "${NV_OBJ}"/libnvidia-fbc.so ${NV_SOVER}
-
-	# NVIDIA video encode/decode <-> CUDA
-	if use kernel_linux; then
-		donvidia "${NV_OBJ}"/libnvcuvid.so ${NV_SOVER}
-		donvidia "${NV_OBJ}"/libnvidia-encode.so ${NV_SOVER}
-	fi
-
-	if use X; then
-		# Xorg DDX driver
-		insinto /usr/$(get_libdir)/xorg/modules/drivers
-		doins "${NV_X11}"/nvidia_drv.so
-
-		# Xorg GLX driver
-		donvidia "${NV_X11}"/libglx.so ${NV_SOVER} \
-			/usr/$(get_libdir)/opengl/nvidia/extensions
-	fi
-
-	# OpenCL ICD for NVIDIA
-	if use kernel_linux; then
-		insinto /etc/OpenCL/vendors
-		doins "${NV_OBJ}"/nvidia.icd
-	fi
-
-	# Documentation
-	if use kernel_FreeBSD; then
-		dodoc "${NV_DOC}"/README
-		use X && doman "${NV_MAN}"/nvidia-xconfig.1
-		use tools && doman "${NV_MAN}"/nvidia-settings.1
-	else
-		# Docs
-		newdoc "${NV_DOC}"/README.txt README
-		dodoc "${NV_DOC}"/NVIDIA_Changelog
-		doman "${NV_MAN}"/nvidia-smi.1
-		use X && doman "${NV_MAN}"/nvidia-xconfig.1
-		use tools && doman "${NV_MAN}"/nvidia-settings.1
-		doman "${NV_MAN}"/nvidia-cuda-mps-control.1
-	fi
-
-	docinto html
-	dodoc -r "${NV_DOC}"/html/*
-
-	# Helper Apps
-	exeinto /opt/bin/
-
-	if use X; then
-		doexe "${NV_OBJ}"/nvidia-xconfig
-	fi
-
-	if use kernel_linux ; then
-		doexe "${NV_OBJ}"/nvidia-cuda-mps-control
-		doexe "${NV_OBJ}"/nvidia-cuda-mps-server
-		doexe "${NV_OBJ}"/nvidia-debugdump
-		doexe "${NV_OBJ}"/nvidia-persistenced
-		doexe "${NV_OBJ}"/nvidia-smi
-
-		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
-		doexe "${NV_OBJ}"/nvidia-modprobe
-		fowners root:video /opt/bin/nvidia-modprobe
-		fperms 4710 /opt/bin/nvidia-modprobe
-		dosym /{opt,usr}/bin/nvidia-modprobe
-
-		doman nvidia-cuda-mps-control.1
-		doman nvidia-modprobe.1
-		doman nvidia-persistenced.1
-		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
-		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
-		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src/ \
-			DESTDIR="${D}" \
-			LIBDIR="${D}/usr/$(get_libdir)" \
-			PREFIX=/usr \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			install
-
-		if use static-libs; then
-			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
-
-			insinto /usr/include/NVCtrl
-			doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
-		fi
-
-		insinto /usr/share/nvidia/
-		doins nvidia-application-profiles-${PV}-key-documentation
-
-		insinto /etc/nvidia
-		newins \
-			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
-
-		# There is no icon in the FreeBSD tarball.
-		use kernel_FreeBSD || \
-			doicon "${NV_OBJ}"/nvidia-settings.png
-
-		domenu "${FILESDIR}"/nvidia-settings.desktop
-
-		exeinto /etc/X11/xinit/xinitrc.d
-		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
-
-	fi
-
-	dobin "${NV_OBJ}"/nvidia-bug-report.sh
-
-	#doenvd "${FILESDIR}"/50nvidia-prelink-blacklist
-
-	if has_multilib_profile && use multilib ; then
-		local OABI=${ABI}
-		for ABI in $(get_install_abis) ; do
-			src_install-libs
-		done
-		ABI=${OABI}
-		unset OABI
-	else
-		src_install-libs
-	fi
-
-	is_final_abi || die "failed to iterate through all ABIs"
-
-	readme.gentoo_create_doc
-}
-
-src_install-libs() {
-	local inslibdir=$(get_libdir)
-	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
-	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
-	local nv_libdir="${NV_OBJ}"
-
-	if use kernel_linux && has_multilib_profile && \
-			[[ ${ABI} == "x86" ]] ; then
-		nv_libdir="${NV_OBJ}"/32
-	fi
-
-	if use X; then
-		# The GLX libraries
-		donvidia "${nv_libdir}"/libEGL.so ${NV_SOVER} ${GL_ROOT}
-		donvidia "${nv_libdir}"/libGL.so ${NV_SOVER} ${GL_ROOT}
-		donvidia "${nv_libdir}"/libGLESv1_CM.so ${NV_SOVER} ${GL_ROOT}
-		donvidia "${nv_libdir}"/libnvidia-eglcore.so ${NV_SOVER}
-		donvidia "${nv_libdir}"/libnvidia-glcore.so ${NV_SOVER}
-		donvidia "${nv_libdir}"/libnvidia-glsi.so ${NV_SOVER}
-		donvidia "${nv_libdir}"/libnvidia-ifr.so ${NV_SOVER}
-		if use kernel_FreeBSD; then
-			donvidia "${nv_libdir}"/libnvidia-tls.so ${NV_SOVER}
-		else
-			donvidia "${nv_libdir}"/tls/libnvidia-tls.so ${NV_SOVER}
-		fi
-
-		# VDPAU
-		donvidia "${nv_libdir}"/libvdpau_nvidia.so ${NV_SOVER}
-
-		# GLES v2 libraries
-		insinto ${GL_ROOT}
-		doexe "${nv_libdir}"/libGLESv2.so.${PV}
-		dosym libGLESv2.so.${PV} ${GL_ROOT}/libGLESv2.so.2
-		dosym libGLESv2.so.2 ${GL_ROOT}/libGLESv2.so
-	fi
-
-	# NVIDIA monitoring library
-	if use kernel_linux ; then
-		donvidia "${nv_libdir}"/libnvidia-ml.so ${NV_SOVER}
-	fi
-
-	# CUDA & OpenCL
-	if use kernel_linux; then
-		donvidia "${nv_libdir}"/libcuda.so ${NV_SOVER}
-		donvidia "${nv_libdir}"/libnvidia-compiler.so ${NV_SOVER}
-		donvidia "${nv_libdir}"/libOpenCL.so 1.0.0 ${CL_ROOT}
-		donvidia "${nv_libdir}"/libnvidia-opencl.so ${NV_SOVER}
-	fi
-}
-
-pkg_preinst() {
-	if use kernel_linux; then
-		linux-mod_pkg_preinst
-
-		local videogroup="$(egetent group video | cut -d ':' -f 3)"
-		if [ -z "${videogroup}" ]; then
-			eerror "Failed to determine the video group gid"
-			die "Failed to determine the video group gid"
-		else
-			sed -i \
-				-e "s:PACKAGE:${PF}:g" \
-				-e "s:VIDEOGID:${videogroup}:" \
-				"${D}"/etc/modprobe.d/nvidia.conf || die
-		fi
-	fi
-
-	# Clean the dynamic libGL stuff's home to ensure
-	# we dont have stale libs floating around
-	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ] ; then
-		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
-	fi
-	# Make sure we nuke the old nvidia-glx's env.d file
-	if [ -e "${ROOT}"/etc/env.d/09nvidia ] ; then
-		rm -f "${ROOT}"/etc/env.d/09nvidia
-	fi
-}
-
-pkg_postinst() {
-	use kernel_linux && linux-mod_pkg_postinst
-
-	# Switch to the nvidia implementation
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
-	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
-
-	readme.gentoo_print_elog
-
-	if ! use X; then
-		elog "You have elected to not install the X.org driver. Along with"
-		elog "this the OpenGL libraries and VDPAU libraries were not"
-		elog "installed. Additionally, once the driver is loaded your card"
-		elog "and fan will run at max speed which may not be desirable."
-		elog "Use the 'nvidia-smi' init script to have your card and fan"
-		elog "speed scale appropriately."
-		elog
-	fi
-	if ! use tools; then
-		elog "USE=tools controls whether the nvidia-settings application"
-		elog "is installed. If you would like to use it, enable that"
-		elog "flag and re-emerge this ebuild. Optionally you can install"
-		elog "media-video/nvidia-settings"
-		elog
-	fi
-}
-
-pkg_prerm() {
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}
-
-pkg_postrm() {
-	use kernel_linux && linux-mod_pkg_postrm
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-390.48.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-390.48.ebuild
deleted file mode 100644
index 3a6d52c598e..00000000000
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-390.48.ebuild
+++ /dev/null
@@ -1,587 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-inherit eutils flag-o-matic linux-info linux-mod multilib-minimal nvidia-driver \
-	portability toolchain-funcs unpacker user udev
-
-DESCRIPTION="NVIDIA Accelerated Graphics Driver"
-HOMEPAGE="http://www.nvidia.com/ http://www.nvidia.com/Download/Find.aspx"
-
-AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
-AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
-ARM_NV_PACKAGE="NVIDIA-Linux-armv7l-gnueabihf-${PV}"
-X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
-X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
-
-NV_URI="http://us.download.nvidia.com/XFree86/"
-SRC_URI="
-	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
-	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
-	arm? ( ${NV_URI}Linux-32bit-ARM/${PV}/${ARM_NV_PACKAGE}.run )
-	x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
-	x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
-	tools? (
-		https://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2
-	)
-"
-
-LICENSE="GPL-2 NVIDIA-r2"
-SLOT="0/${PV%.*}"
-KEYWORDS="-* amd64 x86 ~amd64-fbsd ~x86-fbsd"
-RESTRICT="bindist mirror"
-EMULTILIB_PKG="true"
-
-IUSE="acpi compat +driver gtk3 kernel_FreeBSD kernel_linux +kms multilib pax_kernel static-libs +tools uvm wayland +X"
-REQUIRED_USE="
-	tools? ( X )
-	static-libs? ( tools )
-"
-
-COMMON="
-	app-eselect/eselect-opencl
-	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
-	tools? (
-		dev-libs/atk
-		dev-libs/glib:2
-		dev-libs/jansson
-		gtk3? (
-			x11-libs/gtk+:3
-		)
-		x11-libs/cairo
-		x11-libs/gdk-pixbuf[X]
-		x11-libs/gtk+:2
-		x11-libs/libX11
-		x11-libs/libXext
-		x11-libs/libXrandr
-		x11-libs/libXv
-		x11-libs/libXxf86vm
-		x11-libs/pango[X]
-	)
-	X? (
-		>=app-eselect/eselect-opengl-1.0.9
-		app-misc/pax-utils
-	)
-"
-DEPEND="
-	${COMMON}
-	kernel_linux? ( virtual/linux-sources )
-	tools? ( sys-apps/dbus )
-"
-RDEPEND="
-	${COMMON}
-	acpi? ( sys-power/acpid )
-	tools? ( !media-video/nvidia-settings )
-	wayland? ( dev-libs/wayland[${MULTILIB_USEDEP}] )
-	X? (
-		<x11-base/xorg-server-1.19.99:=
-		>=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
-		>=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
-		>=x11-libs/libvdpau-1.0[${MULTILIB_USEDEP}]
-		sys-libs/zlib[${MULTILIB_USEDEP}]
-	)
-"
-QA_PREBUILT="opt/* usr/lib*"
-S=${WORKDIR}/
-
-nvidia_drivers_versions_check() {
-	if use amd64 && has_multilib_profile && \
-		[ "${DEFAULT_ABI}" != "amd64" ]; then
-		eerror "This ebuild doesn't currently support changing your default ABI"
-		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
-	fi
-
-	if use kernel_linux && kernel_is ge 4 16; then
-		ewarn "Gentoo supports kernels which are supported by NVIDIA"
-		ewarn "which are limited to the following kernels:"
-		ewarn "<sys-kernel/gentoo-sources-4.16"
-		ewarn "<sys-kernel/vanilla-sources-4.16"
-		ewarn ""
-		ewarn "You are free to utilize epatch_user to provide whatever"
-		ewarn "support you feel is appropriate, but will not receive"
-		ewarn "support as a result of those changes."
-		ewarn ""
-		ewarn "Do not file a bug report about this."
-		ewarn ""
-	fi
-
-	# Since Nvidia ships many different series of drivers, we need to give the user
-	# some kind of guidance as to what version they should install. This tries
-	# to point the user in the right direction but can't be perfect. check
-	# nvidia-driver.eclass
-	nvidia-driver-check-warning
-
-	# Kernel features/options to check for
-	CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
-	use x86 && CONFIG_CHECK+=" ~HIGHMEM"
-
-	# Now do the above checks
-	use kernel_linux && check_extra_config
-}
-
-pkg_pretend() {
-	nvidia_drivers_versions_check
-}
-
-pkg_setup() {
-	nvidia_drivers_versions_check
-
-	# try to turn off distcc and ccache for people that have a problem with it
-	export DISTCC_DISABLE=1
-	export CCACHE_DISABLE=1
-
-	if use driver && use kernel_linux; then
-		MODULE_NAMES="nvidia(video:${S}/kernel)"
-		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
-		use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel) nvidia-drm(video:${S}/kernel)"
-
-		# This needs to run after MODULE_NAMES (so that the eclass checks
-		# whether the kernel supports loadable modules) but before BUILD_PARAMS
-		# is set (so that KV_DIR is populated).
-		linux-mod_pkg_setup
-
-		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
-		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
-
-		# linux-mod_src_compile calls set_arch_to_kernel, which
-		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
-		# expects x86_64 or i386 and then converts it to x86
-		# later on in the build process
-		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
-	fi
-
-	if use kernel_linux && kernel_is lt 2 6 9; then
-		eerror "You must build this against 2.6.9 or higher kernels."
-	fi
-
-	# set variables to where files are in the package structure
-	if use kernel_FreeBSD; then
-		use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
-		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
-		NV_DOC="${S}/doc"
-		NV_OBJ="${S}/obj"
-		NV_SRC="${S}/src"
-		NV_MAN="${S}/x11/man"
-		NV_X11="${S}/obj"
-		NV_SOVER=1
-	elif use kernel_linux; then
-		NV_DOC="${S}"
-		NV_OBJ="${S}"
-		NV_SRC="${S}/kernel"
-		NV_MAN="${S}"
-		NV_X11="${S}"
-		NV_SOVER=${PV}
-	else
-		die "Could not determine proper NVIDIA package"
-	fi
-}
-
-src_prepare() {
-	if use pax_kernel; then
-		ewarn "Using PAX patches is not supported. You will be asked to"
-		ewarn "use a standard kernel should you have issues. Should you"
-		ewarn "need support with these patches, contact the PaX team."
-		eapply "${FILESDIR}"/${PN}-375.20-pax.patch
-	fi
-
-	local man_file
-	for man_file in "${NV_MAN}"/*1.gz; do
-		gunzip $man_file || die
-	done
-
-	if use tools; then
-		cp "${FILESDIR}"/nvidia-settings-linker.patch "${WORKDIR}" || die
-		sed -i \
-			-e "s:@PV@:${PV}:g" \
-			"${WORKDIR}"/nvidia-settings-linker.patch || die
-		eapply "${WORKDIR}"/nvidia-settings-linker.patch
-	fi
-
-	default
-
-	if ! [ -f nvidia_icd.json ]; then
-		cp nvidia_icd.json.template nvidia_icd.json || die
-		sed -i -e 's:__NV_VK_ICD__:libGLX_nvidia.so.0:g' nvidia_icd.json || die
-	fi
-}
-
-src_compile() {
-	# This is already the default on Linux, as there's no toplevel Makefile, but
-	# on FreeBSD there's one and triggers the kernel module build, as we install
-	# it by itself, pass this.
-
-	cd "${NV_SRC}"
-	if use kernel_FreeBSD; then
-		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
-			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
-	elif use driver && use kernel_linux; then
-		MAKEOPTS=-j1 linux-mod_src_compile
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			AR="$(tc-getAR)" \
-			CC="$(tc-getCC)" \
-			DO_STRIP= \
-			LD="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			NVLD="$(tc-getLD)" \
-			NV_VERBOSE=1 \
-			RANLIB="$(tc-getRANLIB)" \
-			build-xnvctrl
-
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			CC="$(tc-getCC)" \
-			DO_STRIP= \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LD="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			NVLD="$(tc-getLD)" \
-			NVML_ENABLED=0 \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			NV_VERBOSE=1
-	fi
-}
-
-# Install nvidia library:
-# the first parameter is the library to install
-# the second parameter is the provided soversion
-# the third parameter is the target directory if it is not /usr/lib
-donvidia() {
-	# Full path to library
-	nv_LIB="${1}"
-
-	# SOVER to use
-	nv_SOVER="$(scanelf -qF'%S#F' ${nv_LIB})"
-
-	# Where to install
-	nv_DEST="${2}"
-
-	# Get just the library name
-	nv_LIBNAME=$(basename "${nv_LIB}")
-
-	if [[ "${nv_DEST}" ]]; then
-		exeinto ${nv_DEST}
-		action="doexe"
-	else
-		nv_DEST="/usr/$(get_libdir)"
-		action="dolib.so"
-	fi
-
-	# Install the library
-	${action} ${nv_LIB} || die "failed to install ${nv_LIBNAME}"
-
-	# If the library has a SONAME and SONAME does not match the library name,
-	# then we need to create a symlink
-	if [[ ${nv_SOVER} ]] && ! [[ "${nv_SOVER}" = "${nv_LIBNAME}" ]]; then
-		dosym ${nv_LIBNAME} ${nv_DEST}/${nv_SOVER} \
-			|| die "failed to create ${nv_DEST}/${nv_SOVER} symlink"
-	fi
-
-	dosym ${nv_LIBNAME} ${nv_DEST}/${nv_LIBNAME/.so*/.so} \
-		|| die "failed to create ${nv_LIBNAME/.so*/.so} symlink"
-}
-
-src_install() {
-	if use driver && use kernel_linux; then
-		linux-mod_src_install
-
-		# Add the aliases
-		# This file is tweaked with the appropriate video group in
-		# pkg_preinst, see bug #491414
-		insinto /etc/modprobe.d
-		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
-		doins "${FILESDIR}"/nvidia-rmmod.conf
-
-		# Ensures that our device nodes are created when not using X
-		exeinto "$(get_udevdir)"
-		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
-		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
-	elif use kernel_FreeBSD; then
-		if use x86-fbsd; then
-			insinto /boot/modules
-			doins "${S}/src/nvidia.kld"
-		fi
-
-		exeinto /boot/modules
-		doexe "${S}/src/nvidia.ko"
-	fi
-
-	# NVIDIA kernel <-> userspace driver config lib
-	donvidia ${NV_OBJ}/libnvidia-cfg.so.${NV_SOVER}
-
-	# NVIDIA framebuffer capture library
-	donvidia ${NV_OBJ}/libnvidia-fbc.so.${NV_SOVER}
-
-	# NVIDIA video encode/decode <-> CUDA
-	if use kernel_linux; then
-		donvidia ${NV_OBJ}/libnvcuvid.so.${NV_SOVER}
-		donvidia ${NV_OBJ}/libnvidia-encode.so.${NV_SOVER}
-	fi
-
-	if use X; then
-		# Xorg DDX driver
-		insinto /usr/$(get_libdir)/xorg/modules/drivers
-		doins ${NV_X11}/nvidia_drv.so
-
-		# Xorg GLX driver
-		donvidia ${NV_X11}/libglx.so.${NV_SOVER} \
-			/usr/$(get_libdir)/opengl/nvidia/extensions
-
-		# Xorg nvidia.conf
-		if has_version '>=x11-base/xorg-server-1.16'; then
-			insinto /usr/share/X11/xorg.conf.d
-			newins {,50-}nvidia-drm-outputclass.conf
-		fi
-
-		insinto /usr/share/glvnd/egl_vendor.d
-		doins ${NV_X11}/10_nvidia.json
-	fi
-
-	if use wayland; then
-		insinto /usr/share/egl/egl_external_platform.d
-		doins ${NV_X11}/10_nvidia_wayland.json
-	fi
-
-	# OpenCL ICD for NVIDIA
-	if use kernel_linux; then
-		insinto /etc/OpenCL/vendors
-		doins ${NV_OBJ}/nvidia.icd
-	fi
-
-	# Documentation
-	if use kernel_FreeBSD; then
-		dodoc "${NV_DOC}/README"
-		use X && doman "${NV_MAN}"/nvidia-xconfig.1
-		use tools && doman "${NV_MAN}"/nvidia-settings.1
-	else
-		# Docs
-		newdoc "${NV_DOC}/README.txt" README
-		dodoc "${NV_DOC}/NVIDIA_Changelog"
-		doman "${NV_MAN}"/nvidia-smi.1
-		use X && doman "${NV_MAN}"/nvidia-xconfig.1
-		use tools && doman "${NV_MAN}"/nvidia-settings.1
-		doman "${NV_MAN}"/nvidia-cuda-mps-control.1
-	fi
-
-	docinto html
-	dodoc -r ${NV_DOC}/html/*
-
-	# Helper Apps
-	exeinto /opt/bin/
-
-	if use X; then
-		doexe ${NV_OBJ}/nvidia-xconfig
-
-		insinto /etc/vulkan/icd.d
-		doins nvidia_icd.json
-	fi
-
-	if use kernel_linux; then
-		doexe ${NV_OBJ}/nvidia-cuda-mps-control
-		doexe ${NV_OBJ}/nvidia-cuda-mps-server
-		doexe ${NV_OBJ}/nvidia-debugdump
-		doexe ${NV_OBJ}/nvidia-persistenced
-		doexe ${NV_OBJ}/nvidia-smi
-
-		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
-		doexe ${NV_OBJ}/nvidia-modprobe
-		fowners root:video /opt/bin/nvidia-modprobe
-		fperms 4710 /opt/bin/nvidia-modprobe
-		dosym /{opt,usr}/bin/nvidia-modprobe
-
-		doman nvidia-cuda-mps-control.1
-		doman nvidia-modprobe.1
-		doman nvidia-persistenced.1
-		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
-		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
-		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src/ \
-			DESTDIR="${D}" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LIBDIR="${D}/usr/$(get_libdir)" \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			NV_VERBOSE=1 \
-			PREFIX=/usr \
-			DO_STRIP= \
-			install
-
-		if use static-libs; then
-			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
-
-			insinto /usr/include/NVCtrl
-			doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
-		fi
-
-		insinto /usr/share/nvidia/
-		doins nvidia-application-profiles-${PV}-key-documentation
-
-		insinto /etc/nvidia
-		newins \
-			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
-
-		# There is no icon in the FreeBSD tarball.
-		use kernel_FreeBSD || \
-			doicon ${NV_OBJ}/nvidia-settings.png
-
-		domenu "${FILESDIR}"/nvidia-settings.desktop
-
-		exeinto /etc/X11/xinit/xinitrc.d
-		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
-	fi
-
-	dobin ${NV_OBJ}/nvidia-bug-report.sh
-
-	if has_multilib_profile && use multilib; then
-		local OABI=${ABI}
-		for ABI in $(get_install_abis); do
-			src_install-libs
-		done
-		ABI=${OABI}
-		unset OABI
-	else
-		src_install-libs
-	fi
-
-	is_final_abi || die "failed to iterate through all ABIs"
-
-	readme.gentoo_create_doc
-}
-
-src_install-libs() {
-	local inslibdir=$(get_libdir)
-	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
-	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
-	local nv_libdir="${NV_OBJ}"
-
-	if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
-		nv_libdir="${NV_OBJ}"/32
-	fi
-
-	if use X; then
-		NV_GLX_LIBRARIES=(
-			"libEGL.so.$(usex compat ${NV_SOVER} 1.1.0) ${GL_ROOT}"
-			"libEGL_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGL.so.$(usex compat ${NV_SOVER} 1.7.0) ${GL_ROOT}"
-			"libGLESv1_CM.so.1.2.0 ${GL_ROOT}"
-			"libGLESv1_CM_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLESv2.so.2.1.0 ${GL_ROOT}"
-			"libGLESv2_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLX.so.0 ${GL_ROOT}"
-			"libGLX_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLdispatch.so.0 ${GL_ROOT}"
-			"libOpenCL.so.1.0.0 ${CL_ROOT}"
-			"libOpenGL.so.0 ${GL_ROOT}"
-			"libcuda.so.${NV_SOVER}"
-			"libnvcuvid.so.${NV_SOVER}"
-			"libnvidia-compiler.so.${NV_SOVER}"
-			"libnvidia-eglcore.so.${NV_SOVER}"
-			"libnvidia-encode.so.${NV_SOVER}"
-			"libnvidia-fatbinaryloader.so.${NV_SOVER}"
-			"libnvidia-fbc.so.${NV_SOVER}"
-			"libnvidia-glcore.so.${NV_SOVER}"
-			"libnvidia-glsi.so.${NV_SOVER}"
-			"libnvidia-ifr.so.${NV_SOVER}"
-			"libnvidia-opencl.so.${NV_SOVER}"
-			"libnvidia-ptxjitcompiler.so.${NV_SOVER}"
-			"libvdpau_nvidia.so.${NV_SOVER}"
-		)
-
-		if use wayland && has_multilib_profile && [[ ${ABI} == "amd64" ]];
-		then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-egl-wayland.so.1.0.2"
-			)
-		fi
-
-		if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
-		then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-wfb.so.${NV_SOVER}"
-			)
-		fi
-
-		if use kernel_FreeBSD; then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-tls.so.${NV_SOVER}"
-			)
-		fi
-
-		if use kernel_linux; then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-ml.so.${NV_SOVER}"
-				"tls/libnvidia-tls.so.${NV_SOVER}"
-			)
-		fi
-
-		for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
-			donvidia "${nv_libdir}"/${NV_LIB}
-		done
-	fi
-}
-
-pkg_preinst() {
-	if use driver && use kernel_linux; then
-		linux-mod_pkg_preinst
-
-		local videogroup="$(egetent group video | cut -d ':' -f 3)"
-		if [ -z "${videogroup}" ]; then
-			eerror "Failed to determine the video group gid"
-			die "Failed to determine the video group gid"
-		else
-			sed -i \
-				-e "s:PACKAGE:${PF}:g" \
-				-e "s:VIDEOGID:${videogroup}:" \
-				"${D}"/etc/modprobe.d/nvidia.conf || die
-		fi
-	fi
-
-	# Clean the dynamic libGL stuff's home to ensure
-	# we dont have stale libs floating around
-	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ]; then
-		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
-	fi
-	# Make sure we nuke the old nvidia-glx's env.d file
-	if [ -e "${ROOT}"/etc/env.d/09nvidia ]; then
-		rm -f "${ROOT}"/etc/env.d/09nvidia
-	fi
-}
-
-pkg_postinst() {
-	use driver && use kernel_linux && linux-mod_pkg_postinst
-
-	# Switch to the nvidia implementation
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
-	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
-
-	readme.gentoo_print_elog
-
-	if ! use X; then
-		elog "You have elected to not install the X.org driver. Along with"
-		elog "this the OpenGL libraries and VDPAU libraries were not"
-		elog "installed. Additionally, once the driver is loaded your card"
-		elog "and fan will run at max speed which may not be desirable."
-		elog "Use the 'nvidia-smi' init script to have your card and fan"
-		elog "speed scale appropriately."
-		elog
-	fi
-	if ! use tools; then
-		elog "USE=tools controls whether the nvidia-settings application"
-		elog "is installed. If you would like to use it, enable that"
-		elog "flag and re-emerge this ebuild. Optionally you can install"
-		elog "media-video/nvidia-settings"
-		elog
-	fi
-}
-
-pkg_prerm() {
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}
-
-pkg_postrm() {
-	use driver && use kernel_linux && linux-mod_pkg_postrm
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-390.59.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-390.59.ebuild
deleted file mode 100644
index c88bd1af6e0..00000000000
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-390.59.ebuild
+++ /dev/null
@@ -1,587 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-inherit eutils flag-o-matic linux-info linux-mod multilib-minimal nvidia-driver \
-	portability toolchain-funcs unpacker user udev
-
-DESCRIPTION="NVIDIA Accelerated Graphics Driver"
-HOMEPAGE="http://www.nvidia.com/ http://www.nvidia.com/Download/Find.aspx"
-
-AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
-AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
-ARM_NV_PACKAGE="NVIDIA-Linux-armv7l-gnueabihf-${PV}"
-X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
-X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
-
-NV_URI="http://us.download.nvidia.com/XFree86/"
-SRC_URI="
-	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
-	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
-	arm? ( ${NV_URI}Linux-x86-ARM/${PV}/${ARM_NV_PACKAGE}.run )
-	x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
-	x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
-	tools? (
-		https://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2
-	)
-"
-
-LICENSE="GPL-2 NVIDIA-r2"
-SLOT="0/${PV%.*}"
-KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
-RESTRICT="bindist mirror"
-EMULTILIB_PKG="true"
-
-IUSE="acpi compat +driver gtk3 kernel_FreeBSD kernel_linux +kms multilib pax_kernel static-libs +tools uvm wayland +X"
-REQUIRED_USE="
-	tools? ( X )
-	static-libs? ( tools )
-"
-
-COMMON="
-	app-eselect/eselect-opencl
-	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
-	tools? (
-		dev-libs/atk
-		dev-libs/glib:2
-		dev-libs/jansson
-		gtk3? (
-			x11-libs/gtk+:3
-		)
-		x11-libs/cairo
-		x11-libs/gdk-pixbuf[X]
-		x11-libs/gtk+:2
-		x11-libs/libX11
-		x11-libs/libXext
-		x11-libs/libXrandr
-		x11-libs/libXv
-		x11-libs/libXxf86vm
-		x11-libs/pango[X]
-	)
-	X? (
-		>=app-eselect/eselect-opengl-1.0.9
-		app-misc/pax-utils
-	)
-"
-DEPEND="
-	${COMMON}
-	kernel_linux? ( virtual/linux-sources )
-	tools? ( sys-apps/dbus )
-"
-RDEPEND="
-	${COMMON}
-	acpi? ( sys-power/acpid )
-	tools? ( !media-video/nvidia-settings )
-	wayland? ( dev-libs/wayland[${MULTILIB_USEDEP}] )
-	X? (
-		<x11-base/xorg-server-1.20.99:=
-		>=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
-		>=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
-		>=x11-libs/libvdpau-1.0[${MULTILIB_USEDEP}]
-		sys-libs/zlib[${MULTILIB_USEDEP}]
-	)
-"
-QA_PREBUILT="opt/* usr/lib*"
-S=${WORKDIR}/
-
-nvidia_drivers_versions_check() {
-	if use amd64 && has_multilib_profile && \
-		[ "${DEFAULT_ABI}" != "amd64" ]; then
-		eerror "This ebuild doesn't currently support changing your default ABI"
-		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
-	fi
-
-	if use kernel_linux && kernel_is ge 4 16; then
-		ewarn "Gentoo supports kernels which are supported by NVIDIA"
-		ewarn "which are limited to the following kernels:"
-		ewarn "<sys-kernel/gentoo-sources-4.16"
-		ewarn "<sys-kernel/vanilla-sources-4.16"
-		ewarn ""
-		ewarn "You are free to utilize epatch_user to provide whatever"
-		ewarn "support you feel is appropriate, but will not receive"
-		ewarn "support as a result of those changes."
-		ewarn ""
-		ewarn "Do not file a bug report about this."
-		ewarn ""
-	fi
-
-	# Since Nvidia ships many different series of drivers, we need to give the user
-	# some kind of guidance as to what version they should install. This tries
-	# to point the user in the right direction but can't be perfect. check
-	# nvidia-driver.eclass
-	nvidia-driver-check-warning
-
-	# Kernel features/options to check for
-	CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
-	use x86 && CONFIG_CHECK+=" ~HIGHMEM"
-
-	# Now do the above checks
-	use kernel_linux && check_extra_config
-}
-
-pkg_pretend() {
-	nvidia_drivers_versions_check
-}
-
-pkg_setup() {
-	nvidia_drivers_versions_check
-
-	# try to turn off distcc and ccache for people that have a problem with it
-	export DISTCC_DISABLE=1
-	export CCACHE_DISABLE=1
-
-	if use driver && use kernel_linux; then
-		MODULE_NAMES="nvidia(video:${S}/kernel)"
-		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
-		use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel) nvidia-drm(video:${S}/kernel)"
-
-		# This needs to run after MODULE_NAMES (so that the eclass checks
-		# whether the kernel supports loadable modules) but before BUILD_PARAMS
-		# is set (so that KV_DIR is populated).
-		linux-mod_pkg_setup
-
-		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
-		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
-
-		# linux-mod_src_compile calls set_arch_to_kernel, which
-		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
-		# expects x86_64 or i386 and then converts it to x86
-		# later on in the build process
-		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
-	fi
-
-	if use kernel_linux && kernel_is lt 2 6 9; then
-		eerror "You must build this against 2.6.9 or higher kernels."
-	fi
-
-	# set variables to where files are in the package structure
-	if use kernel_FreeBSD; then
-		use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
-		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
-		NV_DOC="${S}/doc"
-		NV_OBJ="${S}/obj"
-		NV_SRC="${S}/src"
-		NV_MAN="${S}/x11/man"
-		NV_X11="${S}/obj"
-		NV_SOVER=1
-	elif use kernel_linux; then
-		NV_DOC="${S}"
-		NV_OBJ="${S}"
-		NV_SRC="${S}/kernel"
-		NV_MAN="${S}"
-		NV_X11="${S}"
-		NV_SOVER=${PV}
-	else
-		die "Could not determine proper NVIDIA package"
-	fi
-}
-
-src_prepare() {
-	if use pax_kernel; then
-		ewarn "Using PAX patches is not supported. You will be asked to"
-		ewarn "use a standard kernel should you have issues. Should you"
-		ewarn "need support with these patches, contact the PaX team."
-		eapply "${FILESDIR}"/${PN}-375.20-pax.patch
-	fi
-
-	local man_file
-	for man_file in "${NV_MAN}"/*1.gz; do
-		gunzip $man_file || die
-	done
-
-	if use tools; then
-		cp "${FILESDIR}"/nvidia-settings-linker.patch "${WORKDIR}" || die
-		sed -i \
-			-e "s:@PV@:${PV}:g" \
-			"${WORKDIR}"/nvidia-settings-linker.patch || die
-		eapply "${WORKDIR}"/nvidia-settings-linker.patch
-	fi
-
-	default
-
-	if ! [ -f nvidia_icd.json ]; then
-		cp nvidia_icd.json.template nvidia_icd.json || die
-		sed -i -e 's:__NV_VK_ICD__:libGLX_nvidia.so.0:g' nvidia_icd.json || die
-	fi
-}
-
-src_compile() {
-	# This is already the default on Linux, as there's no toplevel Makefile, but
-	# on FreeBSD there's one and triggers the kernel module build, as we install
-	# it by itself, pass this.
-
-	cd "${NV_SRC}"
-	if use kernel_FreeBSD; then
-		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
-			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
-	elif use driver && use kernel_linux; then
-		MAKEOPTS=-j1 linux-mod_src_compile
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			AR="$(tc-getAR)" \
-			CC="$(tc-getCC)" \
-			DO_STRIP= \
-			LD="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			NVLD="$(tc-getLD)" \
-			NV_VERBOSE=1 \
-			RANLIB="$(tc-getRANLIB)" \
-			build-xnvctrl
-
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			CC="$(tc-getCC)" \
-			DO_STRIP= \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LD="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			NVLD="$(tc-getLD)" \
-			NVML_ENABLED=0 \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			NV_VERBOSE=1
-	fi
-}
-
-# Install nvidia library:
-# the first parameter is the library to install
-# the second parameter is the provided soversion
-# the third parameter is the target directory if it is not /usr/lib
-donvidia() {
-	# Full path to library
-	nv_LIB="${1}"
-
-	# SOVER to use
-	nv_SOVER="$(scanelf -qF'%S#F' ${nv_LIB})"
-
-	# Where to install
-	nv_DEST="${2}"
-
-	# Get just the library name
-	nv_LIBNAME=$(basename "${nv_LIB}")
-
-	if [[ "${nv_DEST}" ]]; then
-		exeinto ${nv_DEST}
-		action="doexe"
-	else
-		nv_DEST="/usr/$(get_libdir)"
-		action="dolib.so"
-	fi
-
-	# Install the library
-	${action} ${nv_LIB} || die "failed to install ${nv_LIBNAME}"
-
-	# If the library has a SONAME and SONAME does not match the library name,
-	# then we need to create a symlink
-	if [[ ${nv_SOVER} ]] && ! [[ "${nv_SOVER}" = "${nv_LIBNAME}" ]]; then
-		dosym ${nv_LIBNAME} ${nv_DEST}/${nv_SOVER} \
-			|| die "failed to create ${nv_DEST}/${nv_SOVER} symlink"
-	fi
-
-	dosym ${nv_LIBNAME} ${nv_DEST}/${nv_LIBNAME/.so*/.so} \
-		|| die "failed to create ${nv_LIBNAME/.so*/.so} symlink"
-}
-
-src_install() {
-	if use driver && use kernel_linux; then
-		linux-mod_src_install
-
-		# Add the aliases
-		# This file is tweaked with the appropriate video group in
-		# pkg_preinst, see bug #491414
-		insinto /etc/modprobe.d
-		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
-		doins "${FILESDIR}"/nvidia-rmmod.conf
-
-		# Ensures that our device nodes are created when not using X
-		exeinto "$(get_udevdir)"
-		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
-		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
-	elif use kernel_FreeBSD; then
-		if use x86-fbsd; then
-			insinto /boot/modules
-			doins "${S}/src/nvidia.kld"
-		fi
-
-		exeinto /boot/modules
-		doexe "${S}/src/nvidia.ko"
-	fi
-
-	# NVIDIA kernel <-> userspace driver config lib
-	donvidia ${NV_OBJ}/libnvidia-cfg.so.${NV_SOVER}
-
-	# NVIDIA framebuffer capture library
-	donvidia ${NV_OBJ}/libnvidia-fbc.so.${NV_SOVER}
-
-	# NVIDIA video encode/decode <-> CUDA
-	if use kernel_linux; then
-		donvidia ${NV_OBJ}/libnvcuvid.so.${NV_SOVER}
-		donvidia ${NV_OBJ}/libnvidia-encode.so.${NV_SOVER}
-	fi
-
-	if use X; then
-		# Xorg DDX driver
-		insinto /usr/$(get_libdir)/xorg/modules/drivers
-		doins ${NV_X11}/nvidia_drv.so
-
-		# Xorg GLX driver
-		donvidia ${NV_X11}/libglx.so.${NV_SOVER} \
-			/usr/$(get_libdir)/opengl/nvidia/extensions
-
-		# Xorg nvidia.conf
-		if has_version '>=x11-base/xorg-server-1.16'; then
-			insinto /usr/share/X11/xorg.conf.d
-			newins {,50-}nvidia-drm-outputclass.conf
-		fi
-
-		insinto /usr/share/glvnd/egl_vendor.d
-		doins ${NV_X11}/10_nvidia.json
-	fi
-
-	if use wayland; then
-		insinto /usr/share/egl/egl_external_platform.d
-		doins ${NV_X11}/10_nvidia_wayland.json
-	fi
-
-	# OpenCL ICD for NVIDIA
-	if use kernel_linux; then
-		insinto /etc/OpenCL/vendors
-		doins ${NV_OBJ}/nvidia.icd
-	fi
-
-	# Documentation
-	if use kernel_FreeBSD; then
-		dodoc "${NV_DOC}/README"
-		use X && doman "${NV_MAN}"/nvidia-xconfig.1
-		use tools && doman "${NV_MAN}"/nvidia-settings.1
-	else
-		# Docs
-		newdoc "${NV_DOC}/README.txt" README
-		dodoc "${NV_DOC}/NVIDIA_Changelog"
-		doman "${NV_MAN}"/nvidia-smi.1
-		use X && doman "${NV_MAN}"/nvidia-xconfig.1
-		use tools && doman "${NV_MAN}"/nvidia-settings.1
-		doman "${NV_MAN}"/nvidia-cuda-mps-control.1
-	fi
-
-	docinto html
-	dodoc -r ${NV_DOC}/html/*
-
-	# Helper Apps
-	exeinto /opt/bin/
-
-	if use X; then
-		doexe ${NV_OBJ}/nvidia-xconfig
-
-		insinto /etc/vulkan/icd.d
-		doins nvidia_icd.json
-	fi
-
-	if use kernel_linux; then
-		doexe ${NV_OBJ}/nvidia-cuda-mps-control
-		doexe ${NV_OBJ}/nvidia-cuda-mps-server
-		doexe ${NV_OBJ}/nvidia-debugdump
-		doexe ${NV_OBJ}/nvidia-persistenced
-		doexe ${NV_OBJ}/nvidia-smi
-
-		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
-		doexe ${NV_OBJ}/nvidia-modprobe
-		fowners root:video /opt/bin/nvidia-modprobe
-		fperms 4710 /opt/bin/nvidia-modprobe
-		dosym /{opt,usr}/bin/nvidia-modprobe
-
-		doman nvidia-cuda-mps-control.1
-		doman nvidia-modprobe.1
-		doman nvidia-persistenced.1
-		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
-		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
-		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src/ \
-			DESTDIR="${D}" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LIBDIR="${D}/usr/$(get_libdir)" \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			NV_VERBOSE=1 \
-			PREFIX=/usr \
-			DO_STRIP= \
-			install
-
-		if use static-libs; then
-			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
-
-			insinto /usr/include/NVCtrl
-			doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
-		fi
-
-		insinto /usr/share/nvidia/
-		doins nvidia-application-profiles-${PV}-key-documentation
-
-		insinto /etc/nvidia
-		newins \
-			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
-
-		# There is no icon in the FreeBSD tarball.
-		use kernel_FreeBSD || \
-			doicon ${NV_OBJ}/nvidia-settings.png
-
-		domenu "${FILESDIR}"/nvidia-settings.desktop
-
-		exeinto /etc/X11/xinit/xinitrc.d
-		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
-	fi
-
-	dobin ${NV_OBJ}/nvidia-bug-report.sh
-
-	if has_multilib_profile && use multilib; then
-		local OABI=${ABI}
-		for ABI in $(get_install_abis); do
-			src_install-libs
-		done
-		ABI=${OABI}
-		unset OABI
-	else
-		src_install-libs
-	fi
-
-	is_final_abi || die "failed to iterate through all ABIs"
-
-	readme.gentoo_create_doc
-}
-
-src_install-libs() {
-	local inslibdir=$(get_libdir)
-	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
-	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
-	local nv_libdir="${NV_OBJ}"
-
-	if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
-		nv_libdir="${NV_OBJ}"/32
-	fi
-
-	if use X; then
-		NV_GLX_LIBRARIES=(
-			"libEGL.so.$(usex compat ${NV_SOVER} 1.1.0) ${GL_ROOT}"
-			"libEGL_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGL.so.$(usex compat ${NV_SOVER} 1.7.0) ${GL_ROOT}"
-			"libGLESv1_CM.so.1.2.0 ${GL_ROOT}"
-			"libGLESv1_CM_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLESv2.so.2.1.0 ${GL_ROOT}"
-			"libGLESv2_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLX.so.0 ${GL_ROOT}"
-			"libGLX_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLdispatch.so.0 ${GL_ROOT}"
-			"libOpenCL.so.1.0.0 ${CL_ROOT}"
-			"libOpenGL.so.0 ${GL_ROOT}"
-			"libcuda.so.${NV_SOVER}"
-			"libnvcuvid.so.${NV_SOVER}"
-			"libnvidia-compiler.so.${NV_SOVER}"
-			"libnvidia-eglcore.so.${NV_SOVER}"
-			"libnvidia-encode.so.${NV_SOVER}"
-			"libnvidia-fatbinaryloader.so.${NV_SOVER}"
-			"libnvidia-fbc.so.${NV_SOVER}"
-			"libnvidia-glcore.so.${NV_SOVER}"
-			"libnvidia-glsi.so.${NV_SOVER}"
-			"libnvidia-ifr.so.${NV_SOVER}"
-			"libnvidia-opencl.so.${NV_SOVER}"
-			"libnvidia-ptxjitcompiler.so.${NV_SOVER}"
-			"libvdpau_nvidia.so.${NV_SOVER}"
-		)
-
-		if use wayland && has_multilib_profile && [[ ${ABI} == "amd64" ]];
-		then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-egl-wayland.so.1.0.2"
-			)
-		fi
-
-		if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
-		then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-wfb.so.${NV_SOVER}"
-			)
-		fi
-
-		if use kernel_FreeBSD; then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-tls.so.${NV_SOVER}"
-			)
-		fi
-
-		if use kernel_linux; then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-ml.so.${NV_SOVER}"
-				"tls/libnvidia-tls.so.${NV_SOVER}"
-			)
-		fi
-
-		for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
-			donvidia "${nv_libdir}"/${NV_LIB}
-		done
-	fi
-}
-
-pkg_preinst() {
-	if use driver && use kernel_linux; then
-		linux-mod_pkg_preinst
-
-		local videogroup="$(egetent group video | cut -d ':' -f 3)"
-		if [ -z "${videogroup}" ]; then
-			eerror "Failed to determine the video group gid"
-			die "Failed to determine the video group gid"
-		else
-			sed -i \
-				-e "s:PACKAGE:${PF}:g" \
-				-e "s:VIDEOGID:${videogroup}:" \
-				"${D}"/etc/modprobe.d/nvidia.conf || die
-		fi
-	fi
-
-	# Clean the dynamic libGL stuff's home to ensure
-	# we dont have stale libs floating around
-	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ]; then
-		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
-	fi
-	# Make sure we nuke the old nvidia-glx's env.d file
-	if [ -e "${ROOT}"/etc/env.d/09nvidia ]; then
-		rm -f "${ROOT}"/etc/env.d/09nvidia
-	fi
-}
-
-pkg_postinst() {
-	use driver && use kernel_linux && linux-mod_pkg_postinst
-
-	# Switch to the nvidia implementation
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
-	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
-
-	readme.gentoo_print_elog
-
-	if ! use X; then
-		elog "You have elected to not install the X.org driver. Along with"
-		elog "this the OpenGL libraries and VDPAU libraries were not"
-		elog "installed. Additionally, once the driver is loaded your card"
-		elog "and fan will run at max speed which may not be desirable."
-		elog "Use the 'nvidia-smi' init script to have your card and fan"
-		elog "speed scale appropriately."
-		elog
-	fi
-	if ! use tools; then
-		elog "USE=tools controls whether the nvidia-settings application"
-		elog "is installed. If you would like to use it, enable that"
-		elog "flag and re-emerge this ebuild. Optionally you can install"
-		elog "media-video/nvidia-settings"
-		elog
-	fi
-}
-
-pkg_prerm() {
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}
-
-pkg_postrm() {
-	use driver && use kernel_linux && linux-mod_pkg_postrm
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: x11-drivers/nvidia-drivers/, x11-drivers/nvidia-drivers/files/
@ 2019-01-16 10:00 Jeroen Roovers
  0 siblings, 0 replies; 33+ messages in thread
From: Jeroen Roovers @ 2019-01-16 10:00 UTC (permalink / raw
  To: gentoo-commits

commit:     eb22dfef2d7c2ae67f092cbbdd9a0631ca609f56
Author:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 16 09:59:29 2019 +0000
Commit:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
CommitDate: Wed Jan 16 10:00:43 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=eb22dfef

x11-drivers/nvidia-drivers: Drop unmaintained branches

Bug: https://bugs.gentoo.org/669588
Closes: https://bugs.gentoo.org/673392
Closes: https://bugs.gentoo.org/673490
Package-Manager: Portage-2.3.56, Repoman-2.3.12
Signed-off-by: Jeroen Roovers <jer <AT> gentoo.org>

 x11-drivers/nvidia-drivers/Manifest                |  38 --
 .../files/nvidia-drivers-375.82-profiles-rc.patch  |  11 -
 .../files/nvidia-drivers-pax-const.patch           |  17 -
 .../files/nvidia-drivers-pax-usercopy.patch        |  54 --
 .../nvidia-drivers/nvidia-drivers-304.137.ebuild   | 499 ------------------
 .../nvidia-drivers/nvidia-drivers-375.82.ebuild    | 569 --------------------
 .../nvidia-drivers/nvidia-drivers-378.13-r1.ebuild | 572 --------------------
 .../nvidia-drivers/nvidia-drivers-381.22-r1.ebuild | 573 --------------------
 .../nvidia-drivers/nvidia-drivers-384.130.ebuild   | 581 --------------------
 .../nvidia-drivers/nvidia-drivers-387.34.ebuild    | 586 ---------------------
 .../nvidia-drivers/nvidia-drivers-396.54.ebuild    | 581 --------------------
 11 files changed, 4081 deletions(-)

diff --git a/x11-drivers/nvidia-drivers/Manifest b/x11-drivers/nvidia-drivers/Manifest
index 591b18640db..34ef26714d8 100644
--- a/x11-drivers/nvidia-drivers/Manifest
+++ b/x11-drivers/nvidia-drivers/Manifest
@@ -1,58 +1,20 @@
-DIST NVIDIA-FreeBSD-x86-304.137.tar.gz 35399011 BLAKE2B 823726e4a54f029a47b4c473718099b97d0364b19ac73d36111c0e3552af9a896f60c2aef0eac05d84eb7386fd32ff0a33b2b26d572b6803fddf3c9df0443caa SHA512 9bab183289461d915371b7b5b34e66fdfe8ffff945806dbdf00e0e1cc7242f7b74a0acfc6ed24c3643a6d51edc837cd905ba3b224c30040b0f40d662dc6e7a6d
 DIST NVIDIA-FreeBSD-x86-340.107.tar.gz 60305952 BLAKE2B b634bfd610653f1c546b68e87d934c5d0e25a2e5be6df15e0cb6016793274b4cf08577669e61c35976f3482da2221b05797459b2814965bcfdbf519c8a6d2681 SHA512 fe09e1b3dd870a07b4edd163d302e2d98f00e139d05a8fa627c292182b61d2bd9b37eb746d639ba592dcf90fecedc57430cf1ef76b6522785ffcb3fd46fe9ba0
-DIST NVIDIA-FreeBSD-x86-375.82.tar.gz 59566154 BLAKE2B b888b08cd434899ff73f04a855b47f9416ab247f63023f742dff55e9249d20b8da07bc5cd42e6d555cd9a8ecc62c97821ae09dce1986f0ac2384a16a70c7f181 SHA512 6747bf6d6278c6ed0828c6fdcad5353e516f28384609a3f0a885966707eebb096926a876c17843bfa7626a01a6d4e0ab12c781faf9ac0291771b195c9eb13d85
-DIST NVIDIA-FreeBSD-x86-378.13.tar.gz 59610253 BLAKE2B 723b392b869dd5cc9244cfe9df371fc6df6b4ebc4c1f01082fd79b2bbd0cbf4e670cfb69511f1773d28f6fc51a8801777dd6e3066f50fc96888a9efa467e459e SHA512 a0101201089df2bbf5bdc4ded2228dd989da6a47da31c3ec8d55916b1ff3457924555f82c7381934745fdc1b1f8f78e3fc10e5089279eb13423628dbfe560c6b
-DIST NVIDIA-FreeBSD-x86-381.22.tar.gz 60112159 BLAKE2B 4a61e9a09218eb7d259f82d0a43fee313754004c8716e921b9a83a3e87fff9a291450bef5d7304b2a7ddf5750a830fb7c5cc9dab890dac4a714354265ca25034 SHA512 ffe5882051fad081854e7b7fefe86a4da55b263b2ca217664991a7e0d84ff2f22d62a37c89afd578f3c99c12be897e5db7a3d1c71c747df655af8e220eb983fa
-DIST NVIDIA-FreeBSD-x86-384.130.tar.gz 63719036 BLAKE2B 971006aec05f5bb8f815420f5e1a62103119ae0192a275cc4df3034c20908ebcb8d5a886e030ec06a854102a79e2b31d53c2fcbf3450cb7fa0d9e1f64eeb835f SHA512 54d6d0776190d12f2562fe0ffdf82661fb8a0a4d3d575386a19f5dd5890a7ae4d2ad6704253e7cded62a9a0e1880f1bee9e6bf3aeeb8ce7a265a3d077b0c8018
-DIST NVIDIA-FreeBSD-x86-387.34.tar.gz 64228643 BLAKE2B 80011df5d037cd0a2a6faccf6c990e6019cb85c906c1410d4dde033a8a945ecd46e80a1315e46dc05fa47003eb328c6b8e8e41e18dce60942e645c0e6b813717 SHA512 875648459a149d506b20eb7105e73086e1fb51dddfbd8b484b8cc4793682c088ba16b3d374b0e807738f7aa7489dd9eab2449f70bc9feefeec0bf3a88025b9ef
 DIST NVIDIA-FreeBSD-x86-390.87.tar.gz 64326801 BLAKE2B 91cf9e77040d8c710a0fef58f9bae685a86962f8460a5d55e2c0733dc7bd2050c910bbd0732bb89efb8550d501b08c02e0587118ea767ba768dcf1c356e0e872 SHA512 b7ff9f4e61de08c0626e5e55c1f51e3451640043066944d791f79f4c0b57f39211c0648a2551c0b5ed1622809d7c9579e24b8ee9a46a7988319e25ab709c1400
-DIST NVIDIA-FreeBSD-x86_64-304.137.tar.gz 36474676 BLAKE2B bd75e2916d34f76566d838406419991a860118830366f0297fa63baade3a99f637dae601d6bc6a051596222f2715297dffbf9b81ff5478b030741e6c8a09bc13 SHA512 f0ae7ccea417aceedf34bfb9c96fd79b31cbf74a8fa59d5199b0ad7b81b8a4aeb66cd4801a45cc37f836979cb4267aa69e08517beaa9b8cb9c66a477d02ef8de
 DIST NVIDIA-FreeBSD-x86_64-340.107.tar.gz 61179967 BLAKE2B c12c7c07c090fd7bca78a30082890d0b0330dde07ce9beacdb94fad97d40e9ff9e1413fc36fd94116821137e74076d99a82ab85ecd0a8e16d52b47abeb747802 SHA512 661a4cc79a0adc9a1abebfb3567c26e69628266794b5b539c112112a0989760ea1ea2d8c35a5fe7539b579d4e9cef2685e3e1d12fc7031cd6d1b743c23eadc52
-DIST NVIDIA-FreeBSD-x86_64-375.82.tar.gz 58748290 BLAKE2B 629d65b71270d1c0d94c71e4215a72f0e49bb82e68ebb93fd4b14cd56a2031674458764f4c3e2e3dec7379ec0d5ed9212c8d09a64e4361f40352e52aa9b57de5 SHA512 5e2b42ff63e06219764db8187203ce1a2c3c8b478be31fc713ef396e8f8d46def9b2631d7989866740bd0c6a81bbf5d2ed083c14cfa7171c0d993553ca6f431c
-DIST NVIDIA-FreeBSD-x86_64-378.13.tar.gz 58779963 BLAKE2B d0a165dab740b25e1d97050e4dfc9f916ae17159eb4e4b79e068a4cd6ec3e2bc146d061abb4a411847cbb0d987253f86327e67ffd6efaf725c4fa4dce27e4fa9 SHA512 34cfc383ba196ecec2cd27fc12bf30dd58f8782b73414e7b4c182e832ae0dce1f8c017afbb2101d7525d4e321f80cac49d3b578a8fc0cf88be9310f4deb77057
-DIST NVIDIA-FreeBSD-x86_64-381.22.tar.gz 59284579 BLAKE2B 45703b5658c586fe2fbfaf84a54a591a7d25e836195c47c43375b74a730c1a7aa4dd7bd17d13e7194b37d51da0f11540da1bee564e1c27351ecc6915e65012d5 SHA512 51c5a87fabe87ec7f2589ed97d97447b127ecb5fe501c60bc7c9fce74141c127f4f9bb820d2a9b34fb56db436476d0cb18a73845ab4e7ec2315d4975c8ce4e32
-DIST NVIDIA-FreeBSD-x86_64-384.130.tar.gz 62901704 BLAKE2B 50be9af398f88caa012a7af702ed3d150bd4d0e5aca862dab09f30038906d79254999079983fe242dfe8158549e25f3a49ea8ad07114d8d3bcd01c8a076e8c8f SHA512 ad1a32f8268003d165570137947f517c82074b0851b86a1928f016de95f3dacef4d48f4873f00d603d49b44fe2b99d65295ed4e655d4b16f71c284994a1ea148
-DIST NVIDIA-FreeBSD-x86_64-387.34.tar.gz 63387097 BLAKE2B 53689ba098b4a4de08dca056618ea533c92d17137ec954dea0ae71e1b2c825c021979871e4ff82c820be0a78d3c365f282b760940ebe2caa1ca5bfd2453e178e SHA512 0a905ee72ee6f4e9c941e5dd1f7cddf96bfb20c6da32fd05599258e1bb154f68463d775ba8ff4f67f0d4b8e637e9ed9624fc9a4873a1f2621dc86732f0d6d70d
 DIST NVIDIA-FreeBSD-x86_64-390.87.tar.gz 63648591 BLAKE2B 88aa38b11b64b2ad91f723ec84a2adb6829571136aabb1441a9119418395d5f143736487902f0c60b49ebc1284f3100fbd089e4c941cdd3519ab8511cc1d3261 SHA512 0865fef8b8a3be8f6d9fc81908b162fd6062ba0ea81fd00200e7b2a1e3149ef62408b46bc4ccb7a77f1ac943557a22b13a10cfdde084f0b76cf2b23432e57540
-DIST NVIDIA-FreeBSD-x86_64-396.54.tar.gz 60938322 BLAKE2B a23488b625a15703b0c40bc6871314b05d117d489f64a6f7c70ac3c934b02028b9623be10f0369c98c7d3b5e018e1eb6f1d2cde9d9e1b90be5065f06f6a646dd SHA512 52df85364bfd45a23394078855859ce85de996f7990bb96ba63eb33e516c3cf8e72c4391af9817213f735286f2cf6444bc8ed00312365f12ae17373cfbdc3fc7
 DIST NVIDIA-FreeBSD-x86_64-410.93.tar.gz 61977979 BLAKE2B a662fa13866cfb36ef61a0b9dd459519e26ea93a6ad6ae7bf34075fae8e7622a91707d88cec8de0660513cb959c3596e8b6169357891c83e847870ecffd72928 SHA512 ecdd5270f9d5f32117d83cd3e3cf0376f0b37c748fe164e702c4230d225c6b28bdbbea4334555b6928d05f1a7cfaf87caf20dd2e7e06e1259c526f6bd50e4d0e
 DIST NVIDIA-FreeBSD-x86_64-415.25.tar.gz 62373961 BLAKE2B 4c1ce36ad31933efdb7b9b3a5a530439cadb50c6ee29c0689a521308fbc213266a761765998c44643fd8511159ae96387a3a278accc4a0d00322b06b9b327232 SHA512 792f0cfafb1d6b2137db62c3a5a7e76217d89c3b18cee92ec8317d6c583fdc9676aa46efd55bc795aeaaf1532501f7b40d1d9609d782ffe63e55bb37d0d6db14
 DIST NVIDIA-FreeBSD-x86_64-415.27.tar.gz 62389955 BLAKE2B 39ac5970ef1a6ffbb03abe8b758a6f5d7eaca787231845fa4b4bff5f26aa770fb7c695bbd5585d919c934c65b9ed0cfe42f9674bcaabd796c9bd8b89cea87ee6 SHA512 857d1523bad2fca21c75b45c29066be0f530afa8ca124806bcaa36509ac5135df1c4037e6b09e5718c701f085b3608925e2b1fea45d0681e69a99ef709c307d0
-DIST NVIDIA-Linux-armv7l-gnueabihf-375.82.run 26650801 BLAKE2B 31446667065c56b48f6a3e737afe29a4517459d3462138136bffe383bc6fe514d6e80b49c391c27edc96b8abc3da3dd4d6ee3f3dca17f3c9a0f1cdf0e72cf099 SHA512 28554f1c24fe63c9257c0de3e84e4e739a45bf1c20ec7a53bc2c1b69b4e2355675061491ef5b03f3ae489cf623e553cfa68442f5536f137837327036d1c53d63
-DIST NVIDIA-Linux-armv7l-gnueabihf-378.13.run 26514235 BLAKE2B 2b3c540704496a290be7ae3f1ff378487c75af2298c12488da8b3a1814446e5df02a1ed99afd8ee7fc459d950aab472155359eae0bf56ac83389711d70638152 SHA512 253786a821df85fa926ae842114321b3c70502f887ea7c2b6790dfe3836039ee5d390e6722ca8785904ec6487e465916923d3042dc6191b3b4522c3161b80cb0
-DIST NVIDIA-Linux-armv7l-gnueabihf-381.22.run 26815484 BLAKE2B e5f0241b07d1e54edea2025dd30061d1018c68cc2c7136c507eb894bbad5be3d0724494e2b9f33d1f8f60da4904999bbb964e6f2e78d045d7cd86bcd46b7f6d0 SHA512 934cda37c7aed26243b5b661122e1c060de5b4df890aaf2295b6650dddea37cb4f0e3f0bebddb00b5d687b66ab5e028a203195c4d4ad3379593babda42febe77
-DIST NVIDIA-Linux-armv7l-gnueabihf-384.130.run 28899034 BLAKE2B 4f104243e87d0688d5f234bcadeb501914394ca5ae29c0f7ca7ae8038982c7df14652a1b85fb62a3466a6d4f7cda95c9726367bfd8ab1bf0b73f3fa617418276 SHA512 bd7be99881295f4ddf92b8c6791c4315c7b8699cdd346247dd54dfeb48ee61a40597483379922f5e3d0b28c9b9b9e75dca91c535e4695ebe57734c26f1484f61
-DIST NVIDIA-Linux-armv7l-gnueabihf-387.34.run 29406773 BLAKE2B af27fb1bfa8e432c83220f88c57219d572dfab2d3624c8702759a747f25ff962dba7c39028af5746e04c913c9a53dfbec8a46801bfa7e38df65a8823c4858cca SHA512 cb631dc3b851d84881dfcabee776c68a935853d03f21595acfea84a3efbc85276070f9d0958c0bcced1e66f42f25ecf3fd7d615c715274130ca24426da678c2e
 DIST NVIDIA-Linux-armv7l-gnueabihf-390.87.run 29078256 BLAKE2B a7ce24bcaf82e6c2c95cd11a0d9e0e2aa69c717b8455d4ce0a79a9c03c92f5f6b84107dea6347dedc5c4f8fe076e616fc7a36053c6a5f571af9d794bada6cb1f SHA512 3f8ef4eabc7275685bd5d887c6b7dc20786baab1f4a89bfb23ae6c8d837188d93369c777915d3ea010b08e578c4fb7318d9428811971470e31a8b8b4f51e240f
-DIST NVIDIA-Linux-x86-304.137.run 41504115 BLAKE2B 5938d4df818947e5576172c0ee9bfa42a2fc49a7a7a2b14128cf3b967dfea6d4523901b33283284d450cfadc2c6d72a82a1533b27ebb4b542b6b1454fe8ae960 SHA512 021c5a88d50489aa0a1c7eac14259e23542b93578ae339995a2e38b786d06d239968c07933cab3fb78a922cffc7e213d6fa3fe07e34065a9c7f03e24f8729370
 DIST NVIDIA-Linux-x86-340.107.run 39016798 BLAKE2B 2632c8f257d0cf7c5b9294eb2c0b763eee6feb60eacc316024655971e4d067c4af6548aab3b7b2b295792b064f3f3ac3e6403a2ecfa096761d308dfb6b2569b8 SHA512 0add713942bcdb639d19b5c36f5e0cea14f9e07490191d46dfeba0515ede7700fd8e9467ec531d38329fe1e76bf45905e70e0d440e7bc2dc79c1d767eab03338
-DIST NVIDIA-Linux-x86-375.82.run 44633335 BLAKE2B 55392ba748108b47994bf272829a6476dfc23f7756e0c18d56c8e4d827968196ee70e521c2e6307c134ca0c85d59715db777583fb07c8e06ae7325d586a8117b SHA512 cbd6edd7490e0e5ef9dd2020c18eb5f75412993e06b9c4f1919f49a8ffdc36131a96d868ab51691fb5c4a661e826b000ec93363c9b168304f6498014e300bf24
-DIST NVIDIA-Linux-x86-378.13.run 44397547 BLAKE2B 5b45bdceba75e214028b9f59a3655482ac1ac2b51cc0a6ea22927e5143b47c670db7078ed898e04663feb9fd495165954c90df5ee3afca00155dcc2ae6a97dc8 SHA512 b96d2558a1003a3c66cade3a1e16abd34d855c0e27cdebacdc0495e0ba3cd5c68bb84cc5f81bff1b9ddce36ac52e0dc125c56d868b77d7c8e2f606d559b13b4a
-DIST NVIDIA-Linux-x86-381.22.run 42931990 BLAKE2B cf1ae154854860557bf3e4a50216f1373ff66a45535e7beec67392b1cd1d40a02d758fa3e1cfa0462145b912430b0d1a3b6de3e6d6ede8aa1f484ea0ab46f816 SHA512 15723bfa25b0f39224ad5098c784a292abe4bf1daafaeb2f1df910bbab466e666b848b12e50b0bdd45f83e2d81957425a63501550b3dc5eb8fe3e576a8a10d22
-DIST NVIDIA-Linux-x86-384.130.run 47539521 BLAKE2B d0b84aa6e0a41d7202cce247a419adad5c94d0d98feb83594644d8e0a9426d0c07a5b5889297bc830c7456a4e8cc165a3b23c004e83cabad1000bf5a6e1a147a SHA512 0ed01818606eb7309811a3cb0ae71e9906e318d579dfd85bafcbae498a27f801836c1f1eefee6791ec5d9c6a4c41d244c43b8329583ae4991b45171cac99638d
-DIST NVIDIA-Linux-x86-387.34.run 47797853 BLAKE2B 4ae211ee00e09fe385f24e05cfac3af28447ec18e7a7f53e7f310c210ec22f60094be087aae45d0ea99c90214a07d3c46ce6867984ac0ff6e56559693fcdf148 SHA512 ba9362123a75f85a0a5a9dcc95c06bcb350a8dff2db864db30a73172db44006fa39eee8e23cf959ab2012b61b922d1f0d7ab225329815737819f27d1be300b95
 DIST NVIDIA-Linux-x86-390.87.run 47959124 BLAKE2B bb799a53b6d25ecd0e6013cea544402c25332efcedf0db5c490dc7ebfa064f97a31427d529f0453092e0f6495a996acb8ffcdd29dc1fed5fc8af31514d959c80 SHA512 18c5ef058098c0f055bada06888ee07da4d1455d90d393357483c289eab27969d49a593318d28e535941e7ebacde33e349f3a1cb2f7c627366ba5c6b7835ccbd
-DIST NVIDIA-Linux-x86_64-304.137.run 70087133 BLAKE2B 8db0ade7cf64231ae11e6fc55a16a68a2f7b11a8bb7debb49799fee96eba06a3062b97fe539b093727623a1ed1067282813de047c2aeb89d93bf35a97c71aac5 SHA512 d7fae1e486005ffa2f2bf7f14f901bf5156fc784407a9acfea584f49bdab92ff5f4d0fb66c4c5b2800a461fc06aebb7d760bcb59f69ce4f2cb4e03e11816b3e9
 DIST NVIDIA-Linux-x86_64-340.107.run 70233686 BLAKE2B 821a2672dcc3b546fbb3f826230fb06741503d75b06f72cb407dd3c9de4f2cbd150bff34e554dca8aa86e7f6bf64ce4f7f9b52976799a477c6c2659aaa5bb4d3 SHA512 51df9370526732db099a8a925d35cdf1317ae2b0ab2c130eaf82373f25186165b4af7d44f71e51e2a68f7d07c7ae3f441a6c6c4be8467003b15dc770c4f4e89b
-DIST NVIDIA-Linux-x86_64-375.82.run 77461911 BLAKE2B e7f32bdf1672d98a1fe98c82d80a08dd6f63b3c859df4c60124977dae19520a21e4239ff7be6c272243d4af9416320b5e166d8f100979daa0d005ea2a44fc16d SHA512 6da63b807d6dd7cc8ac2b794d5c9ab8383e3c0ce6a47adc600941545509fb40b5f06344781afc895bd83f2780b2bce187994df5684db2890f50b41adfee8f910
-DIST NVIDIA-Linux-x86_64-378.13.run 76239469 BLAKE2B 0f2be330645f8d9d2828fa6d159f9e41ef09bb32805f94cf3fa255f088a8c6f4c25add584787bd1ed64756ef75821f7143c14330718cc5f5ac3cbcf8b7c3bae4 SHA512 2f6789aa0a400c035c0a074631dc5c26abb4f8a62efe928ca3a2865b89d29acfc09c27f23a664e438275e4bfd25c261745d4d495f9aca5f54ee6c53a389059d2
-DIST NVIDIA-Linux-x86_64-381.22.run 76581130 BLAKE2B fdb5912a775b56edf7dd784b640997fe683d0a32d57db6079dc5466a1a8dc1354cd31ff86aa1e993e0a33163e4c18f6a7aa990e334448ad069db3a5ffc4f1ffa SHA512 669a3dd0896d68ba8eef4689b01971b92ec1c54e6cf2a9ff8d3f281ae9f2fe402f079e76109b65e698d76798bcc7a9bb43da9d128fec59ac1fafafd1c4a1e42c
-DIST NVIDIA-Linux-x86_64-384.130.run 82260837 BLAKE2B 55b6f3627680c881821f5d20f05cb6c7941b1deebf28f22f6712cac73d07e6202507c9f3b98eb8fc59ca8ed0c6aaa4819db5fc5a331f4505887dac6f31774335 SHA512 301fa7d9d73a0654e0090bf4bae98896388c1f52453f1b886e320e36765dc529f802c509a2d518714f2b348df59f9c9048e01b3874819bde4f53cf98aaa2cfff
-DIST NVIDIA-Linux-x86_64-387.34.run 82784271 BLAKE2B b7140d5d6a693892df50b3ad2e20387673dec6b5ac609cc0300bdc4b4a93ca94849255699126e4d55e67f10e488bfe6008e987197ea239b1a1b643b4ae5c7808 SHA512 6742768f1258a028c9ba56ad1d72f27d7eea4b6bfd324ba29c7f057ab5819816bd728aeaf2a8058031dadcd4c51bc6d08f0e0e0e26c68ed57955e90d68ac5a4b
 DIST NVIDIA-Linux-x86_64-390.87.run 82690871 BLAKE2B b43a45a7d48160a72185417360a4ff4238922f6d77c7b58c0562f0e01c8aa33e89057e8a5d354e8d3c8e6fa86acf8908a6c2eab81e06158a92908eec18a9b02e SHA512 f4883744f5e07150677918669eed03c7b87774f752112aabd52d903a09ae16351b34105075da2ff0fcb7a847cf66ec17e9797826859fcaecc44fdcd464a61805
-DIST NVIDIA-Linux-x86_64-396.54.run 86946680 BLAKE2B 9b3ab39c9d09c663238d0fac6346c24feea6ecc44b0ecaf3de871522697685c1c474ec4cc83f3bab0a2bcfecc7c77acea0e6bfee6e8ca8e6883bd338fd6da8a2 SHA512 17139abe99d4f32ec87379ee57af2cc0fec7d24605b2be7e3cd6609d9fcdf871e3c1cb7414b3544e14eb32d2213fec7ac45b3261f27c8d6565d510ccb14a1247
 DIST NVIDIA-Linux-x86_64-410.93.run 107257681 BLAKE2B 56e9b6a17ab4d2fe2f18d90b4e209fe048c53dc43846ee9c8bd0960999a06ef9d9b6ba7e4c242f77cc35cfc5b9a0e2ae24aa5f07f68cb7662bd5010de41a9b36 SHA512 1132884210e447d20768c4ae84ff572c9f6886fb9a082da4d229a03c13932a5c6ccc518cad3311a9302b6a0d9e9675e3a53199e7183e07c81282d46883d26105
 DIST NVIDIA-Linux-x86_64-415.25.run 108599932 BLAKE2B 958a345f03157ebd8f8a84da91af78143ada75be4bf1d5abbbec9bc8b0ca11549891efb2f78c3ae89ed86fa94a4bf179834d1b229b2dc7d3587a138235a8ce7f SHA512 d289a37344916f5d17425f17d0530a7838b264c49866a0148665c9b87dcb7c23e868abae866a2568abac425701149d9075da540dd0f45f3d18f67b57102c0857
 DIST NVIDIA-Linux-x86_64-415.27.run 108399659 BLAKE2B 05fb81a4ab8626d0170a30b70ed114c639ba7f0e5ac260d2f38cb5042a4d6052e40ada51cf2feff6bae0f394781d77cb70014f390873a715b7d9495b86918bf1 SHA512 5919333136042a227ff36c850d0c57898fb428a77d88633d205a269db4b844356a87f5b1e5c3042f40feaf083d4f82d32df5366820375b601f9d69d98cada0b6
-DIST nvidia-settings-304.137.tar.bz2 1481361 BLAKE2B cf52a55a34eeb03a685a683487af6a198ba467dd8ba9983cc75624a37a226373cd931d98e8448b7b8ed430c54be2118c7b240ed2a9100b19bec5e832e2f6cdad SHA512 676d1f70c9a78ee234f5f1a283412430a386fa604de211afba02806a45906c5e246a002989b724d74752178d28c92a268de1c98d4c87876797d991253f16b0cc
 DIST nvidia-settings-340.107.tar.bz2 1549413 BLAKE2B 127442ee2c35ceec47ab4f103bdd2d0278c621fcb9be47051111f6f8728ef5699bdc95fe33a3812a807c38c4868b04c2176e2ed218a422171d2a88ac0c00de96 SHA512 593e7e83aa350a3a7beaaa32aca8660d7e203f6f2e460a6e6eabcdc092087f9917ee4e6d141e37ad4e3b0a1b9908c085e4a71d2f579e481a03bbd1c6f75ca776
-DIST nvidia-settings-375.82.tar.bz2 1620463 BLAKE2B 0c100ee95c91bb53c2192da8ddd1042ce4e0dec7defcf4793a1745020f65d538c4b0d09f690f00034bb02f7ec219048a0539e81031c8b3eb12006f2a0d566d2e SHA512 abc650089cad57ae95a3e3456deb16d2e3c116e148aed83ab40ca5e381445561cdf4c3c0d8676930fb4c73dd5f3282dd1cc1a62d876b7ed07146569ccfb38488
-DIST nvidia-settings-378.13.tar.bz2 1618011 BLAKE2B cc9d5cf7ad63fce3b084c1116c076925ec5c07b8743b6aea80d19c46177d6f33f1916ac90bf8d639e962599e209a0f23bcf945d78e056839e7cc7adcaa6c1ede SHA512 a12352c92fd4f56002bda2b07e8cddd5573af98521ec3495cd428b784eb368c9f2cb40f9b4372400ba1ea67c9349c6a9b4f7c218ede2d0d5dabb08325eda9844
-DIST nvidia-settings-381.22.tar.bz2 1629344 BLAKE2B 1e7fe16b28f12ebef380e85d96597f5a8171fc33b6054eea4c44b5347c579dcf2e114d540c527f9ac5d39d08c90aabfac3a3feab2456e69b336d7d1d8ea64df4 SHA512 be8e7051df88202fdc6afd63da86231453ab19c8ac35d0940ec4d11a011b0bf886919a3c3ba51bd3e8f9b34a29de727586b63dd861eaa6a0ee6190238c682a0f
-DIST nvidia-settings-384.130.tar.bz2 1633217 BLAKE2B ffc1381e680e94aee95752074c39163e48082615f92c6184c01fc7d21e20bf18308d30960db0db602baf89b34fdd295a715692446d21fb2491056ec707e8b844 SHA512 3d878552a78234347f4e51920e8358e56b42d595375e8fd2b0520c3495b02d6fc3877d4346354145c420acd79ff1e9607c312330b2a2e27781a3a576f8860939
-DIST nvidia-settings-387.34.tar.bz2 1080507 BLAKE2B 4eeae3ad4b489f574832e967f0c72198d2b5be0139e36981b701e5ca2cde17119d584677e705243f1be6f920669b921f8e4b54968e2d56e98142aec81383dff5 SHA512 a7a1a2db170b803b769a7307c8507289b763f6cbcecc746edf988491fcc28d7ef1eb76574d6c1f24283e6aebeb56fc8a99d5302a81422c3384df0c8979f006d6
 DIST nvidia-settings-390.87.tar.bz2 1109274 BLAKE2B 20eb809ceeade932e89592ac91071e6d3311f4a075812225d68342806b7ab1f9f8ed0399ea7a47241b7974311794852fd932fd8e824065589de6c124a3c81ef3 SHA512 cafdf2bfefac187409dfcffd593ff23eaba5ab7ab8dd85a9f14a4b6a47ffb3649af770bd2615887af9d30de3ef8fedaad7afc2ebe9f60a8ba7355a9004702959
-DIST nvidia-settings-396.54.tar.bz2 1116371 BLAKE2B 114b88f393b0909c8d84a56a280854e258d0e7e7ce800ee58547ef68b4989f22a3bbb380795472b8222493a988dc9308fc20ef03c81589448b518a12285cf204 SHA512 23dc3c61bef71200b3e8185940dd52a50dae7ca7f2b8a68fa96eaa937aabc87ded5d5f73081af51d1e7af2b78b0ec10ab80d28dadbcf10a046c32ec14db1d83c
 DIST nvidia-settings-410.93.tar.bz2 1115704 BLAKE2B 1119181feb2704711593c19a43dce5feb58778d0251cb2dcb8647de7bfb1abe3a7f374bddd62e4c983b07a207bca7c1d99a7ac51cba3ae41f78fb97c4d1e9666 SHA512 4e5a5babae382dbe9f6899e51d3b1081fd7123f9ba5e147f7d5cc1899904892ea8d953983e43643ea4355d06348db40005755a02c7c0ff6ba104eac4a9d450f2
 DIST nvidia-settings-415.25.tar.bz2 1121689 BLAKE2B acd9dd12b4d9a3d76e08d1498fe2373327308d0764791c7e14c6471cf98e79f635a1073dfacdaa4fa60dd148c15803a18061b185cdea24676d851b3a1b695184 SHA512 8646e4eb8d491cbd20205766833fa9f0629a2567797fbb7ca085e07946f4698645cc134615bc20a42090d4f4fe826df48ab4be717b227ee59c17941d185e0b0b
 DIST nvidia-settings-415.27.tar.bz2 1128013 BLAKE2B 36513252ff3d5f2036c80250e012d79bebfc14daff56fdaabb032856f5f78ce77cf4ce32d6eaee5fe4c1a18db63d5c69d6848517f025c711f133e28b3e509396 SHA512 5ac3b673c41194a1952ec10cd3c961aefd281bb044ecae5c9d11cb55d4555fed44e6056b5a2e97b5b87687743cd7f702f33ce7e0f841f04c8175d63693a24594

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-375.82-profiles-rc.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-375.82-profiles-rc.patch
deleted file mode 100644
index 552f0d6df0e..00000000000
--- a/x11-drivers/nvidia-drivers/files/nvidia-drivers-375.82-profiles-rc.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/nvidia-application-profiles-375.82-rc
-+++ b/nvidia-application-profiles-375.82-rc
-@@ -48,7 +48,7 @@
-         {
-           "name" : "NoEnforceShaderInputOutputMatching",
-           "settings" : [ "GLShaderPortabilityWarnings", false ]
--        },
-+        }
-     ],
-     "rules" : [
-         {

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-pax-const.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-pax-const.patch
deleted file mode 100644
index f3b82593570..00000000000
--- a/x11-drivers/nvidia-drivers/files/nvidia-drivers-pax-const.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-Binary files kernel.orig/.nv-procfs.c.swp and kernel/.nv-procfs.c.swp differ
-diff -urp kernel.orig/nv-procfs.c kernel/nv-procfs.c
---- kernel.orig/nv-procfs.c	2011-07-13 03:29:30.000000000 +0200
-+++ kernel/nv-procfs.c	2011-07-19 15:45:27.982993911 +0200
-@@ -707,8 +707,10 @@ int nv_register_procfs(void)
-      * However, in preparation for this, we need to preserve
-      * the procfs read() and write() operations.
-      */
--    nv_procfs_registry_fops.read = entry->proc_fops->read;
--    nv_procfs_registry_fops.write = entry->proc_fops->write;
-+    pax_open_kernel();
-+    *(void **)&nv_procfs_registry_fops.read = entry->proc_fops->read;
-+    *(void **)&nv_procfs_registry_fops.write = entry->proc_fops->write;
-+    pax_close_kernel();
- 
-     entry = NV_CREATE_PROC_FILE("registry", proc_nvidia,
-         nv_procfs_read_registry,

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-pax-usercopy.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-pax-usercopy.patch
deleted file mode 100644
index ce8c201b8e0..00000000000
--- a/x11-drivers/nvidia-drivers/files/nvidia-drivers-pax-usercopy.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-diff -urp kernel.orig/nv.c kernel/nv.c
---- kernel.orig/nv.c	2011-09-24 02:32:09.000000000 +0200
-+++ kernel/nv.c	2011-10-05 19:13:41.474242252 +0200
-@@ -1105,7 +1105,7 @@ static int __init nvidia_init_module(voi
-     NV_SPIN_LOCK_INIT(&km_lock);
- #endif
- 
--    NV_KMEM_CACHE_CREATE(nv_stack_t_cache, "nv_stack_t", nv_stack_t);
-+    NV_KMEM_CACHE_CREATE(nv_stack_t_cache, "nv_stack_t", nv_stack_t, SLAB_USERCOPY);
-     if (nv_stack_t_cache == NULL)
-     {
-         nv_printf(NV_DBG_ERRORS, "NVRM: stack cache allocation failed!\n");
-@@ -1220,7 +1220,7 @@ static int __init nvidia_init_module(voi
-     }
- #endif
- 
--    NV_KMEM_CACHE_CREATE(nv_pte_t_cache, "nv_pte_t", nv_pte_t);
-+    NV_KMEM_CACHE_CREATE(nv_pte_t_cache, "nv_pte_t", nv_pte_t, 0);
-     if (nv_pte_t_cache == NULL)
-     {
-         rc = -ENOMEM;
-@@ -1229,7 +1229,7 @@ static int __init nvidia_init_module(voi
-     }
- 
-     NV_KMEM_CACHE_CREATE(nvidia_p2p_page_t_cache, "nvidia_p2p_page_t",
--            nvidia_p2p_page_t);
-+            nvidia_p2p_page_t, 0);
-     if (nvidia_p2p_page_t_cache == NULL)
-     {
-         rc = -ENOMEM;
-diff -urp kernel.orig/nv-linux.h kernel/nv-linux.h
---- kernel.orig/nv-linux.h	2011-09-24 02:32:09.000000000 +0200
-+++ kernel/nv-linux.h	2011-10-05 19:14:42.522238996 +0200
-@@ -695,16 +695,16 @@ extern nv_spinlock_t km_lock;
- 
- #if defined(NV_KMEM_CACHE_CREATE_PRESENT)
- #if (NV_KMEM_CACHE_CREATE_ARGUMENT_COUNT == 6)
--#define NV_KMEM_CACHE_CREATE(kmem_cache, name, type)            \
-+#define NV_KMEM_CACHE_CREATE(kmem_cache, name, type, flags)     \
-     {                                                           \
-         kmem_cache = kmem_cache_create(name, sizeof(type),      \
--                        0, 0, NULL, NULL);                      \
-+                        0, flags, NULL, NULL);                  \
-     }
- #elif (NV_KMEM_CACHE_CREATE_ARGUMENT_COUNT == 5)
--#define NV_KMEM_CACHE_CREATE(kmem_cache, name, type)            \
-+#define NV_KMEM_CACHE_CREATE(kmem_cache, name, type, flags)     \
-     {                                                           \
-         kmem_cache = kmem_cache_create(name, sizeof(type),      \
--                        0, 0, NULL);                            \
-+                        0, flags, NULL);                        \
-     }
- #else
- #error "NV_KMEM_CACHE_CREATE_ARGUMENT_COUNT value unrecognized!"

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-304.137.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-304.137.ebuild
deleted file mode 100644
index 97647bdcaa3..00000000000
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-304.137.ebuild
+++ /dev/null
@@ -1,499 +0,0 @@
-# Copyright 1999-2018 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-inherit eutils flag-o-matic linux-info linux-mod multilib-minimal nvidia-driver \
-	portability toolchain-funcs unpacker user versionator udev
-
-NV_URI="https://us.download.nvidia.com/XFree86/"
-X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
-AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
-X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
-AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
-
-DESCRIPTION="NVIDIA Accelerated Graphics Driver"
-HOMEPAGE="http://www.nvidia.com/ http://www.nvidia.com/Download/Find.aspx"
-SRC_URI="
-	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
-	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
-	x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
-	x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
-	tools? (
-		https://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2
-	)
-"
-
-LICENSE="GPL-2 NVIDIA-r1"
-SLOT="0/${PV%.*}"
-KEYWORDS="-* amd64 x86 ~amd64-fbsd ~x86-fbsd"
-IUSE="acpi multilib kernel_FreeBSD kernel_linux pax_kernel static-libs +tools +X"
-RESTRICT="bindist mirror"
-EMULTILIB_PKG="true"
-
-COMMON="
-	app-eselect/eselect-opencl
-	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
-	tools? (
-		dev-libs/atk
-		dev-libs/glib:2
-		x11-libs/gdk-pixbuf[X]
-		x11-libs/gtk+:2
-		x11-libs/libX11
-		x11-libs/libXext
-		x11-libs/libXv
-		x11-libs/pango[X]
-		x11-libs/pangox-compat
-	)
-	X? (
-		>=app-eselect/eselect-opengl-1.0.9
-	)
-"
-DEPEND="${COMMON}
-	kernel_linux? (
-		virtual/linux-sources
-		virtual/pkgconfig
-	)"
-RDEPEND="${COMMON}
-	acpi? ( sys-power/acpid )
-	tools? ( !media-video/nvidia-settings )
-	X? (
-		<x11-base/xorg-server-1.19.99:=
-		>=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
-		>=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
-		sys-libs/zlib[${MULTILIB_USEDEP}]
-		x11-libs/libXvMC[${MULTILIB_USEDEP}]
-	)
-"
-PDEPEND="X? ( >=x11-libs/libvdpau-0.3-r1[${MULTILIB_USEDEP}] )"
-
-REQUIRED_USE="
-	tools? ( X )
-	static-libs? ( tools )
-"
-
-QA_PREBUILT="opt/* usr/lib*"
-
-S=${WORKDIR}/
-
-nvidia_drivers_versions_check() {
-	if use amd64 && has_multilib_profile && \
-		[ "${DEFAULT_ABI}" != "amd64" ]; then
-		eerror "This ebuild doesn't currently support changing your default ABI"
-		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
-	fi
-
-	if use kernel_linux && kernel_is ge 4 13; then
-		ewarn "Gentoo supports kernels which are supported by NVIDIA"
-		ewarn "which are limited to the following kernels:"
-		ewarn "<sys-kernel/gentoo-sources-4.13"
-		ewarn "<sys-kernel/vanilla-sources-4.13"
-		ewarn ""
-		ewarn "You are free to utilize eapply_user to provide whatever"
-		ewarn "support you feel is appropriate, but will not receive"
-		ewarn "support as a result of those changes."
-		ewarn ""
-		ewarn "Do not file a bug report about this."
-		ewarn ""
-	fi
-
-	# Since Nvidia ships many different series of drivers, we need to give the user
-	# some kind of guidance as to what version they should install. This tries
-	# to point the user in the right direction but can't be perfect. check
-	# nvidia-driver.eclass
-	nvidia-driver-check-warning
-
-	# Kernel features/options to check for
-	CONFIG_CHECK="!DEBUG_MUTEXES ~!LOCKDEP ~MTRR ~SYSVIPC ~ZONE_DMA"
-	use x86 && CONFIG_CHECK+=" ~HIGHMEM"
-
-	# Now do the above checks
-	use kernel_linux && check_extra_config
-}
-
-pkg_pretend() {
-	nvidia_drivers_versions_check
-}
-
-pkg_setup() {
-	nvidia_drivers_versions_check
-
-	# try to turn off distcc and ccache for people that have a problem with it
-	export DISTCC_DISABLE=1
-	export CCACHE_DISABLE=1
-
-	if use kernel_linux; then
-		linux-mod_pkg_setup
-		MODULE_NAMES="nvidia(video:${S}/kernel)"
-		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
-		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC)"
-		# linux-mod_src_compile calls set_arch_to_kernel, which
-		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
-		# expects x86_64 or i386 and then converts it to x86
-		# later on in the build process
-		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
-	fi
-
-	# set variables to where files are in the package structure
-	if use kernel_FreeBSD; then
-		use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
-		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
-		NV_DOC="${S}/doc"
-		NV_OBJ="${S}/obj"
-		NV_SRC="${S}/src"
-		NV_MAN="${S}/x11/man"
-		NV_X11="${S}/obj"
-		NV_SOVER=1
-	elif use kernel_linux; then
-		NV_DOC="${S}"
-		NV_OBJ="${S}"
-		NV_SRC="${S}/kernel"
-		NV_MAN="${S}"
-		NV_X11="${S}"
-		NV_SOVER=${PV}
-	else
-		die "Could not determine proper NVIDIA package"
-	fi
-}
-
-src_prepare() {
-	# Please add a brief description for every added patch
-
-	if use kernel_linux; then
-		if kernel_is lt 2 6 9 ; then
-			eerror "You must build this against 2.6.9 or higher kernels."
-		fi
-
-		# If greater than 2.6.5 use M= instead of SUBDIR=
-		convert_to_m "${NV_SRC}"/Makefile.kbuild
-	fi
-
-	if use pax_kernel; then
-		ewarn "Using PAX patches is not supported. You will be asked to"
-		ewarn "use a standard kernel should you have issues. Should you"
-		ewarn "need support with these patches, contact the PaX team."
-		eapply "${FILESDIR}"/${PN}-pax-const.patch
-		eapply "${FILESDIR}"/${PN}-pax-usercopy.patch
-	fi
-
-	cat <<- EOF > "${S}"/nvidia.icd
-		/usr/$(get_libdir)/libnvidia-opencl.so
-	EOF
-
-	local man_file
-	for man_file in "${NV_MAN}"/*1.gz; do
-		gunzip $man_file || die
-	done
-
-	# Allow user patches so they can support RC kernels and whatever else
-	eapply_user
-}
-
-src_compile() {
-	# This is already the default on Linux, as there's no toplevel Makefile, but
-	# on FreeBSD there's one and triggers the kernel module build, as we install
-	# it by itself, pass this.
-
-	cd "${NV_SRC}"
-	if use kernel_FreeBSD; then
-		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
-			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
-	elif use kernel_linux; then
-		linux-mod_src_compile src="${KERNEL_DIR}" KERNELRELEASE="${KV_FULL}"
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src/libXNVCtrl clean
-		emake -C "${S}"/nvidia-settings-${PV}/src/libXNVCtrl \
-			AR="$(tc-getAR)" \
-			CC="$(tc-getCC)" \
-			RANLIB="$(tc-getRANLIB)" \
-			libXNVCtrl.a
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			AR="$(tc-getAR)" \
-			CC="$(tc-getCC)" \
-			LD="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			NVML_ENABLED=0 \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			NV_VERBOSE=1 \
-			RANLIB="$(tc-getRANLIB)" \
-			STRIP_CMD=true
-	fi
-}
-
-# Install nvidia library:
-# the first parameter is the library to install
-# the second parameter is the provided soversion
-# the third parameter is the target directory if its not /usr/lib
-donvidia() {
-	# Full path to library minus SOVER
-	MY_LIB="$1"
-
-	# SOVER to use
-	MY_SOVER="$2"
-
-	# Where to install
-	MY_DEST="$3"
-
-	if [[ -z "${MY_DEST}" ]]; then
-		MY_DEST="/usr/$(get_libdir)"
-		action="dolib.so"
-	else
-		exeinto ${MY_DEST}
-		action="doexe"
-	fi
-
-	# Get just the library name
-	libname=$(basename $1)
-
-	# Install the library with the correct SOVER
-	${action} ${MY_LIB}.${MY_SOVER} || \
-		die "failed to install ${libname}"
-
-	# If SOVER wasn't 1, then we need to create a .1 symlink
-	if [[ "${MY_SOVER}" != "1" ]]; then
-		dosym ${libname}.${MY_SOVER} \
-			${MY_DEST}/${libname}.1 || \
-			die "failed to create ${libname} symlink"
-	fi
-
-	# Always create the symlink from the raw lib to the .1
-	dosym ${libname}.1 \
-		${MY_DEST}/${libname} || \
-		die "failed to create ${libname} symlink"
-}
-
-src_install() {
-	if use kernel_linux; then
-		linux-mod_src_install
-
-		# Add the aliases
-		# This file is tweaked with the appropriate video group in
-		# pkg_preinst, see bug #491414
-		insinto /etc/modprobe.d
-		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
-
-		# Ensures that our device nodes are created when not using X
-		exeinto "$(get_udevdir)"
-		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
-		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
-	elif use kernel_FreeBSD; then
-		if use x86-fbsd; then
-			insinto /boot/modules
-			doins "${S}/src/nvidia.kld"
-		fi
-
-		exeinto /boot/modules
-		doexe "${S}/src/nvidia.ko"
-	fi
-
-	# NVIDIA kernel <-> userspace driver config lib
-	donvidia "${NV_OBJ}"/libnvidia-cfg.so ${NV_SOVER}
-
-	if use kernel_linux; then
-		# NVIDIA video decode <-> CUDA
-		donvidia "${NV_OBJ}"/libnvcuvid.so ${NV_SOVER}
-	fi
-
-	if use X; then
-		# Xorg DDX driver
-		insinto /usr/$(get_libdir)/xorg/modules/drivers
-		doins "${NV_X11}"/nvidia_drv.so
-
-		# Xorg GLX driver
-		donvidia "${NV_X11}"/libglx.so ${NV_SOVER} \
-			/usr/$(get_libdir)/opengl/nvidia/extensions
-
-		# XvMC driver
-		dolib.a "${NV_X11}"/libXvMCNVIDIA.a || \
-			die "failed to install libXvMCNVIDIA.so"
-		donvidia "${NV_X11}"/libXvMCNVIDIA.so ${NV_SOVER}
-		dosym libXvMCNVIDIA.so.${NV_SOVER} \
-			/usr/$(get_libdir)/libXvMCNVIDIA_dynamic.so.1 || \
-			die "failed to create libXvMCNVIDIA_dynamic.so symlink"
-	fi
-
-	# OpenCL ICD for NVIDIA
-	if use kernel_linux; then
-		insinto /etc/OpenCL/vendors
-		doins nvidia.icd
-		donvidia "${NV_OBJ}"/libnvidia-opencl.so ${NV_SOVER}
-	fi
-
-	# Documentation
-	dodoc -r "${NV_DOC}"/html
-	if use kernel_FreeBSD; then
-		dodoc "${NV_DOC}"/README
-		use X && doman "${NV_MAN}"/nvidia-xconfig.1
-		use tools && doman "${NV_MAN}"/nvidia-settings.1
-	else
-		# Docs
-		newdoc "${NV_DOC}"/README.txt README
-		dodoc "${NV_DOC}"/NVIDIA_Changelog
-		doman "${NV_MAN}"/nvidia-smi.1
-		use X && doman "${NV_MAN}"/nvidia-xconfig.1
-		use tools && doman "${NV_MAN}"/nvidia-settings.1
-		doman "${NV_MAN}"/nvidia-cuda-proxy-control.1
-	fi
-
-	# Helper Apps
-	exeinto /opt/bin/
-
-	if use X; then
-		doexe "${NV_OBJ}"/nvidia-xconfig
-	fi
-
-	if use kernel_linux ; then
-		doexe "${NV_OBJ}"/nvidia-debugdump
-		doexe "${NV_OBJ}"/nvidia-cuda-proxy-control
-		doexe "${NV_OBJ}"/nvidia-cuda-proxy-server
-		doexe "${NV_OBJ}"/nvidia-smi
-		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
-	fi
-
-	dobin "${NV_OBJ}"/nvidia-bug-report.sh
-
-	# Desktop entries for nvidia-settings
-	if use tools ; then
-		emake -C "${S}"/nvidia-settings-${PV}/src/ \
-			DESTDIR="${D}" \
-			LIBDIR="${D}/usr/$(get_libdir)" \
-			PREFIX=/usr \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			install
-
-		if use static-libs; then
-			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
-
-			insinto /usr/include/NVCtrl
-			doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
-		fi
-
-		# There is no icon in the FreeBSD tarball.
-		use kernel_FreeBSD || \
-			doicon "${NV_OBJ}"/nvidia-settings.png
-
-		domenu "${FILESDIR}"/nvidia-settings.desktop
-
-		exeinto /etc/X11/xinit/xinitrc.d
-		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
-	fi
-
-	#doenvd "${FILESDIR}"/50nvidia-prelink-blacklist
-
-	if has_multilib_profile && use multilib ; then
-		local OABI=${ABI}
-		for ABI in $(get_install_abis) ; do
-			src_install-libs
-		done
-		ABI=${OABI}
-		unset OABI
-	else
-		src_install-libs
-	fi
-
-	is_final_abi || die "failed to iterate through all ABIs"
-
-	readme.gentoo_create_doc
-}
-
-src_install-libs() {
-	local inslibdir=$(get_libdir)
-	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
-	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
-	local nv_libdir="${NV_OBJ}"
-
-	if use kernel_linux && has_multilib_profile && \
-			[[ ${ABI} == "x86" ]] ; then
-		nv_libdir="${NV_OBJ}"/32
-	fi
-
-	if use X; then
-		# The GLX libraries
-		donvidia "${nv_libdir}"/libGL.so ${NV_SOVER} ${GL_ROOT}
-		donvidia "${nv_libdir}"/libnvidia-glcore.so ${NV_SOVER}
-		if use kernel_FreeBSD; then
-			donvidia "${nv_libdir}"/libnvidia-tls.so ${NV_SOVER} ${GL_ROOT}
-		else
-			donvidia "${nv_libdir}"/tls/libnvidia-tls.so ${NV_SOVER} ${GL_ROOT}
-		fi
-
-		# VDPAU
-		donvidia "${nv_libdir}"/libvdpau_nvidia.so ${NV_SOVER}
-	fi
-
-	# NVIDIA monitoring library
-	if use kernel_linux ; then
-		donvidia "${nv_libdir}"/libnvidia-ml.so ${NV_SOVER}
-	fi
-
-	# CUDA & OpenCL
-	if use kernel_linux; then
-		donvidia "${nv_libdir}"/libcuda.so ${NV_SOVER}
-		donvidia "${nv_libdir}"/libnvidia-compiler.so ${NV_SOVER}
-		donvidia "${nv_libdir}"/libOpenCL.so 1.0.0 ${CL_ROOT}
-	fi
-}
-
-pkg_preinst() {
-	if use kernel_linux; then
-		linux-mod_pkg_preinst
-
-		local videogroup="$(egetent group video | cut -d ':' -f 3)"
-		if [ -z "${videogroup}" ]; then
-			eerror "Failed to determine the video group gid"
-			die "Failed to determine the video group gid"
-		else
-			sed -i \
-				-e "s:PACKAGE:${PF}:g" \
-				-e "s:VIDEOGID:${videogroup}:" \
-				"${D}"/etc/modprobe.d/nvidia.conf || die
-		fi
-	fi
-
-	# Clean the dynamic libGL stuff's home to ensure
-	# we dont have stale libs floating around
-	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ] ; then
-		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
-	fi
-	# Make sure we nuke the old nvidia-glx's env.d file
-	if [ -e "${ROOT}"/etc/env.d/09nvidia ] ; then
-		rm -f "${ROOT}"/etc/env.d/09nvidia
-	fi
-}
-
-pkg_postinst() {
-	use kernel_linux && linux-mod_pkg_postinst
-
-	# Switch to the nvidia implementation
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
-	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
-
-	readme.gentoo_print_elog
-
-	if ! use X; then
-		elog "You have elected to not install the X.org driver. Along with"
-		elog "this the OpenGL libraries, XvMC, and VDPAU libraries were not"
-		elog "installed. Additionally, once the driver is loaded your card"
-		elog "and fan will run at max speed which may not be desirable."
-		elog "Use the 'nvidia-smi' init script to have your card and fan"
-		elog "speed scale appropriately."
-		elog
-	fi
-	if ! use tools; then
-		elog "USE=tools controls whether the nvidia-settings application"
-		elog "is installed. If you would like to use it, enable that"
-		elog "flag and re-emerge this ebuild. Optionally you can install"
-		elog "media-video/nvidia-settings"
-		elog
-	fi
-}
-
-pkg_prerm() {
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}
-
-pkg_postrm() {
-	use kernel_linux && linux-mod_pkg_postrm
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-375.82.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-375.82.ebuild
deleted file mode 100644
index beb76b9a771..00000000000
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-375.82.ebuild
+++ /dev/null
@@ -1,569 +0,0 @@
-# Copyright 1999-2018 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-inherit eutils flag-o-matic linux-info linux-mod multilib-minimal nvidia-driver \
-	portability toolchain-funcs unpacker user udev
-
-NV_URI="https://download.nvidia.com/XFree86/"
-X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
-AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
-ARM_NV_PACKAGE="NVIDIA-Linux-armv7l-gnueabihf-${PV}"
-X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
-AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
-
-DESCRIPTION="NVIDIA Accelerated Graphics Driver"
-HOMEPAGE="http://www.nvidia.com/ http://www.nvidia.com/Download/Find.aspx"
-SRC_URI="
-	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
-	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
-	arm? ( ${NV_URI}Linux-32bit-ARM/${PV}/${ARM_NV_PACKAGE}.run )
-	x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
-	x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
-	tools? (
-		https://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2
-	)
-"
-
-LICENSE="GPL-2 NVIDIA-r2"
-SLOT="0/${PV%.*}"
-KEYWORDS="-* amd64 x86 ~amd64-fbsd ~x86-fbsd"
-RESTRICT="bindist mirror"
-EMULTILIB_PKG="true"
-
-IUSE="acpi compat +driver gtk3 kernel_FreeBSD kernel_linux +kms multilib pax_kernel static-libs +tools uvm wayland +X"
-REQUIRED_USE="
-	tools? ( X )
-	static-libs? ( tools )
-"
-
-COMMON="
-	app-eselect/eselect-opencl
-	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
-	tools? (
-		dev-libs/atk
-		dev-libs/glib:2
-		dev-libs/jansson
-		gtk3? (
-			x11-libs/gtk+:3
-		)
-		x11-libs/cairo
-		x11-libs/gdk-pixbuf[X]
-		x11-libs/gtk+:2
-		x11-libs/libX11
-		x11-libs/libXext
-		x11-libs/libXrandr
-		x11-libs/libXv
-		x11-libs/libXxf86vm
-		x11-libs/pango[X]
-	)
-	X? (
-		>=app-eselect/eselect-opengl-1.0.9
-		app-misc/pax-utils
-	)
-"
-DEPEND="
-	${COMMON}
-	kernel_linux? ( virtual/linux-sources )
-"
-RDEPEND="
-	${COMMON}
-	acpi? ( sys-power/acpid )
-	tools? ( !media-video/nvidia-settings )
-	wayland? ( dev-libs/wayland[${MULTILIB_USEDEP}] )
-	X? (
-		<x11-base/xorg-server-1.19.99:=
-		>=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
-		>=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
-		>=x11-libs/libvdpau-1.0[${MULTILIB_USEDEP}]
-		sys-libs/zlib[${MULTILIB_USEDEP}]
-	)
-"
-
-QA_PREBUILT="opt/* usr/lib*"
-
-S=${WORKDIR}/
-
-nvidia_drivers_versions_check() {
-	if use amd64 && has_multilib_profile && \
-		[ "${DEFAULT_ABI}" != "amd64" ]; then
-		eerror "This ebuild doesn't currently support changing your default ABI"
-		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
-	fi
-
-	if use kernel_linux && kernel_is ge 4 14; then
-		ewarn "Gentoo supports kernels which are supported by NVIDIA"
-		ewarn "which are limited to the following kernels:"
-		ewarn "<sys-kernel/gentoo-sources-4.14"
-		ewarn "<sys-kernel/vanilla-sources-4.14"
-		ewarn ""
-		ewarn "You are free to utilize epatch_user to provide whatever"
-		ewarn "support you feel is appropriate, but will not receive"
-		ewarn "support as a result of those changes."
-		ewarn ""
-		ewarn "Do not file a bug report about this."
-		ewarn ""
-	fi
-
-	# Since Nvidia ships many different series of drivers, we need to give the user
-	# some kind of guidance as to what version they should install. This tries
-	# to point the user in the right direction but can't be perfect. check
-	# nvidia-driver.eclass
-	nvidia-driver-check-warning
-
-	# Kernel features/options to check for
-	CONFIG_CHECK="!DEBUG_MUTEXES ~!LOCKDEP ~MTRR ~SYSVIPC ~ZONE_DMA"
-	use x86 && CONFIG_CHECK+=" ~HIGHMEM"
-
-	# Now do the above checks
-	use kernel_linux && check_extra_config
-}
-
-pkg_pretend() {
-	nvidia_drivers_versions_check
-}
-
-pkg_setup() {
-	nvidia_drivers_versions_check
-
-	# try to turn off distcc and ccache for people that have a problem with it
-	export DISTCC_DISABLE=1
-	export CCACHE_DISABLE=1
-
-	if use driver && use kernel_linux; then
-		MODULE_NAMES="nvidia(video:${S}/kernel)"
-		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
-		use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel) nvidia-drm(video:${S}/kernel)"
-
-		# This needs to run after MODULE_NAMES (so that the eclass checks
-		# whether the kernel supports loadable modules) but before BUILD_PARAMS
-		# is set (so that KV_DIR is populated).
-		linux-mod_pkg_setup
-
-		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
-		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
-
-		# linux-mod_src_compile calls set_arch_to_kernel, which
-		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
-		# expects x86_64 or i386 and then converts it to x86
-		# later on in the build process
-		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
-	fi
-
-	if use kernel_linux && kernel_is lt 2 6 9; then
-		eerror "You must build this against 2.6.9 or higher kernels."
-	fi
-
-	# set variables to where files are in the package structure
-	if use kernel_FreeBSD; then
-		use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
-		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
-		NV_DOC="${S}/doc"
-		NV_OBJ="${S}/obj"
-		NV_SRC="${S}/src"
-		NV_MAN="${S}/x11/man"
-		NV_X11="${S}/obj"
-		NV_SOVER=1
-	elif use kernel_linux; then
-		NV_DOC="${S}"
-		NV_OBJ="${S}"
-		NV_SRC="${S}/kernel"
-		NV_MAN="${S}"
-		NV_X11="${S}"
-		NV_SOVER=${PV}
-	else
-		die "Could not determine proper NVIDIA package"
-	fi
-}
-
-src_prepare() {
-	eapply "${FILESDIR}"/${P}-profiles-rc.patch
-
-	if use pax_kernel; then
-		ewarn "Using PAX patches is not supported. You will be asked to"
-		ewarn "use a standard kernel should you have issues. Should you"
-		ewarn "need support with these patches, contact the PaX team."
-		eapply "${FILESDIR}"/${PN}-375.20-pax.patch
-	fi
-
-	local man_file
-	for man_file in "${NV_MAN}"/*1.gz; do
-		gunzip $man_file || die
-	done
-
-	# Allow user patches so they can support RC kernels and whatever else
-	eapply_user
-}
-
-src_compile() {
-	# This is already the default on Linux, as there's no toplevel Makefile, but
-	# on FreeBSD there's one and triggers the kernel module build, as we install
-	# it by itself, pass this.
-
-	cd "${NV_SRC}"
-	if use kernel_FreeBSD; then
-		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
-			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
-	elif use driver && use kernel_linux; then
-		MAKEOPTS=-j1 linux-mod_src_compile
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			AR="$(tc-getAR)" \
-			CC="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			NV_VERBOSE=1 \
-			RANLIB="$(tc-getRANLIB)" \
-			DO_STRIP= \
-			build-xnvctrl
-
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			CC="$(tc-getCC)" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LD="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			NVML_ENABLED=0 \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			NV_VERBOSE=1 \
-			DO_STRIP=
-	fi
-}
-
-# Install nvidia library:
-# the first parameter is the library to install
-# the second parameter is the provided soversion
-# the third parameter is the target directory if it is not /usr/lib
-donvidia() {
-	# Full path to library
-	nv_LIB="${1}"
-
-	# SOVER to use
-	nv_SOVER="$(scanelf -qF'%S#F' ${nv_LIB})"
-
-	# Where to install
-	nv_DEST="${2}"
-
-	# Get just the library name
-	nv_LIBNAME=$(basename "${nv_LIB}")
-
-	if [[ "${nv_DEST}" ]]; then
-		exeinto ${nv_DEST}
-		action="doexe"
-	else
-		nv_DEST="/usr/$(get_libdir)"
-		action="dolib.so"
-	fi
-
-	# Install the library
-	${action} ${nv_LIB} || die "failed to install ${nv_LIBNAME}"
-
-	# If the library has a SONAME and SONAME does not match the library name,
-	# then we need to create a symlink
-	if [[ ${nv_SOVER} ]] && ! [[ "${nv_SOVER}" = "${nv_LIBNAME}" ]]; then
-		dosym ${nv_LIBNAME} ${nv_DEST}/${nv_SOVER} \
-			|| die "failed to create ${nv_DEST}/${nv_SOVER} symlink"
-	fi
-
-	dosym ${nv_LIBNAME} ${nv_DEST}/${nv_LIBNAME/.so*/.so} \
-		|| die "failed to create ${nv_LIBNAME/.so*/.so} symlink"
-}
-
-src_install() {
-	if use driver && use kernel_linux; then
-		linux-mod_src_install
-
-		# Add the aliases
-		# This file is tweaked with the appropriate video group in
-		# pkg_preinst, see bug #491414
-		insinto /etc/modprobe.d
-		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
-		doins "${FILESDIR}"/nvidia-rmmod.conf
-
-		# Ensures that our device nodes are created when not using X
-		exeinto "$(get_udevdir)"
-		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
-		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
-	elif use kernel_FreeBSD; then
-		if use x86-fbsd; then
-			insinto /boot/modules
-			doins "${S}/src/nvidia.kld"
-		fi
-
-		exeinto /boot/modules
-		doexe "${S}/src/nvidia.ko"
-	fi
-
-	# NVIDIA kernel <-> userspace driver config lib
-	donvidia "${NV_OBJ}"/libnvidia-cfg.so.${NV_SOVER}
-
-	# NVIDIA framebuffer capture library
-	donvidia "${NV_OBJ}"/libnvidia-fbc.so.${NV_SOVER}
-
-	# NVIDIA video encode/decode <-> CUDA
-	if use kernel_linux; then
-		donvidia "${NV_OBJ}"/libnvcuvid.so.${NV_SOVER}
-		donvidia "${NV_OBJ}"/libnvidia-encode.so.${NV_SOVER}
-	fi
-
-	if use X; then
-		# Xorg DDX driver
-		insinto /usr/$(get_libdir)/xorg/modules/drivers
-		doins "${NV_X11}"/nvidia_drv.so
-
-		# Xorg GLX driver
-		donvidia "${NV_X11}"/libglx.so.${NV_SOVER} \
-			/usr/$(get_libdir)/opengl/nvidia/extensions
-
-		# Xorg nvidia.conf
-		if has_version '>=x11-base/xorg-server-1.16'; then
-			insinto /usr/share/X11/xorg.conf.d
-			newins {,50-}nvidia-drm-outputclass.conf
-		fi
-
-		insinto /usr/share/glvnd/egl_vendor.d
-		doins "${NV_X11}"/10_nvidia.json
-	fi
-
-	# OpenCL ICD for NVIDIA
-	if use kernel_linux; then
-		insinto /etc/OpenCL/vendors
-		doins "${NV_OBJ}"/nvidia.icd
-	fi
-
-	# Documentation
-	if use kernel_FreeBSD; then
-		dodoc "${NV_DOC}"/README
-		use X && doman "${NV_MAN}"/nvidia-xconfig.1
-		use tools && doman "${NV_MAN}"/nvidia-settings.1
-	else
-		# Docs
-		newdoc "${NV_DOC}"/README.txt README
-		dodoc "${NV_DOC}"/NVIDIA_Changelog
-		doman "${NV_MAN}"/nvidia-smi.1
-		use X && doman "${NV_MAN}"/nvidia-xconfig.1
-		use tools && doman "${NV_MAN}"/nvidia-settings.1
-		doman "${NV_MAN}"/nvidia-cuda-mps-control.1
-	fi
-
-	docinto html
-	dodoc -r "${NV_DOC}"/html/*
-
-	# Helper Apps
-	exeinto /opt/bin/
-
-	if use X; then
-		doexe "${NV_OBJ}"/nvidia-xconfig
-
-		insinto /etc/vulkan/icd.d
-		doins nvidia_icd.json
-	fi
-
-	if use kernel_linux; then
-		doexe "${NV_OBJ}"/nvidia-cuda-mps-control
-		doexe "${NV_OBJ}"/nvidia-cuda-mps-server
-		doexe "${NV_OBJ}"/nvidia-debugdump
-		doexe "${NV_OBJ}"/nvidia-persistenced
-		doexe "${NV_OBJ}"/nvidia-smi
-
-		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
-		doexe "${NV_OBJ}"/nvidia-modprobe
-		fowners root:video /opt/bin/nvidia-modprobe
-		fperms 4710 /opt/bin/nvidia-modprobe
-		dosym /{opt,usr}/bin/nvidia-modprobe
-
-		doman nvidia-cuda-mps-control.1
-		doman nvidia-modprobe.1
-		doman nvidia-persistenced.1
-		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
-		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
-		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src/ \
-			DESTDIR="${D}" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LIBDIR="${D}/usr/$(get_libdir)" \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			NV_VERBOSE=1 \
-			PREFIX=/usr \
-			DO_STRIP= \
-			install
-
-		if use static-libs; then
-			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
-
-			insinto /usr/include/NVCtrl
-			doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
-		fi
-
-		insinto /usr/share/nvidia/
-		doins nvidia-application-profiles-${PV}-key-documentation
-
-		insinto /etc/nvidia
-		newins \
-			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
-
-		# There is no icon in the FreeBSD tarball.
-		use kernel_FreeBSD || \
-			doicon "${NV_OBJ}"/nvidia-settings.png
-
-		domenu "${FILESDIR}"/nvidia-settings.desktop
-
-		exeinto /etc/X11/xinit/xinitrc.d
-		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
-	fi
-
-	dobin "${NV_OBJ}"/nvidia-bug-report.sh
-
-	if has_multilib_profile && use multilib; then
-		local OABI=${ABI}
-		for ABI in $(get_install_abis); do
-			src_install-libs
-		done
-		ABI=${OABI}
-		unset OABI
-	else
-		src_install-libs
-	fi
-
-	is_final_abi || die "failed to iterate through all ABIs"
-
-	readme.gentoo_create_doc
-}
-
-src_install-libs() {
-	local inslibdir=$(get_libdir)
-	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
-	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
-	local nv_libdir="${NV_OBJ}"
-
-	if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
-		nv_libdir="${NV_OBJ}"/32
-	fi
-
-	if use X; then
-		NV_GLX_LIBRARIES=(
-			"libEGL.so.$(usex compat ${NV_SOVER} 1) ${GL_ROOT}"
-			"libEGL_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGL.so.$(usex compat ${NV_SOVER} 1.0.0) ${GL_ROOT}"
-			"libGLESv1_CM.so.1 ${GL_ROOT}"
-			"libGLESv1_CM_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLESv2.so.2 ${GL_ROOT}"
-			"libGLESv2_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLX.so.0 ${GL_ROOT}"
-			"libGLX_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLdispatch.so.0 ${GL_ROOT}"
-			"libOpenCL.so.1.0.0 ${CL_ROOT}"
-			"libOpenGL.so.0 ${GL_ROOT}"
-			"libcuda.so.${NV_SOVER}"
-			"libnvcuvid.so.${NV_SOVER}"
-			"libnvidia-compiler.so.${NV_SOVER}"
-			"libnvidia-eglcore.so.${NV_SOVER}"
-			"libnvidia-encode.so.${NV_SOVER}"
-			"libnvidia-fatbinaryloader.so.${NV_SOVER}"
-			"libnvidia-fbc.so.${NV_SOVER}"
-			"libnvidia-glcore.so.${NV_SOVER}"
-			"libnvidia-glsi.so.${NV_SOVER}"
-			"libnvidia-ifr.so.${NV_SOVER}"
-			"libnvidia-opencl.so.${NV_SOVER}"
-			"libnvidia-ptxjitcompiler.so.${NV_SOVER}"
-			"libvdpau_nvidia.so.${NV_SOVER}"
-		)
-
-		if use wayland && has_multilib_profile && [[ ${ABI} == "amd64" ]];
-		then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-egl-wayland.so.${NV_SOVER}"
-			)
-		fi
-
-		if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
-		then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-wfb.so.${NV_SOVER}"
-			)
-		fi
-
-		if use kernel_FreeBSD; then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-tls.so.${NV_SOVER}"
-			)
-		fi
-
-		if use kernel_linux; then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-ml.so.${NV_SOVER}"
-				"tls/libnvidia-tls.so.${NV_SOVER}"
-			)
-		fi
-
-		for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
-			donvidia "${nv_libdir}"/${NV_LIB}
-		done
-	fi
-}
-
-pkg_preinst() {
-	if use driver && use kernel_linux; then
-		linux-mod_pkg_preinst
-
-		local videogroup="$(egetent group video | cut -d ':' -f 3)"
-		if [ -z "${videogroup}" ]; then
-			eerror "Failed to determine the video group gid"
-			die "Failed to determine the video group gid"
-		else
-			sed -i \
-				-e "s:PACKAGE:${PF}:g" \
-				-e "s:VIDEOGID:${videogroup}:" \
-				"${D}"/etc/modprobe.d/nvidia.conf || die
-		fi
-	fi
-
-	# Clean the dynamic libGL stuff's home to ensure
-	# we dont have stale libs floating around
-	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ]; then
-		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
-	fi
-	# Make sure we nuke the old nvidia-glx's env.d file
-	if [ -e "${ROOT}"/etc/env.d/09nvidia ]; then
-		rm -f "${ROOT}"/etc/env.d/09nvidia
-	fi
-}
-
-pkg_postinst() {
-	use driver && use kernel_linux && linux-mod_pkg_postinst
-
-	# Switch to the nvidia implementation
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
-	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
-
-	readme.gentoo_print_elog
-
-	if ! use X; then
-		elog "You have elected to not install the X.org driver. Along with"
-		elog "this the OpenGL libraries and VDPAU libraries were not"
-		elog "installed. Additionally, once the driver is loaded your card"
-		elog "and fan will run at max speed which may not be desirable."
-		elog "Use the 'nvidia-smi' init script to have your card and fan"
-		elog "speed scale appropriately."
-		elog
-	fi
-	if ! use tools; then
-		elog "USE=tools controls whether the nvidia-settings application"
-		elog "is installed. If you would like to use it, enable that"
-		elog "flag and re-emerge this ebuild. Optionally you can install"
-		elog "media-video/nvidia-settings"
-		elog
-	fi
-}
-
-pkg_prerm() {
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}
-
-pkg_postrm() {
-	use driver && use kernel_linux && linux-mod_pkg_postrm
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-378.13-r1.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-378.13-r1.ebuild
deleted file mode 100644
index 66cd8db5127..00000000000
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-378.13-r1.ebuild
+++ /dev/null
@@ -1,572 +0,0 @@
-# Copyright 1999-2018 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-inherit eutils flag-o-matic linux-info linux-mod multilib-minimal nvidia-driver \
-	portability toolchain-funcs unpacker user udev
-
-NV_URI="https://download.nvidia.com/XFree86/"
-X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
-AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
-ARM_NV_PACKAGE="NVIDIA-Linux-armv7l-gnueabihf-${PV}"
-X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
-AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
-
-DESCRIPTION="NVIDIA Accelerated Graphics Driver"
-HOMEPAGE="http://www.nvidia.com/ http://www.nvidia.com/Download/Find.aspx"
-SRC_URI="
-	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
-	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
-	arm? ( ${NV_URI}Linux-32bit-ARM/${PV}/${ARM_NV_PACKAGE}.run )
-	x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
-	x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
-	tools? (
-		https://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2
-	)
-"
-
-LICENSE="GPL-2 NVIDIA-r2"
-SLOT="0/${PV%.*}"
-KEYWORDS="-* amd64 x86 ~amd64-fbsd ~x86-fbsd"
-RESTRICT="bindist mirror"
-EMULTILIB_PKG="true"
-
-IUSE="acpi compat +driver gtk3 kernel_FreeBSD kernel_linux +kms multilib pax_kernel static-libs +tools uvm wayland +X"
-REQUIRED_USE="
-	tools? ( X )
-	static-libs? ( tools )
-"
-
-COMMON="
-	app-eselect/eselect-opencl
-	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
-	tools? (
-		dev-libs/atk
-		dev-libs/glib:2
-		dev-libs/jansson
-		gtk3? (
-			x11-libs/gtk+:3
-		)
-		x11-libs/cairo
-		x11-libs/gdk-pixbuf[X]
-		x11-libs/gtk+:2
-		x11-libs/libX11
-		x11-libs/libXext
-		x11-libs/libXrandr
-		x11-libs/libXv
-		x11-libs/libXxf86vm
-		x11-libs/pango[X]
-	)
-	X? (
-		>=app-eselect/eselect-opengl-1.0.9
-		app-misc/pax-utils
-	)
-"
-DEPEND="
-	${COMMON}
-	kernel_linux? ( virtual/linux-sources )
-"
-RDEPEND="
-	${COMMON}
-	acpi? ( sys-power/acpid )
-	tools? ( !media-video/nvidia-settings )
-	wayland? ( dev-libs/wayland[${MULTILIB_USEDEP}] )
-	X? (
-		<x11-base/xorg-server-1.19.99:=
-		>=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
-		>=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
-		>=x11-libs/libvdpau-1.0[${MULTILIB_USEDEP}]
-		sys-libs/zlib[${MULTILIB_USEDEP}]
-	)
-"
-
-QA_PREBUILT="opt/* usr/lib*"
-
-S=${WORKDIR}/
-
-nvidia_drivers_versions_check() {
-	if use amd64 && has_multilib_profile && \
-		[ "${DEFAULT_ABI}" != "amd64" ]; then
-		eerror "This ebuild doesn't currently support changing your default ABI"
-		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
-	fi
-
-	if use kernel_linux && kernel_is ge 4 10; then
-		ewarn "Gentoo supports kernels which are supported by NVIDIA"
-		ewarn "which are limited to the following kernels:"
-		ewarn "<sys-kernel/gentoo-sources-4.10"
-		ewarn "<sys-kernel/vanilla-sources-4.10"
-		ewarn ""
-		ewarn "You are free to utilize epatch_user to provide whatever"
-		ewarn "support you feel is appropriate, but will not receive"
-		ewarn "support as a result of those changes."
-		ewarn ""
-		ewarn "Do not file a bug report about this."
-		ewarn ""
-	fi
-
-	# Since Nvidia ships many different series of drivers, we need to give the user
-	# some kind of guidance as to what version they should install. This tries
-	# to point the user in the right direction but can't be perfect. check
-	# nvidia-driver.eclass
-	nvidia-driver-check-warning
-
-	# Kernel features/options to check for
-	CONFIG_CHECK="!DEBUG_MUTEXES ~!LOCKDEP ~MTRR ~SYSVIPC ~ZONE_DMA"
-	use x86 && CONFIG_CHECK+=" ~HIGHMEM"
-
-	# Now do the above checks
-	use kernel_linux && check_extra_config
-}
-
-pkg_pretend() {
-	nvidia_drivers_versions_check
-}
-
-pkg_setup() {
-	nvidia_drivers_versions_check
-
-	# try to turn off distcc and ccache for people that have a problem with it
-	export DISTCC_DISABLE=1
-	export CCACHE_DISABLE=1
-
-	if use driver && use kernel_linux; then
-		MODULE_NAMES="nvidia(video:${S}/kernel)"
-		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
-		use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel) nvidia-drm(video:${S}/kernel)"
-
-		# This needs to run after MODULE_NAMES (so that the eclass checks
-		# whether the kernel supports loadable modules) but before BUILD_PARAMS
-		# is set (so that KV_DIR is populated).
-		linux-mod_pkg_setup
-
-		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
-		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
-
-		# linux-mod_src_compile calls set_arch_to_kernel, which
-		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
-		# expects x86_64 or i386 and then converts it to x86
-		# later on in the build process
-		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
-	fi
-
-	if use kernel_linux && kernel_is lt 2 6 9; then
-		eerror "You must build this against 2.6.9 or higher kernels."
-	fi
-
-	# set variables to where files are in the package structure
-	if use kernel_FreeBSD; then
-		use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
-		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
-		NV_DOC="${S}/doc"
-		NV_OBJ="${S}/obj"
-		NV_SRC="${S}/src"
-		NV_MAN="${S}/x11/man"
-		NV_X11="${S}/obj"
-		NV_SOVER=1
-	elif use kernel_linux; then
-		NV_DOC="${S}"
-		NV_OBJ="${S}"
-		NV_SRC="${S}/kernel"
-		NV_MAN="${S}"
-		NV_X11="${S}"
-		NV_SOVER=${PV}
-	else
-		die "Could not determine proper NVIDIA package"
-	fi
-}
-
-src_prepare() {
-	if use pax_kernel; then
-		ewarn "Using PAX patches is not supported. You will be asked to"
-		ewarn "use a standard kernel should you have issues. Should you"
-		ewarn "need support with these patches, contact the PaX team."
-		eapply "${FILESDIR}"/${PN}-375.20-pax.patch
-	fi
-
-	local man_file
-	for man_file in "${NV_MAN}"/*1.gz; do
-		gunzip $man_file || die
-	done
-
-	# Allow user patches so they can support RC kernels and whatever else
-	eapply_user
-}
-
-src_compile() {
-	# This is already the default on Linux, as there's no toplevel Makefile, but
-	# on FreeBSD there's one and triggers the kernel module build, as we install
-	# it by itself, pass this.
-
-	cd "${NV_SRC}"
-	if use kernel_FreeBSD; then
-		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
-			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
-	elif use driver && use kernel_linux; then
-		MAKEOPTS=-j1 linux-mod_src_compile
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			AR="$(tc-getAR)" \
-			CC="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			NV_VERBOSE=1 \
-			RANLIB="$(tc-getRANLIB)" \
-			DO_STRIP= \
-			build-xnvctrl
-
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			CC="$(tc-getCC)" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LD="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			NVML_ENABLED=0 \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			NV_VERBOSE=1 \
-			DO_STRIP=
-	fi
-}
-
-# Install nvidia library:
-# the first parameter is the library to install
-# the second parameter is the provided soversion
-# the third parameter is the target directory if it is not /usr/lib
-donvidia() {
-	# Full path to library
-	nv_LIB="${1}"
-
-	# SOVER to use
-	nv_SOVER="$(scanelf -qF'%S#F' ${nv_LIB})"
-
-	# Where to install
-	nv_DEST="${2}"
-
-	# Get just the library name
-	nv_LIBNAME=$(basename "${nv_LIB}")
-
-	if [[ "${nv_DEST}" ]]; then
-		exeinto ${nv_DEST}
-		action="doexe"
-	else
-		nv_DEST="/usr/$(get_libdir)"
-		action="dolib.so"
-	fi
-
-	# Install the library
-	${action} ${nv_LIB} || die "failed to install ${nv_LIBNAME}"
-
-	# If the library has a SONAME and SONAME does not match the library name,
-	# then we need to create a symlink
-	if [[ ${nv_SOVER} ]] && ! [[ "${nv_SOVER}" = "${nv_LIBNAME}" ]]; then
-		dosym ${nv_LIBNAME} ${nv_DEST}/${nv_SOVER} \
-			|| die "failed to create ${nv_DEST}/${nv_SOVER} symlink"
-	fi
-
-	dosym ${nv_LIBNAME} ${nv_DEST}/${nv_LIBNAME/.so*/.so} \
-		|| die "failed to create ${nv_LIBNAME/.so*/.so} symlink"
-}
-
-src_install() {
-	if use driver && use kernel_linux; then
-		linux-mod_src_install
-
-		# Add the aliases
-		# This file is tweaked with the appropriate video group in
-		# pkg_preinst, see bug #491414
-		insinto /etc/modprobe.d
-		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
-		doins "${FILESDIR}"/nvidia-rmmod.conf
-
-		# Ensures that our device nodes are created when not using X
-		exeinto "$(get_udevdir)"
-		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
-		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
-	elif use kernel_FreeBSD; then
-		if use x86-fbsd; then
-			insinto /boot/modules
-			doins "${S}/src/nvidia.kld"
-		fi
-
-		exeinto /boot/modules
-		doexe "${S}/src/nvidia.ko"
-	fi
-
-	# NVIDIA kernel <-> userspace driver config lib
-	donvidia ${NV_OBJ}/libnvidia-cfg.so.${NV_SOVER}
-
-	# NVIDIA framebuffer capture library
-	donvidia ${NV_OBJ}/libnvidia-fbc.so.${NV_SOVER}
-
-	# NVIDIA video encode/decode <-> CUDA
-	if use kernel_linux; then
-		donvidia ${NV_OBJ}/libnvcuvid.so.${NV_SOVER}
-		donvidia ${NV_OBJ}/libnvidia-encode.so.${NV_SOVER}
-	fi
-
-	if use X; then
-		# Xorg DDX driver
-		insinto /usr/$(get_libdir)/xorg/modules/drivers
-		doins ${NV_X11}/nvidia_drv.so
-
-		# Xorg GLX driver
-		donvidia ${NV_X11}/libglx.so.${NV_SOVER} \
-			/usr/$(get_libdir)/opengl/nvidia/extensions
-
-		# Xorg nvidia.conf
-		if has_version '>=x11-base/xorg-server-1.16'; then
-			insinto /usr/share/X11/xorg.conf.d
-			newins {,50-}nvidia-drm-outputclass.conf
-		fi
-
-		insinto /usr/share/glvnd/egl_vendor.d
-		doins ${NV_X11}/10_nvidia.json
-	fi
-
-	if use wayland; then
-		insinto /usr/share/egl/egl_external_platform.d
-		doins ${NV_X11}/10_nvidia_wayland.json
-	fi
-
-	# OpenCL ICD for NVIDIA
-	if use kernel_linux; then
-		insinto /etc/OpenCL/vendors
-		doins ${NV_OBJ}/nvidia.icd
-	fi
-
-	# Documentation
-	if use kernel_FreeBSD; then
-		dodoc "${NV_DOC}/README"
-		use X && doman "${NV_MAN}/nvidia-xconfig.1"
-		use tools && doman "${NV_MAN}/nvidia-settings.1"
-	else
-		# Docs
-		newdoc "${NV_DOC}/README.txt" README
-		dodoc "${NV_DOC}/NVIDIA_Changelog"
-		doman "${NV_MAN}"/nvidia-smi.1
-		use X && doman "${NV_MAN}"/nvidia-xconfig.1
-		use tools && doman "${NV_MAN}"/nvidia-settings.1
-		doman "${NV_MAN}"/nvidia-cuda-mps-control.1
-	fi
-
-	docinto html
-	dodoc -r ${NV_DOC}/html/*
-
-	# Helper Apps
-	exeinto /opt/bin/
-
-	if use X; then
-		doexe ${NV_OBJ}/nvidia-xconfig
-
-		insinto /etc/vulkan/icd.d
-		doins nvidia_icd.json
-	fi
-
-	if use kernel_linux; then
-		doexe ${NV_OBJ}/nvidia-cuda-mps-control
-		doexe ${NV_OBJ}/nvidia-cuda-mps-server
-		doexe ${NV_OBJ}/nvidia-debugdump
-		doexe ${NV_OBJ}/nvidia-persistenced
-		doexe ${NV_OBJ}/nvidia-smi
-
-		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
-		doexe ${NV_OBJ}/nvidia-modprobe
-		fowners root:video /opt/bin/nvidia-modprobe
-		fperms 4710 /opt/bin/nvidia-modprobe
-		dosym /{opt,usr}/bin/nvidia-modprobe
-
-		doman nvidia-cuda-mps-control.1
-		doman nvidia-modprobe.1
-		doman nvidia-persistenced.1
-		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
-		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
-		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src/ \
-			DESTDIR="${D}" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LIBDIR="${D}/usr/$(get_libdir)" \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			NV_VERBOSE=1 \
-			PREFIX=/usr \
-			DO_STRIP= \
-			install
-
-		if use static-libs; then
-			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
-
-			insinto /usr/include/NVCtrl
-			doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
-		fi
-
-		insinto /usr/share/nvidia/
-		doins nvidia-application-profiles-${PV}-key-documentation
-
-		insinto /etc/nvidia
-		newins \
-			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
-
-		# There is no icon in the FreeBSD tarball.
-		use kernel_FreeBSD || \
-			doicon ${NV_OBJ}/nvidia-settings.png
-
-		domenu "${FILESDIR}"/nvidia-settings.desktop
-
-		exeinto /etc/X11/xinit/xinitrc.d
-		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
-	fi
-
-	dobin ${NV_OBJ}/nvidia-bug-report.sh
-
-	if has_multilib_profile && use multilib; then
-		local OABI=${ABI}
-		for ABI in $(get_install_abis); do
-			src_install-libs
-		done
-		ABI=${OABI}
-		unset OABI
-	else
-		src_install-libs
-	fi
-
-	is_final_abi || die "failed to iterate through all ABIs"
-
-	readme.gentoo_create_doc
-}
-
-src_install-libs() {
-	local inslibdir=$(get_libdir)
-	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
-	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
-	local nv_libdir="${NV_OBJ}"
-
-	if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
-		nv_libdir="${NV_OBJ}"/32
-	fi
-
-	if use X; then
-		NV_GLX_LIBRARIES=(
-			"libEGL.so.$(usex compat ${NV_SOVER} 1) ${GL_ROOT}"
-			"libEGL_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGL.so.$(usex compat ${NV_SOVER} 1.0.0) ${GL_ROOT}"
-			"libGLESv1_CM.so.1 ${GL_ROOT}"
-			"libGLESv1_CM_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLESv2.so.2 ${GL_ROOT}"
-			"libGLESv2_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLX.so.0 ${GL_ROOT}"
-			"libGLX_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLdispatch.so.0 ${GL_ROOT}"
-			"libOpenCL.so.1.0.0 ${CL_ROOT}"
-			"libOpenGL.so.0 ${GL_ROOT}"
-			"libcuda.so.${NV_SOVER}"
-			"libnvcuvid.so.${NV_SOVER}"
-			"libnvidia-compiler.so.${NV_SOVER}"
-			"libnvidia-eglcore.so.${NV_SOVER}"
-			"libnvidia-encode.so.${NV_SOVER}"
-			"libnvidia-fatbinaryloader.so.${NV_SOVER}"
-			"libnvidia-fbc.so.${NV_SOVER}"
-			"libnvidia-glcore.so.${NV_SOVER}"
-			"libnvidia-glsi.so.${NV_SOVER}"
-			"libnvidia-ifr.so.${NV_SOVER}"
-			"libnvidia-opencl.so.${NV_SOVER}"
-			"libnvidia-ptxjitcompiler.so.${NV_SOVER}"
-			"libvdpau_nvidia.so.${NV_SOVER}"
-		)
-
-		if use wayland && has_multilib_profile && [[ ${ABI} == "amd64" ]];
-		then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-egl-wayland.so.1.0.1"
-			)
-		fi
-
-		if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
-		then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-wfb.so.${NV_SOVER}"
-			)
-		fi
-
-		if use kernel_FreeBSD; then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-tls.so.${NV_SOVER}"
-			)
-		fi
-
-		if use kernel_linux; then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-ml.so.${NV_SOVER}"
-				"tls/libnvidia-tls.so.${NV_SOVER}"
-			)
-		fi
-
-		for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
-			donvidia "${nv_libdir}"/${NV_LIB}
-		done
-	fi
-}
-
-pkg_preinst() {
-	if use driver && use kernel_linux; then
-		linux-mod_pkg_preinst
-
-		local videogroup="$(egetent group video | cut -d ':' -f 3)"
-		if [ -z "${videogroup}" ]; then
-			eerror "Failed to determine the video group gid"
-			die "Failed to determine the video group gid"
-		else
-			sed -i \
-				-e "s:PACKAGE:${PF}:g" \
-				-e "s:VIDEOGID:${videogroup}:" \
-				"${D}"/etc/modprobe.d/nvidia.conf || die
-		fi
-	fi
-
-	# Clean the dynamic libGL stuff's home to ensure
-	# we dont have stale libs floating around
-	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ]; then
-		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
-	fi
-	# Make sure we nuke the old nvidia-glx's env.d file
-	if [ -e "${ROOT}"/etc/env.d/09nvidia ]; then
-		rm -f "${ROOT}"/etc/env.d/09nvidia
-	fi
-}
-
-pkg_postinst() {
-	use driver && use kernel_linux && linux-mod_pkg_postinst
-
-	# Switch to the nvidia implementation
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
-	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
-
-	readme.gentoo_print_elog
-
-	if ! use X; then
-		elog "You have elected to not install the X.org driver. Along with"
-		elog "this the OpenGL libraries and VDPAU libraries were not"
-		elog "installed. Additionally, once the driver is loaded your card"
-		elog "and fan will run at max speed which may not be desirable."
-		elog "Use the 'nvidia-smi' init script to have your card and fan"
-		elog "speed scale appropriately."
-		elog
-	fi
-	if ! use tools; then
-		elog "USE=tools controls whether the nvidia-settings application"
-		elog "is installed. If you would like to use it, enable that"
-		elog "flag and re-emerge this ebuild. Optionally you can install"
-		elog "media-video/nvidia-settings"
-		elog
-	fi
-}
-
-pkg_prerm() {
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}
-
-pkg_postrm() {
-	use driver && use kernel_linux && linux-mod_pkg_postrm
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-381.22-r1.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-381.22-r1.ebuild
deleted file mode 100644
index 2d4d3a73dcd..00000000000
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-381.22-r1.ebuild
+++ /dev/null
@@ -1,573 +0,0 @@
-# Copyright 1999-2018 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-inherit eutils flag-o-matic linux-info linux-mod multilib-minimal nvidia-driver \
-	portability toolchain-funcs unpacker user udev
-
-NV_URI="https://download.nvidia.com/XFree86/"
-X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
-AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
-ARM_NV_PACKAGE="NVIDIA-Linux-armv7l-gnueabihf-${PV}"
-X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
-AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
-
-DESCRIPTION="NVIDIA Accelerated Graphics Driver"
-HOMEPAGE="http://www.nvidia.com/ http://www.nvidia.com/Download/Find.aspx"
-SRC_URI="
-	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
-	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
-	arm? ( ${NV_URI}Linux-32bit-ARM/${PV}/${ARM_NV_PACKAGE}.run )
-	x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
-	x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
-	tools? (
-		${NV_URI}nvidia-settings/nvidia-settings-${PV}.tar.bz2
-	)
-"
-
-LICENSE="GPL-2 NVIDIA-r2"
-SLOT="0/${PV%.*}"
-KEYWORDS="-* amd64 x86 ~amd64-fbsd ~x86-fbsd"
-RESTRICT="bindist mirror"
-EMULTILIB_PKG="true"
-
-IUSE="acpi compat +driver gtk3 kernel_FreeBSD kernel_linux +kms multilib pax_kernel static-libs +tools uvm wayland +X"
-REQUIRED_USE="
-	tools? ( X )
-	static-libs? ( tools )
-"
-
-COMMON="
-	app-eselect/eselect-opencl
-	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
-	tools? (
-		dev-libs/atk
-		dev-libs/glib:2
-		dev-libs/jansson
-		gtk3? (
-			x11-libs/gtk+:3
-		)
-		x11-libs/cairo
-		x11-libs/gdk-pixbuf[X]
-		x11-libs/gtk+:2
-		x11-libs/libX11
-		x11-libs/libXext
-		x11-libs/libXrandr
-		x11-libs/libXv
-		x11-libs/libXxf86vm
-		x11-libs/pango[X]
-	)
-	X? (
-		>=app-eselect/eselect-opengl-1.0.9
-		app-misc/pax-utils
-	)
-"
-DEPEND="
-	${COMMON}
-	kernel_linux? ( virtual/linux-sources )
-	tools? ( sys-apps/dbus )
-"
-RDEPEND="
-	${COMMON}
-	acpi? ( sys-power/acpid )
-	tools? ( !media-video/nvidia-settings )
-	wayland? ( dev-libs/wayland[${MULTILIB_USEDEP}] )
-	X? (
-		<x11-base/xorg-server-1.19.99:=
-		>=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
-		>=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
-		>=x11-libs/libvdpau-1.0[${MULTILIB_USEDEP}]
-		sys-libs/zlib[${MULTILIB_USEDEP}]
-	)
-"
-
-QA_PREBUILT="opt/* usr/lib*"
-
-S=${WORKDIR}/
-
-nvidia_drivers_versions_check() {
-	if use amd64 && has_multilib_profile && \
-		[ "${DEFAULT_ABI}" != "amd64" ]; then
-		eerror "This ebuild doesn't currently support changing your default ABI"
-		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
-	fi
-
-	if use kernel_linux && kernel_is ge 4 12; then
-		ewarn "Gentoo supports kernels which are supported by NVIDIA"
-		ewarn "which are limited to the following kernels:"
-		ewarn "<sys-kernel/gentoo-sources-4.12"
-		ewarn "<sys-kernel/vanilla-sources-4.12"
-		ewarn ""
-		ewarn "You are free to utilize epatch_user to provide whatever"
-		ewarn "support you feel is appropriate, but will not receive"
-		ewarn "support as a result of those changes."
-		ewarn ""
-		ewarn "Do not file a bug report about this."
-		ewarn ""
-	fi
-
-	# Since Nvidia ships many different series of drivers, we need to give the user
-	# some kind of guidance as to what version they should install. This tries
-	# to point the user in the right direction but can't be perfect. check
-	# nvidia-driver.eclass
-	nvidia-driver-check-warning
-
-	# Kernel features/options to check for
-	CONFIG_CHECK="!DEBUG_MUTEXES ~!LOCKDEP ~MTRR ~SYSVIPC ~ZONE_DMA"
-	use x86 && CONFIG_CHECK+=" ~HIGHMEM"
-
-	# Now do the above checks
-	use kernel_linux && check_extra_config
-}
-
-pkg_pretend() {
-	nvidia_drivers_versions_check
-}
-
-pkg_setup() {
-	nvidia_drivers_versions_check
-
-	# try to turn off distcc and ccache for people that have a problem with it
-	export DISTCC_DISABLE=1
-	export CCACHE_DISABLE=1
-
-	if use driver && use kernel_linux; then
-		MODULE_NAMES="nvidia(video:${S}/kernel)"
-		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
-		use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel) nvidia-drm(video:${S}/kernel)"
-
-		# This needs to run after MODULE_NAMES (so that the eclass checks
-		# whether the kernel supports loadable modules) but before BUILD_PARAMS
-		# is set (so that KV_DIR is populated).
-		linux-mod_pkg_setup
-
-		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
-		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
-
-		# linux-mod_src_compile calls set_arch_to_kernel, which
-		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
-		# expects x86_64 or i386 and then converts it to x86
-		# later on in the build process
-		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
-	fi
-
-	if use kernel_linux && kernel_is lt 2 6 9; then
-		eerror "You must build this against 2.6.9 or higher kernels."
-	fi
-
-	# set variables to where files are in the package structure
-	if use kernel_FreeBSD; then
-		use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
-		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
-		NV_DOC="${S}/doc"
-		NV_OBJ="${S}/obj"
-		NV_SRC="${S}/src"
-		NV_MAN="${S}/x11/man"
-		NV_X11="${S}/obj"
-		NV_SOVER=1
-	elif use kernel_linux; then
-		NV_DOC="${S}"
-		NV_OBJ="${S}"
-		NV_SRC="${S}/kernel"
-		NV_MAN="${S}"
-		NV_X11="${S}"
-		NV_SOVER=${PV}
-	else
-		die "Could not determine proper NVIDIA package"
-	fi
-}
-
-src_prepare() {
-	if use pax_kernel; then
-		ewarn "Using PAX patches is not supported. You will be asked to"
-		ewarn "use a standard kernel should you have issues. Should you"
-		ewarn "need support with these patches, contact the PaX team."
-		eapply "${FILESDIR}"/${PN}-375.20-pax.patch
-	fi
-
-	local man_file
-	for man_file in "${NV_MAN}"/*1.gz; do
-		gunzip $man_file || die
-	done
-
-	# Allow user patches so they can support RC kernels and whatever else
-	eapply_user
-}
-
-src_compile() {
-	# This is already the default on Linux, as there's no toplevel Makefile, but
-	# on FreeBSD there's one and triggers the kernel module build, as we install
-	# it by itself, pass this.
-
-	cd "${NV_SRC}"
-	if use kernel_FreeBSD; then
-		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
-			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
-	elif use driver && use kernel_linux; then
-		MAKEOPTS=-j1 linux-mod_src_compile
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			AR="$(tc-getAR)" \
-			CC="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			NV_VERBOSE=1 \
-			RANLIB="$(tc-getRANLIB)" \
-			DO_STRIP= \
-			build-xnvctrl
-
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			CC="$(tc-getCC)" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LD="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			NVML_ENABLED=0 \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			NV_VERBOSE=1 \
-			DO_STRIP=
-	fi
-}
-
-# Install nvidia library:
-# the first parameter is the library to install
-# the second parameter is the provided soversion
-# the third parameter is the target directory if it is not /usr/lib
-donvidia() {
-	# Full path to library
-	nv_LIB="${1}"
-
-	# SOVER to use
-	nv_SOVER="$(scanelf -qF'%S#F' ${nv_LIB})"
-
-	# Where to install
-	nv_DEST="${2}"
-
-	# Get just the library name
-	nv_LIBNAME=$(basename "${nv_LIB}")
-
-	if [[ "${nv_DEST}" ]]; then
-		exeinto ${nv_DEST}
-		action="doexe"
-	else
-		nv_DEST="/usr/$(get_libdir)"
-		action="dolib.so"
-	fi
-
-	# Install the library
-	${action} ${nv_LIB} || die "failed to install ${nv_LIBNAME}"
-
-	# If the library has a SONAME and SONAME does not match the library name,
-	# then we need to create a symlink
-	if [[ ${nv_SOVER} ]] && ! [[ "${nv_SOVER}" = "${nv_LIBNAME}" ]]; then
-		dosym ${nv_LIBNAME} ${nv_DEST}/${nv_SOVER} \
-			|| die "failed to create ${nv_DEST}/${nv_SOVER} symlink"
-	fi
-
-	dosym ${nv_LIBNAME} ${nv_DEST}/${nv_LIBNAME/.so*/.so} \
-		|| die "failed to create ${nv_LIBNAME/.so*/.so} symlink"
-}
-
-src_install() {
-	if use driver && use kernel_linux; then
-		linux-mod_src_install
-
-		# Add the aliases
-		# This file is tweaked with the appropriate video group in
-		# pkg_preinst, see bug #491414
-		insinto /etc/modprobe.d
-		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
-		doins "${FILESDIR}"/nvidia-rmmod.conf
-
-		# Ensures that our device nodes are created when not using X
-		exeinto "$(get_udevdir)"
-		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
-		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
-	elif use kernel_FreeBSD; then
-		if use x86-fbsd; then
-			insinto /boot/modules
-			doins "${S}/src/nvidia.kld"
-		fi
-
-		exeinto /boot/modules
-		doexe "${S}/src/nvidia.ko"
-	fi
-
-	# NVIDIA kernel <-> userspace driver config lib
-	donvidia ${NV_OBJ}/libnvidia-cfg.so.${NV_SOVER}
-
-	# NVIDIA framebuffer capture library
-	donvidia ${NV_OBJ}/libnvidia-fbc.so.${NV_SOVER}
-
-	# NVIDIA video encode/decode <-> CUDA
-	if use kernel_linux; then
-		donvidia ${NV_OBJ}/libnvcuvid.so.${NV_SOVER}
-		donvidia ${NV_OBJ}/libnvidia-encode.so.${NV_SOVER}
-	fi
-
-	if use X; then
-		# Xorg DDX driver
-		insinto /usr/$(get_libdir)/xorg/modules/drivers
-		doins ${NV_X11}/nvidia_drv.so
-
-		# Xorg GLX driver
-		donvidia ${NV_X11}/libglx.so.${NV_SOVER} \
-			/usr/$(get_libdir)/opengl/nvidia/extensions
-
-		# Xorg nvidia.conf
-		if has_version '>=x11-base/xorg-server-1.16'; then
-			insinto /usr/share/X11/xorg.conf.d
-			newins {,50-}nvidia-drm-outputclass.conf
-		fi
-
-		insinto /usr/share/glvnd/egl_vendor.d
-		doins ${NV_X11}/10_nvidia.json
-	fi
-
-	if use wayland; then
-		insinto /usr/share/egl/egl_external_platform.d
-		doins ${NV_X11}/10_nvidia_wayland.json
-	fi
-
-	# OpenCL ICD for NVIDIA
-	if use kernel_linux; then
-		insinto /etc/OpenCL/vendors
-		doins ${NV_OBJ}/nvidia.icd
-	fi
-
-	# Documentation
-	if use kernel_FreeBSD; then
-		dodoc "${NV_DOC}/README"
-		use X && doman "${NV_MAN}"/nvidia-xconfig.1
-		use tools && doman "${NV_MAN}"/nvidia-settings.1
-	else
-		# Docs
-		newdoc "${NV_DOC}/README.txt" README
-		dodoc "${NV_DOC}/NVIDIA_Changelog"
-		doman "${NV_MAN}"/nvidia-smi.1
-		use X && doman "${NV_MAN}"/nvidia-xconfig.1
-		use tools && doman "${NV_MAN}"/nvidia-settings.1
-		doman "${NV_MAN}"/nvidia-cuda-mps-control.1
-	fi
-
-	docinto html
-	dodoc -r ${NV_DOC}/html/*
-
-	# Helper Apps
-	exeinto /opt/bin/
-
-	if use X; then
-		doexe ${NV_OBJ}/nvidia-xconfig
-
-		insinto /etc/vulkan/icd.d
-		doins nvidia_icd.json
-	fi
-
-	if use kernel_linux; then
-		doexe ${NV_OBJ}/nvidia-cuda-mps-control
-		doexe ${NV_OBJ}/nvidia-cuda-mps-server
-		doexe ${NV_OBJ}/nvidia-debugdump
-		doexe ${NV_OBJ}/nvidia-persistenced
-		doexe ${NV_OBJ}/nvidia-smi
-
-		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
-		doexe ${NV_OBJ}/nvidia-modprobe
-		fowners root:video /opt/bin/nvidia-modprobe
-		fperms 4710 /opt/bin/nvidia-modprobe
-		dosym /{opt,usr}/bin/nvidia-modprobe
-
-		doman nvidia-cuda-mps-control.1
-		doman nvidia-modprobe.1
-		doman nvidia-persistenced.1
-		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
-		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
-		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src/ \
-			DESTDIR="${D}" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LIBDIR="${D}/usr/$(get_libdir)" \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			NV_VERBOSE=1 \
-			PREFIX=/usr \
-			DO_STRIP= \
-			install
-
-		if use static-libs; then
-			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
-
-			insinto /usr/include/NVCtrl
-			doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
-		fi
-
-		insinto /usr/share/nvidia/
-		doins nvidia-application-profiles-${PV}-key-documentation
-
-		insinto /etc/nvidia
-		newins \
-			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
-
-		# There is no icon in the FreeBSD tarball.
-		use kernel_FreeBSD || \
-			doicon ${NV_OBJ}/nvidia-settings.png
-
-		domenu "${FILESDIR}"/nvidia-settings.desktop
-
-		exeinto /etc/X11/xinit/xinitrc.d
-		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
-	fi
-
-	dobin ${NV_OBJ}/nvidia-bug-report.sh
-
-	if has_multilib_profile && use multilib; then
-		local OABI=${ABI}
-		for ABI in $(get_install_abis); do
-			src_install-libs
-		done
-		ABI=${OABI}
-		unset OABI
-	else
-		src_install-libs
-	fi
-
-	is_final_abi || die "failed to iterate through all ABIs"
-
-	readme.gentoo_create_doc
-}
-
-src_install-libs() {
-	local inslibdir=$(get_libdir)
-	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
-	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
-	local nv_libdir="${NV_OBJ}"
-
-	if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
-		nv_libdir="${NV_OBJ}"/32
-	fi
-
-	if use X; then
-		NV_GLX_LIBRARIES=(
-			"libEGL.so.$(usex compat ${NV_SOVER} 1) ${GL_ROOT}"
-			"libEGL_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGL.so.$(usex compat ${NV_SOVER} 1.0.0) ${GL_ROOT}"
-			"libGLESv1_CM.so.1 ${GL_ROOT}"
-			"libGLESv1_CM_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLESv2.so.2 ${GL_ROOT}"
-			"libGLESv2_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLX.so.0 ${GL_ROOT}"
-			"libGLX_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLdispatch.so.0 ${GL_ROOT}"
-			"libOpenCL.so.1.0.0 ${CL_ROOT}"
-			"libOpenGL.so.0 ${GL_ROOT}"
-			"libcuda.so.${NV_SOVER}"
-			"libnvcuvid.so.${NV_SOVER}"
-			"libnvidia-compiler.so.${NV_SOVER}"
-			"libnvidia-eglcore.so.${NV_SOVER}"
-			"libnvidia-encode.so.${NV_SOVER}"
-			"libnvidia-fatbinaryloader.so.${NV_SOVER}"
-			"libnvidia-fbc.so.${NV_SOVER}"
-			"libnvidia-glcore.so.${NV_SOVER}"
-			"libnvidia-glsi.so.${NV_SOVER}"
-			"libnvidia-ifr.so.${NV_SOVER}"
-			"libnvidia-opencl.so.${NV_SOVER}"
-			"libnvidia-ptxjitcompiler.so.${NV_SOVER}"
-			"libvdpau_nvidia.so.${NV_SOVER}"
-		)
-
-		if use wayland && has_multilib_profile && [[ ${ABI} == "amd64" ]];
-		then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-egl-wayland.so.1.0.1"
-			)
-		fi
-
-		if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
-		then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-wfb.so.${NV_SOVER}"
-			)
-		fi
-
-		if use kernel_FreeBSD; then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-tls.so.${NV_SOVER}"
-			)
-		fi
-
-		if use kernel_linux; then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-ml.so.${NV_SOVER}"
-				"tls/libnvidia-tls.so.${NV_SOVER}"
-			)
-		fi
-
-		for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
-			donvidia "${nv_libdir}"/${NV_LIB}
-		done
-	fi
-}
-
-pkg_preinst() {
-	if use driver && use kernel_linux; then
-		linux-mod_pkg_preinst
-
-		local videogroup="$(egetent group video | cut -d ':' -f 3)"
-		if [ -z "${videogroup}" ]; then
-			eerror "Failed to determine the video group gid"
-			die "Failed to determine the video group gid"
-		else
-			sed -i \
-				-e "s:PACKAGE:${PF}:g" \
-				-e "s:VIDEOGID:${videogroup}:" \
-				"${D}"/etc/modprobe.d/nvidia.conf || die
-		fi
-	fi
-
-	# Clean the dynamic libGL stuff's home to ensure
-	# we dont have stale libs floating around
-	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ]; then
-		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
-	fi
-	# Make sure we nuke the old nvidia-glx's env.d file
-	if [ -e "${ROOT}"/etc/env.d/09nvidia ]; then
-		rm -f "${ROOT}"/etc/env.d/09nvidia
-	fi
-}
-
-pkg_postinst() {
-	use driver && use kernel_linux && linux-mod_pkg_postinst
-
-	# Switch to the nvidia implementation
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
-	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
-
-	readme.gentoo_print_elog
-
-	if ! use X; then
-		elog "You have elected to not install the X.org driver. Along with"
-		elog "this the OpenGL libraries and VDPAU libraries were not"
-		elog "installed. Additionally, once the driver is loaded your card"
-		elog "and fan will run at max speed which may not be desirable."
-		elog "Use the 'nvidia-smi' init script to have your card and fan"
-		elog "speed scale appropriately."
-		elog
-	fi
-	if ! use tools; then
-		elog "USE=tools controls whether the nvidia-settings application"
-		elog "is installed. If you would like to use it, enable that"
-		elog "flag and re-emerge this ebuild. Optionally you can install"
-		elog "media-video/nvidia-settings"
-		elog
-	fi
-}
-
-pkg_prerm() {
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}
-
-pkg_postrm() {
-	use driver && use kernel_linux && linux-mod_pkg_postrm
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-384.130.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-384.130.ebuild
deleted file mode 100644
index 398ef28e2d0..00000000000
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-384.130.ebuild
+++ /dev/null
@@ -1,581 +0,0 @@
-# Copyright 1999-2018 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-inherit eutils flag-o-matic linux-info linux-mod multilib-minimal nvidia-driver \
-	portability toolchain-funcs unpacker user udev
-
-DESCRIPTION="NVIDIA Accelerated Graphics Driver"
-HOMEPAGE="http://www.nvidia.com/ http://www.nvidia.com/Download/Find.aspx"
-
-AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
-AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
-ARM_NV_PACKAGE="NVIDIA-Linux-armv7l-gnueabihf-${PV}"
-X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
-X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
-
-NV_URI="https://download.nvidia.com/XFree86/"
-SRC_URI="
-	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
-	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
-	arm? ( ${NV_URI}Linux-32bit-ARM/${PV}/${ARM_NV_PACKAGE}.run )
-	x86-fbsd? (
-		https://us.download.nvidia.com/XFree86/FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz
-	)
-	x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
-	tools? (
-		${NV_URI}nvidia-settings/nvidia-settings-${PV}.tar.bz2
-	)
-"
-
-LICENSE="GPL-2 NVIDIA-r2"
-SLOT="0/${PV%.*}"
-KEYWORDS="-* amd64 x86 ~amd64-fbsd ~x86-fbsd"
-RESTRICT="bindist mirror"
-EMULTILIB_PKG="true"
-
-IUSE="acpi compat +driver gtk3 kernel_FreeBSD kernel_linux +kms multilib pax_kernel static-libs +tools uvm wayland +X"
-REQUIRED_USE="
-	tools? ( X )
-	static-libs? ( tools )
-"
-
-COMMON="
-	app-eselect/eselect-opencl
-	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
-	tools? (
-		dev-libs/atk
-		dev-libs/glib:2
-		dev-libs/jansson
-		gtk3? (
-			x11-libs/gtk+:3
-		)
-		x11-libs/cairo
-		x11-libs/gdk-pixbuf[X]
-		x11-libs/gtk+:2
-		x11-libs/libX11
-		x11-libs/libXext
-		x11-libs/libXrandr
-		x11-libs/libXv
-		x11-libs/libXxf86vm
-		x11-libs/pango[X]
-	)
-	X? (
-		>=app-eselect/eselect-opengl-1.0.9
-		app-misc/pax-utils
-	)
-"
-DEPEND="
-	${COMMON}
-	kernel_linux? ( virtual/linux-sources )
-	tools? ( sys-apps/dbus )
-"
-RDEPEND="
-	${COMMON}
-	acpi? ( sys-power/acpid )
-	tools? ( !media-video/nvidia-settings )
-	wayland? ( dev-libs/wayland[${MULTILIB_USEDEP}] )
-	X? (
-		<x11-base/xorg-server-1.19.99:=
-		>=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
-		>=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
-		>=x11-libs/libvdpau-1.0[${MULTILIB_USEDEP}]
-		sys-libs/zlib[${MULTILIB_USEDEP}]
-	)
-"
-
-QA_PREBUILT="opt/* usr/lib*"
-
-S=${WORKDIR}/
-
-nvidia_drivers_versions_check() {
-	if use amd64 && has_multilib_profile && \
-		[ "${DEFAULT_ABI}" != "amd64" ]; then
-		eerror "This ebuild doesn't currently support changing your default ABI"
-		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
-	fi
-
-	if use kernel_linux && kernel_is ge 4 16; then
-		ewarn "Gentoo supports kernels which are supported by NVIDIA"
-		ewarn "which are limited to the following kernels:"
-		ewarn "<sys-kernel/gentoo-sources-4.16"
-		ewarn "<sys-kernel/vanilla-sources-4.16"
-		ewarn ""
-		ewarn "You are free to utilize epatch_user to provide whatever"
-		ewarn "support you feel is appropriate, but will not receive"
-		ewarn "support as a result of those changes."
-		ewarn ""
-		ewarn "Do not file a bug report about this."
-		ewarn ""
-	fi
-
-	# Since Nvidia ships many different series of drivers, we need to give the user
-	# some kind of guidance as to what version they should install. This tries
-	# to point the user in the right direction but can't be perfect. check
-	# nvidia-driver.eclass
-	nvidia-driver-check-warning
-
-	# Kernel features/options to check for
-	CONFIG_CHECK="!DEBUG_MUTEXES ~!LOCKDEP ~MTRR ~SYSVIPC ~ZONE_DMA"
-	use x86 && CONFIG_CHECK+=" ~HIGHMEM"
-
-	# Now do the above checks
-	use kernel_linux && check_extra_config
-}
-
-pkg_pretend() {
-	nvidia_drivers_versions_check
-}
-
-pkg_setup() {
-	nvidia_drivers_versions_check
-
-	# try to turn off distcc and ccache for people that have a problem with it
-	export DISTCC_DISABLE=1
-	export CCACHE_DISABLE=1
-
-	if use driver && use kernel_linux; then
-		MODULE_NAMES="nvidia(video:${S}/kernel)"
-		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
-		use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel) nvidia-drm(video:${S}/kernel)"
-
-		# This needs to run after MODULE_NAMES (so that the eclass checks
-		# whether the kernel supports loadable modules) but before BUILD_PARAMS
-		# is set (so that KV_DIR is populated).
-		linux-mod_pkg_setup
-
-		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
-		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
-
-		# linux-mod_src_compile calls set_arch_to_kernel, which
-		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
-		# expects x86_64 or i386 and then converts it to x86
-		# later on in the build process
-		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
-	fi
-
-	if use kernel_linux && kernel_is lt 2 6 9; then
-		eerror "You must build this against 2.6.9 or higher kernels."
-	fi
-
-	# set variables to where files are in the package structure
-	if use kernel_FreeBSD; then
-		use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
-		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
-		NV_DOC="${S}/doc"
-		NV_OBJ="${S}/obj"
-		NV_SRC="${S}/src"
-		NV_MAN="${S}/x11/man"
-		NV_X11="${S}/obj"
-		NV_SOVER=1
-	elif use kernel_linux; then
-		NV_DOC="${S}"
-		NV_OBJ="${S}"
-		NV_SRC="${S}/kernel"
-		NV_MAN="${S}"
-		NV_X11="${S}"
-		NV_SOVER=${PV}
-	else
-		die "Could not determine proper NVIDIA package"
-	fi
-}
-
-src_prepare() {
-	if use pax_kernel; then
-		ewarn "Using PAX patches is not supported. You will be asked to"
-		ewarn "use a standard kernel should you have issues. Should you"
-		ewarn "need support with these patches, contact the PaX team."
-		eapply "${FILESDIR}"/${PN}-375.20-pax.patch
-	fi
-
-	local man_file
-	for man_file in "${NV_MAN}"/*1.gz; do
-		gunzip $man_file || die
-	done
-
-	# Allow user patches so they can support RC kernels and whatever else
-	eapply_user
-
-	if ! [ -f nvidia_icd.json ]; then
-		cp nvidia_icd.json.template nvidia_icd.json || die
-		sed -i -e 's:__NV_VK_ICD__:libGLX_nvidia.so.0:g' nvidia_icd.json || die
-	fi
-}
-
-src_compile() {
-	# This is already the default on Linux, as there's no toplevel Makefile, but
-	# on FreeBSD there's one and triggers the kernel module build, as we install
-	# it by itself, pass this.
-
-	cd "${NV_SRC}"
-	if use kernel_FreeBSD; then
-		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
-			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
-	elif use driver && use kernel_linux; then
-		linux-mod_src_compile src="${KERNEL_DIR}" KERNELRELEASE="${KV_FULL}"
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			AR="$(tc-getAR)" \
-			CC="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			NV_VERBOSE=1 \
-			RANLIB="$(tc-getRANLIB)" \
-			DO_STRIP= \
-			build-xnvctrl
-
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			CC="$(tc-getCC)" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LD="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			NVML_ENABLED=0 \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			NV_VERBOSE=1 \
-			DO_STRIP=
-	fi
-}
-
-# Install nvidia library:
-# the first parameter is the library to install
-# the second parameter is the provided soversion
-# the third parameter is the target directory if it is not /usr/lib
-donvidia() {
-	# Full path to library
-	nv_LIB="${1}"
-
-	# SOVER to use
-	nv_SOVER="$(scanelf -qF'%S#F' ${nv_LIB})"
-
-	# Where to install
-	nv_DEST="${2}"
-
-	# Get just the library name
-	nv_LIBNAME=$(basename "${nv_LIB}")
-
-	if [[ "${nv_DEST}" ]]; then
-		exeinto ${nv_DEST}
-		action="doexe"
-	else
-		nv_DEST="/usr/$(get_libdir)"
-		action="dolib.so"
-	fi
-
-	# Install the library
-	${action} ${nv_LIB} || die "failed to install ${nv_LIBNAME}"
-
-	# If the library has a SONAME and SONAME does not match the library name,
-	# then we need to create a symlink
-	if [[ ${nv_SOVER} ]] && ! [[ "${nv_SOVER}" = "${nv_LIBNAME}" ]]; then
-		dosym ${nv_LIBNAME} ${nv_DEST}/${nv_SOVER} \
-			|| die "failed to create ${nv_DEST}/${nv_SOVER} symlink"
-	fi
-
-	dosym ${nv_LIBNAME} ${nv_DEST}/${nv_LIBNAME/.so*/.so} \
-		|| die "failed to create ${nv_LIBNAME/.so*/.so} symlink"
-}
-
-src_install() {
-	if use driver && use kernel_linux; then
-		linux-mod_src_install
-
-		# Add the aliases
-		# This file is tweaked with the appropriate video group in
-		# pkg_preinst, see bug #491414
-		insinto /etc/modprobe.d
-		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
-		doins "${FILESDIR}"/nvidia-rmmod.conf
-
-		# Ensures that our device nodes are created when not using X
-		exeinto "$(get_udevdir)"
-		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
-		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
-	elif use kernel_FreeBSD; then
-		if use x86-fbsd; then
-			insinto /boot/modules
-			doins "${S}/src/nvidia.kld"
-		fi
-
-		exeinto /boot/modules
-		doexe "${S}/src/nvidia.ko"
-	fi
-
-	# NVIDIA kernel <-> userspace driver config lib
-	donvidia ${NV_OBJ}/libnvidia-cfg.so.${NV_SOVER}
-
-	# NVIDIA framebuffer capture library
-	donvidia ${NV_OBJ}/libnvidia-fbc.so.${NV_SOVER}
-
-	# NVIDIA video encode/decode <-> CUDA
-	if use kernel_linux; then
-		donvidia ${NV_OBJ}/libnvcuvid.so.${NV_SOVER}
-		donvidia ${NV_OBJ}/libnvidia-encode.so.${NV_SOVER}
-	fi
-
-	if use X; then
-		# Xorg DDX driver
-		insinto /usr/$(get_libdir)/xorg/modules/drivers
-		doins ${NV_X11}/nvidia_drv.so
-
-		# Xorg GLX driver
-		donvidia ${NV_X11}/libglx.so.${NV_SOVER} \
-			/usr/$(get_libdir)/opengl/nvidia/extensions
-
-		# Xorg nvidia.conf
-		if has_version '>=x11-base/xorg-server-1.16'; then
-			insinto /usr/share/X11/xorg.conf.d
-			newins {,50-}nvidia-drm-outputclass.conf
-		fi
-
-		insinto /usr/share/glvnd/egl_vendor.d
-		doins ${NV_X11}/10_nvidia.json
-	fi
-
-	if use wayland; then
-		insinto /usr/share/egl/egl_external_platform.d
-		doins ${NV_X11}/10_nvidia_wayland.json
-	fi
-
-	# OpenCL ICD for NVIDIA
-	if use kernel_linux; then
-		insinto /etc/OpenCL/vendors
-		doins ${NV_OBJ}/nvidia.icd
-	fi
-
-	# Documentation
-	if use kernel_FreeBSD; then
-		dodoc "${NV_DOC}/README"
-		use X && doman "${NV_MAN}"/nvidia-xconfig.1
-		use tools && doman "${NV_MAN}"/nvidia-settings.1
-	else
-		# Docs
-		newdoc "${NV_DOC}/README.txt" README
-		dodoc "${NV_DOC}/NVIDIA_Changelog"
-		doman "${NV_MAN}"/nvidia-smi.1
-		use X && doman "${NV_MAN}"/nvidia-xconfig.1
-		use tools && doman "${NV_MAN}"/nvidia-settings.1
-		doman "${NV_MAN}"/nvidia-cuda-mps-control.1
-	fi
-
-	docinto html
-	dodoc -r ${NV_DOC}/html/*
-
-	# Helper Apps
-	exeinto /opt/bin/
-
-	if use X; then
-		doexe ${NV_OBJ}/nvidia-xconfig
-
-		insinto /etc/vulkan/icd.d
-		doins nvidia_icd.json
-	fi
-
-	if use kernel_linux; then
-		doexe ${NV_OBJ}/nvidia-cuda-mps-control
-		doexe ${NV_OBJ}/nvidia-cuda-mps-server
-		doexe ${NV_OBJ}/nvidia-debugdump
-		doexe ${NV_OBJ}/nvidia-persistenced
-		doexe ${NV_OBJ}/nvidia-smi
-
-		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
-		doexe ${NV_OBJ}/nvidia-modprobe
-		fowners root:video /opt/bin/nvidia-modprobe
-		fperms 4710 /opt/bin/nvidia-modprobe
-		dosym /{opt,usr}/bin/nvidia-modprobe
-
-		doman nvidia-cuda-mps-control.1
-		doman nvidia-modprobe.1
-		doman nvidia-persistenced.1
-		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
-		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
-		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src/ \
-			DESTDIR="${D}" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LIBDIR="${D}/usr/$(get_libdir)" \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			NV_VERBOSE=1 \
-			PREFIX=/usr \
-			DO_STRIP= \
-			install
-
-		if use static-libs; then
-			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
-
-			insinto /usr/include/NVCtrl
-			doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
-		fi
-
-		insinto /usr/share/nvidia/
-		doins nvidia-application-profiles-${PV}-key-documentation
-
-		insinto /etc/nvidia
-		newins \
-			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
-
-		# There is no icon in the FreeBSD tarball.
-		use kernel_FreeBSD || \
-			doicon ${NV_OBJ}/nvidia-settings.png
-
-		domenu "${FILESDIR}"/nvidia-settings.desktop
-
-		exeinto /etc/X11/xinit/xinitrc.d
-		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
-	fi
-
-	dobin ${NV_OBJ}/nvidia-bug-report.sh
-
-	if has_multilib_profile && use multilib; then
-		local OABI=${ABI}
-		for ABI in $(get_install_abis); do
-			src_install-libs
-		done
-		ABI=${OABI}
-		unset OABI
-	else
-		src_install-libs
-	fi
-
-	is_final_abi || die "failed to iterate through all ABIs"
-
-	readme.gentoo_create_doc
-}
-
-src_install-libs() {
-	local inslibdir=$(get_libdir)
-	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
-	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
-	local nv_libdir="${NV_OBJ}"
-
-	if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
-		nv_libdir="${NV_OBJ}"/32
-	fi
-
-	if use X; then
-		NV_GLX_LIBRARIES=(
-			"libEGL.so.$(usex compat ${NV_SOVER} 1.1.0) ${GL_ROOT}"
-			"libEGL_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGL.so.$(usex compat ${NV_SOVER} 1.7.0) ${GL_ROOT}"
-			"libGLESv1_CM.so.$(usex compat ${NV_SOVER} 1.2.0) ${GL_ROOT}"
-			"libGLESv1_CM_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLESv2.so.$(usex compat ${NV_SOVER} 2.1.0) ${GL_ROOT}"
-			"libGLESv2_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLX.so.0 ${GL_ROOT}"
-			"libGLX_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLdispatch.so.0 ${GL_ROOT}"
-			"libOpenCL.so.1.0.0 ${CL_ROOT}"
-			"libOpenGL.so.0 ${GL_ROOT}"
-			"libcuda.so.${NV_SOVER}"
-			"libnvcuvid.so.${NV_SOVER}"
-			"libnvidia-compiler.so.${NV_SOVER}"
-			"libnvidia-eglcore.so.${NV_SOVER}"
-			"libnvidia-encode.so.${NV_SOVER}"
-			"libnvidia-fatbinaryloader.so.${NV_SOVER}"
-			"libnvidia-fbc.so.${NV_SOVER}"
-			"libnvidia-glcore.so.${NV_SOVER}"
-			"libnvidia-glsi.so.${NV_SOVER}"
-			"libnvidia-ifr.so.${NV_SOVER}"
-			"libnvidia-opencl.so.${NV_SOVER}"
-			"libnvidia-ptxjitcompiler.so.${NV_SOVER}"
-			"libvdpau_nvidia.so.${NV_SOVER}"
-		)
-
-		if use wayland && has_multilib_profile && [[ ${ABI} == "amd64" ]];
-		then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-egl-wayland.so.1.0.1"
-			)
-		fi
-
-		if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
-		then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-wfb.so.${NV_SOVER}"
-			)
-		fi
-
-		if use kernel_FreeBSD; then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-tls.so.${NV_SOVER}"
-			)
-		fi
-
-		if use kernel_linux; then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-ml.so.${NV_SOVER}"
-				"tls/libnvidia-tls.so.${NV_SOVER}"
-			)
-		fi
-
-		for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
-			donvidia "${nv_libdir}"/${NV_LIB}
-		done
-	fi
-}
-
-pkg_preinst() {
-	if use driver && use kernel_linux; then
-		linux-mod_pkg_preinst
-
-		local videogroup="$(egetent group video | cut -d ':' -f 3)"
-		if [ -z "${videogroup}" ]; then
-			eerror "Failed to determine the video group gid"
-			die "Failed to determine the video group gid"
-		else
-			sed -i \
-				-e "s:PACKAGE:${PF}:g" \
-				-e "s:VIDEOGID:${videogroup}:" \
-				"${D}"/etc/modprobe.d/nvidia.conf || die
-		fi
-	fi
-
-	# Clean the dynamic libGL stuff's home to ensure
-	# we dont have stale libs floating around
-	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ]; then
-		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
-	fi
-	# Make sure we nuke the old nvidia-glx's env.d file
-	if [ -e "${ROOT}"/etc/env.d/09nvidia ]; then
-		rm -f "${ROOT}"/etc/env.d/09nvidia
-	fi
-}
-
-pkg_postinst() {
-	use driver && use kernel_linux && linux-mod_pkg_postinst
-
-	# Switch to the nvidia implementation
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
-	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
-
-	readme.gentoo_print_elog
-
-	if ! use X; then
-		elog "You have elected to not install the X.org driver. Along with"
-		elog "this the OpenGL libraries and VDPAU libraries were not"
-		elog "installed. Additionally, once the driver is loaded your card"
-		elog "and fan will run at max speed which may not be desirable."
-		elog "Use the 'nvidia-smi' init script to have your card and fan"
-		elog "speed scale appropriately."
-		elog
-	fi
-	if ! use tools; then
-		elog "USE=tools controls whether the nvidia-settings application"
-		elog "is installed. If you would like to use it, enable that"
-		elog "flag and re-emerge this ebuild. Optionally you can install"
-		elog "media-video/nvidia-settings"
-		elog
-	fi
-}
-
-pkg_prerm() {
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}
-
-pkg_postrm() {
-	use driver && use kernel_linux && linux-mod_pkg_postrm
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-387.34.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-387.34.ebuild
deleted file mode 100644
index 0673bc7bb2a..00000000000
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-387.34.ebuild
+++ /dev/null
@@ -1,586 +0,0 @@
-# Copyright 1999-2018 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-inherit eutils flag-o-matic linux-info linux-mod multilib-minimal nvidia-driver \
-	portability toolchain-funcs unpacker user udev
-
-NV_URI="https://us.download.nvidia.com/XFree86/"
-X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
-AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
-ARM_NV_PACKAGE="NVIDIA-Linux-armv7l-gnueabihf-${PV}"
-X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
-AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
-
-DESCRIPTION="NVIDIA Accelerated Graphics Driver"
-HOMEPAGE="http://www.nvidia.com/ http://www.nvidia.com/Download/Find.aspx"
-SRC_URI="
-	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
-	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
-	arm? ( https://download.nvidia.com/XFree86/Linux-32bit-ARM/${PV}/${ARM_NV_PACKAGE}.run )
-	x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
-	x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
-	tools? (
-		https://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2
-	)
-"
-
-LICENSE="GPL-2 NVIDIA-r2"
-SLOT="0/${PV%.*}"
-KEYWORDS="-* amd64 x86 ~amd64-fbsd ~x86-fbsd"
-RESTRICT="bindist mirror"
-EMULTILIB_PKG="true"
-
-IUSE="acpi compat +driver gtk3 kernel_FreeBSD kernel_linux +kms multilib pax_kernel static-libs +tools uvm wayland +X"
-REQUIRED_USE="
-	tools? ( X )
-	static-libs? ( tools )
-"
-
-COMMON="
-	app-eselect/eselect-opencl
-	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
-	tools? (
-		dev-libs/atk
-		dev-libs/glib:2
-		dev-libs/jansson
-		gtk3? (
-			x11-libs/gtk+:3
-		)
-		x11-libs/cairo
-		x11-libs/gdk-pixbuf[X]
-		x11-libs/gtk+:2
-		x11-libs/libX11
-		x11-libs/libXext
-		x11-libs/libXrandr
-		x11-libs/libXv
-		x11-libs/libXxf86vm
-		x11-libs/pango[X]
-	)
-	X? (
-		>=app-eselect/eselect-opengl-1.0.9
-		app-misc/pax-utils
-	)
-"
-DEPEND="
-	${COMMON}
-	kernel_linux? ( virtual/linux-sources )
-	tools? ( sys-apps/dbus )
-"
-RDEPEND="
-	${COMMON}
-	acpi? ( sys-power/acpid )
-	tools? ( !media-video/nvidia-settings )
-	wayland? ( dev-libs/wayland[${MULTILIB_USEDEP}] )
-	X? (
-		<x11-base/xorg-server-1.19.99:=
-		>=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
-		>=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
-		>=x11-libs/libvdpau-1.0[${MULTILIB_USEDEP}]
-		sys-libs/zlib[${MULTILIB_USEDEP}]
-	)
-"
-QA_PREBUILT="opt/* usr/lib*"
-S=${WORKDIR}/
-
-nvidia_drivers_versions_check() {
-	if use amd64 && has_multilib_profile && \
-		[ "${DEFAULT_ABI}" != "amd64" ]; then
-		eerror "This ebuild doesn't currently support changing your default ABI"
-		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
-	fi
-
-	if use kernel_linux && kernel_is ge 4 15; then
-		ewarn "Gentoo supports kernels which are supported by NVIDIA"
-		ewarn "which are limited to the following kernels:"
-		ewarn "<sys-kernel/gentoo-sources-4.15"
-		ewarn "<sys-kernel/vanilla-sources-4.15"
-		ewarn ""
-		ewarn "You are free to utilize epatch_user to provide whatever"
-		ewarn "support you feel is appropriate, but will not receive"
-		ewarn "support as a result of those changes."
-		ewarn ""
-		ewarn "Do not file a bug report about this."
-		ewarn ""
-	fi
-
-	# Since Nvidia ships many different series of drivers, we need to give the user
-	# some kind of guidance as to what version they should install. This tries
-	# to point the user in the right direction but can't be perfect. check
-	# nvidia-driver.eclass
-	nvidia-driver-check-warning
-
-	# Kernel features/options to check for
-	CONFIG_CHECK="!DEBUG_MUTEXES ~!LOCKDEP ~MTRR ~SYSVIPC ~ZONE_DMA"
-	use x86 && CONFIG_CHECK+=" ~HIGHMEM"
-
-	# Now do the above checks
-	use kernel_linux && check_extra_config
-}
-
-pkg_pretend() {
-	nvidia_drivers_versions_check
-}
-
-pkg_setup() {
-	nvidia_drivers_versions_check
-
-	# try to turn off distcc and ccache for people that have a problem with it
-	export DISTCC_DISABLE=1
-	export CCACHE_DISABLE=1
-
-	if use driver && use kernel_linux; then
-		MODULE_NAMES="nvidia(video:${S}/kernel)"
-		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
-		use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel) nvidia-drm(video:${S}/kernel)"
-
-		# This needs to run after MODULE_NAMES (so that the eclass checks
-		# whether the kernel supports loadable modules) but before BUILD_PARAMS
-		# is set (so that KV_DIR is populated).
-		linux-mod_pkg_setup
-
-		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
-		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
-
-		# linux-mod_src_compile calls set_arch_to_kernel, which
-		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
-		# expects x86_64 or i386 and then converts it to x86
-		# later on in the build process
-		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
-	fi
-
-	if use kernel_linux && kernel_is lt 2 6 9; then
-		eerror "You must build this against 2.6.9 or higher kernels."
-	fi
-
-	# set variables to where files are in the package structure
-	if use kernel_FreeBSD; then
-		use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
-		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
-		NV_DOC="${S}/doc"
-		NV_OBJ="${S}/obj"
-		NV_SRC="${S}/src"
-		NV_MAN="${S}/x11/man"
-		NV_X11="${S}/obj"
-		NV_SOVER=1
-	elif use kernel_linux; then
-		NV_DOC="${S}"
-		NV_OBJ="${S}"
-		NV_SRC="${S}/kernel"
-		NV_MAN="${S}"
-		NV_X11="${S}"
-		NV_SOVER=${PV}
-	else
-		die "Could not determine proper NVIDIA package"
-	fi
-}
-
-src_prepare() {
-	if use pax_kernel; then
-		ewarn "Using PAX patches is not supported. You will be asked to"
-		ewarn "use a standard kernel should you have issues. Should you"
-		ewarn "need support with these patches, contact the PaX team."
-		eapply "${FILESDIR}"/${PN}-375.20-pax.patch
-	fi
-
-	local man_file
-	for man_file in "${NV_MAN}"/*1.gz; do
-		gunzip $man_file || die
-	done
-
-	if use tools; then
-		cp "${FILESDIR}"/nvidia-settings-linker.patch "${WORKDIR}" || die
-		sed -i \
-			-e "s:@PV@:${PV}:g" \
-			"${WORKDIR}"/nvidia-settings-linker.patch || die
-		eapply "${WORKDIR}"/nvidia-settings-linker.patch
-	fi
-
-	default
-
-	if ! [ -f nvidia_icd.json ]; then
-		cp nvidia_icd.json.template nvidia_icd.json || die
-		sed -i -e 's:__NV_VK_ICD__:libGLX_nvidia.so.0:g' nvidia_icd.json || die
-	fi
-}
-
-src_compile() {
-	# This is already the default on Linux, as there's no toplevel Makefile, but
-	# on FreeBSD there's one and triggers the kernel module build, as we install
-	# it by itself, pass this.
-
-	cd "${NV_SRC}"
-	if use kernel_FreeBSD; then
-		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
-			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
-	elif use driver && use kernel_linux; then
-		linux-mod_src_compile src="${KERNEL_DIR}" KERNELRELEASE="${KV_FULL}"
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			AR="$(tc-getAR)" \
-			CC="$(tc-getCC)" \
-			DO_STRIP= \
-			LD="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			NVLD="$(tc-getLD)" \
-			NV_VERBOSE=1 \
-			RANLIB="$(tc-getRANLIB)" \
-			build-xnvctrl
-
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			CC="$(tc-getCC)" \
-			DO_STRIP= \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LD="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			NVLD="$(tc-getLD)" \
-			NVML_ENABLED=0 \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			NV_VERBOSE=1
-	fi
-}
-
-# Install nvidia library:
-# the first parameter is the library to install
-# the second parameter is the provided soversion
-# the third parameter is the target directory if it is not /usr/lib
-donvidia() {
-	# Full path to library
-	nv_LIB="${1}"
-
-	# SOVER to use
-	nv_SOVER="$(scanelf -qF'%S#F' ${nv_LIB})"
-
-	# Where to install
-	nv_DEST="${2}"
-
-	# Get just the library name
-	nv_LIBNAME=$(basename "${nv_LIB}")
-
-	if [[ "${nv_DEST}" ]]; then
-		exeinto ${nv_DEST}
-		action="doexe"
-	else
-		nv_DEST="/usr/$(get_libdir)"
-		action="dolib.so"
-	fi
-
-	# Install the library
-	${action} ${nv_LIB} || die "failed to install ${nv_LIBNAME}"
-
-	# If the library has a SONAME and SONAME does not match the library name,
-	# then we need to create a symlink
-	if [[ ${nv_SOVER} ]] && ! [[ "${nv_SOVER}" = "${nv_LIBNAME}" ]]; then
-		dosym ${nv_LIBNAME} ${nv_DEST}/${nv_SOVER} \
-			|| die "failed to create ${nv_DEST}/${nv_SOVER} symlink"
-	fi
-
-	dosym ${nv_LIBNAME} ${nv_DEST}/${nv_LIBNAME/.so*/.so} \
-		|| die "failed to create ${nv_LIBNAME/.so*/.so} symlink"
-}
-
-src_install() {
-	if use driver && use kernel_linux; then
-		linux-mod_src_install
-
-		# Add the aliases
-		# This file is tweaked with the appropriate video group in
-		# pkg_preinst, see bug #491414
-		insinto /etc/modprobe.d
-		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
-		doins "${FILESDIR}"/nvidia-rmmod.conf
-
-		# Ensures that our device nodes are created when not using X
-		exeinto "$(get_udevdir)"
-		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
-		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
-	elif use kernel_FreeBSD; then
-		if use x86-fbsd; then
-			insinto /boot/modules
-			doins "${S}/src/nvidia.kld"
-		fi
-
-		exeinto /boot/modules
-		doexe "${S}/src/nvidia.ko"
-	fi
-
-	# NVIDIA kernel <-> userspace driver config lib
-	donvidia ${NV_OBJ}/libnvidia-cfg.so.${NV_SOVER}
-
-	# NVIDIA framebuffer capture library
-	donvidia ${NV_OBJ}/libnvidia-fbc.so.${NV_SOVER}
-
-	# NVIDIA video encode/decode <-> CUDA
-	if use kernel_linux; then
-		donvidia ${NV_OBJ}/libnvcuvid.so.${NV_SOVER}
-		donvidia ${NV_OBJ}/libnvidia-encode.so.${NV_SOVER}
-	fi
-
-	if use X; then
-		# Xorg DDX driver
-		insinto /usr/$(get_libdir)/xorg/modules/drivers
-		doins ${NV_X11}/nvidia_drv.so
-
-		# Xorg GLX driver
-		donvidia ${NV_X11}/libglx.so.${NV_SOVER} \
-			/usr/$(get_libdir)/opengl/nvidia/extensions
-
-		# Xorg nvidia.conf
-		if has_version '>=x11-base/xorg-server-1.16'; then
-			insinto /usr/share/X11/xorg.conf.d
-			newins {,50-}nvidia-drm-outputclass.conf
-		fi
-
-		insinto /usr/share/glvnd/egl_vendor.d
-		doins ${NV_X11}/10_nvidia.json
-	fi
-
-	if use wayland; then
-		insinto /usr/share/egl/egl_external_platform.d
-		doins ${NV_X11}/10_nvidia_wayland.json
-	fi
-
-	# OpenCL ICD for NVIDIA
-	if use kernel_linux; then
-		insinto /etc/OpenCL/vendors
-		doins ${NV_OBJ}/nvidia.icd
-	fi
-
-	# Documentation
-	if use kernel_FreeBSD; then
-		dodoc "${NV_DOC}/README"
-		use X && doman "${NV_MAN}"/nvidia-xconfig.1
-		use tools && doman "${NV_MAN}"/nvidia-settings.1
-	else
-		# Docs
-		newdoc "${NV_DOC}/README.txt" README
-		dodoc "${NV_DOC}/NVIDIA_Changelog"
-		doman "${NV_MAN}"/nvidia-smi.1
-		use X && doman "${NV_MAN}"/nvidia-xconfig.1
-		use tools && doman "${NV_MAN}"/nvidia-settings.1
-		doman "${NV_MAN}"/nvidia-cuda-mps-control.1
-	fi
-
-	docinto html
-	dodoc -r ${NV_DOC}/html/*
-
-	# Helper Apps
-	exeinto /opt/bin/
-
-	if use X; then
-		doexe ${NV_OBJ}/nvidia-xconfig
-
-		insinto /etc/vulkan/icd.d
-		doins nvidia_icd.json
-	fi
-
-	if use kernel_linux; then
-		doexe ${NV_OBJ}/nvidia-cuda-mps-control
-		doexe ${NV_OBJ}/nvidia-cuda-mps-server
-		doexe ${NV_OBJ}/nvidia-debugdump
-		doexe ${NV_OBJ}/nvidia-persistenced
-		doexe ${NV_OBJ}/nvidia-smi
-
-		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
-		doexe ${NV_OBJ}/nvidia-modprobe
-		fowners root:video /opt/bin/nvidia-modprobe
-		fperms 4710 /opt/bin/nvidia-modprobe
-		dosym /{opt,usr}/bin/nvidia-modprobe
-
-		doman nvidia-cuda-mps-control.1
-		doman nvidia-modprobe.1
-		doman nvidia-persistenced.1
-		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
-		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
-		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src/ \
-			DESTDIR="${D}" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LIBDIR="${D}/usr/$(get_libdir)" \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			NV_VERBOSE=1 \
-			PREFIX=/usr \
-			DO_STRIP= \
-			install
-
-		if use static-libs; then
-			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
-
-			insinto /usr/include/NVCtrl
-			doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
-		fi
-
-		insinto /usr/share/nvidia/
-		doins nvidia-application-profiles-${PV}-key-documentation
-
-		insinto /etc/nvidia
-		newins \
-			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
-
-		# There is no icon in the FreeBSD tarball.
-		use kernel_FreeBSD || \
-			doicon ${NV_OBJ}/nvidia-settings.png
-
-		domenu "${FILESDIR}"/nvidia-settings.desktop
-
-		exeinto /etc/X11/xinit/xinitrc.d
-		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
-	fi
-
-	dobin ${NV_OBJ}/nvidia-bug-report.sh
-
-	if has_multilib_profile && use multilib; then
-		local OABI=${ABI}
-		for ABI in $(get_install_abis); do
-			src_install-libs
-		done
-		ABI=${OABI}
-		unset OABI
-	else
-		src_install-libs
-	fi
-
-	is_final_abi || die "failed to iterate through all ABIs"
-
-	readme.gentoo_create_doc
-}
-
-src_install-libs() {
-	local inslibdir=$(get_libdir)
-	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
-	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
-	local nv_libdir="${NV_OBJ}"
-
-	if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
-		nv_libdir="${NV_OBJ}"/32
-	fi
-
-	if use X; then
-		NV_GLX_LIBRARIES=(
-			"libEGL.so.$(usex compat ${NV_SOVER} 1) ${GL_ROOT}"
-			"libEGL_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGL.so.$(usex compat ${NV_SOVER} 1.0.0) ${GL_ROOT}"
-			"libGLESv1_CM.so.1 ${GL_ROOT}"
-			"libGLESv1_CM_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLESv2.so.2 ${GL_ROOT}"
-			"libGLESv2_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLX.so.0 ${GL_ROOT}"
-			"libGLX_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLdispatch.so.0 ${GL_ROOT}"
-			"libOpenCL.so.1.0.0 ${CL_ROOT}"
-			"libOpenGL.so.0 ${GL_ROOT}"
-			"libcuda.so.${NV_SOVER}"
-			"libnvcuvid.so.${NV_SOVER}"
-			"libnvidia-compiler.so.${NV_SOVER}"
-			"libnvidia-eglcore.so.${NV_SOVER}"
-			"libnvidia-encode.so.${NV_SOVER}"
-			"libnvidia-fatbinaryloader.so.${NV_SOVER}"
-			"libnvidia-fbc.so.${NV_SOVER}"
-			"libnvidia-glcore.so.${NV_SOVER}"
-			"libnvidia-glsi.so.${NV_SOVER}"
-			"libnvidia-ifr.so.${NV_SOVER}"
-			"libnvidia-opencl.so.${NV_SOVER}"
-			"libnvidia-ptxjitcompiler.so.${NV_SOVER}"
-			"libvdpau_nvidia.so.${NV_SOVER}"
-		)
-
-		if use wayland && has_multilib_profile && [[ ${ABI} == "amd64" ]];
-		then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-egl-wayland.so.1.0.2"
-			)
-		fi
-
-		if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
-		then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-wfb.so.${NV_SOVER}"
-			)
-		fi
-
-		if use kernel_FreeBSD; then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-tls.so.${NV_SOVER}"
-			)
-		fi
-
-		if use kernel_linux; then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-ml.so.${NV_SOVER}"
-				"tls/libnvidia-tls.so.${NV_SOVER}"
-			)
-		fi
-
-		for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
-			donvidia "${nv_libdir}"/${NV_LIB}
-		done
-	fi
-}
-
-pkg_preinst() {
-	if use driver && use kernel_linux; then
-		linux-mod_pkg_preinst
-
-		local videogroup="$(egetent group video | cut -d ':' -f 3)"
-		if [ -z "${videogroup}" ]; then
-			eerror "Failed to determine the video group gid"
-			die "Failed to determine the video group gid"
-		else
-			sed -i \
-				-e "s:PACKAGE:${PF}:g" \
-				-e "s:VIDEOGID:${videogroup}:" \
-				"${D}"/etc/modprobe.d/nvidia.conf || die
-		fi
-	fi
-
-	# Clean the dynamic libGL stuff's home to ensure
-	# we dont have stale libs floating around
-	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ]; then
-		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
-	fi
-	# Make sure we nuke the old nvidia-glx's env.d file
-	if [ -e "${ROOT}"/etc/env.d/09nvidia ]; then
-		rm -f "${ROOT}"/etc/env.d/09nvidia
-	fi
-}
-
-pkg_postinst() {
-	use driver && use kernel_linux && linux-mod_pkg_postinst
-
-	# Switch to the nvidia implementation
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
-	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
-
-	readme.gentoo_print_elog
-
-	if ! use X; then
-		elog "You have elected to not install the X.org driver. Along with"
-		elog "this the OpenGL libraries and VDPAU libraries were not"
-		elog "installed. Additionally, once the driver is loaded your card"
-		elog "and fan will run at max speed which may not be desirable."
-		elog "Use the 'nvidia-smi' init script to have your card and fan"
-		elog "speed scale appropriately."
-		elog
-	fi
-	if ! use tools; then
-		elog "USE=tools controls whether the nvidia-settings application"
-		elog "is installed. If you would like to use it, enable that"
-		elog "flag and re-emerge this ebuild. Optionally you can install"
-		elog "media-video/nvidia-settings"
-		elog
-	fi
-}
-
-pkg_prerm() {
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}
-
-pkg_postrm() {
-	use driver && use kernel_linux && linux-mod_pkg_postrm
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-396.54.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-396.54.ebuild
deleted file mode 100644
index 7a038cf22fe..00000000000
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-396.54.ebuild
+++ /dev/null
@@ -1,581 +0,0 @@
-# Copyright 1999-2018 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-inherit eutils flag-o-matic linux-info linux-mod multilib-minimal nvidia-driver \
-	portability toolchain-funcs unpacker user udev
-
-DESCRIPTION="NVIDIA Accelerated Graphics Driver"
-HOMEPAGE="http://www.nvidia.com/ http://www.nvidia.com/Download/Find.aspx"
-
-AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
-AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
-ARM_NV_PACKAGE="NVIDIA-Linux-armv7l-gnueabihf-${PV}"
-
-NV_URI="https://us.download.nvidia.com/XFree86/"
-SRC_URI="
-	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
-	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
-	tools? (
-		https://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2
-	)
-"
-
-LICENSE="GPL-2 NVIDIA-r2"
-SLOT="0/${PV%.*}"
-KEYWORDS="-* amd64 ~amd64-fbsd"
-RESTRICT="bindist mirror"
-EMULTILIB_PKG="true"
-
-IUSE="acpi compat +driver gtk3 kernel_FreeBSD kernel_linux +kms multilib pax_kernel static-libs +tools uvm wayland +X"
-REQUIRED_USE="
-	tools? ( X )
-	static-libs? ( tools )
-"
-
-COMMON="
-	app-eselect/eselect-opencl
-	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
-	tools? (
-		dev-libs/atk
-		dev-libs/glib:2
-		dev-libs/jansson
-		gtk3? (
-			x11-libs/gtk+:3
-		)
-		x11-libs/cairo
-		x11-libs/gdk-pixbuf[X]
-		x11-libs/gtk+:2
-		x11-libs/libX11
-		x11-libs/libXext
-		x11-libs/libXrandr
-		x11-libs/libXv
-		x11-libs/libXxf86vm
-		x11-libs/pango[X]
-	)
-	X? (
-		>=app-eselect/eselect-opengl-1.0.9
-		app-misc/pax-utils
-	)
-"
-DEPEND="
-	${COMMON}
-	kernel_linux? ( virtual/linux-sources )
-	tools? ( sys-apps/dbus )
-"
-RDEPEND="
-	${COMMON}
-	acpi? ( sys-power/acpid )
-	tools? ( !media-video/nvidia-settings )
-	wayland? ( dev-libs/wayland[${MULTILIB_USEDEP}] )
-	X? (
-		<x11-base/xorg-server-1.20.99:=
-		>=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
-		>=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
-		>=x11-libs/libvdpau-1.0[${MULTILIB_USEDEP}]
-		sys-libs/zlib[${MULTILIB_USEDEP}]
-	)
-"
-QA_PREBUILT="opt/* usr/lib*"
-S=${WORKDIR}/
-
-nvidia_drivers_versions_check() {
-	if use amd64 && has_multilib_profile && \
-		[ "${DEFAULT_ABI}" != "amd64" ]; then
-		eerror "This ebuild doesn't currently support changing your default ABI"
-		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
-	fi
-
-	if use kernel_linux && kernel_is ge 4 19; then
-		ewarn "Gentoo supports kernels which are supported by NVIDIA"
-		ewarn "which are limited to the following kernels:"
-		ewarn "<sys-kernel/gentoo-sources-4.19"
-		ewarn "<sys-kernel/vanilla-sources-4.19"
-		ewarn ""
-		ewarn "You are free to utilize epatch_user to provide whatever"
-		ewarn "support you feel is appropriate, but will not receive"
-		ewarn "support as a result of those changes."
-		ewarn ""
-		ewarn "Do not file a bug report about this."
-		ewarn ""
-	fi
-
-	# Since Nvidia ships many different series of drivers, we need to give the user
-	# some kind of guidance as to what version they should install. This tries
-	# to point the user in the right direction but can't be perfect. check
-	# nvidia-driver.eclass
-	nvidia-driver-check-warning
-
-	# Kernel features/options to check for
-	CONFIG_CHECK="!DEBUG_MUTEXES ~!LOCKDEP ~MTRR ~SYSVIPC ~ZONE_DMA"
-
-	# Now do the above checks
-	use kernel_linux && check_extra_config
-}
-
-pkg_pretend() {
-	nvidia_drivers_versions_check
-}
-
-pkg_setup() {
-	nvidia_drivers_versions_check
-
-	# try to turn off distcc and ccache for people that have a problem with it
-	export DISTCC_DISABLE=1
-	export CCACHE_DISABLE=1
-
-	if use driver && use kernel_linux; then
-		MODULE_NAMES="nvidia(video:${S}/kernel)"
-		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
-		use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel) nvidia-drm(video:${S}/kernel)"
-
-		# This needs to run after MODULE_NAMES (so that the eclass checks
-		# whether the kernel supports loadable modules) but before BUILD_PARAMS
-		# is set (so that KV_DIR is populated).
-		linux-mod_pkg_setup
-
-		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
-		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
-
-		# linux-mod_src_compile calls set_arch_to_kernel, which
-		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
-		# expects x86_64 or i386 and then converts it to x86
-		# later on in the build process
-		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
-	fi
-
-	if use kernel_linux && kernel_is lt 2 6 9; then
-		eerror "You must build this against 2.6.9 or higher kernels."
-	fi
-
-	# set variables to where files are in the package structure
-	if use kernel_FreeBSD; then
-		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
-		NV_DOC="${S}/doc"
-		NV_OBJ="${S}/obj"
-		NV_SRC="${S}/src"
-		NV_MAN="${S}/x11/man"
-		NV_X11="${S}/obj"
-		NV_SOVER=1
-	elif use kernel_linux; then
-		NV_DOC="${S}"
-		NV_OBJ="${S}"
-		NV_SRC="${S}/kernel"
-		NV_MAN="${S}"
-		NV_X11="${S}"
-		NV_SOVER=${PV}
-	else
-		die "Could not determine proper NVIDIA package"
-	fi
-}
-
-src_prepare() {
-	if use pax_kernel; then
-		ewarn "Using PAX patches is not supported. You will be asked to"
-		ewarn "use a standard kernel should you have issues. Should you"
-		ewarn "need support with these patches, contact the PaX team."
-		eapply "${FILESDIR}"/${PN}-375.20-pax.patch
-	fi
-
-	local man_file
-	for man_file in "${NV_MAN}"/*1.gz; do
-		gunzip $man_file || die
-	done
-
-	if use tools; then
-		cp "${FILESDIR}"/nvidia-settings-linker.patch "${WORKDIR}" || die
-		sed -i \
-			-e "s:@PV@:${PV}:g" \
-			"${WORKDIR}"/nvidia-settings-linker.patch || die
-		eapply "${WORKDIR}"/nvidia-settings-linker.patch
-	fi
-
-	default
-
-	if ! [ -f nvidia_icd.json ]; then
-		cp nvidia_icd.json.template nvidia_icd.json || die
-		sed -i -e 's:__NV_VK_ICD__:libGLX_nvidia.so.0:g' nvidia_icd.json || die
-	fi
-}
-
-src_compile() {
-	# This is already the default on Linux, as there's no toplevel Makefile, but
-	# on FreeBSD there's one and triggers the kernel module build, as we install
-	# it by itself, pass this.
-
-	cd "${NV_SRC}"
-	if use kernel_FreeBSD; then
-		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
-			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
-	elif use driver && use kernel_linux; then
-		linux-mod_src_compile src="${KERNEL_DIR}" KERNELRELEASE="${KV_FULL}"
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			AR="$(tc-getAR)" \
-			CC="$(tc-getCC)" \
-			DO_STRIP= \
-			LD="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			NVLD="$(tc-getLD)" \
-			NV_VERBOSE=1 \
-			RANLIB="$(tc-getRANLIB)" \
-			build-xnvctrl
-
-		emake -C "${S}"/nvidia-settings-${PV}/src \
-			CC="$(tc-getCC)" \
-			DO_STRIP= \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LD="$(tc-getCC)" \
-			LIBDIR="$(get_libdir)" \
-			NVLD="$(tc-getLD)" \
-			NVML_ENABLED=0 \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			NV_VERBOSE=1
-	fi
-}
-
-# Install nvidia library:
-# the first parameter is the library to install
-# the second parameter is the provided soversion
-# the third parameter is the target directory if it is not /usr/lib
-donvidia() {
-	# Full path to library
-	nv_LIB="${1}"
-
-	# SOVER to use
-	nv_SOVER="$(scanelf -qF'%S#F' ${nv_LIB})"
-
-	# Where to install
-	nv_DEST="${2}"
-
-	# Get just the library name
-	nv_LIBNAME=$(basename "${nv_LIB}")
-
-	if [[ "${nv_DEST}" ]]; then
-		exeinto ${nv_DEST}
-		action="doexe"
-	else
-		nv_DEST="/usr/$(get_libdir)"
-		action="dolib.so"
-	fi
-
-	# Install the library
-	${action} ${nv_LIB} || die "failed to install ${nv_LIBNAME}"
-
-	# If the library has a SONAME and SONAME does not match the library name,
-	# then we need to create a symlink
-	if [[ ${nv_SOVER} ]] && ! [[ "${nv_SOVER}" = "${nv_LIBNAME}" ]]; then
-		dosym ${nv_LIBNAME} ${nv_DEST}/${nv_SOVER} \
-			|| die "failed to create ${nv_DEST}/${nv_SOVER} symlink"
-	fi
-
-	dosym ${nv_LIBNAME} ${nv_DEST}/${nv_LIBNAME/.so*/.so} \
-		|| die "failed to create ${nv_LIBNAME/.so*/.so} symlink"
-}
-
-src_install() {
-	if use driver && use kernel_linux; then
-		linux-mod_src_install
-
-		# Add the aliases
-		# This file is tweaked with the appropriate video group in
-		# pkg_preinst, see bug #491414
-		insinto /etc/modprobe.d
-		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
-		doins "${FILESDIR}"/nvidia-rmmod.conf
-
-		# Ensures that our device nodes are created when not using X
-		exeinto "$(get_udevdir)"
-		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
-		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
-	elif use kernel_FreeBSD; then
-		if use x86-fbsd; then
-			insinto /boot/modules
-			doins "${S}/src/nvidia.kld"
-		fi
-
-		exeinto /boot/modules
-		doexe "${S}/src/nvidia.ko"
-	fi
-
-	# NVIDIA kernel <-> userspace driver config lib
-	donvidia ${NV_OBJ}/libnvidia-cfg.so.${NV_SOVER}
-
-	# NVIDIA framebuffer capture library
-	donvidia ${NV_OBJ}/libnvidia-fbc.so.${NV_SOVER}
-
-	# NVIDIA video encode/decode <-> CUDA
-	if use kernel_linux; then
-		donvidia ${NV_OBJ}/libnvcuvid.so.${NV_SOVER}
-		donvidia ${NV_OBJ}/libnvidia-encode.so.${NV_SOVER}
-	fi
-
-	if use X; then
-		# Xorg DDX driver
-		insinto /usr/$(get_libdir)/xorg/modules/drivers
-		doins ${NV_X11}/nvidia_drv.so
-
-		# Xorg GLX driver
-		donvidia ${NV_X11}/libglx.so.${NV_SOVER} \
-			/usr/$(get_libdir)/opengl/nvidia/extensions
-
-		# Xorg nvidia.conf
-		if has_version '>=x11-base/xorg-server-1.16'; then
-			insinto /usr/share/X11/xorg.conf.d
-			newins {,50-}nvidia-drm-outputclass.conf
-		fi
-
-		insinto /usr/share/glvnd/egl_vendor.d
-		doins ${NV_X11}/10_nvidia.json
-	fi
-
-	if use wayland; then
-		insinto /usr/share/egl/egl_external_platform.d
-		doins ${NV_X11}/10_nvidia_wayland.json
-	fi
-
-	# OpenCL ICD for NVIDIA
-	if use kernel_linux; then
-		insinto /etc/OpenCL/vendors
-		doins ${NV_OBJ}/nvidia.icd
-	fi
-
-	# Documentation
-	if use kernel_FreeBSD; then
-		dodoc "${NV_DOC}/README"
-		use X && doman "${NV_MAN}"/nvidia-xconfig.1
-		use tools && doman "${NV_MAN}"/nvidia-settings.1
-	else
-		# Docs
-		newdoc "${NV_DOC}/README.txt" README
-		dodoc "${NV_DOC}/NVIDIA_Changelog"
-		doman "${NV_MAN}"/nvidia-smi.1
-		use X && doman "${NV_MAN}"/nvidia-xconfig.1
-		use tools && doman "${NV_MAN}"/nvidia-settings.1
-		doman "${NV_MAN}"/nvidia-cuda-mps-control.1
-	fi
-
-	docinto html
-	dodoc -r ${NV_DOC}/html/*
-
-	# Helper Apps
-	exeinto /opt/bin/
-
-	if use X; then
-		doexe ${NV_OBJ}/nvidia-xconfig
-
-		insinto /etc/vulkan/icd.d
-		doins nvidia_icd.json
-	fi
-
-	if use kernel_linux; then
-		doexe ${NV_OBJ}/nvidia-cuda-mps-control
-		doexe ${NV_OBJ}/nvidia-cuda-mps-server
-		doexe ${NV_OBJ}/nvidia-debugdump
-		doexe ${NV_OBJ}/nvidia-persistenced
-		doexe ${NV_OBJ}/nvidia-smi
-
-		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
-		doexe ${NV_OBJ}/nvidia-modprobe
-		fowners root:video /opt/bin/nvidia-modprobe
-		fperms 4710 /opt/bin/nvidia-modprobe
-		dosym /{opt,usr}/bin/nvidia-modprobe
-
-		doman nvidia-cuda-mps-control.1
-		doman nvidia-modprobe.1
-		doman nvidia-persistenced.1
-		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
-		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
-		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
-	fi
-
-	if use tools; then
-		emake -C "${S}"/nvidia-settings-${PV}/src/ \
-			DESTDIR="${D}" \
-			GTK3_AVAILABLE=$(usex gtk3 1 0) \
-			LIBDIR="${D}/usr/$(get_libdir)" \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			NV_VERBOSE=1 \
-			PREFIX=/usr \
-			DO_STRIP= \
-			install
-
-		if use static-libs; then
-			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
-
-			insinto /usr/include/NVCtrl
-			doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
-		fi
-
-		insinto /usr/share/nvidia/
-		doins nvidia-application-profiles-${PV}-key-documentation
-
-		insinto /etc/nvidia
-		newins \
-			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
-
-		# There is no icon in the FreeBSD tarball.
-		use kernel_FreeBSD || \
-			doicon ${NV_OBJ}/nvidia-settings.png
-
-		domenu "${FILESDIR}"/nvidia-settings.desktop
-
-		exeinto /etc/X11/xinit/xinitrc.d
-		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
-	fi
-
-	dobin ${NV_OBJ}/nvidia-bug-report.sh
-
-	if has_multilib_profile && use multilib; then
-		local OABI=${ABI}
-		for ABI in $(get_install_abis); do
-			src_install-libs
-		done
-		ABI=${OABI}
-		unset OABI
-	else
-		src_install-libs
-	fi
-
-	is_final_abi || die "failed to iterate through all ABIs"
-
-	readme.gentoo_create_doc
-}
-
-src_install-libs() {
-	local inslibdir=$(get_libdir)
-	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
-	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
-	local nv_libdir="${NV_OBJ}"
-
-	if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
-		nv_libdir="${NV_OBJ}"/32
-	fi
-
-	if use X; then
-		NV_GLX_LIBRARIES=(
-			"libEGL.so.$(usex compat ${NV_SOVER} 1.1.0) ${GL_ROOT}"
-			"libEGL_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGL.so.$(usex compat ${NV_SOVER} 1.7.0) ${GL_ROOT}"
-			"libGLESv1_CM.so.1.2.0 ${GL_ROOT}"
-			"libGLESv1_CM_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLESv2.so.2.1.0 ${GL_ROOT}"
-			"libGLESv2_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLX.so.0 ${GL_ROOT}"
-			"libGLX_nvidia.so.${NV_SOVER} ${GL_ROOT}"
-			"libGLdispatch.so.0 ${GL_ROOT}"
-			"libOpenCL.so.1.0.0 ${CL_ROOT}"
-			"libOpenGL.so.0 ${GL_ROOT}"
-			"libcuda.so.${NV_SOVER}"
-			"libnvcuvid.so.${NV_SOVER}"
-			"libnvidia-compiler.so.${NV_SOVER}"
-			"libnvidia-eglcore.so.${NV_SOVER}"
-			"libnvidia-encode.so.${NV_SOVER}"
-			"libnvidia-fatbinaryloader.so.${NV_SOVER}"
-			"libnvidia-fbc.so.${NV_SOVER}"
-			"libnvidia-glcore.so.${NV_SOVER}"
-			"libnvidia-glsi.so.${NV_SOVER}"
-			"libnvidia-glvkspirv.so.${NV_SOVER}"
-			"libnvidia-ifr.so.${NV_SOVER}"
-			"libnvidia-opencl.so.${NV_SOVER}"
-			"libnvidia-ptxjitcompiler.so.${NV_SOVER}"
-			"libvdpau_nvidia.so.${NV_SOVER}"
-		)
-
-		if use wayland && has_multilib_profile && [[ ${ABI} == "amd64" ]];
-		then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-egl-wayland.so.1.0.3"
-			)
-		fi
-
-		if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
-		then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-wfb.so.${NV_SOVER}"
-			)
-		fi
-
-		if use kernel_FreeBSD; then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-tls.so.${NV_SOVER}"
-			)
-		fi
-
-		if use kernel_linux; then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-ml.so.${NV_SOVER}"
-				"tls/libnvidia-tls.so.${NV_SOVER}"
-			)
-		fi
-
-		for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
-			donvidia "${nv_libdir}"/${NV_LIB}
-		done
-	fi
-}
-
-pkg_preinst() {
-	if use driver && use kernel_linux; then
-		linux-mod_pkg_preinst
-
-		local videogroup="$(egetent group video | cut -d ':' -f 3)"
-		if [ -z "${videogroup}" ]; then
-			eerror "Failed to determine the video group gid"
-			die "Failed to determine the video group gid"
-		else
-			sed -i \
-				-e "s:PACKAGE:${PF}:g" \
-				-e "s:VIDEOGID:${videogroup}:" \
-				"${D}"/etc/modprobe.d/nvidia.conf || die
-		fi
-	fi
-
-	# Clean the dynamic libGL stuff's home to ensure
-	# we dont have stale libs floating around
-	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ]; then
-		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
-	fi
-	# Make sure we nuke the old nvidia-glx's env.d file
-	if [ -e "${ROOT}"/etc/env.d/09nvidia ]; then
-		rm -f "${ROOT}"/etc/env.d/09nvidia
-	fi
-}
-
-pkg_postinst() {
-	use driver && use kernel_linux && linux-mod_pkg_postinst
-
-	# Switch to the nvidia implementation
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
-	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
-
-	readme.gentoo_print_elog
-
-	if ! use X; then
-		elog "You have elected to not install the X.org driver. Along with"
-		elog "this the OpenGL libraries and VDPAU libraries were not"
-		elog "installed. Additionally, once the driver is loaded your card"
-		elog "and fan will run at max speed which may not be desirable."
-		elog "Use the 'nvidia-smi' init script to have your card and fan"
-		elog "speed scale appropriately."
-		elog
-	fi
-	if ! use tools; then
-		elog "USE=tools controls whether the nvidia-settings application"
-		elog "is installed. If you would like to use it, enable that"
-		elog "flag and re-emerge this ebuild. Optionally you can install"
-		elog "media-video/nvidia-settings"
-		elog
-	fi
-}
-
-pkg_prerm() {
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}
-
-pkg_postrm() {
-	use driver && use kernel_linux && linux-mod_pkg_postrm
-	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
-}


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: x11-drivers/nvidia-drivers/, x11-drivers/nvidia-drivers/files/
@ 2019-03-03 13:11 Jeroen Roovers
  0 siblings, 0 replies; 33+ messages in thread
From: Jeroen Roovers @ 2019-03-03 13:11 UTC (permalink / raw
  To: gentoo-commits

commit:     9fd6d358a4e831724c79f9369c3c86dea00cddd0
Author:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
AuthorDate: Sun Mar  3 13:09:53 2019 +0000
Commit:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
CommitDate: Sun Mar  3 13:11:05 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9fd6d358

x11-drivers/nvidia-drivers: USE=uvm: add udev rule, fix rmmod

Package-Manager: Portage-2.3.62, Repoman-2.3.12
Bug: https://bugs.gentoo.org/506696
Bug: https://bugs.gentoo.org/578126
Signed-off-by: Jeroen Roovers <jer <AT> gentoo.org>

 .../nvidia-drivers/files/nvidia-uvm.udev-rule      |   1 +
 .../nvidia-drivers-390.116-r1.ebuild               | 589 ++++++++++++++++++++
 .../nvidia-drivers-410.104-r1.ebuild               | 592 +++++++++++++++++++++
 .../nvidia-drivers/nvidia-drivers-415.27-r1.ebuild | 592 +++++++++++++++++++++
 .../nvidia-drivers/nvidia-drivers-418.43-r1.ebuild | 585 ++++++++++++++++++++
 5 files changed, 2359 insertions(+)

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-uvm.udev-rule b/x11-drivers/nvidia-drivers/files/nvidia-uvm.udev-rule
new file mode 100644
index 00000000000..3df8a3ab07f
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-uvm.udev-rule
@@ -0,0 +1 @@
+KERNEL=="nvidia_uvm", RUN+="/bin/bash -c '/bin/mknod -m 660 /dev/nvidia-uvm c $(grep nvidia-uvm /proc/devices | cut -d \  -f 1) 0; /bin/chgrp video /dev/nvidia-uvm'"

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-390.116-r1.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-390.116-r1.ebuild
new file mode 100644
index 00000000000..aa55b3cdd05
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-390.116-r1.ebuild
@@ -0,0 +1,589 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit eutils flag-o-matic linux-info linux-mod multilib-minimal nvidia-driver \
+	portability toolchain-funcs unpacker user udev
+
+DESCRIPTION="NVIDIA Accelerated Graphics Driver"
+HOMEPAGE="http://www.nvidia.com/"
+
+AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
+AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
+ARM_NV_PACKAGE="NVIDIA-Linux-armv7l-gnueabihf-${PV}"
+X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
+X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
+
+NV_URI="https://us.download.nvidia.com/XFree86/"
+SRC_URI="
+	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
+	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
+	arm? ( ${NV_URI}Linux-x86-ARM/${PV}/${ARM_NV_PACKAGE}.run )
+	x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
+	x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
+	tools? (
+		https://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2
+	)
+"
+
+LICENSE="GPL-2 NVIDIA-r2"
+SLOT="0/${PV%.*}"
+KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
+RESTRICT="bindist mirror"
+EMULTILIB_PKG="true"
+
+IUSE="acpi compat +driver gtk3 kernel_FreeBSD kernel_linux +kms multilib static-libs +tools uvm wayland +X"
+REQUIRED_USE="
+	tools? ( X )
+	static-libs? ( tools )
+"
+
+COMMON="
+	app-eselect/eselect-opencl
+	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
+	tools? (
+		dev-libs/atk
+		dev-libs/glib:2
+		dev-libs/jansson
+		gtk3? (
+			x11-libs/gtk+:3
+		)
+		x11-libs/cairo
+		x11-libs/gdk-pixbuf[X]
+		x11-libs/gtk+:2
+		x11-libs/libX11
+		x11-libs/libXext
+		x11-libs/libXrandr
+		x11-libs/libXv
+		x11-libs/libXxf86vm
+		x11-libs/pango[X]
+	)
+	X? (
+		>=app-eselect/eselect-opengl-1.0.9
+		app-misc/pax-utils
+	)
+"
+DEPEND="
+	${COMMON}
+	kernel_linux? ( virtual/linux-sources )
+	tools? ( sys-apps/dbus )
+"
+RDEPEND="
+	${COMMON}
+	acpi? ( sys-power/acpid )
+	tools? ( !media-video/nvidia-settings )
+	wayland? ( dev-libs/wayland[${MULTILIB_USEDEP}] )
+	X? (
+		<x11-base/xorg-server-1.20.99:=
+		>=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
+		>=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
+		>=x11-libs/libvdpau-1.0[${MULTILIB_USEDEP}]
+		sys-libs/zlib[${MULTILIB_USEDEP}]
+	)
+"
+QA_PREBUILT="opt/* usr/lib*"
+S=${WORKDIR}/
+
+nvidia_drivers_versions_check() {
+	if use amd64 && has_multilib_profile && \
+		[ "${DEFAULT_ABI}" != "amd64" ]; then
+		eerror "This ebuild doesn't currently support changing your default ABI"
+		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
+	fi
+
+	if use kernel_linux && kernel_is ge 5 1; then
+		ewarn "Gentoo supports kernels which are supported by NVIDIA"
+		ewarn "which are limited to the following kernels:"
+		ewarn "<sys-kernel/gentoo-sources-5.1"
+		ewarn "<sys-kernel/vanilla-sources-5.1"
+		ewarn ""
+		ewarn "You are free to utilize epatch_user to provide whatever"
+		ewarn "support you feel is appropriate, but will not receive"
+		ewarn "support as a result of those changes."
+		ewarn ""
+		ewarn "Do not file a bug report about this."
+		ewarn ""
+	fi
+
+	# Since Nvidia ships many different series of drivers, we need to give the user
+	# some kind of guidance as to what version they should install. This tries
+	# to point the user in the right direction but can't be perfect. check
+	# nvidia-driver.eclass
+	nvidia-driver-check-warning
+
+	# Kernel features/options to check for
+	CONFIG_CHECK="!DEBUG_MUTEXES ~!LOCKDEP ~MTRR ~SYSVIPC ~ZONE_DMA"
+	use x86 && CONFIG_CHECK+=" ~HIGHMEM"
+
+	# Now do the above checks
+	use kernel_linux && check_extra_config
+}
+
+pkg_pretend() {
+	nvidia_drivers_versions_check
+}
+
+pkg_setup() {
+	nvidia_drivers_versions_check
+
+	# try to turn off distcc and ccache for people that have a problem with it
+	export DISTCC_DISABLE=1
+	export CCACHE_DISABLE=1
+
+	if use driver && use kernel_linux; then
+		MODULE_NAMES="nvidia(video:${S}/kernel)"
+		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
+		use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel) nvidia-drm(video:${S}/kernel)"
+
+		# This needs to run after MODULE_NAMES (so that the eclass checks
+		# whether the kernel supports loadable modules) but before BUILD_PARAMS
+		# is set (so that KV_DIR is populated).
+		linux-mod_pkg_setup
+
+		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
+		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
+
+		# linux-mod_src_compile calls set_arch_to_kernel, which
+		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
+		# expects x86_64 or i386 and then converts it to x86
+		# later on in the build process
+		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
+	fi
+
+	if use kernel_linux && kernel_is lt 2 6 9; then
+		eerror "You must build this against 2.6.9 or higher kernels."
+	fi
+
+	# set variables to where files are in the package structure
+	if use kernel_FreeBSD; then
+		use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
+		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
+		NV_DOC="${S}/doc"
+		NV_OBJ="${S}/obj"
+		NV_SRC="${S}/src"
+		NV_MAN="${S}/x11/man"
+		NV_X11="${S}/obj"
+		NV_SOVER=1
+	elif use kernel_linux; then
+		NV_DOC="${S}"
+		NV_OBJ="${S}"
+		NV_SRC="${S}/kernel"
+		NV_MAN="${S}"
+		NV_X11="${S}"
+		NV_SOVER=${PV}
+	else
+		die "Could not determine proper NVIDIA package"
+	fi
+}
+
+src_prepare() {
+	local man_file
+	for man_file in "${NV_MAN}"/*1.gz; do
+		gunzip $man_file || die
+	done
+
+	if use tools; then
+		cp "${FILESDIR}"/nvidia-settings-linker.patch "${WORKDIR}" || die
+		sed -i \
+			-e "s:@PV@:${PV}:g" \
+			"${WORKDIR}"/nvidia-settings-linker.patch || die
+		eapply "${WORKDIR}"/nvidia-settings-linker.patch
+	fi
+
+	default
+
+	if ! [ -f nvidia_icd.json ]; then
+		cp nvidia_icd.json.template nvidia_icd.json || die
+		sed -i -e 's:__NV_VK_ICD__:libGLX_nvidia.so.0:g' nvidia_icd.json || die
+	fi
+}
+
+src_compile() {
+	# This is already the default on Linux, as there's no toplevel Makefile, but
+	# on FreeBSD there's one and triggers the kernel module build, as we install
+	# it by itself, pass this.
+
+	cd "${NV_SRC}"
+	if use kernel_FreeBSD; then
+		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
+			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
+	elif use driver && use kernel_linux; then
+		BUILD_TARGETS=module linux-mod_src_compile \
+			KERNELRELEASE="${KV_FULL}" \
+			src="${KERNEL_DIR}"
+	fi
+
+	if use tools; then
+		emake -C "${S}"/nvidia-settings-${PV}/src \
+			AR="$(tc-getAR)" \
+			CC="$(tc-getCC)" \
+			DO_STRIP= \
+			LD="$(tc-getCC)" \
+			LIBDIR="$(get_libdir)" \
+			NVLD="$(tc-getLD)" \
+			NV_VERBOSE=1 \
+			RANLIB="$(tc-getRANLIB)" \
+			build-xnvctrl
+
+		emake -C "${S}"/nvidia-settings-${PV}/src \
+			CC="$(tc-getCC)" \
+			DO_STRIP= \
+			GTK3_AVAILABLE=$(usex gtk3 1 0) \
+			LD="$(tc-getCC)" \
+			LIBDIR="$(get_libdir)" \
+			NVLD="$(tc-getLD)" \
+			NVML_ENABLED=0 \
+			NV_USE_BUNDLED_LIBJANSSON=0 \
+			NV_VERBOSE=1
+	fi
+}
+
+# Install nvidia library:
+# the first parameter is the library to install
+# the second parameter is the provided soversion
+# the third parameter is the target directory if it is not /usr/lib
+donvidia() {
+	# Full path to library
+	nv_LIB="${1}"
+
+	# SOVER to use
+	nv_SOVER="$(scanelf -qF'%S#F' ${nv_LIB})"
+
+	# Where to install
+	nv_DEST="${2}"
+
+	# Get just the library name
+	nv_LIBNAME=$(basename "${nv_LIB}")
+
+	if [[ "${nv_DEST}" ]]; then
+		exeinto ${nv_DEST}
+		action="doexe"
+	else
+		nv_DEST="/usr/$(get_libdir)"
+		action="dolib.so"
+	fi
+
+	# Install the library
+	${action} ${nv_LIB} || die "failed to install ${nv_LIBNAME}"
+
+	# If the library has a SONAME and SONAME does not match the library name,
+	# then we need to create a symlink
+	if [[ ${nv_SOVER} ]] && ! [[ "${nv_SOVER}" = "${nv_LIBNAME}" ]]; then
+		dosym ${nv_LIBNAME} ${nv_DEST}/${nv_SOVER} \
+			|| die "failed to create ${nv_DEST}/${nv_SOVER} symlink"
+	fi
+
+	dosym ${nv_LIBNAME} ${nv_DEST}/${nv_LIBNAME/.so*/.so} \
+		|| die "failed to create ${nv_LIBNAME/.so*/.so} symlink"
+}
+
+src_install() {
+	if use driver && use kernel_linux; then
+		linux-mod_src_install
+
+		# Add the aliases
+		# This file is tweaked with the appropriate video group in
+		# pkg_preinst, see bug #491414
+		insinto /etc/modprobe.d
+		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
+		if use uvm; then
+			doins "${FILESDIR}"/nvidia-rmmod.conf
+			udev_newrules "${FILESDIR}"/nvidia-uvm.udev-rule 99-nvidia-uvm.rules
+		else
+			sed -e 's|nvidia-uvm ||g' "${FILESDIR}"/nvidia-rmmod.conf \
+				> "${T}"/nvidia-rmmod.conf || die
+			doins "${T}"/nvidia-rmmod.conf
+		fi
+
+		# Ensures that our device nodes are created when not using X
+		exeinto "$(get_udevdir)"
+		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
+		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
+	elif use kernel_FreeBSD; then
+		if use x86-fbsd; then
+			insinto /boot/modules
+			doins "${S}/src/nvidia.kld"
+		fi
+
+		exeinto /boot/modules
+		doexe "${S}/src/nvidia.ko"
+	fi
+
+	# NVIDIA kernel <-> userspace driver config lib
+	donvidia ${NV_OBJ}/libnvidia-cfg.so.${NV_SOVER}
+
+	# NVIDIA framebuffer capture library
+	donvidia ${NV_OBJ}/libnvidia-fbc.so.${NV_SOVER}
+
+	# NVIDIA video encode/decode <-> CUDA
+	if use kernel_linux; then
+		donvidia ${NV_OBJ}/libnvcuvid.so.${NV_SOVER}
+		donvidia ${NV_OBJ}/libnvidia-encode.so.${NV_SOVER}
+	fi
+
+	if use X; then
+		# Xorg DDX driver
+		insinto /usr/$(get_libdir)/xorg/modules/drivers
+		doins ${NV_X11}/nvidia_drv.so
+
+		# Xorg GLX driver
+		donvidia ${NV_X11}/libglx.so.${NV_SOVER} \
+			/usr/$(get_libdir)/opengl/nvidia/extensions
+
+		# Xorg nvidia.conf
+		if has_version '>=x11-base/xorg-server-1.16'; then
+			insinto /usr/share/X11/xorg.conf.d
+			newins {,50-}nvidia-drm-outputclass.conf
+		fi
+
+		insinto /usr/share/glvnd/egl_vendor.d
+		doins ${NV_X11}/10_nvidia.json
+	fi
+
+	if use wayland; then
+		insinto /usr/share/egl/egl_external_platform.d
+		doins ${NV_X11}/10_nvidia_wayland.json
+	fi
+
+	# OpenCL ICD for NVIDIA
+	if use kernel_linux; then
+		insinto /etc/OpenCL/vendors
+		doins ${NV_OBJ}/nvidia.icd
+	fi
+
+	# Documentation
+	if use kernel_FreeBSD; then
+		dodoc "${NV_DOC}/README"
+		use X && doman "${NV_MAN}"/nvidia-xconfig.1
+		use tools && doman "${NV_MAN}"/nvidia-settings.1
+	else
+		# Docs
+		newdoc "${NV_DOC}/README.txt" README
+		dodoc "${NV_DOC}/NVIDIA_Changelog"
+		doman "${NV_MAN}"/nvidia-smi.1
+		use X && doman "${NV_MAN}"/nvidia-xconfig.1
+		use tools && doman "${NV_MAN}"/nvidia-settings.1
+		doman "${NV_MAN}"/nvidia-cuda-mps-control.1
+	fi
+
+	docinto html
+	dodoc -r ${NV_DOC}/html/*
+
+	# Helper Apps
+	exeinto /opt/bin/
+
+	if use X; then
+		doexe ${NV_OBJ}/nvidia-xconfig
+
+		insinto /etc/vulkan/icd.d
+		doins nvidia_icd.json
+	fi
+
+	if use kernel_linux; then
+		doexe ${NV_OBJ}/nvidia-cuda-mps-control
+		doexe ${NV_OBJ}/nvidia-cuda-mps-server
+		doexe ${NV_OBJ}/nvidia-debugdump
+		doexe ${NV_OBJ}/nvidia-persistenced
+		doexe ${NV_OBJ}/nvidia-smi
+
+		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
+		doexe ${NV_OBJ}/nvidia-modprobe
+		fowners root:video /opt/bin/nvidia-modprobe
+		fperms 4710 /opt/bin/nvidia-modprobe
+		dosym /{opt,usr}/bin/nvidia-modprobe
+
+		doman nvidia-cuda-mps-control.1
+		doman nvidia-modprobe.1
+		doman nvidia-persistenced.1
+		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
+		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
+		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
+	fi
+
+	if use tools; then
+		emake -C "${S}"/nvidia-settings-${PV}/src/ \
+			DESTDIR="${D}" \
+			GTK3_AVAILABLE=$(usex gtk3 1 0) \
+			LIBDIR="${D}/usr/$(get_libdir)" \
+			NV_USE_BUNDLED_LIBJANSSON=0 \
+			NV_VERBOSE=1 \
+			PREFIX=/usr \
+			DO_STRIP= \
+			install
+
+		if use static-libs; then
+			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
+
+			insinto /usr/include/NVCtrl
+			doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
+		fi
+
+		insinto /usr/share/nvidia/
+		doins nvidia-application-profiles-${PV}-key-documentation
+
+		insinto /etc/nvidia
+		newins \
+			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
+
+		# There is no icon in the FreeBSD tarball.
+		use kernel_FreeBSD || \
+			doicon ${NV_OBJ}/nvidia-settings.png
+
+		domenu "${FILESDIR}"/nvidia-settings.desktop
+
+		exeinto /etc/X11/xinit/xinitrc.d
+		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
+	fi
+
+	dobin ${NV_OBJ}/nvidia-bug-report.sh
+
+	if has_multilib_profile && use multilib; then
+		local OABI=${ABI}
+		for ABI in $(get_install_abis); do
+			src_install-libs
+		done
+		ABI=${OABI}
+		unset OABI
+	else
+		src_install-libs
+	fi
+
+	is_final_abi || die "failed to iterate through all ABIs"
+
+	readme.gentoo_create_doc
+}
+
+src_install-libs() {
+	local inslibdir=$(get_libdir)
+	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
+	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
+	local nv_libdir="${NV_OBJ}"
+
+	if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
+		nv_libdir="${NV_OBJ}"/32
+	fi
+
+	if use X; then
+		NV_GLX_LIBRARIES=(
+			"libEGL.so.$(usex compat ${NV_SOVER} 1.1.0) ${GL_ROOT}"
+			"libEGL_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGL.so.$(usex compat ${NV_SOVER} 1.7.0) ${GL_ROOT}"
+			"libGLESv1_CM.so.1.2.0 ${GL_ROOT}"
+			"libGLESv1_CM_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGLESv2.so.2.1.0 ${GL_ROOT}"
+			"libGLESv2_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGLX.so.0 ${GL_ROOT}"
+			"libGLX_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGLdispatch.so.0 ${GL_ROOT}"
+			"libOpenCL.so.1.0.0 ${CL_ROOT}"
+			"libOpenGL.so.0 ${GL_ROOT}"
+			"libcuda.so.${NV_SOVER}"
+			"libnvcuvid.so.${NV_SOVER}"
+			"libnvidia-compiler.so.${NV_SOVER}"
+			"libnvidia-eglcore.so.${NV_SOVER}"
+			"libnvidia-encode.so.${NV_SOVER}"
+			"libnvidia-fatbinaryloader.so.${NV_SOVER}"
+			"libnvidia-fbc.so.${NV_SOVER}"
+			"libnvidia-glcore.so.${NV_SOVER}"
+			"libnvidia-glsi.so.${NV_SOVER}"
+			"libnvidia-ifr.so.${NV_SOVER}"
+			"libnvidia-opencl.so.${NV_SOVER}"
+			"libnvidia-ptxjitcompiler.so.${NV_SOVER}"
+			"libvdpau_nvidia.so.${NV_SOVER}"
+		)
+
+		if use wayland && has_multilib_profile && [[ ${ABI} == "amd64" ]];
+		then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-egl-wayland.so.1.0.2"
+			)
+		fi
+
+		if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
+		then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-wfb.so.${NV_SOVER}"
+			)
+		fi
+
+		if use kernel_FreeBSD; then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-tls.so.${NV_SOVER}"
+			)
+		fi
+
+		if use kernel_linux; then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-ml.so.${NV_SOVER}"
+				"tls/libnvidia-tls.so.${NV_SOVER}"
+			)
+		fi
+
+		for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
+			donvidia "${nv_libdir}"/${NV_LIB}
+		done
+	fi
+}
+
+pkg_preinst() {
+	if use driver && use kernel_linux; then
+		linux-mod_pkg_preinst
+
+		local videogroup="$(egetent group video | cut -d ':' -f 3)"
+		if [ -z "${videogroup}" ]; then
+			eerror "Failed to determine the video group gid"
+			die "Failed to determine the video group gid"
+		else
+			sed -i \
+				-e "s:PACKAGE:${PF}:g" \
+				-e "s:VIDEOGID:${videogroup}:" \
+				"${D}"/etc/modprobe.d/nvidia.conf || die
+		fi
+	fi
+
+	# Clean the dynamic libGL stuff's home to ensure
+	# we dont have stale libs floating around
+	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ]; then
+		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
+	fi
+	# Make sure we nuke the old nvidia-glx's env.d file
+	if [ -e "${ROOT}"/etc/env.d/09nvidia ]; then
+		rm -f "${ROOT}"/etc/env.d/09nvidia
+	fi
+}
+
+pkg_postinst() {
+	use driver && use kernel_linux && linux-mod_pkg_postinst
+
+	# Switch to the nvidia implementation
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
+	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
+
+	readme.gentoo_print_elog
+
+	if ! use X; then
+		elog "You have elected to not install the X.org driver. Along with"
+		elog "this the OpenGL libraries and VDPAU libraries were not"
+		elog "installed. Additionally, once the driver is loaded your card"
+		elog "and fan will run at max speed which may not be desirable."
+		elog "Use the 'nvidia-smi' init script to have your card and fan"
+		elog "speed scale appropriately."
+		elog
+	fi
+	if ! use tools; then
+		elog "USE=tools controls whether the nvidia-settings application"
+		elog "is installed. If you would like to use it, enable that"
+		elog "flag and re-emerge this ebuild. Optionally you can install"
+		elog "media-video/nvidia-settings"
+		elog
+	fi
+}
+
+pkg_prerm() {
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+	use driver && use kernel_linux && linux-mod_pkg_postrm
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-410.104-r1.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-410.104-r1.ebuild
new file mode 100644
index 00000000000..4a4029ee9d4
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-410.104-r1.ebuild
@@ -0,0 +1,592 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit eutils flag-o-matic linux-info linux-mod multilib-minimal nvidia-driver \
+	portability toolchain-funcs unpacker user udev
+
+DESCRIPTION="NVIDIA Accelerated Graphics Driver"
+HOMEPAGE="http://www.nvidia.com/"
+
+AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
+AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
+ARM_NV_PACKAGE="NVIDIA-Linux-armv7l-gnueabihf-${PV}"
+
+NV_URI="https://us.download.nvidia.com/XFree86/"
+SRC_URI="
+	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
+	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
+	tools? (
+		https://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2
+	)
+"
+
+LICENSE="GPL-2 NVIDIA-r2"
+SLOT="0/${PV%.*}"
+KEYWORDS="-* ~amd64 ~amd64-fbsd"
+RESTRICT="bindist mirror"
+EMULTILIB_PKG="true"
+
+IUSE="acpi compat +driver gtk3 kernel_FreeBSD kernel_linux +kms multilib static-libs +tools uvm wayland +X"
+REQUIRED_USE="
+	tools? ( X )
+	static-libs? ( tools )
+"
+
+COMMON="
+	app-eselect/eselect-opencl
+	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
+	tools? (
+		dev-libs/atk
+		dev-libs/glib:2
+		dev-libs/jansson
+		gtk3? (
+			x11-libs/gtk+:3
+		)
+		x11-libs/cairo
+		x11-libs/gdk-pixbuf[X]
+		x11-libs/gtk+:2
+		x11-libs/libX11
+		x11-libs/libXext
+		x11-libs/libXrandr
+		x11-libs/libXv
+		x11-libs/libXxf86vm
+		x11-libs/pango[X]
+	)
+	X? (
+		>=app-eselect/eselect-opengl-1.0.9
+		app-misc/pax-utils
+	)
+"
+DEPEND="
+	${COMMON}
+	kernel_linux? ( virtual/linux-sources )
+	tools? ( sys-apps/dbus )
+"
+RDEPEND="
+	${COMMON}
+	acpi? ( sys-power/acpid )
+	tools? ( !media-video/nvidia-settings )
+	wayland? ( dev-libs/wayland[${MULTILIB_USEDEP}] )
+	X? (
+		<x11-base/xorg-server-1.20.99:=
+		>=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
+		>=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
+		>=x11-libs/libvdpau-1.0[${MULTILIB_USEDEP}]
+		sys-libs/zlib[${MULTILIB_USEDEP}]
+	)
+"
+QA_PREBUILT="opt/* usr/lib*"
+S=${WORKDIR}/
+
+nvidia_drivers_versions_check() {
+	if use amd64 && has_multilib_profile && \
+		[ "${DEFAULT_ABI}" != "amd64" ]; then
+		eerror "This ebuild doesn't currently support changing your default ABI"
+		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
+	fi
+
+	if use kernel_linux && kernel_is ge 5 1; then
+		ewarn "Gentoo supports kernels which are supported by NVIDIA"
+		ewarn "which are limited to the following kernels:"
+		ewarn "<sys-kernel/gentoo-sources-5.1"
+		ewarn "<sys-kernel/vanilla-sources-5.1"
+		ewarn ""
+		ewarn "You are free to utilize epatch_user to provide whatever"
+		ewarn "support you feel is appropriate, but will not receive"
+		ewarn "support as a result of those changes."
+		ewarn ""
+		ewarn "Do not file a bug report about this."
+		ewarn ""
+	fi
+
+	# Since Nvidia ships many different series of drivers, we need to give the user
+	# some kind of guidance as to what version they should install. This tries
+	# to point the user in the right direction but can't be perfect. check
+	# nvidia-driver.eclass
+	nvidia-driver-check-warning
+
+	# Kernel features/options to check for
+	CONFIG_CHECK="!DEBUG_MUTEXES ~!LOCKDEP ~MTRR ~PM ~SYSVIPC ~ZONE_DMA"
+
+	# Now do the above checks
+	use kernel_linux && check_extra_config
+}
+
+pkg_pretend() {
+	nvidia_drivers_versions_check
+}
+
+pkg_setup() {
+	nvidia_drivers_versions_check
+
+	# try to turn off distcc and ccache for people that have a problem with it
+	export DISTCC_DISABLE=1
+	export CCACHE_DISABLE=1
+
+	if use driver && use kernel_linux; then
+		MODULE_NAMES="nvidia(video:${S}/kernel)"
+		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
+		use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel) nvidia-drm(video:${S}/kernel)"
+
+		# This needs to run after MODULE_NAMES (so that the eclass checks
+		# whether the kernel supports loadable modules) but before BUILD_PARAMS
+		# is set (so that KV_DIR is populated).
+		linux-mod_pkg_setup
+
+		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
+		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
+
+		# linux-mod_src_compile calls set_arch_to_kernel, which
+		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
+		# expects x86_64 or i386 and then converts it to x86
+		# later on in the build process
+		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
+	fi
+
+	if use kernel_linux && kernel_is lt 2 6 9; then
+		eerror "You must build this against 2.6.9 or higher kernels."
+	fi
+
+	# set variables to where files are in the package structure
+	if use kernel_FreeBSD; then
+		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
+		NV_DOC="${S}/doc"
+		NV_OBJ="${S}/obj"
+		NV_SRC="${S}/src"
+		NV_MAN="${S}/x11/man"
+		NV_X11="${S}/obj"
+		NV_SOVER=1
+	elif use kernel_linux; then
+		NV_DOC="${S}"
+		NV_OBJ="${S}"
+		NV_SRC="${S}/kernel"
+		NV_MAN="${S}"
+		NV_X11="${S}"
+		NV_SOVER=${PV}
+	else
+		die "Could not determine proper NVIDIA package"
+	fi
+}
+
+src_prepare() {
+	local man_file
+	for man_file in "${NV_MAN}"/*1.gz; do
+		gunzip $man_file || die
+	done
+
+	if use tools; then
+		cp "${FILESDIR}"/nvidia-settings-linker.patch "${WORKDIR}" || die
+		sed -i \
+			-e "s:@PV@:${PV}:g" \
+			"${WORKDIR}"/nvidia-settings-linker.patch || die
+		eapply "${WORKDIR}"/nvidia-settings-linker.patch
+	fi
+
+	default
+
+	if ! [ -f nvidia_icd.json ]; then
+		cp nvidia_icd.json.template nvidia_icd.json || die
+		sed -i -e 's:__NV_VK_ICD__:libGLX_nvidia.so.0:g' nvidia_icd.json || die
+	fi
+}
+
+src_compile() {
+	# This is already the default on Linux, as there's no toplevel Makefile, but
+	# on FreeBSD there's one and triggers the kernel module build, as we install
+	# it by itself, pass this.
+
+	cd "${NV_SRC}"
+	if use kernel_FreeBSD; then
+		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
+			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
+	elif use driver && use kernel_linux; then
+		BUILD_TARGETS=module linux-mod_src_compile \
+			KERNELRELEASE="${KV_FULL}" \
+			src="${KERNEL_DIR}"
+	fi
+
+	if use tools; then
+		emake -C "${S}"/nvidia-settings-${PV}/src \
+			AR="$(tc-getAR)" \
+			CC="$(tc-getCC)" \
+			DO_STRIP= \
+			LD="$(tc-getCC)" \
+			LIBDIR="$(get_libdir)" \
+			NVLD="$(tc-getLD)" \
+			NV_VERBOSE=1 \
+			RANLIB="$(tc-getRANLIB)" \
+			build-xnvctrl
+
+		emake -C "${S}"/nvidia-settings-${PV}/src \
+			CC="$(tc-getCC)" \
+			DO_STRIP= \
+			GTK3_AVAILABLE=$(usex gtk3 1 0) \
+			LD="$(tc-getCC)" \
+			LIBDIR="$(get_libdir)" \
+			NVLD="$(tc-getLD)" \
+			NVML_ENABLED=0 \
+			NV_USE_BUNDLED_LIBJANSSON=0 \
+			NV_VERBOSE=1
+	fi
+}
+
+# Install nvidia library:
+# the first parameter is the library to install
+# the second parameter is the provided soversion
+# the third parameter is the target directory if it is not /usr/lib
+donvidia() {
+	# Full path to library
+	nv_LIB="${1}"
+
+	# SOVER to use
+	nv_SOVER="$(scanelf -qF'%S#F' ${nv_LIB})"
+
+	# Where to install
+	nv_DEST="${2}"
+
+	# Get just the library name
+	nv_LIBNAME=$(basename "${nv_LIB}")
+
+	if [[ "${nv_DEST}" ]]; then
+		exeinto ${nv_DEST}
+		action="doexe"
+	else
+		nv_DEST="/usr/$(get_libdir)"
+		action="dolib.so"
+	fi
+
+	# Install the library
+	${action} ${nv_LIB} || die "failed to install ${nv_LIBNAME}"
+
+	# If the library has a SONAME and SONAME does not match the library name,
+	# then we need to create a symlink
+	if [[ ${nv_SOVER} ]] && ! [[ "${nv_SOVER}" = "${nv_LIBNAME}" ]]; then
+		dosym ${nv_LIBNAME} ${nv_DEST}/${nv_SOVER} \
+			|| die "failed to create ${nv_DEST}/${nv_SOVER} symlink"
+	fi
+
+	dosym ${nv_LIBNAME} ${nv_DEST}/${nv_LIBNAME/.so*/.so} \
+		|| die "failed to create ${nv_LIBNAME/.so*/.so} symlink"
+}
+
+src_install() {
+	if use driver && use kernel_linux; then
+		linux-mod_src_install
+
+		# Add the aliases
+		# This file is tweaked with the appropriate video group in
+		# pkg_preinst, see bug #491414
+		insinto /etc/modprobe.d
+		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
+		if use uvm; then
+			doins "${FILESDIR}"/nvidia-rmmod.conf
+			udev_newrules "${FILESDIR}"/nvidia-uvm.udev-rule 99-nvidia-uvm.rules
+		else
+			sed -e 's|nvidia-uvm ||g' "${FILESDIR}"/nvidia-rmmod.conf \
+				> "${T}"/nvidia-rmmod.conf || die
+			doins "${T}"/nvidia-rmmod.conf
+		fi
+
+		# Ensures that our device nodes are created when not using X
+		exeinto "$(get_udevdir)"
+		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
+		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
+	elif use kernel_FreeBSD; then
+		if use x86-fbsd; then
+			insinto /boot/modules
+			doins "${S}/src/nvidia.kld"
+		fi
+
+		exeinto /boot/modules
+		doexe "${S}/src/nvidia.ko"
+	fi
+
+	# NVIDIA kernel <-> userspace driver config lib
+	donvidia ${NV_OBJ}/libnvidia-cfg.so.${NV_SOVER}
+
+	# NVIDIA framebuffer capture library
+	donvidia ${NV_OBJ}/libnvidia-fbc.so.${NV_SOVER}
+
+	# NVIDIA video encode/decode <-> CUDA
+	if use kernel_linux; then
+		donvidia ${NV_OBJ}/libnvcuvid.so.${NV_SOVER}
+		donvidia ${NV_OBJ}/libnvidia-encode.so.${NV_SOVER}
+	fi
+
+	if use X; then
+		# Xorg DDX driver
+		insinto /usr/$(get_libdir)/xorg/modules/drivers
+		doins ${NV_X11}/nvidia_drv.so
+
+		# Xorg GLX driver
+		donvidia ${NV_X11}/libglxserver_nvidia.so.${NV_SOVER} \
+			/usr/$(get_libdir)/xorg/modules/extensions
+
+		# Xorg nvidia.conf
+		if has_version '>=x11-base/xorg-server-1.16'; then
+			insinto /usr/share/X11/xorg.conf.d
+			newins {,50-}nvidia-drm-outputclass.conf
+		fi
+
+		insinto /usr/share/glvnd/egl_vendor.d
+		doins ${NV_X11}/10_nvidia.json
+	fi
+
+	if use wayland; then
+		insinto /usr/share/egl/egl_external_platform.d
+		doins ${NV_X11}/10_nvidia_wayland.json
+	fi
+
+	# OpenCL ICD for NVIDIA
+	if use kernel_linux; then
+		insinto /etc/OpenCL/vendors
+		doins ${NV_OBJ}/nvidia.icd
+	fi
+
+	# Documentation
+	if use kernel_FreeBSD; then
+		dodoc "${NV_DOC}/README"
+		use X && doman "${NV_MAN}"/nvidia-xconfig.1
+		use tools && doman "${NV_MAN}"/nvidia-settings.1
+	else
+		# Docs
+		newdoc "${NV_DOC}/README.txt" README
+		dodoc "${NV_DOC}/NVIDIA_Changelog"
+		doman "${NV_MAN}"/nvidia-smi.1
+		use X && doman "${NV_MAN}"/nvidia-xconfig.1
+		use tools && doman "${NV_MAN}"/nvidia-settings.1
+		doman "${NV_MAN}"/nvidia-cuda-mps-control.1
+	fi
+
+	docinto html
+	dodoc -r ${NV_DOC}/html/*
+
+	# Helper Apps
+	exeinto /opt/bin/
+
+	if use X; then
+		doexe ${NV_OBJ}/nvidia-xconfig
+
+		insinto /etc/vulkan/icd.d
+		doins nvidia_icd.json
+	fi
+
+	if use kernel_linux; then
+		doexe ${NV_OBJ}/nvidia-cuda-mps-control
+		doexe ${NV_OBJ}/nvidia-cuda-mps-server
+		doexe ${NV_OBJ}/nvidia-debugdump
+		doexe ${NV_OBJ}/nvidia-persistenced
+		doexe ${NV_OBJ}/nvidia-smi
+
+		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
+		doexe ${NV_OBJ}/nvidia-modprobe
+		fowners root:video /opt/bin/nvidia-modprobe
+		fperms 4710 /opt/bin/nvidia-modprobe
+		dosym /{opt,usr}/bin/nvidia-modprobe
+
+		doman nvidia-cuda-mps-control.1
+		doman nvidia-modprobe.1
+		doman nvidia-persistenced.1
+		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
+		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
+		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
+	fi
+
+	if use tools; then
+		emake -C "${S}"/nvidia-settings-${PV}/src/ \
+			DESTDIR="${D}" \
+			GTK3_AVAILABLE=$(usex gtk3 1 0) \
+			LIBDIR="${D}/usr/$(get_libdir)" \
+			NV_USE_BUNDLED_LIBJANSSON=0 \
+			NV_VERBOSE=1 \
+			PREFIX=/usr \
+			DO_STRIP= \
+			install
+
+		if use static-libs; then
+			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
+
+			insinto /usr/include/NVCtrl
+			doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
+		fi
+
+		insinto /usr/share/nvidia/
+		doins nvidia-application-profiles-${PV}-key-documentation
+
+		insinto /etc/nvidia
+		newins \
+			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
+
+		# There is no icon in the FreeBSD tarball.
+		use kernel_FreeBSD || \
+			doicon ${NV_OBJ}/nvidia-settings.png
+
+		domenu "${FILESDIR}"/nvidia-settings.desktop
+
+		exeinto /etc/X11/xinit/xinitrc.d
+		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
+	fi
+
+	dobin ${NV_OBJ}/nvidia-bug-report.sh
+
+	if has_multilib_profile && use multilib; then
+		local OABI=${ABI}
+		for ABI in $(get_install_abis); do
+			src_install-libs
+		done
+		ABI=${OABI}
+		unset OABI
+	else
+		src_install-libs
+	fi
+
+	is_final_abi || die "failed to iterate through all ABIs"
+
+	readme.gentoo_create_doc
+}
+
+src_install-libs() {
+	local inslibdir=$(get_libdir)
+	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
+	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
+	local nv_libdir="${NV_OBJ}"
+
+	if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
+		nv_libdir="${NV_OBJ}"/32
+	fi
+
+	if use X; then
+		NV_GLX_LIBRARIES=(
+			"libEGL.so.$(usex compat ${NV_SOVER} 1.1.0) ${GL_ROOT}"
+			"libEGL_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGL.so.$(usex compat ${NV_SOVER} 1.7.0) ${GL_ROOT}"
+			"libGLESv1_CM.so.1.2.0 ${GL_ROOT}"
+			"libGLESv1_CM_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGLESv2.so.2.1.0 ${GL_ROOT}"
+			"libGLESv2_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGLX.so.0 ${GL_ROOT}"
+			"libGLX_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGLdispatch.so.0 ${GL_ROOT}"
+			"libOpenCL.so.1.0.0 ${CL_ROOT}"
+			"libOpenGL.so.0 ${GL_ROOT}"
+			"libcuda.so.${NV_SOVER}"
+			"libnvcuvid.so.${NV_SOVER}"
+			"libnvidia-compiler.so.${NV_SOVER}"
+			"libnvidia-eglcore.so.${NV_SOVER}"
+			"libnvidia-encode.so.${NV_SOVER}"
+			"libnvidia-fatbinaryloader.so.${NV_SOVER}"
+			"libnvidia-fbc.so.${NV_SOVER}"
+			"libnvidia-glcore.so.${NV_SOVER}"
+			"libnvidia-glsi.so.${NV_SOVER}"
+			"libnvidia-glvkspirv.so.${NV_SOVER}"
+			"libnvidia-ifr.so.${NV_SOVER}"
+			"libnvidia-opencl.so.${NV_SOVER}"
+			"libnvidia-ptxjitcompiler.so.${NV_SOVER}"
+			"libvdpau_nvidia.so.${NV_SOVER}"
+		)
+
+		if use wayland && has_multilib_profile && [[ ${ABI} == "amd64" ]];
+		then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-egl-wayland.so.1.1.0"
+			)
+		fi
+
+		if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
+		then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-wfb.so.${NV_SOVER}"
+			)
+		fi
+
+		if use kernel_FreeBSD; then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-tls.so.${NV_SOVER}"
+			)
+		fi
+
+		if use kernel_linux; then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-ml.so.${NV_SOVER}"
+				"tls/libnvidia-tls.so.${NV_SOVER}"
+			)
+		fi
+
+		if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
+		then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-cbl.so.${NV_SOVER}"
+				"libnvidia-rtcore.so.${NV_SOVER}"
+				"libnvoptix.so.${NV_SOVER}"
+			)
+		fi
+
+		for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
+			donvidia "${nv_libdir}"/${NV_LIB}
+		done
+	fi
+}
+
+pkg_preinst() {
+	if use driver && use kernel_linux; then
+		linux-mod_pkg_preinst
+
+		local videogroup="$(egetent group video | cut -d ':' -f 3)"
+		if [ -z "${videogroup}" ]; then
+			eerror "Failed to determine the video group gid"
+			die "Failed to determine the video group gid"
+		else
+			sed -i \
+				-e "s:PACKAGE:${PF}:g" \
+				-e "s:VIDEOGID:${videogroup}:" \
+				"${D}"/etc/modprobe.d/nvidia.conf || die
+		fi
+	fi
+
+	# Clean the dynamic libGL stuff's home to ensure
+	# we dont have stale libs floating around
+	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ]; then
+		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
+	fi
+	# Make sure we nuke the old nvidia-glx's env.d file
+	if [ -e "${ROOT}"/etc/env.d/09nvidia ]; then
+		rm -f "${ROOT}"/etc/env.d/09nvidia
+	fi
+}
+
+pkg_postinst() {
+	use driver && use kernel_linux && linux-mod_pkg_postinst
+
+	# Switch to the nvidia implementation
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
+	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
+
+	readme.gentoo_print_elog
+
+	if ! use X; then
+		elog "You have elected to not install the X.org driver. Along with"
+		elog "this the OpenGL libraries and VDPAU libraries were not"
+		elog "installed. Additionally, once the driver is loaded your card"
+		elog "and fan will run at max speed which may not be desirable."
+		elog "Use the 'nvidia-smi' init script to have your card and fan"
+		elog "speed scale appropriately."
+		elog
+	fi
+	if ! use tools; then
+		elog "USE=tools controls whether the nvidia-settings application"
+		elog "is installed. If you would like to use it, enable that"
+		elog "flag and re-emerge this ebuild. Optionally you can install"
+		elog "media-video/nvidia-settings"
+		elog
+	fi
+}
+
+pkg_prerm() {
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+	use driver && use kernel_linux && linux-mod_pkg_postrm
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-415.27-r1.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-415.27-r1.ebuild
new file mode 100644
index 00000000000..3e96bb07188
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-415.27-r1.ebuild
@@ -0,0 +1,592 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit eutils flag-o-matic linux-info linux-mod multilib-minimal nvidia-driver \
+	portability toolchain-funcs unpacker user udev
+
+DESCRIPTION="NVIDIA Accelerated Graphics Driver"
+HOMEPAGE="http://www.nvidia.com/"
+
+AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
+AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
+ARM_NV_PACKAGE="NVIDIA-Linux-armv7l-gnueabihf-${PV}"
+
+NV_URI="https://us.download.nvidia.com/XFree86/"
+SRC_URI="
+	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
+	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
+	tools? (
+		https://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2
+	)
+"
+
+LICENSE="GPL-2 NVIDIA-r2"
+SLOT="0/${PV%.*}"
+KEYWORDS="-* ~amd64 ~amd64-fbsd"
+RESTRICT="bindist mirror"
+EMULTILIB_PKG="true"
+
+IUSE="acpi compat +driver gtk3 kernel_FreeBSD kernel_linux +kms multilib static-libs +tools uvm wayland +X"
+REQUIRED_USE="
+	tools? ( X )
+	static-libs? ( tools )
+"
+
+COMMON="
+	app-eselect/eselect-opencl
+	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
+	tools? (
+		dev-libs/atk
+		dev-libs/glib:2
+		dev-libs/jansson
+		gtk3? (
+			x11-libs/gtk+:3
+		)
+		x11-libs/cairo
+		x11-libs/gdk-pixbuf[X]
+		x11-libs/gtk+:2
+		x11-libs/libX11
+		x11-libs/libXext
+		x11-libs/libXrandr
+		x11-libs/libXv
+		x11-libs/libXxf86vm
+		x11-libs/pango[X]
+	)
+	X? (
+		>=app-eselect/eselect-opengl-1.0.9
+		app-misc/pax-utils
+	)
+"
+DEPEND="
+	${COMMON}
+	kernel_linux? ( virtual/linux-sources )
+	tools? ( sys-apps/dbus )
+"
+RDEPEND="
+	${COMMON}
+	acpi? ( sys-power/acpid )
+	tools? ( !media-video/nvidia-settings )
+	wayland? ( dev-libs/wayland[${MULTILIB_USEDEP}] )
+	X? (
+		<x11-base/xorg-server-1.20.99:=
+		>=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
+		>=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
+		>=x11-libs/libvdpau-1.0[${MULTILIB_USEDEP}]
+		sys-libs/zlib[${MULTILIB_USEDEP}]
+	)
+"
+QA_PREBUILT="opt/* usr/lib*"
+S=${WORKDIR}/
+
+nvidia_drivers_versions_check() {
+	if use amd64 && has_multilib_profile && \
+		[ "${DEFAULT_ABI}" != "amd64" ]; then
+		eerror "This ebuild doesn't currently support changing your default ABI"
+		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
+	fi
+
+	if use kernel_linux && kernel_is ge 4 21; then
+		ewarn "Gentoo supports kernels which are supported by NVIDIA"
+		ewarn "which are limited to the following kernels:"
+		ewarn "<sys-kernel/gentoo-sources-4.21"
+		ewarn "<sys-kernel/vanilla-sources-4.21"
+		ewarn ""
+		ewarn "You are free to utilize epatch_user to provide whatever"
+		ewarn "support you feel is appropriate, but will not receive"
+		ewarn "support as a result of those changes."
+		ewarn ""
+		ewarn "Do not file a bug report about this."
+		ewarn ""
+	fi
+
+	# Since Nvidia ships many different series of drivers, we need to give the user
+	# some kind of guidance as to what version they should install. This tries
+	# to point the user in the right direction but can't be perfect. check
+	# nvidia-driver.eclass
+	nvidia-driver-check-warning
+
+	# Kernel features/options to check for
+	CONFIG_CHECK="!DEBUG_MUTEXES !I2C_NVIDIA_GPU ~!LOCKDEP ~MTRR ~SYSVIPC ~ZONE_DMA"
+
+	# Now do the above checks
+	use kernel_linux && check_extra_config
+}
+
+pkg_pretend() {
+	nvidia_drivers_versions_check
+}
+
+pkg_setup() {
+	nvidia_drivers_versions_check
+
+	# try to turn off distcc and ccache for people that have a problem with it
+	export DISTCC_DISABLE=1
+	export CCACHE_DISABLE=1
+
+	if use driver && use kernel_linux; then
+		MODULE_NAMES="nvidia(video:${S}/kernel)"
+		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
+		use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel) nvidia-drm(video:${S}/kernel)"
+
+		# This needs to run after MODULE_NAMES (so that the eclass checks
+		# whether the kernel supports loadable modules) but before BUILD_PARAMS
+		# is set (so that KV_DIR is populated).
+		linux-mod_pkg_setup
+
+		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
+		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
+
+		# linux-mod_src_compile calls set_arch_to_kernel, which
+		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
+		# expects x86_64 or i386 and then converts it to x86
+		# later on in the build process
+		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
+	fi
+
+	if use kernel_linux && kernel_is lt 2 6 9; then
+		eerror "You must build this against 2.6.9 or higher kernels."
+	fi
+
+	# set variables to where files are in the package structure
+	if use kernel_FreeBSD; then
+		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
+		NV_DOC="${S}/doc"
+		NV_OBJ="${S}/obj"
+		NV_SRC="${S}/src"
+		NV_MAN="${S}/x11/man"
+		NV_X11="${S}/obj"
+		NV_SOVER=1
+	elif use kernel_linux; then
+		NV_DOC="${S}"
+		NV_OBJ="${S}"
+		NV_SRC="${S}/kernel"
+		NV_MAN="${S}"
+		NV_X11="${S}"
+		NV_SOVER=${PV}
+	else
+		die "Could not determine proper NVIDIA package"
+	fi
+}
+
+src_prepare() {
+	local man_file
+	for man_file in "${NV_MAN}"/*1.gz; do
+		gunzip $man_file || die
+	done
+
+	if use tools; then
+		cp "${FILESDIR}"/nvidia-settings-linker.patch "${WORKDIR}" || die
+		sed -i \
+			-e "s:@PV@:${PV}:g" \
+			"${WORKDIR}"/nvidia-settings-linker.patch || die
+		eapply "${WORKDIR}"/nvidia-settings-linker.patch
+	fi
+
+	default
+
+	if ! [ -f nvidia_icd.json ]; then
+		cp nvidia_icd.json.template nvidia_icd.json || die
+		sed -i -e 's:__NV_VK_ICD__:libGLX_nvidia.so.0:g' nvidia_icd.json || die
+	fi
+}
+
+src_compile() {
+	# This is already the default on Linux, as there's no toplevel Makefile, but
+	# on FreeBSD there's one and triggers the kernel module build, as we install
+	# it by itself, pass this.
+
+	cd "${NV_SRC}"
+	if use kernel_FreeBSD; then
+		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
+			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
+	elif use driver && use kernel_linux; then
+		BUILD_TARGETS=module linux-mod_src_compile \
+			KERNELRELEASE="${KV_FULL}" \
+			src="${KERNEL_DIR}"
+	fi
+
+	if use tools; then
+		emake -C "${S}"/nvidia-settings-${PV}/src \
+			AR="$(tc-getAR)" \
+			CC="$(tc-getCC)" \
+			DO_STRIP= \
+			LD="$(tc-getCC)" \
+			LIBDIR="$(get_libdir)" \
+			NVLD="$(tc-getLD)" \
+			NV_VERBOSE=1 \
+			RANLIB="$(tc-getRANLIB)" \
+			build-xnvctrl
+
+		emake -C "${S}"/nvidia-settings-${PV}/src \
+			CC="$(tc-getCC)" \
+			DO_STRIP= \
+			GTK3_AVAILABLE=$(usex gtk3 1 0) \
+			LD="$(tc-getCC)" \
+			LIBDIR="$(get_libdir)" \
+			NVLD="$(tc-getLD)" \
+			NVML_ENABLED=0 \
+			NV_USE_BUNDLED_LIBJANSSON=0 \
+			NV_VERBOSE=1
+	fi
+}
+
+# Install nvidia library:
+# the first parameter is the library to install
+# the second parameter is the provided soversion
+# the third parameter is the target directory if it is not /usr/lib
+donvidia() {
+	# Full path to library
+	nv_LIB="${1}"
+
+	# SOVER to use
+	nv_SOVER="$(scanelf -qF'%S#F' ${nv_LIB})"
+
+	# Where to install
+	nv_DEST="${2}"
+
+	# Get just the library name
+	nv_LIBNAME=$(basename "${nv_LIB}")
+
+	if [[ "${nv_DEST}" ]]; then
+		exeinto ${nv_DEST}
+		action="doexe"
+	else
+		nv_DEST="/usr/$(get_libdir)"
+		action="dolib.so"
+	fi
+
+	# Install the library
+	${action} ${nv_LIB} || die "failed to install ${nv_LIBNAME}"
+
+	# If the library has a SONAME and SONAME does not match the library name,
+	# then we need to create a symlink
+	if [[ ${nv_SOVER} ]] && ! [[ "${nv_SOVER}" = "${nv_LIBNAME}" ]]; then
+		dosym ${nv_LIBNAME} ${nv_DEST}/${nv_SOVER} \
+			|| die "failed to create ${nv_DEST}/${nv_SOVER} symlink"
+	fi
+
+	dosym ${nv_LIBNAME} ${nv_DEST}/${nv_LIBNAME/.so*/.so} \
+		|| die "failed to create ${nv_LIBNAME/.so*/.so} symlink"
+}
+
+src_install() {
+	if use driver && use kernel_linux; then
+		linux-mod_src_install
+
+		# Add the aliases
+		# This file is tweaked with the appropriate video group in
+		# pkg_preinst, see bug #491414
+		insinto /etc/modprobe.d
+		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
+		if use uvm; then
+			doins "${FILESDIR}"/nvidia-rmmod.conf
+			udev_newrules "${FILESDIR}"/nvidia-uvm.udev-rule 99-nvidia-uvm.rules
+		else
+			sed -e 's|nvidia-uvm ||g' "${FILESDIR}"/nvidia-rmmod.conf \
+				> "${T}"/nvidia-rmmod.conf || die
+			doins "${T}"/nvidia-rmmod.conf
+		fi
+
+		# Ensures that our device nodes are created when not using X
+		exeinto "$(get_udevdir)"
+		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
+		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
+	elif use kernel_FreeBSD; then
+		if use x86-fbsd; then
+			insinto /boot/modules
+			doins "${S}/src/nvidia.kld"
+		fi
+
+		exeinto /boot/modules
+		doexe "${S}/src/nvidia.ko"
+	fi
+
+	# NVIDIA kernel <-> userspace driver config lib
+	donvidia ${NV_OBJ}/libnvidia-cfg.so.${NV_SOVER}
+
+	# NVIDIA framebuffer capture library
+	donvidia ${NV_OBJ}/libnvidia-fbc.so.${NV_SOVER}
+
+	# NVIDIA video encode/decode <-> CUDA
+	if use kernel_linux; then
+		donvidia ${NV_OBJ}/libnvcuvid.so.${NV_SOVER}
+		donvidia ${NV_OBJ}/libnvidia-encode.so.${NV_SOVER}
+	fi
+
+	if use X; then
+		# Xorg DDX driver
+		insinto /usr/$(get_libdir)/xorg/modules/drivers
+		doins ${NV_X11}/nvidia_drv.so
+
+		# Xorg GLX driver
+		donvidia ${NV_X11}/libglxserver_nvidia.so.${NV_SOVER} \
+			/usr/$(get_libdir)/xorg/modules/extensions
+
+		# Xorg nvidia.conf
+		if has_version '>=x11-base/xorg-server-1.16'; then
+			insinto /usr/share/X11/xorg.conf.d
+			newins {,50-}nvidia-drm-outputclass.conf
+		fi
+
+		insinto /usr/share/glvnd/egl_vendor.d
+		doins ${NV_X11}/10_nvidia.json
+	fi
+
+	if use wayland; then
+		insinto /usr/share/egl/egl_external_platform.d
+		doins ${NV_X11}/10_nvidia_wayland.json
+	fi
+
+	# OpenCL ICD for NVIDIA
+	if use kernel_linux; then
+		insinto /etc/OpenCL/vendors
+		doins ${NV_OBJ}/nvidia.icd
+	fi
+
+	# Documentation
+	if use kernel_FreeBSD; then
+		dodoc "${NV_DOC}/README"
+		use X && doman "${NV_MAN}"/nvidia-xconfig.1
+		use tools && doman "${NV_MAN}"/nvidia-settings.1
+	else
+		# Docs
+		newdoc "${NV_DOC}/README.txt" README
+		dodoc "${NV_DOC}/NVIDIA_Changelog"
+		doman "${NV_MAN}"/nvidia-smi.1
+		use X && doman "${NV_MAN}"/nvidia-xconfig.1
+		use tools && doman "${NV_MAN}"/nvidia-settings.1
+		doman "${NV_MAN}"/nvidia-cuda-mps-control.1
+	fi
+
+	docinto html
+	dodoc -r ${NV_DOC}/html/*
+
+	# Helper Apps
+	exeinto /opt/bin/
+
+	if use X; then
+		doexe ${NV_OBJ}/nvidia-xconfig
+
+		insinto /etc/vulkan/icd.d
+		doins nvidia_icd.json
+	fi
+
+	if use kernel_linux; then
+		doexe ${NV_OBJ}/nvidia-cuda-mps-control
+		doexe ${NV_OBJ}/nvidia-cuda-mps-server
+		doexe ${NV_OBJ}/nvidia-debugdump
+		doexe ${NV_OBJ}/nvidia-persistenced
+		doexe ${NV_OBJ}/nvidia-smi
+
+		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
+		doexe ${NV_OBJ}/nvidia-modprobe
+		fowners root:video /opt/bin/nvidia-modprobe
+		fperms 4710 /opt/bin/nvidia-modprobe
+		dosym /{opt,usr}/bin/nvidia-modprobe
+
+		doman nvidia-cuda-mps-control.1
+		doman nvidia-modprobe.1
+		doman nvidia-persistenced.1
+		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
+		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
+		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
+	fi
+
+	if use tools; then
+		emake -C "${S}"/nvidia-settings-${PV}/src/ \
+			DESTDIR="${D}" \
+			GTK3_AVAILABLE=$(usex gtk3 1 0) \
+			LIBDIR="${D}/usr/$(get_libdir)" \
+			NV_USE_BUNDLED_LIBJANSSON=0 \
+			NV_VERBOSE=1 \
+			PREFIX=/usr \
+			DO_STRIP= \
+			install
+
+		if use static-libs; then
+			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
+
+			insinto /usr/include/NVCtrl
+			doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
+		fi
+
+		insinto /usr/share/nvidia/
+		doins nvidia-application-profiles-${PV}-key-documentation
+
+		insinto /etc/nvidia
+		newins \
+			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
+
+		# There is no icon in the FreeBSD tarball.
+		use kernel_FreeBSD || \
+			doicon ${NV_OBJ}/nvidia-settings.png
+
+		domenu "${FILESDIR}"/nvidia-settings.desktop
+
+		exeinto /etc/X11/xinit/xinitrc.d
+		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
+	fi
+
+	dobin ${NV_OBJ}/nvidia-bug-report.sh
+
+	if has_multilib_profile && use multilib; then
+		local OABI=${ABI}
+		for ABI in $(get_install_abis); do
+			src_install-libs
+		done
+		ABI=${OABI}
+		unset OABI
+	else
+		src_install-libs
+	fi
+
+	is_final_abi || die "failed to iterate through all ABIs"
+
+	readme.gentoo_create_doc
+}
+
+src_install-libs() {
+	local inslibdir=$(get_libdir)
+	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
+	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
+	local nv_libdir="${NV_OBJ}"
+
+	if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
+		nv_libdir="${NV_OBJ}"/32
+	fi
+
+	if use X; then
+		NV_GLX_LIBRARIES=(
+			"libEGL.so.$(usex compat ${NV_SOVER} 1.1.0) ${GL_ROOT}"
+			"libEGL_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGL.so.$(usex compat ${NV_SOVER} 1.7.0) ${GL_ROOT}"
+			"libGLESv1_CM.so.1.2.0 ${GL_ROOT}"
+			"libGLESv1_CM_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGLESv2.so.2.1.0 ${GL_ROOT}"
+			"libGLESv2_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGLX.so.0 ${GL_ROOT}"
+			"libGLX_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGLdispatch.so.0 ${GL_ROOT}"
+			"libOpenCL.so.1.0.0 ${CL_ROOT}"
+			"libOpenGL.so.0 ${GL_ROOT}"
+			"libcuda.so.${NV_SOVER}"
+			"libnvcuvid.so.${NV_SOVER}"
+			"libnvidia-compiler.so.${NV_SOVER}"
+			"libnvidia-eglcore.so.${NV_SOVER}"
+			"libnvidia-encode.so.${NV_SOVER}"
+			"libnvidia-fatbinaryloader.so.${NV_SOVER}"
+			"libnvidia-fbc.so.${NV_SOVER}"
+			"libnvidia-glcore.so.${NV_SOVER}"
+			"libnvidia-glsi.so.${NV_SOVER}"
+			"libnvidia-glvkspirv.so.${NV_SOVER}"
+			"libnvidia-ifr.so.${NV_SOVER}"
+			"libnvidia-opencl.so.${NV_SOVER}"
+			"libnvidia-ptxjitcompiler.so.${NV_SOVER}"
+			"libvdpau_nvidia.so.${NV_SOVER}"
+		)
+
+		if use wayland && has_multilib_profile && [[ ${ABI} == "amd64" ]];
+		then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-egl-wayland.so.1.1.0"
+			)
+		fi
+
+		if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
+		then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-wfb.so.${NV_SOVER}"
+			)
+		fi
+
+		if use kernel_FreeBSD; then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-tls.so.${NV_SOVER}"
+			)
+		fi
+
+		if use kernel_linux; then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-ml.so.${NV_SOVER}"
+				"libnvidia-tls.so.${NV_SOVER}"
+			)
+		fi
+
+		if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
+		then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-cbl.so.${NV_SOVER}"
+				"libnvidia-rtcore.so.${NV_SOVER}"
+				"libnvoptix.so.${NV_SOVER}"
+			)
+		fi
+
+		for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
+			donvidia "${nv_libdir}"/${NV_LIB}
+		done
+	fi
+}
+
+pkg_preinst() {
+	if use driver && use kernel_linux; then
+		linux-mod_pkg_preinst
+
+		local videogroup="$(egetent group video | cut -d ':' -f 3)"
+		if [ -z "${videogroup}" ]; then
+			eerror "Failed to determine the video group gid"
+			die "Failed to determine the video group gid"
+		else
+			sed -i \
+				-e "s:PACKAGE:${PF}:g" \
+				-e "s:VIDEOGID:${videogroup}:" \
+				"${D}"/etc/modprobe.d/nvidia.conf || die
+		fi
+	fi
+
+	# Clean the dynamic libGL stuff's home to ensure
+	# we dont have stale libs floating around
+	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ]; then
+		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
+	fi
+	# Make sure we nuke the old nvidia-glx's env.d file
+	if [ -e "${ROOT}"/etc/env.d/09nvidia ]; then
+		rm -f "${ROOT}"/etc/env.d/09nvidia
+	fi
+}
+
+pkg_postinst() {
+	use driver && use kernel_linux && linux-mod_pkg_postinst
+
+	# Switch to the nvidia implementation
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
+	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
+
+	readme.gentoo_print_elog
+
+	if ! use X; then
+		elog "You have elected to not install the X.org driver. Along with"
+		elog "this the OpenGL libraries and VDPAU libraries were not"
+		elog "installed. Additionally, once the driver is loaded your card"
+		elog "and fan will run at max speed which may not be desirable."
+		elog "Use the 'nvidia-smi' init script to have your card and fan"
+		elog "speed scale appropriately."
+		elog
+	fi
+	if ! use tools; then
+		elog "USE=tools controls whether the nvidia-settings application"
+		elog "is installed. If you would like to use it, enable that"
+		elog "flag and re-emerge this ebuild. Optionally you can install"
+		elog "media-video/nvidia-settings"
+		elog
+	fi
+}
+
+pkg_prerm() {
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+	use driver && use kernel_linux && linux-mod_pkg_postrm
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-418.43-r1.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-418.43-r1.ebuild
new file mode 100644
index 00000000000..422f58398a8
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-418.43-r1.ebuild
@@ -0,0 +1,585 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit eutils flag-o-matic linux-info linux-mod multilib-minimal nvidia-driver \
+	portability toolchain-funcs unpacker user udev
+
+DESCRIPTION="NVIDIA Accelerated Graphics Driver"
+HOMEPAGE="http://www.nvidia.com/"
+
+AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
+AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
+ARM_NV_PACKAGE="NVIDIA-Linux-armv7l-gnueabihf-${PV}"
+
+NV_URI="https://us.download.nvidia.com/XFree86/"
+SRC_URI="
+	amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
+	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
+	tools? (
+		https://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2
+	)
+"
+
+LICENSE="GPL-2 NVIDIA-r2"
+SLOT="0/${PV%.*}"
+KEYWORDS="-* ~amd64 ~amd64-fbsd"
+RESTRICT="bindist mirror"
+EMULTILIB_PKG="true"
+
+IUSE="acpi compat +driver gtk3 kernel_FreeBSD kernel_linux +kms multilib static-libs +tools uvm wayland +X"
+REQUIRED_USE="
+	tools? ( X )
+	static-libs? ( tools )
+"
+
+COMMON="
+	app-eselect/eselect-opencl
+	kernel_linux? ( >=sys-libs/glibc-2.6.1 )
+	tools? (
+		dev-libs/atk
+		dev-libs/glib:2
+		dev-libs/jansson
+		gtk3? (
+			x11-libs/gtk+:3
+		)
+		x11-libs/cairo
+		x11-libs/gdk-pixbuf[X]
+		x11-libs/gtk+:2
+		x11-libs/libX11
+		x11-libs/libXext
+		x11-libs/libXrandr
+		x11-libs/libXv
+		x11-libs/libXxf86vm
+		x11-libs/pango[X]
+	)
+	X? (
+		>=app-eselect/eselect-opengl-1.0.9
+		app-misc/pax-utils
+	)
+"
+DEPEND="
+	${COMMON}
+	kernel_linux? ( virtual/linux-sources )
+	tools? ( sys-apps/dbus )
+"
+RDEPEND="
+	${COMMON}
+	acpi? ( sys-power/acpid )
+	tools? ( !media-video/nvidia-settings )
+	wayland? ( dev-libs/wayland[${MULTILIB_USEDEP}] )
+	X? (
+		<x11-base/xorg-server-1.20.99:=
+		>=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
+		>=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
+		>=x11-libs/libvdpau-1.0[${MULTILIB_USEDEP}]
+		sys-libs/zlib[${MULTILIB_USEDEP}]
+	)
+"
+QA_PREBUILT="opt/* usr/lib*"
+S=${WORKDIR}/
+
+nvidia_drivers_versions_check() {
+	if use amd64 && has_multilib_profile && \
+		[ "${DEFAULT_ABI}" != "amd64" ]; then
+		eerror "This ebuild doesn't currently support changing your default ABI"
+		die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
+	fi
+
+	if use kernel_linux && kernel_is ge 5 1; then
+		ewarn "Gentoo supports kernels which are supported by NVIDIA"
+		ewarn "which are limited to the following kernels:"
+		ewarn "<sys-kernel/gentoo-sources-5.1"
+		ewarn "<sys-kernel/vanilla-sources-5.1"
+		ewarn ""
+		ewarn "You are free to utilize epatch_user to provide whatever"
+		ewarn "support you feel is appropriate, but will not receive"
+		ewarn "support as a result of those changes."
+		ewarn ""
+		ewarn "Do not file a bug report about this."
+		ewarn ""
+	fi
+
+	# Since Nvidia ships many different series of drivers, we need to give the user
+	# some kind of guidance as to what version they should install. This tries
+	# to point the user in the right direction but can't be perfect. check
+	# nvidia-driver.eclass
+	nvidia-driver-check-warning
+
+	# Kernel features/options to check for
+	CONFIG_CHECK="!DEBUG_MUTEXES !I2C_NVIDIA_GPU ~!LOCKDEP ~MTRR ~SYSVIPC ~ZONE_DMA"
+
+	# Now do the above checks
+	use kernel_linux && check_extra_config
+}
+
+pkg_pretend() {
+	nvidia_drivers_versions_check
+}
+
+pkg_setup() {
+	nvidia_drivers_versions_check
+
+	# try to turn off distcc and ccache for people that have a problem with it
+	export DISTCC_DISABLE=1
+	export CCACHE_DISABLE=1
+
+	if use driver && use kernel_linux; then
+		MODULE_NAMES="nvidia(video:${S}/kernel)"
+		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
+		use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel) nvidia-drm(video:${S}/kernel)"
+
+		# This needs to run after MODULE_NAMES (so that the eclass checks
+		# whether the kernel supports loadable modules) but before BUILD_PARAMS
+		# is set (so that KV_DIR is populated).
+		linux-mod_pkg_setup
+
+		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
+		SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
+
+		# linux-mod_src_compile calls set_arch_to_kernel, which
+		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
+		# expects x86_64 or i386 and then converts it to x86
+		# later on in the build process
+		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
+	fi
+
+	if use kernel_linux && kernel_is lt 2 6 9; then
+		eerror "You must build this against 2.6.9 or higher kernels."
+	fi
+
+	# set variables to where files are in the package structure
+	if use kernel_FreeBSD; then
+		use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
+		NV_DOC="${S}/doc"
+		NV_OBJ="${S}/obj"
+		NV_SRC="${S}/src"
+		NV_MAN="${S}/x11/man"
+		NV_X11="${S}/obj"
+		NV_SOVER=1
+	elif use kernel_linux; then
+		NV_DOC="${S}"
+		NV_OBJ="${S}"
+		NV_SRC="${S}/kernel"
+		NV_MAN="${S}"
+		NV_X11="${S}"
+		NV_SOVER=${PV}
+	else
+		die "Could not determine proper NVIDIA package"
+	fi
+}
+
+src_prepare() {
+	local man_file
+	for man_file in "${NV_MAN}"/*1.gz; do
+		gunzip $man_file || die
+	done
+
+	if use tools; then
+		cp "${FILESDIR}"/nvidia-settings-linker.patch "${WORKDIR}" || die
+		sed -i \
+			-e "s:@PV@:${PV}:g" \
+			"${WORKDIR}"/nvidia-settings-linker.patch || die
+		eapply "${WORKDIR}"/nvidia-settings-linker.patch
+	fi
+
+	default
+
+	if ! [ -f nvidia_icd.json ]; then
+		cp nvidia_icd.json.template nvidia_icd.json || die
+		sed -i -e 's:__NV_VK_ICD__:libGLX_nvidia.so.0:g' nvidia_icd.json || die
+	fi
+}
+
+src_compile() {
+	# This is already the default on Linux, as there's no toplevel Makefile, but
+	# on FreeBSD there's one and triggers the kernel module build, as we install
+	# it by itself, pass this.
+
+	cd "${NV_SRC}"
+	if use kernel_FreeBSD; then
+		MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
+			LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
+	elif use driver && use kernel_linux; then
+		BUILD_TARGETS=module linux-mod_src_compile \
+			KERNELRELEASE="${KV_FULL}" \
+			src="${KERNEL_DIR}"
+	fi
+
+	if use tools; then
+		emake -C "${S}"/nvidia-settings-${PV}/src \
+			AR="$(tc-getAR)" \
+			CC="$(tc-getCC)" \
+			DO_STRIP= \
+			LD="$(tc-getCC)" \
+			LIBDIR="$(get_libdir)" \
+			NVLD="$(tc-getLD)" \
+			NV_VERBOSE=1 \
+			RANLIB="$(tc-getRANLIB)" \
+			build-xnvctrl
+
+		emake -C "${S}"/nvidia-settings-${PV}/src \
+			CC="$(tc-getCC)" \
+			DO_STRIP= \
+			GTK3_AVAILABLE=$(usex gtk3 1 0) \
+			LD="$(tc-getCC)" \
+			LIBDIR="$(get_libdir)" \
+			NVLD="$(tc-getLD)" \
+			NVML_ENABLED=0 \
+			NV_USE_BUNDLED_LIBJANSSON=0 \
+			NV_VERBOSE=1
+	fi
+}
+
+# Install nvidia library:
+# the first parameter is the library to install
+# the second parameter is the provided soversion
+# the third parameter is the target directory if it is not /usr/lib
+donvidia() {
+	# Full path to library
+	nv_LIB="${1}"
+
+	# SOVER to use
+	nv_SOVER="$(scanelf -qF'%S#F' ${nv_LIB})"
+
+	# Where to install
+	nv_DEST="${2}"
+
+	# Get just the library name
+	nv_LIBNAME=$(basename "${nv_LIB}")
+
+	if [[ "${nv_DEST}" ]]; then
+		exeinto ${nv_DEST}
+		action="doexe"
+	else
+		nv_DEST="/usr/$(get_libdir)"
+		action="dolib.so"
+	fi
+
+	# Install the library
+	${action} ${nv_LIB} || die "failed to install ${nv_LIBNAME}"
+
+	# If the library has a SONAME and SONAME does not match the library name,
+	# then we need to create a symlink
+	if [[ ${nv_SOVER} ]] && ! [[ "${nv_SOVER}" = "${nv_LIBNAME}" ]]; then
+		dosym ${nv_LIBNAME} ${nv_DEST}/${nv_SOVER} \
+			|| die "failed to create ${nv_DEST}/${nv_SOVER} symlink"
+	fi
+
+	dosym ${nv_LIBNAME} ${nv_DEST}/${nv_LIBNAME/.so*/.so} \
+		|| die "failed to create ${nv_LIBNAME/.so*/.so} symlink"
+}
+
+src_install() {
+	if use driver && use kernel_linux; then
+		linux-mod_src_install
+
+		# Add the aliases
+		# This file is tweaked with the appropriate video group in
+		# pkg_preinst, see bug #491414
+		insinto /etc/modprobe.d
+		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
+		if use uvm; then
+			doins "${FILESDIR}"/nvidia-rmmod.conf
+			udev_newrules "${FILESDIR}"/nvidia-uvm.udev-rule 99-nvidia-uvm.rules
+		else
+			sed -e 's|nvidia-uvm ||g' "${FILESDIR}"/nvidia-rmmod.conf \
+				> "${T}"/nvidia-rmmod.conf || die
+			doins "${T}"/nvidia-rmmod.conf
+		fi
+
+		# Ensures that our device nodes are created when not using X
+		exeinto "$(get_udevdir)"
+		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
+		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
+	elif use kernel_FreeBSD; then
+		if use x86-fbsd; then
+			insinto /boot/modules
+			doins "${S}/src/nvidia.kld"
+		fi
+
+		exeinto /boot/modules
+		doexe "${S}/src/nvidia.ko"
+	fi
+
+	# NVIDIA kernel <-> userspace driver config lib
+	donvidia ${NV_OBJ}/libnvidia-cfg.so.${NV_SOVER}
+
+	# NVIDIA framebuffer capture library
+	donvidia ${NV_OBJ}/libnvidia-fbc.so.${NV_SOVER}
+
+	# NVIDIA video encode/decode <-> CUDA
+	if use kernel_linux; then
+		donvidia ${NV_OBJ}/libnvcuvid.so.${NV_SOVER}
+		donvidia ${NV_OBJ}/libnvidia-encode.so.${NV_SOVER}
+	fi
+
+	if use X; then
+		# Xorg DDX driver
+		insinto /usr/$(get_libdir)/xorg/modules/drivers
+		doins ${NV_X11}/nvidia_drv.so
+
+		# Xorg GLX driver
+		donvidia ${NV_X11}/libglxserver_nvidia.so.${NV_SOVER} \
+			/usr/$(get_libdir)/xorg/modules/extensions
+
+		# Xorg nvidia.conf
+		if has_version '>=x11-base/xorg-server-1.16'; then
+			insinto /usr/share/X11/xorg.conf.d
+			newins {,50-}nvidia-drm-outputclass.conf
+		fi
+
+		insinto /usr/share/glvnd/egl_vendor.d
+		doins ${NV_X11}/10_nvidia.json
+	fi
+
+	if use wayland; then
+		insinto /usr/share/egl/egl_external_platform.d
+		doins ${NV_X11}/10_nvidia_wayland.json
+	fi
+
+	# OpenCL ICD for NVIDIA
+	if use kernel_linux; then
+		insinto /etc/OpenCL/vendors
+		doins ${NV_OBJ}/nvidia.icd
+	fi
+
+	# Documentation
+	if use kernel_FreeBSD; then
+		dodoc "${NV_DOC}/README"
+		use X && doman "${NV_MAN}"/nvidia-xconfig.1
+		use tools && doman "${NV_MAN}"/nvidia-settings.1
+	else
+		# Docs
+		newdoc "${NV_DOC}/README.txt" README
+		dodoc "${NV_DOC}/NVIDIA_Changelog"
+		doman "${NV_MAN}"/nvidia-smi.1
+		use X && doman "${NV_MAN}"/nvidia-xconfig.1
+		use tools && doman "${NV_MAN}"/nvidia-settings.1
+		doman "${NV_MAN}"/nvidia-cuda-mps-control.1
+	fi
+
+	docinto html
+	dodoc -r ${NV_DOC}/html/*
+
+	# Helper Apps
+	exeinto /opt/bin/
+
+	if use X; then
+		doexe ${NV_OBJ}/nvidia-xconfig
+
+		insinto /etc/vulkan/icd.d
+		doins nvidia_icd.json
+	fi
+
+	if use kernel_linux; then
+		doexe ${NV_OBJ}/nvidia-cuda-mps-control
+		doexe ${NV_OBJ}/nvidia-cuda-mps-server
+		doexe ${NV_OBJ}/nvidia-debugdump
+		doexe ${NV_OBJ}/nvidia-persistenced
+		doexe ${NV_OBJ}/nvidia-smi
+
+		# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
+		doexe ${NV_OBJ}/nvidia-modprobe
+		fowners root:video /opt/bin/nvidia-modprobe
+		fperms 4710 /opt/bin/nvidia-modprobe
+		dosym /{opt,usr}/bin/nvidia-modprobe
+
+		doman nvidia-cuda-mps-control.1
+		doman nvidia-modprobe.1
+		doman nvidia-persistenced.1
+		newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
+		newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
+		newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
+	fi
+
+	if use tools; then
+		emake -C "${S}"/nvidia-settings-${PV}/src/ \
+			DESTDIR="${D}" \
+			GTK3_AVAILABLE=$(usex gtk3 1 0) \
+			LIBDIR="${D}/usr/$(get_libdir)" \
+			NV_USE_BUNDLED_LIBJANSSON=0 \
+			NV_VERBOSE=1 \
+			PREFIX=/usr \
+			DO_STRIP= \
+			install
+
+		if use static-libs; then
+			dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
+
+			insinto /usr/include/NVCtrl
+			doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
+		fi
+
+		insinto /usr/share/nvidia/
+		doins nvidia-application-profiles-${PV}-key-documentation
+
+		insinto /etc/nvidia
+		newins \
+			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
+
+		# There is no icon in the FreeBSD tarball.
+		use kernel_FreeBSD || \
+			doicon ${NV_OBJ}/nvidia-settings.png
+
+		domenu "${FILESDIR}"/nvidia-settings.desktop
+
+		exeinto /etc/X11/xinit/xinitrc.d
+		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
+	fi
+
+	dobin ${NV_OBJ}/nvidia-bug-report.sh
+
+	if has_multilib_profile && use multilib; then
+		local OABI=${ABI}
+		for ABI in $(get_install_abis); do
+			src_install-libs
+		done
+		ABI=${OABI}
+		unset OABI
+	else
+		src_install-libs
+	fi
+
+	is_final_abi || die "failed to iterate through all ABIs"
+
+	readme.gentoo_create_doc
+}
+
+src_install-libs() {
+	local inslibdir=$(get_libdir)
+	local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
+	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
+	local nv_libdir="${NV_OBJ}"
+
+	if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
+		nv_libdir="${NV_OBJ}"/32
+	fi
+
+	if use X; then
+		NV_GLX_LIBRARIES=(
+			"libEGL.so.$(usex compat ${NV_SOVER} 1.1.0) ${GL_ROOT}"
+			"libEGL_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGL.so.$(usex compat ${NV_SOVER} 1.7.0) ${GL_ROOT}"
+			"libGLESv1_CM.so.1.2.0 ${GL_ROOT}"
+			"libGLESv1_CM_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGLESv2.so.2.1.0 ${GL_ROOT}"
+			"libGLESv2_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGLX.so.0 ${GL_ROOT}"
+			"libGLX_nvidia.so.${NV_SOVER} ${GL_ROOT}"
+			"libGLdispatch.so.0 ${GL_ROOT}"
+			"libOpenCL.so.1.0.0 ${CL_ROOT}"
+			"libOpenGL.so.0 ${GL_ROOT}"
+			"libcuda.so.${NV_SOVER}"
+			"libnvcuvid.so.${NV_SOVER}"
+			"libnvidia-compiler.so.${NV_SOVER}"
+			"libnvidia-eglcore.so.${NV_SOVER}"
+			"libnvidia-encode.so.${NV_SOVER}"
+			"libnvidia-fatbinaryloader.so.${NV_SOVER}"
+			"libnvidia-fbc.so.${NV_SOVER}"
+			"libnvidia-glcore.so.${NV_SOVER}"
+			"libnvidia-glsi.so.${NV_SOVER}"
+			"libnvidia-glvkspirv.so.${NV_SOVER}"
+			"libnvidia-ifr.so.${NV_SOVER}"
+			"libnvidia-opencl.so.${NV_SOVER}"
+			"libnvidia-ptxjitcompiler.so.${NV_SOVER}"
+			"libvdpau_nvidia.so.${NV_SOVER}"
+		)
+
+		if use wayland && has_multilib_profile && [[ ${ABI} == "amd64" ]];
+		then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-egl-wayland.so.1.1.2"
+			)
+		fi
+
+		if use kernel_FreeBSD; then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-tls.so.${NV_SOVER}"
+			)
+		fi
+
+		if use kernel_linux; then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-ml.so.${NV_SOVER}"
+				"libnvidia-tls.so.${NV_SOVER}"
+			)
+		fi
+
+		if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
+		then
+			NV_GLX_LIBRARIES+=(
+				"libnvidia-cbl.so.${NV_SOVER}"
+				"libnvidia-rtcore.so.${NV_SOVER}"
+				"libnvoptix.so.${NV_SOVER}"
+			)
+		fi
+
+		for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
+			donvidia "${nv_libdir}"/${NV_LIB}
+		done
+	fi
+}
+
+pkg_preinst() {
+	if use driver && use kernel_linux; then
+		linux-mod_pkg_preinst
+
+		local videogroup="$(egetent group video | cut -d ':' -f 3)"
+		if [ -z "${videogroup}" ]; then
+			eerror "Failed to determine the video group gid"
+			die "Failed to determine the video group gid"
+		else
+			sed -i \
+				-e "s:PACKAGE:${PF}:g" \
+				-e "s:VIDEOGID:${videogroup}:" \
+				"${D}"/etc/modprobe.d/nvidia.conf || die
+		fi
+	fi
+
+	# Clean the dynamic libGL stuff's home to ensure
+	# we dont have stale libs floating around
+	if [ -d "${ROOT}"/usr/lib/opengl/nvidia ]; then
+		rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
+	fi
+	# Make sure we nuke the old nvidia-glx's env.d file
+	if [ -e "${ROOT}"/etc/env.d/09nvidia ]; then
+		rm -f "${ROOT}"/etc/env.d/09nvidia
+	fi
+}
+
+pkg_postinst() {
+	use driver && use kernel_linux && linux-mod_pkg_postinst
+
+	# Switch to the nvidia implementation
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
+	"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
+
+	readme.gentoo_print_elog
+
+	if ! use X; then
+		elog "You have elected to not install the X.org driver. Along with"
+		elog "this the OpenGL libraries and VDPAU libraries were not"
+		elog "installed. Additionally, once the driver is loaded your card"
+		elog "and fan will run at max speed which may not be desirable."
+		elog "Use the 'nvidia-smi' init script to have your card and fan"
+		elog "speed scale appropriately."
+		elog
+	fi
+	if ! use tools; then
+		elog "USE=tools controls whether the nvidia-settings application"
+		elog "is installed. If you would like to use it, enable that"
+		elog "flag and re-emerge this ebuild. Optionally you can install"
+		elog "media-video/nvidia-settings"
+		elog
+	fi
+}
+
+pkg_prerm() {
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+	use driver && use kernel_linux && linux-mod_pkg_postrm
+	use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: x11-drivers/nvidia-drivers/, x11-drivers/nvidia-drivers/files/
@ 2019-11-29  1:59 Mike Gilbert
  0 siblings, 0 replies; 33+ messages in thread
From: Mike Gilbert @ 2019-11-29  1:59 UTC (permalink / raw
  To: gentoo-commits

commit:     f4c7b2f1e880a4795ee529180369f60658f565f2
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 29 01:57:48 2019 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Fri Nov 29 01:57:48 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f4c7b2f1

x11-drivers/nvidia-drivers: fix udev rule syntax

Closes: https://bugs.gentoo.org/697538
Package-Manager: Portage-2.3.79_p3, Repoman-2.3.18_p2
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 x11-drivers/nvidia-drivers/files/nvidia-uvm.udev-rule                   | 2 +-
 .../{nvidia-drivers-390.129.ebuild => nvidia-drivers-390.129-r1.ebuild} | 0
 .../{nvidia-drivers-390.132.ebuild => nvidia-drivers-390.132-r1.ebuild} | 0
 .../{nvidia-drivers-430.64.ebuild => nvidia-drivers-430.64-r1.ebuild}   | 0
 .../{nvidia-drivers-435.21.ebuild => nvidia-drivers-435.21-r1.ebuild}   | 0
 .../{nvidia-drivers-440.31.ebuild => nvidia-drivers-440.31-r1.ebuild}   | 0
 .../{nvidia-drivers-440.36.ebuild => nvidia-drivers-440.36-r1.ebuild}   | 0
 7 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-uvm.udev-rule b/x11-drivers/nvidia-drivers/files/nvidia-uvm.udev-rule
index 3df8a3ab07f..0602a4353fe 100644
--- a/x11-drivers/nvidia-drivers/files/nvidia-uvm.udev-rule
+++ b/x11-drivers/nvidia-drivers/files/nvidia-uvm.udev-rule
@@ -1 +1 @@
-KERNEL=="nvidia_uvm", RUN+="/bin/bash -c '/bin/mknod -m 660 /dev/nvidia-uvm c $(grep nvidia-uvm /proc/devices | cut -d \  -f 1) 0; /bin/chgrp video /dev/nvidia-uvm'"
+KERNEL=="nvidia_uvm", RUN+="/bin/bash -c '/bin/mknod -m 660 /dev/nvidia-uvm c $$(grep nvidia-uvm /proc/devices | cut -d \  -f 1) 0; /bin/chgrp video /dev/nvidia-uvm'"

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-390.129.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-390.129-r1.ebuild
similarity index 100%
rename from x11-drivers/nvidia-drivers/nvidia-drivers-390.129.ebuild
rename to x11-drivers/nvidia-drivers/nvidia-drivers-390.129-r1.ebuild

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-390.132.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-390.132-r1.ebuild
similarity index 100%
rename from x11-drivers/nvidia-drivers/nvidia-drivers-390.132.ebuild
rename to x11-drivers/nvidia-drivers/nvidia-drivers-390.132-r1.ebuild

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-430.64.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-430.64-r1.ebuild
similarity index 100%
rename from x11-drivers/nvidia-drivers/nvidia-drivers-430.64.ebuild
rename to x11-drivers/nvidia-drivers/nvidia-drivers-430.64-r1.ebuild

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-435.21.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-435.21-r1.ebuild
similarity index 100%
rename from x11-drivers/nvidia-drivers/nvidia-drivers-435.21.ebuild
rename to x11-drivers/nvidia-drivers/nvidia-drivers-435.21-r1.ebuild

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-440.31.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-440.31-r1.ebuild
similarity index 100%
rename from x11-drivers/nvidia-drivers/nvidia-drivers-440.31.ebuild
rename to x11-drivers/nvidia-drivers/nvidia-drivers-440.31-r1.ebuild

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-440.36.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-440.36-r1.ebuild
similarity index 100%
rename from x11-drivers/nvidia-drivers/nvidia-drivers-440.36.ebuild
rename to x11-drivers/nvidia-drivers/nvidia-drivers-440.36-r1.ebuild


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: x11-drivers/nvidia-drivers/, x11-drivers/nvidia-drivers/files/
@ 2020-08-25 17:44 Matt Turner
  0 siblings, 0 replies; 33+ messages in thread
From: Matt Turner @ 2020-08-25 17:44 UTC (permalink / raw
  To: gentoo-commits

commit:     cb335d5d9efcb79e99a8c8fc2fbce91610050bcd
Author:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 25 17:12:58 2020 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Tue Aug 25 17:42:45 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cb335d5d

x11-drivers/nvidia-drivers: Add xorg.conf file to set ModulePath

Closes: https://bugs.gentoo.org/713546
Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>

 x11-drivers/nvidia-drivers/files/nvidia-390.conf                   | 7 +++++++
 ...-drivers-390.138-r1.ebuild => nvidia-drivers-390.138-r2.ebuild} | 3 +++
 2 files changed, 10 insertions(+)

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-390.conf b/x11-drivers/nvidia-drivers/files/nvidia-390.conf
new file mode 100644
index 00000000000..81dbfc45786
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-390.conf
@@ -0,0 +1,7 @@
+Section "OutputClass"
+    Identifier "nvidia"
+    MatchDriver "nvidia-drm"
+    Driver "nvidia"
+    Option "AllowEmptyInitialConfiguration"
+    ModulePath "/usr/lib/nvidia/xorg"
+EndSection

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-390.138-r1.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-390.138-r2.ebuild
similarity index 99%
rename from x11-drivers/nvidia-drivers/nvidia-drivers-390.138-r1.ebuild
rename to x11-drivers/nvidia-drivers/nvidia-drivers-390.138-r2.ebuild
index 783dd93a4d2..7505e7d936a 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-390.138-r1.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-390.138-r2.ebuild
@@ -343,6 +343,9 @@ src_install() {
 
 		insinto /etc/vulkan/icd.d
 		doins nvidia_icd.json
+
+		insinto /etc/X11/xorg.conf.d
+		doins "${FILESDIR}"/nvidia-390.conf
 	fi
 
 	if use kernel_linux; then


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: x11-drivers/nvidia-drivers/, x11-drivers/nvidia-drivers/files/
@ 2020-12-07 12:57 David Seifert
  0 siblings, 0 replies; 33+ messages in thread
From: David Seifert @ 2020-12-07 12:57 UTC (permalink / raw
  To: gentoo-commits

commit:     477b1935411fdc4646c5ef49a1414faeda70058d
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Mon Dec  7 12:57:41 2020 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Mon Dec  7 12:57:41 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=477b1935

x11-drivers/nvidia-drivers: Add patch for modesetting allocation failures

Bug: https://bugs.gentoo.org/755497
Package-Manager: Portage-3.0.12, Repoman-3.0.2
Suggested-by: Gregory Beauregard <gentoobugs <AT> gably.net>
Signed-off-by: David Seifert <soap <AT> gentoo.org>

 ...nvidia-drivers-455.45.01-reduce-kmalloc-limit.patch | 18 ++++++++++++++++++
 ...45.01.ebuild => nvidia-drivers-455.45.01-r1.ebuild} |  1 +
 2 files changed, 19 insertions(+)

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-455.45.01-reduce-kmalloc-limit.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-455.45.01-reduce-kmalloc-limit.patch
new file mode 100644
index 00000000000..c61033bf2a9
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-455.45.01-reduce-kmalloc-limit.patch
@@ -0,0 +1,18 @@
+Patch taken from
+  https://forums.developer.nvidia.com/t/455-23-04-page-allocation-failure-in-kernel-module-at-random-points/155250/55
+Bug: https://bugs.gentoo.org/755497
+Credits go to Gregory Beauregard for pointing this out
+
+--- a/kernel/nvidia-modeset/nvidia-modeset-linux.c
++++ b/kernel/nvidia-modeset/nvidia-modeset-linux.c
+@@ -282,8 +282,8 @@
+  * are called while nvkms_lock is held.
+  *************************************************************************/
+ 
+-/* Don't use kmalloc for allocations larger than 128k */
+-#define KMALLOC_LIMIT (128 * 1024)
++/* Don't use kmalloc for allocations larger than one page */
++#define KMALLOC_LIMIT PAGE_SIZE
+ 
+ void* NVKMS_API_CALL nvkms_alloc(size_t size, NvBool zero)
+ {

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-455.45.01.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-455.45.01-r1.ebuild
similarity index 99%
rename from x11-drivers/nvidia-drivers/nvidia-drivers-455.45.01.ebuild
rename to x11-drivers/nvidia-drivers/nvidia-drivers-455.45.01-r1.ebuild
index 836ce3fa124..f549e169c64 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-455.45.01.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-455.45.01-r1.ebuild
@@ -78,6 +78,7 @@ QA_PREBUILT="opt/* usr/lib*"
 S=${WORKDIR}/
 PATCHES=(
 	"${FILESDIR}"/${PN}-440.26-locale.patch
+	"${FILESDIR}"/${PN}-455.45.01-reduce-kmalloc-limit.patch
 )
 NV_KV_MAX_PLUS="5.10"
 CONFIG_CHECK="


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: x11-drivers/nvidia-drivers/, x11-drivers/nvidia-drivers/files/
@ 2021-03-21 15:53 David Seifert
  0 siblings, 0 replies; 33+ messages in thread
From: David Seifert @ 2021-03-21 15:53 UTC (permalink / raw
  To: gentoo-commits

commit:     26146d1510fd678538b7d02400c1eb8e66e20212
Author:     Ionen Wolkens <sudinave <AT> gmail <DOT> com>
AuthorDate: Sun Mar 21 15:52:10 2021 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Sun Mar 21 15:52:10 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=26146d15

x11-drivers/nvidia-drivers: bump to 460.67 with refactored ebuild

ebuild carries a lot of history and, rather than cleanups, it needed
something closer to a rewrite.

Bugfixes:
- Removed all udev rules to solve long standing issues (bug #454740)
- Install libraries with no X11 dependencies with USE=-X,
  notably for headless OpenCL/CUDA (bug #561706)
- Install systemd unit for persistenced + nvpd user (bug #591638)
- Add custom error message for DRM_KMS_HELPER and ensure driver
  doesn't attempt building DRM support without it (bug #603818)
- Warn about AMD SME if enabled by default (bug #652408)
- Distribute extra sources to lift RESTRICT="bindist mirror", the
  nvidia-driver.eclass is no longer used (bug #732702)
- Build modprobe and persistenced from source (bug #747145)
- Use system locations for vulkan icd/layers (bug #749600)

Others:
- Dropped IUSE=compat/multilib/kms/uvm/wayland
  > compat: was for non-GLVND variants and currently a no-op
  > multilib: obsolete, abi_x86_32 does all that's needed
  > kms/uvm: modules are loaded by nvidia-modprobe as-needed and
    there's not much sense in skipping installation. Will also save
    OpenCL/CUDA packages from having to depend on [uvm]
  > wayland: library is provided by gui-libs/egl-wayland instead which
    now also provides pkgconfig files and can be a newer version.
    optfeature warning was added for awareness.
- Dropped REQUIRED_USE, all USE can now be used independently, e.g.
  now possible to get libXNVCtrl.a (static-libs) without the
  deps-heavy USE=tools
- Dropped locale patch, the offending code it was meant to fix is gone.
- Dropped linker patch, uses right linker even with -native-symlinks.
- Added modprobe.d .conf to blacklist nouveau by default.
- Patched nvidia-modprobe to respect nvidia.conf's permissions when
  creating uvm devices, was previously created as world read-write.
- No longer installing libOpenCL.so loader (not needed to use OpenCL,
  was used by the no longer available eselect-opencl).
- nvidia-persistenced init script simplified and updated for nvpd user.
- nvidia-smi init script removed (all it did was query cards every 300
  seconds), mentioned behavior is no longer observable (fan scales
  normally without X) and it wasn't intended for this purpose.
- Removed I2C_NVIDIA_GPU check as it caused unnecessary noise for
  gentoo-kernel-bin users (built as module), and being a bad thing
  even if loaded is questionable.
- Attempt to reduce message noise. The only fatal CONFIG_CHECK is
  fairly rare so there's little reason to check twice with pkg_pretend.
- ... but added new conditional messages to explain important things
  often seen as common sense but that a new user likely won't know.
- Replaced the nvidia-driver.eclass legacy test with a compact version
  that reads supported-gpus.json (usable on >450).
- More strict deps, some may sound strange but nvidia-settings only
  use headers for some of these (dbus/Xrandr/Xv/vdpau).
  > X? libs kept separate as it's the only one needing multilib deps.
  > pax-utils now unconditional for scanelf as libraries are always
    installed. Alternatively could've generated those, but prefer to
    leave it easier to maintain for future generations.
  > virtual/opencl removed, no sense in the drivers depending on this
    and it's instead applications using opencl that should.
  > Added MODULES_OPTIONAL_USE="driver" to handle linux-mod deps
- Added MIT license for persistenced
- Added ZLIB license for supported-gpus.json
- NV_KERNEL_MAX (previously NV_KV_MAX_PLUS) set to be <=5.11 form
  rather than <5.12 given that often confused users thinking it meant
  5.12 support from quick looks.
- arm64 support "should" work but runtime untested
- And a long list of cleanups that "hopefully" won't cause new issues.

Closes: https://bugs.gentoo.org/454740
Closes: https://bugs.gentoo.org/561706
Closes: https://bugs.gentoo.org/591638
Closes: https://bugs.gentoo.org/603818
Closes: https://bugs.gentoo.org/652408
Closes: https://bugs.gentoo.org/732702
Closes: https://bugs.gentoo.org/747145
Closes: https://bugs.gentoo.org/749600
Signed-off-by: Ionen Wolkens <sudinave <AT> gmail.com>
Signed-off-by: David Seifert <soap <AT> gentoo.org>

 x11-drivers/nvidia-drivers/Manifest                |   7 +
 .../files/nvidia-blacklist-nouveau.conf            |   3 +
 .../files/nvidia-modprobe-390.141-uvm-perms.patch  |  12 +
 .../nvidia-drivers/files/nvidia-persistenced.confd |   7 +
 .../nvidia-drivers/files/nvidia-persistenced.initd |  12 +
 .../nvidia-drivers/nvidia-drivers-460.67.ebuild    | 391 +++++++++++++++++++++
 6 files changed, 432 insertions(+)

diff --git a/x11-drivers/nvidia-drivers/Manifest b/x11-drivers/nvidia-drivers/Manifest
index fd3ddf91738..a85b7fa514e 100644
--- a/x11-drivers/nvidia-drivers/Manifest
+++ b/x11-drivers/nvidia-drivers/Manifest
@@ -1,9 +1,16 @@
+DIST NVIDIA-Linux-aarch64-460.67.run 112551235 BLAKE2B cc1166454f6e8771c7fe97010906919e9f2afd74ac86321006628f90f4d8dee033c3e09b2d9cac9063fe3fd313c0b529b347bcf38c051588ca7a972617c45026 SHA512 6ba17844dd215967f2f55a6620535464f244075a13f4b2b6d0ffaeeb6d97397fae0ba0de032d971847556d7b78ac8a1010ecec5127f45eb7ec73db87b1507ca1
 DIST NVIDIA-Linux-x86-390.141.run 49589744 BLAKE2B 304672806b89885adbf8459ea99ca872769e44a42ff041a5b79ef05d113d7717f505f543441e7a2fc6c569f6d66391f0380a4f23f3e68108c8de817bf251f850 SHA512 6dfde3b54520070954b45f6bc071251084e1741f55e582b1abd806eb367e4b9ce0015615bf6a887fa784d075b3db08b6940da4163b960969773d1bdc52b4961e
 DIST NVIDIA-Linux-x86_64-390.141.run 85330901 BLAKE2B 7759d8cf6c9a75607b9a3ecd53cdd6f6a93f2f372d740a5a87d4d3f41a22f3bd953cc7dd6a0dc0e23a829ec86df8d65b9de499a76cfd4266a13b0aa3288aceb5 SHA512 5448d70e6e64a6403e61a004d83c69a442dd8ed0d61da3a31d3e3b7943c06c559a66b0f8d135982868ecbf209a965f60dae1a633367630b4d9287f725bbaa53c
 DIST NVIDIA-Linux-x86_64-450.102.04.run 141391114 BLAKE2B 019f928464b23d2a86bfdd255b7651e3cfe2b0b6ebf58d1b4a6ba1f27990e1d050d1e2429ba4aa60b966b04e775939084a04d82d1dd3482a10b39375b17b1c31 SHA512 1d13de540da36274a360ea6bcd1ce01eaae103fe417b42aa8f9ac757c382b06da455a78cf6798310179f90e2afeadf3a8c9f3398186490c3c0f9079021e850ed
 DIST NVIDIA-Linux-x86_64-460.39.run 178310565 BLAKE2B 65931f34ff47de02933797f60128c66c8774f3b217b79e82f781cd50560835ec79c37b7e63fb50231a22646f0cd7cf968d1fbe1ec6c2b3732a1c565b68de7bcb SHA512 9275a58ff0e72c3ee033bd18fa9e9dbb0203d2961a63e7cc04444889118eb4029c60bb10c2af8f230c1aa4aa30769131ea8c01f3bc4e7453336ad9c03ba23b42
 DIST NVIDIA-Linux-x86_64-460.56.run 178496173 BLAKE2B 8f84a403ccaa9a92186cac9fb2dee9600cd29915cdacf475b6a1105772ffd52c671ef217a1201fbcd9192e858ec17796fd77b817887c79c43c266d32671fe7d0 SHA512 a61855576a27cdd2e48906ecb49cd1e9f88d14a8358aa4bdc57d59e2dfa64b394b2dcee45184d75e889fac6ebedcaaff902a07428c7f9eb011cf265228c6eb4e
+DIST NVIDIA-Linux-x86_64-460.67.run 177691692 BLAKE2B 25a7d87cc128933a98100d7c5ef37f93c3a870c096eea3228a28ef79d712ce104608f9422221cc1eadc21dccbbc8bc41ab1832795cfee75e217600ed0d76489e SHA512 80fdc023a8ce80e3a103896f28a5564bb43903af6bfc719f755c48eb225e79ec6abf219ab20eb80ada5808ef932ef5fa0fe710c6e0a07dd8a248daff2ba3b898
+DIST nvidia-installer-460.67.tar.gz 198484 BLAKE2B 0eaf3e3eccd6749e4fe89394905dded58e739f42cbc33c8a91575f4505030a216670fc8c0fd4d1d42659acf301c9ba59d4052a80c6eba6c5db84ed022acb2620 SHA512 8fff0fa13a82cb7eaf2fd1d05be509e9124e67bb05810f8937fb1f16c4a2362a5c1a50bc9a5155cfc90a9bbcee38a54fb5ae0ae164e205900a49f6d21779d54f
+DIST nvidia-modprobe-460.67.tar.gz 43140 BLAKE2B 8243d355f9d51495c9d09f25ccbcb39c0a6ef472cbfaded98f10818fae655e1cf62ff2edcf40baea72b8cca9eebc947742b2516bb057410239193201bb843538 SHA512 16c8239b54988622196e0eea113173e44ff8b60cdcdf585bf859e6440aff2c6699bb107962776e69056dd7d5e3bbd6289ea628a2255ac27e22ef79521e9baad3
+DIST nvidia-persistenced-460.67.tar.gz 53334 BLAKE2B 1354ec98fd2b95d264fd7df6219f639cf5d73173e6f0843a0880e6b18953904412cb756bd2c60432f6ae4c253d047515a9e32a128210fd94386ae6bc9a341b5c SHA512 0b4f7d8aa781c3536f6cd020225d2a3bab4b83498090419198488a2bec811534e61ba90461ae846bd09f4530f19984d77ca41edf0a851b1b700d1c0e053d537f
 DIST nvidia-settings-390.141.tar.bz2 1108755 BLAKE2B 210c33d4bb483dd9abe13275feb641a00d7c39a7222cbe828c925b9cfca6d4422f8fa3333dd77b73f2ba4071a7badf77625be88e02a1835177bda490c3c3c368 SHA512 44bf5f6b5bfbe3146f97d9ac82a75cc5653b6002002623ac6fa6cd233bbd3ef0d15f0b8091b59de5dbfdbde4fbe1b5212c9f9a1653ec98597c9049c9b137902e
 DIST nvidia-settings-450.102.04.tar.bz2 1057126 BLAKE2B 4e27ac75441d455122860b3834f2584e4736fff1f641e9a1d3ced4a354cb0e0e35c4e7a71e7bc05940d585e0ceca576f726fdfffbb84aae8057d06355b91293f SHA512 33f27b9a2832f7f24603d3a741b6c34cdd3f27a7075b523f8b98ae89325f810e13c134fcc7503e72d44a6f6c7a0d8587bfdad898a4ab5fa252bd9c7360a32341
 DIST nvidia-settings-460.39.tar.bz2 1060391 BLAKE2B badfe9e5fa3ca7f5389369b01f839aa37b687e99bac47663b320602ada4d4e8dfb7c6fa4f64cee358a25ced7d9393ddfa4242147d9b645ae4fbd1b68310f3363 SHA512 a5f01d2a627695932399804776923a90050ec66b19c9d95ed34d11fc79e41604fe25474ed7b7bfec68b2115dd6fccb444b66427ce78c1d67b1b01f072bc8892a
 DIST nvidia-settings-460.56.tar.bz2 1060604 BLAKE2B cd1480e42ab2b25b399f19b458a1d5252d1b77d263ddecbad2d61f0445ba9f0ddf81fc944ac1136c273dfd1d21d06385bcfac9bdd7a7dc02f75302a6b8276df4 SHA512 018eb3cb7f25b926aa620201979b0efaaa82e7f036c4870a1e1234f5aac3ab9cfd48846d7eedd7ed38c3035eface3f2afe1a0d5de7a67e53e6bea760aa99fa72
+DIST nvidia-settings-460.67.tar.gz 1233189 BLAKE2B 33ffceefea4e184cb1873cdce97db26637e87cd20c82bcabcbfe88bcb084ac3d833ac5688cafa33a5a89383040d5c1c5d46de9c3f9a8ba6174574aa57aea2e46 SHA512 d1828379aa477394747ae3e5d3505e864d38a349dd159a04cb263613380afea9aea2081300b0d2b8ae205b800bfe6e8ba504e612989da394d757f00e4399b617
+DIST nvidia-xconfig-460.67.tar.gz 142323 BLAKE2B 09c7281de09a2c2968b5f4a48eca63110e6db988429c844b55f8efc28fbcd9d44c79ad47149c25f657c2a98ae7576c01b2c9b7f643b8321fe1393adc571ebcaa SHA512 0e65c81ec40d3eaeec036fbd8f46a3052a75ff0ad200c58438ff6c782a5764e62e51d03b4a2080770c32522894641288ac495f62bc39c3d5658b1ff87c9f6cdd

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-blacklist-nouveau.conf b/x11-drivers/nvidia-drivers/files/nvidia-blacklist-nouveau.conf
new file mode 100644
index 00000000000..b15fe0a3d92
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-blacklist-nouveau.conf
@@ -0,0 +1,3 @@
+# NVIDIA's official drivers and nouveau cannot be used at same time.
+# Comment out the following line if you wish to allow nouveau.
+blacklist nouveau

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-modprobe-390.141-uvm-perms.patch b/x11-drivers/nvidia-drivers/files/nvidia-modprobe-390.141-uvm-perms.patch
new file mode 100644
index 00000000000..6ffd42ff77e
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-modprobe-390.141-uvm-perms.patch
@@ -0,0 +1,12 @@
+Create /dev/nvidia-uvm* by respecting nvidia.conf's permissions.
+--- a/nvidia-modprobe/modprobe-utils/nvidia-modprobe-utils.c
++++ b/nvidia-modprobe/modprobe-utils/nvidia-modprobe-utils.c
+@@ -742,6 +742,6 @@
+     }
+ 
+-    return mknod_helper(major, base_minor, NV_UVM_DEVICE_NAME, NULL) &&
+-           mknod_helper(major, base_minor + 1, NV_UVM_TOOLS_DEVICE_NAME, NULL);
++    return mknod_helper(major, base_minor, NV_UVM_DEVICE_NAME, NV_PROC_REGISTRY_PATH) &&
++           mknod_helper(major, base_minor + 1, NV_UVM_TOOLS_DEVICE_NAME, NV_PROC_REGISTRY_PATH);
+ }
+ 

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-persistenced.confd b/x11-drivers/nvidia-drivers/files/nvidia-persistenced.confd
new file mode 100644
index 00000000000..e06d53c0c98
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-persistenced.confd
@@ -0,0 +1,7 @@
+# configuration file for /etc/init.d/nvidia-persistenced
+
+# NVPD_USER: user to run as, needs access to /dev/nvidia* (video group)
+NVPD_USER="nvpd"
+
+# ARGS: additional arguments, see nvidia-persistenced(1)
+ARGS=""

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-persistenced.initd b/x11-drivers/nvidia-drivers/files/nvidia-persistenced.initd
new file mode 100644
index 00000000000..e199efc1e54
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-persistenced.initd
@@ -0,0 +1,12 @@
+#!/sbin/openrc-run
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+description="Maintain persistent software state in the NVIDIA driver"
+command="nvidia-persistenced"
+command_args="${NVPD_USER:+--user ${NVPD_USER}} ${ARGS}"
+pidfile="/var/run/nvidia-persistenced/nvidia-persistenced.pid"
+
+stop_post() {
+	rmdir "${pidfile%/*}" 2>/dev/null || true
+}

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-460.67.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-460.67.ebuild
new file mode 100644
index 00000000000..40107b838e5
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-460.67.ebuild
@@ -0,0 +1,391 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+MODULES_OPTIONAL_USE="driver"
+inherit desktop linux-info linux-mod multilib-build \
+	optfeature systemd toolchain-funcs unpacker
+
+NV_KERNEL_MAX="5.11"
+NV_BIN_URI="https://download.nvidia.com/XFree86/Linux-"
+NV_GIT_URI="https://github.com/NVIDIA/nvidia-"
+
+DESCRIPTION="NVIDIA Accelerated Graphics Driver"
+HOMEPAGE="https://www.nvidia.com/download/index.aspx"
+SRC_URI="
+	amd64? ( ${NV_BIN_URI}x86_64/${PV}/NVIDIA-Linux-x86_64-${PV}.run )
+	arm64? ( ${NV_BIN_URI}aarch64/${PV}/NVIDIA-Linux-aarch64-${PV}.run )
+	${NV_GIT_URI}installer/archive/${PV}.tar.gz -> nvidia-installer-${PV}.tar.gz
+	${NV_GIT_URI}modprobe/archive/${PV}.tar.gz -> nvidia-modprobe-${PV}.tar.gz
+	${NV_GIT_URI}persistenced/archive/${PV}.tar.gz -> nvidia-persistenced-${PV}.tar.gz
+	${NV_GIT_URI}settings/archive/${PV}.tar.gz -> nvidia-settings-${PV}.tar.gz
+	${NV_GIT_URI}xconfig/archive/${PV}.tar.gz -> nvidia-xconfig-${PV}.tar.gz"
+# nvidia-installer is unused but here for GPL-2's "distribute sources"
+S="${WORKDIR}"
+
+LICENSE="GPL-2 MIT NVIDIA-r2 ZLIB"
+SLOT="0/${PV%%.*}"
+KEYWORDS="-* ~amd64"
+IUSE="+X +driver static-libs +tools"
+
+COMMON_DEPEND="
+	acct-group/video
+	acct-user/nvpd
+	net-libs/libtirpc
+	tools? (
+		dev-libs/atk
+		dev-libs/glib:2
+		dev-libs/jansson
+		x11-libs/cairo
+		x11-libs/gdk-pixbuf:2
+		x11-libs/gtk+:3
+		x11-libs/libX11
+		x11-libs/libXext
+		x11-libs/libXxf86vm
+		x11-libs/pango
+	)"
+RDEPEND="
+	${COMMON_DEPEND}
+	X? (
+		media-libs/libglvnd[X,${MULTILIB_USEDEP}]
+		x11-libs/libX11[${MULTILIB_USEDEP}]
+		x11-libs/libXext[${MULTILIB_USEDEP}]
+	)"
+DEPEND="
+	${COMMON_DEPEND}
+	static-libs? (
+		x11-libs/libX11
+		x11-libs/libXext
+	)
+	tools? (
+		media-libs/libglvnd
+		sys-apps/dbus
+		x11-base/xorg-proto
+		x11-libs/libXrandr
+		x11-libs/libXv
+		x11-libs/libvdpau
+	)"
+BDEPEND="
+	app-misc/pax-utils
+	virtual/pkgconfig"
+
+QA_PREBUILT="opt/* usr/lib*"
+
+CONFIG_CHECK="
+	~DRM_KMS_HELPER
+	~SYSVIPC
+	~!AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT
+	~!LOCKDEP
+	!DEBUG_MUTEXES"
+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.
+	Cannot be directly selected in the kernel's menuconfig, so enable
+	options such as CONFIG_DRM_FBDEV_EMULATION instead."
+
+PATCHES=(
+	"${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch
+)
+DOCS=(
+	README.txt NVIDIA_Changelog supported-gpus/supported-gpus.json
+	nvidia-settings/doc/{FRAMELOCK,NV-CONTROL-API}.txt
+)
+HTML_DOCS=( html/. )
+
+pkg_setup() {
+	use driver || return
+	BUILD_PARAMS='NV_VERBOSE=1 IGNORE_CC_MISMATCH=yes SYSSRC="${KERNEL_DIR}"'
+	BUILD_TARGETS="modules" # defaults' clean sometimes deletes modules
+	MODULE_NAMES="
+		nvidia(video:kernel)
+		nvidia-drm(video:kernel)
+		nvidia-modeset(video:kernel)
+		nvidia-uvm(video:kernel)"
+	linux-mod_pkg_setup
+
+	if [[ ${MERGE_TYPE} != binary ]] && kernel_is gt ${NV_KERNEL_MAX/./ }; then
+		ewarn "Kernel ${KV_MAJOR}.${KV_MINOR} is either known to break this version of nvidia-drivers"
+		ewarn "or was not tested with it. It is recommended to use one of:"
+		ewarn "  <=sys-kernel/gentoo-kernel-${NV_KERNEL_MAX}"
+		ewarn "  <=sys-kernel/gentoo-sources-${NV_KERNEL_MAX}"
+		ewarn "You are free to try or use /etc/portage/patches, but support will"
+		ewarn "not be given and issues wait until NVIDIA releases a fixed version."
+		ewarn
+		ewarn "Do _not_ file a bug report if run into issues."
+		ewarn
+	fi
+}
+
+src_prepare() {
+	# make user patches usable across versions
+	rm nvidia-modprobe && mv nvidia-modprobe{-${PV},} || die
+	rm nvidia-persistenced && mv nvidia-persistenced{-${PV},} || die
+	rm nvidia-settings && mv nvidia-settings{-${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)/' \
+		-i kernel/conftest.sh || die
+
+	sed -e '/Exec=\|Icon=/s/_.*/nvidia-settings/' \
+		-e '/Categories=/s/_.*/System;Settings;/' \
+		-i nvidia-settings/doc/nvidia-settings.desktop || die
+
+	# remove gtk2 support (bug #592730)
+	sed '/^GTK2LIB = /d;/INSTALL.*GTK2LIB/,+1d' \
+		-i nvidia-settings/src/Makefile || die
+
+	sed 's/__USER__/nvpd/' \
+		nvidia-persistenced/init/systemd/nvidia-persistenced.service.template \
+		> nvidia-persistenced.service || die
+
+	gzip -d nvidia-{cuda-mps-control,smi}.1.gz || die
+}
+
+nvidia-drivers_make() {
+	emake -C nvidia-${1} ${2} \
+		DESTDIR="${ED}" PREFIX=/usr LIBDIR="${ED}/usr/$(get_libdir)" \
+		HOST_CC="$(tc-getBUILD_CC)" HOST_LD="$(tc-getBUILD_LD)" \
+		DO_STRIP= MANPAGE_GZIP= \
+		NV_USE_BUNDLED_LIBJANSSON=0 NV_VERBOSE=1 OUTPUTDIR=out
+}
+
+src_compile() {
+	tc-export AR CC LD OBJCOPY
+	# may no longer be relevant but kept as a safety
+	export DISTCC_DISABLE=1 CCACHE_DISABLE=1
+
+	use driver && linux-mod_src_compile
+
+	nvidia-drivers_make modprobe
+	nvidia-drivers_make persistenced
+	use X && nvidia-drivers_make xconfig
+
+	if use tools; then
+		nvidia-drivers_make settings
+	elif use static-libs; then
+		nvidia-drivers_make settings/src out/libXNVCtrl.a
+	fi
+}
+
+nvidia-drivers_libs_install() {
+	local libs=(
+		EGL_nvidia
+		GLESv1_CM_nvidia
+		GLESv2_nvidia
+		cuda
+		nvcuvid
+		nvidia-allocator
+		nvidia-eglcore
+		nvidia-encode
+		nvidia-glcore
+		nvidia-glsi
+		nvidia-glvkspirv
+		nvidia-ml
+		nvidia-opencl
+		nvidia-opticalflow
+		nvidia-ptxjitcompiler
+		nvidia-tls
+	)
+	use amd64 && libs+=( nvidia-compiler )
+
+	if use X; then
+		libs+=(
+			GLX_nvidia
+			vdpau_nvidia
+		)
+		if use amd64; then
+			libs+=(
+				nvidia-fbc
+				nvidia-ifr
+			)
+		fi
+	fi
+
+	local libdir=.
+	if multilib_is_native_abi; then
+		libs+=(
+			nvidia-cbl
+			nvidia-cfg
+			nvidia-rtcore
+			nvoptix
+		)
+		use amd64 && libs+=( nvidia-ngx )
+	else
+		libdir+=/32
+	fi
+
+	local lib soname
+	for lib in "${libs[@]}"; do
+		[[ ${lib:0:3} != lib ]] && lib=lib${lib}.so.${PV}
+
+		# auto-detect soname and create appropriate symlinks
+		soname=$(scanelf -qF'%S#F' "${lib}") || die "Scanning ${lib} failed"
+		if [[ ${soname} && ${soname} != ${lib} ]]; then
+			ln -s ${lib} ${libdir}/${soname} || die
+		fi
+		ln -s ${lib} ${libdir}/${lib%.so*}.so || die
+
+		dolib.so ${libdir}/${lib%.so*}*
+	done
+}
+
+src_install() {
+	if use driver; then
+		linux-mod_src_install
+
+		insinto /etc/modprobe.d
+		newins "${FILESDIR}"/nvidia-460.conf nvidia.conf
+		doins "${FILESDIR}"/nvidia-blacklist-nouveau.conf
+		doins "${FILESDIR}"/nvidia-rmmod.conf
+
+		# used for gpu verification with binpkgs (not kept)
+		insinto /usr/share/nvidia
+		doins supported-gpus/supported-gpus.json
+	fi
+
+	if use X; then
+		exeinto /usr/$(get_libdir)/xorg/modules/drivers
+		doexe nvidia_drv.so
+
+		exeinto /usr/$(get_libdir)/xorg/modules/extensions
+		newexe libglxserver_nvidia.so{.${PV},}
+
+		insinto /usr/share/X11/xorg.conf.d
+		newins {,50-}nvidia-drm-outputclass.conf
+
+		# vulkan icd uses libGLX_nvidia.so and so requires X
+		insinto /usr/share/vulkan/icd.d
+		doins nvidia_icd.json
+		insinto /usr/share/vulkan/implicit_layer.d
+		doins nvidia_layers.json
+	fi
+
+	insinto /usr/share/glvnd/egl_vendor.d
+	doins 10_nvidia.json
+
+	insinto /etc/OpenCL/vendors
+	doins nvidia.icd
+
+	insinto /etc/nvidia
+	newins nvidia-application-profiles{-${PV},}-rc
+
+	# install built helpers
+	nvidia-drivers_make modprobe install
+	# allow video group to load mods and create devs (bug #505092)
+	fowners root:video /usr/bin/nvidia-modprobe
+	fperms 4710 /usr/bin/nvidia-modprobe
+
+	nvidia-drivers_make persistenced install
+	newconfd "${FILESDIR}/nvidia-persistenced.confd" nvidia-persistenced
+	newinitd "${FILESDIR}/nvidia-persistenced.initd" nvidia-persistenced
+	systemd_dounit nvidia-persistenced.service
+
+	use X && nvidia-drivers_make xconfig install
+
+	if use tools; then
+		nvidia-drivers_make settings install
+		doicon nvidia-settings/doc/nvidia-settings.png
+		domenu nvidia-settings/doc/nvidia-settings.desktop
+
+		insinto /usr/share/nvidia
+		newins nvidia-application-profiles{-${PV},}-key-documentation
+
+		exeinto /etc/X11/xinit/xinitrc.d
+		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
+	fi
+
+	if use static-libs; then
+		dolib.a nvidia-settings/src/out/libXNVCtrl.a
+
+		insinto /usr/include/NVCtrl
+		doins nvidia-settings/src/libXNVCtrl/NVCtrl{Lib,}.h
+	fi
+
+	# install prebuilt-only helpers
+	exeinto /opt/bin
+
+	doexe nvidia-cuda-mps-control
+	doman nvidia-cuda-mps-control.1
+	doexe nvidia-cuda-mps-server
+
+	doexe nvidia-debugdump
+	dobin nvidia-bug-report.sh
+
+	doexe nvidia-smi
+	doman nvidia-smi.1
+
+	# install prebuilt-only libraries
+	multilib_foreach_abi nvidia-drivers_libs_install
+
+	exeinto /lib/systemd/system-sleep
+	doexe nvidia
+	dobin nvidia-sleep.sh
+	systemd_dounit *.service
+
+	einstalldocs
+}
+
+pkg_preinst() {
+	use driver || return
+	linux-mod_pkg_preinst
+
+	# set video group id based on live system (bug #491414)
+	local g=$(getent group video | cut -d: -f3)
+	[[ ${g} ]] || die "Failed to determine video group id"
+	sed "s/PACKAGE/${PF}/;s/VIDEOGID/${g}/" \
+		-i "${ED}"/etc/modprobe.d/nvidia.conf || die
+
+	# try to find driver mismatches using temporary supported-gpus.json
+	for g in $(grep -l 0x10de /sys/bus/pci/devices/*/vendor 2>/dev/null); do
+		g=$(grep -io "\"$(<${g%vendor}device)\"[^}]*branch\":\"[0-9]*" \
+			"${ED}"/usr/share/nvidia/supported-gpus.json 2>/dev/null)
+		if [[ ${g} ]]; then
+			g=$((${g##*\"}+1))
+			if ver_test -ge ${g}; then
+				NV_LEGACY_MASK=">=${CATEGORY}/${PN}-${g}"
+				break
+			fi
+		fi
+	done
+	rm "${ED}"/usr/share/nvidia/supported-gpus.json || die
+}
+
+pkg_postinst() {
+	use driver && linux-mod_pkg_postinst
+
+	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."
+	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
+			ewarn "  echo '${NV_LEGACY_MASK}' > ${EROOT}/etc/portage/package.mask/${PN}"
+		else
+			ewarn "  echo '${NV_LEGACY_MASK}' >> ${EROOT}/etc/portage/package.mask"
+		fi
+		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
+}


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: x11-drivers/nvidia-drivers/, x11-drivers/nvidia-drivers/files/
@ 2021-03-21 15:53 David Seifert
  0 siblings, 0 replies; 33+ messages in thread
From: David Seifert @ 2021-03-21 15:53 UTC (permalink / raw
  To: gentoo-commits

commit:     ad0532525ca174d7ee972e6435488b1d21845d39
Author:     Ionen Wolkens <sudinave <AT> gmail <DOT> com>
AuthorDate: Sun Mar 21 15:52:16 2021 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Sun Mar 21 15:52:16 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ad053252

x11-drivers/nvidia-drivers: revbump to sync 390.141 with 460.67

Mostly same as 460.67 minus same existing 390.xx workarounds.

Other than those:
- Given uvm flag is gone, the x86-only uvm mask is now handled
  internally with an explanation to users.
- nvidia-persistenced needed an extra workaround to find libtirpc
- fno-common patch updated for new layout
- Moved the /etc 390-specific GLX workaround to /usr/share where it
  replaces nvidia-drm-outputclass.conf
- No supported-gpus.json so no legacy check (nor ZLIB license), but
  this is as far as legacy support goes on Gentoo with 340 gone.

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

 x11-drivers/nvidia-drivers/Manifest                |   5 +
 .../files/nvidia-settings-390.141-fno-common.patch |  16 +
 .../nvidia-drivers-390.141-r1.ebuild               | 365 +++++++++++++++++++++
 3 files changed, 386 insertions(+)

diff --git a/x11-drivers/nvidia-drivers/Manifest b/x11-drivers/nvidia-drivers/Manifest
index 42a3a7005c1..58b540cb337 100644
--- a/x11-drivers/nvidia-drivers/Manifest
+++ b/x11-drivers/nvidia-drivers/Manifest
@@ -6,17 +6,22 @@ DIST NVIDIA-Linux-x86_64-450.102.04.run 141391114 BLAKE2B 019f928464b23d2a86bfdd
 DIST NVIDIA-Linux-x86_64-460.39.run 178310565 BLAKE2B 65931f34ff47de02933797f60128c66c8774f3b217b79e82f781cd50560835ec79c37b7e63fb50231a22646f0cd7cf968d1fbe1ec6c2b3732a1c565b68de7bcb SHA512 9275a58ff0e72c3ee033bd18fa9e9dbb0203d2961a63e7cc04444889118eb4029c60bb10c2af8f230c1aa4aa30769131ea8c01f3bc4e7453336ad9c03ba23b42
 DIST NVIDIA-Linux-x86_64-460.56.run 178496173 BLAKE2B 8f84a403ccaa9a92186cac9fb2dee9600cd29915cdacf475b6a1105772ffd52c671ef217a1201fbcd9192e858ec17796fd77b817887c79c43c266d32671fe7d0 SHA512 a61855576a27cdd2e48906ecb49cd1e9f88d14a8358aa4bdc57d59e2dfa64b394b2dcee45184d75e889fac6ebedcaaff902a07428c7f9eb011cf265228c6eb4e
 DIST NVIDIA-Linux-x86_64-460.67.run 177691692 BLAKE2B 25a7d87cc128933a98100d7c5ef37f93c3a870c096eea3228a28ef79d712ce104608f9422221cc1eadc21dccbbc8bc41ab1832795cfee75e217600ed0d76489e SHA512 80fdc023a8ce80e3a103896f28a5564bb43903af6bfc719f755c48eb225e79ec6abf219ab20eb80ada5808ef932ef5fa0fe710c6e0a07dd8a248daff2ba3b898
+DIST nvidia-installer-390.141.tar.gz 205299 BLAKE2B b95ddcf9a8d61247572d73faa04558564962782b0eb222601315d741d1ee71fa0636fa87d31105ecc5ec61328d3174a3ed646046e02b6b5f29f071215a0e8bdd SHA512 3848a4ec17510bf4d3060e5ef8aafa1ad921215ec39d26c54b3bbdd8a5867c46e01d247b24b05ad6906fed7fb4ae6dc37346a7da6e5aae88b5b47584c0b07a02
 DIST nvidia-installer-450.102.04.tar.gz 197642 BLAKE2B 5d94dee76057eaea236090e2eb8cba4fdf90f4959a0ae26805bc771262a0eb05640846c191f2a5a5485e0584ae07ba64d2989201118594df747c3ac13503f90d SHA512 2c1608c0dd971122978a395edc5a51de6cb76d72aac45b4f9303e1a99e292ec0ddd9c03f2e95b10c357c0da1dc2824197c2553828eedbd0c4434b431aa593f6f
 DIST nvidia-installer-460.67.tar.gz 198484 BLAKE2B 0eaf3e3eccd6749e4fe89394905dded58e739f42cbc33c8a91575f4505030a216670fc8c0fd4d1d42659acf301c9ba59d4052a80c6eba6c5db84ed022acb2620 SHA512 8fff0fa13a82cb7eaf2fd1d05be509e9124e67bb05810f8937fb1f16c4a2362a5c1a50bc9a5155cfc90a9bbcee38a54fb5ae0ae164e205900a49f6d21779d54f
+DIST nvidia-modprobe-390.141.tar.gz 39965 BLAKE2B 46c01ec3e53569454a032e42561a81154712485ffb11d0393d9e9007a3825a33c8d045ea7296dd8465ad9b2cee36a639274c55ff31c70e93d334ac9fe724f7b1 SHA512 c0abec334fee4293a55a43edbcc6a7a8cd8ff6b6fbb954b428182542a24eba90f47100977c84ea9cbe557a39fc5fb90677b4f2227f49a6f30a56f6941508f40e
 DIST nvidia-modprobe-450.102.04.tar.gz 42139 BLAKE2B 79218a4e76dacdafadd31e45a27d3578924db6a74894064ce856498121fbf9d80e7b07046dfc36426340e0cefd78b416b017202bc93858fdf8cc77ba335bbaf8 SHA512 ac9d8d8849606d7ef3772570c976e5efab36f66e83a62f959b28c88cd798bba860052033dc5eb18c0f9e4a6f2d8e6082456d9b1586977a23f240cfa3a750d7ef
 DIST nvidia-modprobe-460.67.tar.gz 43140 BLAKE2B 8243d355f9d51495c9d09f25ccbcb39c0a6ef472cbfaded98f10818fae655e1cf62ff2edcf40baea72b8cca9eebc947742b2516bb057410239193201bb843538 SHA512 16c8239b54988622196e0eea113173e44ff8b60cdcdf585bf859e6440aff2c6699bb107962776e69056dd7d5e3bbd6289ea628a2255ac27e22ef79521e9baad3
+DIST nvidia-persistenced-390.141.tar.gz 55984 BLAKE2B c4e889d15643f6e8a4e37b32d89e14acaa792c681863c74281b17e414021dc56e4692e91e7552762ef8b8ef977284ee2f307b14216a2562a9d30b2ab7a1ba522 SHA512 d9ea32c842d8d13a59128b28ce985fe3a421d2848eac30fc8a671a391c63516b58c46d3c5b21403b4e5b016577d23aebaec1f5b4e59b25a20668120f52e231a5
 DIST nvidia-persistenced-450.102.04.tar.gz 52485 BLAKE2B 1fec24c86875789303aee8bf4362c9c35f76957a2906e2682aa5c07e914cc2acde769439d88007420904a71526e9f0d03ab9d0a3c5dcd1355047e03958d006f9 SHA512 6c51daaed3e7ecdb8d98bdcf0618e50962895895f88cc45a5f861c08d3c10f590d4a6a3f0a683ce0dce0e327d5977da1a76fdde974a97031dc698120ef990b07
 DIST nvidia-persistenced-460.67.tar.gz 53334 BLAKE2B 1354ec98fd2b95d264fd7df6219f639cf5d73173e6f0843a0880e6b18953904412cb756bd2c60432f6ae4c253d047515a9e32a128210fd94386ae6bc9a341b5c SHA512 0b4f7d8aa781c3536f6cd020225d2a3bab4b83498090419198488a2bec811534e61ba90461ae846bd09f4530f19984d77ca41edf0a851b1b700d1c0e053d537f
 DIST nvidia-settings-390.141.tar.bz2 1108755 BLAKE2B 210c33d4bb483dd9abe13275feb641a00d7c39a7222cbe828c925b9cfca6d4422f8fa3333dd77b73f2ba4071a7badf77625be88e02a1835177bda490c3c3c368 SHA512 44bf5f6b5bfbe3146f97d9ac82a75cc5653b6002002623ac6fa6cd233bbd3ef0d15f0b8091b59de5dbfdbde4fbe1b5212c9f9a1653ec98597c9049c9b137902e
+DIST nvidia-settings-390.141.tar.gz 1297261 BLAKE2B 452870df1ba598692f5da47444eb2daf4db40c79cac98c10b1c994c0ff39fc7936909b9d7788cbfe784999e68a2bdbbc12e85d63c3bc02ac872e6b3c46834697 SHA512 dbf7c389bbdc94291a1b974adfa33414148b1ab752aa7d948a27e91ee1bceb3b8435aceb6b7ef3cb806333572db11b5524667045ef7686b119d7955d2699cb04
 DIST nvidia-settings-450.102.04.tar.bz2 1057126 BLAKE2B 4e27ac75441d455122860b3834f2584e4736fff1f641e9a1d3ced4a354cb0e0e35c4e7a71e7bc05940d585e0ceca576f726fdfffbb84aae8057d06355b91293f SHA512 33f27b9a2832f7f24603d3a741b6c34cdd3f27a7075b523f8b98ae89325f810e13c134fcc7503e72d44a6f6c7a0d8587bfdad898a4ab5fa252bd9c7360a32341
 DIST nvidia-settings-450.102.04.tar.gz 1229675 BLAKE2B 166b73a0e9fe1cc1c16f83128aa94f3b9ef44fc71004e80c2681299dd564df6b458b52bedfd60eaaecf6142d0ea7d5147cb9c509d4db4e6b85bc72dd4dc75751 SHA512 c514bb3cc72954a52f4821674f9b783ebc0bd8c7294a296716619ddad15f2b63f50ada47797dee1386709deb7d407cb1d6c04532b7ca6e03d84234555751c9a9
 DIST nvidia-settings-460.39.tar.bz2 1060391 BLAKE2B badfe9e5fa3ca7f5389369b01f839aa37b687e99bac47663b320602ada4d4e8dfb7c6fa4f64cee358a25ced7d9393ddfa4242147d9b645ae4fbd1b68310f3363 SHA512 a5f01d2a627695932399804776923a90050ec66b19c9d95ed34d11fc79e41604fe25474ed7b7bfec68b2115dd6fccb444b66427ce78c1d67b1b01f072bc8892a
 DIST nvidia-settings-460.56.tar.bz2 1060604 BLAKE2B cd1480e42ab2b25b399f19b458a1d5252d1b77d263ddecbad2d61f0445ba9f0ddf81fc944ac1136c273dfd1d21d06385bcfac9bdd7a7dc02f75302a6b8276df4 SHA512 018eb3cb7f25b926aa620201979b0efaaa82e7f036c4870a1e1234f5aac3ab9cfd48846d7eedd7ed38c3035eface3f2afe1a0d5de7a67e53e6bea760aa99fa72
 DIST nvidia-settings-460.67.tar.gz 1233189 BLAKE2B 33ffceefea4e184cb1873cdce97db26637e87cd20c82bcabcbfe88bcb084ac3d833ac5688cafa33a5a89383040d5c1c5d46de9c3f9a8ba6174574aa57aea2e46 SHA512 d1828379aa477394747ae3e5d3505e864d38a349dd159a04cb263613380afea9aea2081300b0d2b8ae205b800bfe6e8ba504e612989da394d757f00e4399b617
+DIST nvidia-xconfig-390.141.tar.gz 140293 BLAKE2B 08ee93be953f75dbe078c557af7c062092ce8a3b53af0735d43b7feabe6d1c99390b9533027fbc5017d207a70dfa5aecf88d211905bf8f0e846f769a6ea16c2b SHA512 9fedee2f720d86bd24e393328249bf970a1f242b9e750543e757eb13ca30f6ecfda6c63441093ab96ae28d5f38d4e55cc6de6316eb82d2a2f33074144a1eef2f
 DIST nvidia-xconfig-450.102.04.tar.gz 141072 BLAKE2B 0d299429ccb10f351de0e7b81fa7ce8199da83db346483a7d791fd77276ff6d70b46ba153cdf6503b945d80f4a0108a6ec02a3955c9d7310de901f0e3b1e6e36 SHA512 f5752d7c49d1cb3c0061caace8cf5899c8d61e76f0b7080e05d70cd77758496dd8646a1551d93a12c8ad5f9fcfd53a49c51206af96f36ec1eec7ccfe59505f2d
 DIST nvidia-xconfig-460.67.tar.gz 142323 BLAKE2B 09c7281de09a2c2968b5f4a48eca63110e6db988429c844b55f8efc28fbcd9d44c79ad47149c25f657c2a98ae7576c01b2c9b7f643b8321fe1393adc571ebcaa SHA512 0e65c81ec40d3eaeec036fbd8f46a3052a75ff0ad200c58438ff6c782a5764e62e51d03b4a2080770c32522894641288ac495f62bc39c3d5658b1ff87c9f6cdd

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-settings-390.141-fno-common.patch b/x11-drivers/nvidia-drivers/files/nvidia-settings-390.141-fno-common.patch
new file mode 100644
index 00000000000..499e969bf23
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-settings-390.141-fno-common.patch
@@ -0,0 +1,16 @@
+Fix compilation with -fno-common or gcc10
+https://bugs.gentoo.org/706742
+--- a/nvidia-settings/src/gtk+-2.x/ctkvdpau.c
++++ b/nvidia-settings/src/gtk+-2.x/ctkvdpau.c
+@@ -105,2 +105,4 @@
+ 
++struct VDPAUDeviceImpl VDPAUDeviceFunctions;
++
+ static int queryOutputSurface(CtkVDPAU *ctk_vdpau, VdpDevice device,
+--- a/nvidia-settings/src/gtk+-2.x/ctkvdpau.h
++++ b/nvidia-settings/src/gtk+-2.x/ctkvdpau.h
+@@ -48,3 +48,3 @@
+ 
+-struct VDPAUDeviceImpl {
++extern struct VDPAUDeviceImpl {
+ 

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-390.141-r1.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-390.141-r1.ebuild
new file mode 100644
index 00000000000..acde43fed16
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-390.141-r1.ebuild
@@ -0,0 +1,365 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+MODULES_OPTIONAL_USE="driver"
+inherit desktop linux-info linux-mod multilib-build \
+	optfeature systemd toolchain-funcs unpacker
+
+NV_KERNEL_MAX="5.10"
+NV_BIN_URI="https://download.nvidia.com/XFree86/Linux-"
+NV_GIT_URI="https://github.com/NVIDIA/nvidia-"
+
+DESCRIPTION="NVIDIA Accelerated Graphics Driver"
+HOMEPAGE="https://www.nvidia.com/download/index.aspx"
+SRC_URI="
+	amd64? ( ${NV_BIN_URI}x86_64/${PV}/NVIDIA-Linux-x86_64-${PV}.run )
+	x86? ( ${NV_BIN_URI}x86/${PV}/NVIDIA-Linux-x86-${PV}.run )
+	${NV_GIT_URI}installer/archive/${PV}.tar.gz -> nvidia-installer-${PV}.tar.gz
+	${NV_GIT_URI}modprobe/archive/${PV}.tar.gz -> nvidia-modprobe-${PV}.tar.gz
+	${NV_GIT_URI}persistenced/archive/${PV}.tar.gz -> nvidia-persistenced-${PV}.tar.gz
+	${NV_GIT_URI}settings/archive/${PV}.tar.gz -> nvidia-settings-${PV}.tar.gz
+	${NV_GIT_URI}xconfig/archive/${PV}.tar.gz -> nvidia-xconfig-${PV}.tar.gz"
+# nvidia-installer is unused but here for GPL-2's "distribute sources"
+S="${WORKDIR}"
+
+LICENSE="GPL-2 MIT NVIDIA-r2"
+SLOT="0/${PV%%.*}"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE="+X +driver static-libs +tools"
+
+COMMON_DEPEND="
+	acct-group/video
+	acct-user/nvpd
+	net-libs/libtirpc
+	tools? (
+		dev-libs/atk
+		dev-libs/glib:2
+		dev-libs/jansson
+		x11-libs/cairo
+		x11-libs/gdk-pixbuf:2
+		x11-libs/gtk+:3
+		x11-libs/libX11
+		x11-libs/libXext
+		x11-libs/libXxf86vm
+		x11-libs/pango
+	)"
+RDEPEND="
+	${COMMON_DEPEND}
+	X? (
+		media-libs/libglvnd[X,${MULTILIB_USEDEP}]
+		x11-libs/libX11[${MULTILIB_USEDEP}]
+		x11-libs/libXext[${MULTILIB_USEDEP}]
+	)"
+DEPEND="
+	${COMMON_DEPEND}
+	static-libs? (
+		x11-libs/libX11
+		x11-libs/libXext
+	)
+	tools? (
+		media-libs/libglvnd
+		sys-apps/dbus
+		x11-base/xorg-proto
+		x11-libs/libXrandr
+		x11-libs/libXv
+		x11-libs/libvdpau
+	)"
+BDEPEND="
+	app-misc/pax-utils
+	virtual/pkgconfig"
+
+QA_PREBUILT="opt/* usr/lib*"
+
+CONFIG_CHECK="
+	~DRM_KMS_HELPER
+	~SYSVIPC
+	~!AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT
+	~!LOCKDEP
+	!DEBUG_MUTEXES"
+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.
+	Cannot be directly selected in the kernel's menuconfig, so enable
+	options such as CONFIG_DRM_FBDEV_EMULATION instead.
+	390.xx branch: also used by a GLX workaround needed for OpenGL."
+
+PATCHES=(
+	"${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch
+	"${FILESDIR}"/nvidia-settings-390.141-fno-common.patch
+)
+DOCS=(
+	README.txt NVIDIA_Changelog
+	nvidia-settings/doc/{FRAMELOCK,NV-CONTROL-API}.txt
+)
+HTML_DOCS=( html/. )
+
+pkg_setup() {
+	use driver || return
+	BUILD_PARAMS='NV_VERBOSE=1 IGNORE_CC_MISMATCH=yes SYSSRC="${KERNEL_DIR}"'
+	use x86 && BUILD_PARAMS+=' ARCH=i386' # needed for recognition
+	BUILD_TARGETS="modules" # defaults' clean sometimes deletes modules
+	MODULE_NAMES="
+		nvidia(video:kernel)
+		nvidia-drm(video:kernel)
+		nvidia-modeset(video:kernel)"
+	use amd64 && MODULE_NAMES+=" nvidia-uvm(video:kernel)" # no x86 support
+	linux-mod_pkg_setup
+
+	if [[ ${MERGE_TYPE} != binary ]] && kernel_is gt ${NV_KERNEL_MAX/./ }; then
+		ewarn "Kernel ${KV_MAJOR}.${KV_MINOR} is either known to break this version of nvidia-drivers"
+		ewarn "or was not tested with it. It is recommended to use one of:"
+		ewarn "  <=sys-kernel/gentoo-kernel-${NV_KERNEL_MAX}"
+		ewarn "  <=sys-kernel/gentoo-sources-${NV_KERNEL_MAX}"
+		ewarn "You are free to try or use /etc/portage/patches, but support will"
+		ewarn "not be given and issues wait until NVIDIA releases a fixed version."
+		ewarn
+		ewarn "Do _not_ file a bug report if run into issues."
+		ewarn
+	fi
+}
+
+src_prepare() {
+	# make user patches usable across versions
+	rm nvidia-modprobe && mv nvidia-modprobe{-${PV},} || die
+	rm nvidia-persistenced && mv nvidia-persistenced{-${PV},} || die
+	rm nvidia-settings && mv nvidia-settings{-${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)/' \
+		-i kernel/conftest.sh || die
+
+	sed -e '/Exec=\|Icon=/s/_.*/nvidia-settings/' \
+		-e '/Categories=/s/_.*/System;Settings;/' \
+		-i nvidia-settings/doc/nvidia-settings.desktop || die
+
+	# remove gtk2 support (bug #592730)
+	sed '/^GTK2LIB = /d;/INSTALL.*GTK2LIB/,+1d' \
+		-i nvidia-settings/src/Makefile || die
+
+	sed 's/__USER__/nvpd/' \
+		nvidia-persistenced/init/systemd/nvidia-persistenced.service.template \
+		> nvidia-persistenced.service || die
+
+	sed 's/__NV_VK_ICD__/libGLX_nvidia.so.0/' \
+		nvidia_icd.json.template > nvidia_icd.json || die
+
+	sed "s/%LIBDIR%/$(get_libdir)/g" "${FILESDIR}/nvidia-390.conf" \
+		> nvidia-drm-outputclass.conf || die
+
+	gzip -d nvidia-{cuda-mps-control,smi}.1.gz || die
+}
+
+nvidia-drivers_make() {
+	emake -C nvidia-${1} ${2} \
+		DESTDIR="${ED}" PREFIX=/usr LIBDIR="${ED}/usr/$(get_libdir)" \
+		HOST_CC="$(tc-getBUILD_CC)" HOST_LD="$(tc-getBUILD_LD)" \
+		DO_STRIP= MANPAGE_GZIP= \
+		NV_USE_BUNDLED_LIBJANSSON=0 NV_VERBOSE=1 OUTPUTDIR=out
+}
+
+src_compile() {
+	tc-export AR CC LD OBJCOPY
+	# may no longer be relevant but kept as a safety
+	export DISTCC_DISABLE=1 CCACHE_DISABLE=1
+
+	use driver && linux-mod_src_compile
+
+	# 390.xx persistenced doesn't auto-detect libtirpc
+	LIBS=$($(tc-getPKG_CONFIG) --libs libtirpc) \
+		common_cflags=$($(tc-getPKG_CONFIG) --cflags libtirpc) \
+		nvidia-drivers_make persistenced
+
+	nvidia-drivers_make modprobe
+	use X && nvidia-drivers_make xconfig
+
+	if use tools; then
+		nvidia-drivers_make settings
+	elif use static-libs; then
+		nvidia-drivers_make settings/src build-xnvctrl
+	fi
+}
+
+nvidia-drivers_libs_install() {
+	local libs=(
+		EGL_nvidia
+		GLESv1_CM_nvidia
+		GLESv2_nvidia
+		cuda
+		nvcuvid
+		nvidia-compiler
+		nvidia-eglcore
+		nvidia-encode
+		nvidia-fatbinaryloader
+		nvidia-glcore
+		nvidia-glsi
+		nvidia-ml
+		nvidia-opencl
+		nvidia-ptxjitcompiler
+		nvidia-tls
+	)
+
+	if use X; then
+		libs+=(
+			GLX_nvidia
+			nvidia-fbc
+			nvidia-ifr
+			vdpau_nvidia
+		)
+	fi
+
+	local libdir=.
+	if multilib_is_native_abi; then
+		libs+=(
+			nvidia-cfg
+			nvidia-wfb
+		)
+	else
+		libdir+=/32
+	fi
+
+	local lib soname
+	for lib in "${libs[@]}"; do
+		[[ ${lib:0:3} != lib ]] && lib=lib${lib}.so.${PV}
+
+		# auto-detect soname and create appropriate symlinks
+		soname=$(scanelf -qF'%S#F' "${lib}") || die "Scanning ${lib} failed"
+		if [[ ${soname} && ${soname} != ${lib} ]]; then
+			ln -s ${lib} ${libdir}/${soname} || die
+		fi
+		ln -s ${lib} ${libdir}/${lib%.so*}.so || die
+
+		dolib.so ${libdir}/${lib%.so*}*
+	done
+}
+
+src_install() {
+	if use driver; then
+		linux-mod_src_install
+
+		insinto /etc/modprobe.d
+		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
+		doins "${FILESDIR}"/nvidia-blacklist-nouveau.conf
+		doins "${FILESDIR}"/nvidia-rmmod.conf
+	fi
+
+	if use X; then
+		exeinto /usr/$(get_libdir)/xorg/modules/drivers
+		doexe nvidia_drv.so
+
+		# 390 has legacy glx needing a modified .conf (bug #713546)
+		exeinto /usr/$(get_libdir)/extensions/nvidia
+		newexe libglx.so{.${PV},}
+		insinto /usr/share/X11/xorg.conf.d
+		newins {,50-}nvidia-drm-outputclass.conf
+
+		# vulkan icd uses libGLX_nvidia.so and so requires X
+		insinto /usr/share/vulkan/icd.d
+		doins nvidia_icd.json
+	fi
+
+	insinto /usr/share/glvnd/egl_vendor.d
+	doins 10_nvidia.json
+
+	insinto /etc/OpenCL/vendors
+	doins nvidia.icd
+
+	insinto /etc/nvidia
+	newins nvidia-application-profiles{-${PV},}-rc
+
+	# install built helpers
+	nvidia-drivers_make modprobe install
+	# allow video group to load mods and create devs (bug #505092)
+	fowners root:video /usr/bin/nvidia-modprobe
+	fperms 4710 /usr/bin/nvidia-modprobe
+
+	nvidia-drivers_make persistenced install
+	newconfd "${FILESDIR}/nvidia-persistenced.confd" nvidia-persistenced
+	newinitd "${FILESDIR}/nvidia-persistenced.initd" nvidia-persistenced
+	systemd_dounit nvidia-persistenced.service
+
+	use X && nvidia-drivers_make xconfig install
+
+	if use tools; then
+		nvidia-drivers_make settings install
+		doicon nvidia-settings/doc/nvidia-settings.png
+		domenu nvidia-settings/doc/nvidia-settings.desktop
+
+		insinto /usr/share/nvidia
+		newins nvidia-application-profiles{-${PV},}-key-documentation
+
+		exeinto /etc/X11/xinit/xinitrc.d
+		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
+	fi
+
+	if use static-libs; then
+		dolib.a nvidia-settings/src/libXNVCtrl/libXNVCtrl.a
+
+		insinto /usr/include/NVCtrl
+		doins nvidia-settings/src/libXNVCtrl/NVCtrl{Lib,}.h
+	fi
+
+	# install prebuilt-only helpers
+	exeinto /opt/bin
+
+	doexe nvidia-cuda-mps-control
+	doman nvidia-cuda-mps-control.1
+	doexe nvidia-cuda-mps-server
+
+	doexe nvidia-debugdump
+	dobin nvidia-bug-report.sh
+
+	doexe nvidia-smi
+	doman nvidia-smi.1
+
+	# install prebuilt-only libraries
+	mv tls/* . || die # alternate tls lib needed for libglx.so
+	multilib_foreach_abi nvidia-drivers_libs_install
+
+	einstalldocs
+}
+
+pkg_preinst() {
+	use driver || return
+	linux-mod_pkg_preinst
+
+	# set video group id based on live system (bug #491414)
+	local g=$(getent group video | cut -d: -f3)
+	[[ ${g} ]] || die "Failed to determine video group id"
+	sed "s/PACKAGE/${PF}/;s/VIDEOGID/${g}/" \
+		-i "${ED}"/etc/modprobe.d/nvidia.conf || die
+}
+
+pkg_postinst() {
+	use driver && linux-mod_pkg_postinst
+
+	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."
+	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"
+	fi
+}


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: x11-drivers/nvidia-drivers/, x11-drivers/nvidia-drivers/files/
@ 2021-04-21 12:22 David Seifert
  0 siblings, 0 replies; 33+ messages in thread
From: David Seifert @ 2021-04-21 12:22 UTC (permalink / raw
  To: gentoo-commits

commit:     dd8dd30e8e767b6d6846735b57e33c4f0cc7a01b
Author:     Ionen Wolkens <sudinave <AT> gmail <DOT> com>
AuthorDate: Wed Apr 21 12:19:51 2021 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Wed Apr 21 12:19:51 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dd8dd30e

x11-drivers/nvidia-drivers: drop 460.56

Also removes remaining support files/metadata for old style ebuilds.

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

 x11-drivers/nvidia-drivers/Manifest                |   2 -
 .../files/nvidia-drivers-440.26-locale.patch       |  13 -
 .../nvidia-drivers/files/nvidia-persistenced.conf  |   8 -
 .../nvidia-drivers/files/nvidia-persistenced.init  |  24 -
 .../files/nvidia-settings-linker.patch             |  22 -
 .../nvidia-drivers/files/nvidia-settings.desktop   |   7 -
 x11-drivers/nvidia-drivers/files/nvidia-smi.init   |  24 -
 x11-drivers/nvidia-drivers/files/nvidia-udev.sh-r1 |  20 -
 .../nvidia-drivers/files/nvidia-uvm.udev-rule      |   1 -
 x11-drivers/nvidia-drivers/files/nvidia.udev-rule  |   6 -
 x11-drivers/nvidia-drivers/metadata.xml            |   3 -
 .../nvidia-drivers/nvidia-drivers-460.56.ebuild    | 485 ---------------------
 12 files changed, 615 deletions(-)

diff --git a/x11-drivers/nvidia-drivers/Manifest b/x11-drivers/nvidia-drivers/Manifest
index 524020e0b4a..f2cd533cb7d 100644
--- a/x11-drivers/nvidia-drivers/Manifest
+++ b/x11-drivers/nvidia-drivers/Manifest
@@ -4,7 +4,6 @@ DIST NVIDIA-Linux-aarch64-465.19.01.run 174150951 BLAKE2B 7344404cff1ee5fce5368d
 DIST NVIDIA-Linux-x86-390.141.run 49589744 BLAKE2B 304672806b89885adbf8459ea99ca872769e44a42ff041a5b79ef05d113d7717f505f543441e7a2fc6c569f6d66391f0380a4f23f3e68108c8de817bf251f850 SHA512 6dfde3b54520070954b45f6bc071251084e1741f55e582b1abd806eb367e4b9ce0015615bf6a887fa784d075b3db08b6940da4163b960969773d1bdc52b4961e
 DIST NVIDIA-Linux-x86_64-390.141.run 85330901 BLAKE2B 7759d8cf6c9a75607b9a3ecd53cdd6f6a93f2f372d740a5a87d4d3f41a22f3bd953cc7dd6a0dc0e23a829ec86df8d65b9de499a76cfd4266a13b0aa3288aceb5 SHA512 5448d70e6e64a6403e61a004d83c69a442dd8ed0d61da3a31d3e3b7943c06c559a66b0f8d135982868ecbf209a965f60dae1a633367630b4d9287f725bbaa53c
 DIST NVIDIA-Linux-x86_64-450.102.04.run 141391114 BLAKE2B 019f928464b23d2a86bfdd255b7651e3cfe2b0b6ebf58d1b4a6ba1f27990e1d050d1e2429ba4aa60b966b04e775939084a04d82d1dd3482a10b39375b17b1c31 SHA512 1d13de540da36274a360ea6bcd1ce01eaae103fe417b42aa8f9ac757c382b06da455a78cf6798310179f90e2afeadf3a8c9f3398186490c3c0f9079021e850ed
-DIST NVIDIA-Linux-x86_64-460.56.run 178496173 BLAKE2B 8f84a403ccaa9a92186cac9fb2dee9600cd29915cdacf475b6a1105772ffd52c671ef217a1201fbcd9192e858ec17796fd77b817887c79c43c266d32671fe7d0 SHA512 a61855576a27cdd2e48906ecb49cd1e9f88d14a8358aa4bdc57d59e2dfa64b394b2dcee45184d75e889fac6ebedcaaff902a07428c7f9eb011cf265228c6eb4e
 DIST NVIDIA-Linux-x86_64-460.67.run 177691692 BLAKE2B 25a7d87cc128933a98100d7c5ef37f93c3a870c096eea3228a28ef79d712ce104608f9422221cc1eadc21dccbbc8bc41ab1832795cfee75e217600ed0d76489e SHA512 80fdc023a8ce80e3a103896f28a5564bb43903af6bfc719f755c48eb225e79ec6abf219ab20eb80ada5808ef932ef5fa0fe710c6e0a07dd8a248daff2ba3b898
 DIST NVIDIA-Linux-x86_64-465.19.01.run 259853124 BLAKE2B 04d5d738a99e313d9c0c8aa074b28ff744b3d16893f26d4837d7440e7fa51c3182101f7cadedcb7b13f01d0e6dd612c931f2357e87003966cfc5b2c7f4398079 SHA512 b4ececb6069ec961a4bf6b50c3bb0d7ca94add13e04f9dcceaddc6d3267f6dfc5f020d14e49f37e6c09ec3b47b3f44f0f44620e1ab4d25f7739514a07769a67d
 DIST nvidia-installer-390.141.tar.gz 205299 BLAKE2B b95ddcf9a8d61247572d73faa04558564962782b0eb222601315d741d1ee71fa0636fa87d31105ecc5ec61328d3174a3ed646046e02b6b5f29f071215a0e8bdd SHA512 3848a4ec17510bf4d3060e5ef8aafa1ad921215ec39d26c54b3bbdd8a5867c46e01d247b24b05ad6906fed7fb4ae6dc37346a7da6e5aae88b5b47584c0b07a02
@@ -21,7 +20,6 @@ DIST nvidia-persistenced-460.67.tar.gz 53334 BLAKE2B 1354ec98fd2b95d264fd7df6219
 DIST nvidia-persistenced-465.19.01.tar.gz 53555 BLAKE2B 0b163a2cf37c9180512f9d3af442f52d4417f1ca0b286bafc154cd3c235bc8ff82380fbb92633f9dc0e010c9cc4e36ab3b5f6aad726b5357dc368edafe737146 SHA512 ebe8a8eff5770605e751665f325a82cbe24b20395684d124558838553a2815f6cf2804cb58a9624105a99442fea91d774ad4978bcd2ad13a52f55e777ae13c5d
 DIST nvidia-settings-390.141.tar.gz 1297261 BLAKE2B 452870df1ba598692f5da47444eb2daf4db40c79cac98c10b1c994c0ff39fc7936909b9d7788cbfe784999e68a2bdbbc12e85d63c3bc02ac872e6b3c46834697 SHA512 dbf7c389bbdc94291a1b974adfa33414148b1ab752aa7d948a27e91ee1bceb3b8435aceb6b7ef3cb806333572db11b5524667045ef7686b119d7955d2699cb04
 DIST nvidia-settings-450.102.04.tar.gz 1229675 BLAKE2B 166b73a0e9fe1cc1c16f83128aa94f3b9ef44fc71004e80c2681299dd564df6b458b52bedfd60eaaecf6142d0ea7d5147cb9c509d4db4e6b85bc72dd4dc75751 SHA512 c514bb3cc72954a52f4821674f9b783ebc0bd8c7294a296716619ddad15f2b63f50ada47797dee1386709deb7d407cb1d6c04532b7ca6e03d84234555751c9a9
-DIST nvidia-settings-460.56.tar.bz2 1060604 BLAKE2B cd1480e42ab2b25b399f19b458a1d5252d1b77d263ddecbad2d61f0445ba9f0ddf81fc944ac1136c273dfd1d21d06385bcfac9bdd7a7dc02f75302a6b8276df4 SHA512 018eb3cb7f25b926aa620201979b0efaaa82e7f036c4870a1e1234f5aac3ab9cfd48846d7eedd7ed38c3035eface3f2afe1a0d5de7a67e53e6bea760aa99fa72
 DIST nvidia-settings-460.67.tar.gz 1233189 BLAKE2B 33ffceefea4e184cb1873cdce97db26637e87cd20c82bcabcbfe88bcb084ac3d833ac5688cafa33a5a89383040d5c1c5d46de9c3f9a8ba6174574aa57aea2e46 SHA512 d1828379aa477394747ae3e5d3505e864d38a349dd159a04cb263613380afea9aea2081300b0d2b8ae205b800bfe6e8ba504e612989da394d757f00e4399b617
 DIST nvidia-settings-465.19.01.tar.gz 1233866 BLAKE2B 297ffe66639bd4221f5b780abb784f640553f0f7d4f9bcc254cdf54fa6dcc98ac197fa76178f66b626bcef8c4fc6c2c83c3c2474f81a2c5124df0a651f878663 SHA512 90f2786941ee062f4f8e7f80e0174620d8aedca17164e7e466c77733f29e891ffce9b08a09a75c25a219546efc816ca2fbb26b3b142522e89e495b7b90bd65d1
 DIST nvidia-xconfig-390.141.tar.gz 140293 BLAKE2B 08ee93be953f75dbe078c557af7c062092ce8a3b53af0735d43b7feabe6d1c99390b9533027fbc5017d207a70dfa5aecf88d211905bf8f0e846f769a6ea16c2b SHA512 9fedee2f720d86bd24e393328249bf970a1f242b9e750543e757eb13ca30f6ecfda6c63441093ab96ae28d5f38d4e55cc6de6316eb82d2a2f33074144a1eef2f

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-440.26-locale.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-440.26-locale.patch
deleted file mode 100644
index aa2a74349f2..00000000000
--- a/x11-drivers/nvidia-drivers/files/nvidia-drivers-440.26-locale.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/kernel/conftest.sh
-+++ b/kernel/conftest.sh
-@@ -6,6 +6,10 @@
- SCRIPTDIR=`dirname $0`
- cd $SCRIPTDIR
- 
-+# translate_and_compile_header_files() expects the default locale
-+# https://bugs.gentoo.org/698238
-+export LC_ALL=C
-+
- CC="$1"
- ARCH=$2
- ISYSTEM=`$CC -print-file-name=include 2> /dev/null`

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-persistenced.conf b/x11-drivers/nvidia-drivers/files/nvidia-persistenced.conf
deleted file mode 100644
index 637ac1afb41..00000000000
--- a/x11-drivers/nvidia-drivers/files/nvidia-persistenced.conf
+++ /dev/null
@@ -1,8 +0,0 @@
-# run-time configuration file for /etc/init.d/nvidia-persistenced
-
-# NVPD_USER: The user nvidia-persistenced is intended to run for
-NVPD_USER=""
-
-# ARGS: Additional arguments to set the default persistence mode
-# (see nvidia-persistenced(1))
-ARGS=""

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-persistenced.init b/x11-drivers/nvidia-drivers/files/nvidia-persistenced.init
deleted file mode 100644
index f80456d1603..00000000000
--- a/x11-drivers/nvidia-drivers/files/nvidia-persistenced.init
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-pidfile="/var/run/nvidia-persistenced/nvidia-persistenced.pid"
-
-start() {
-	if ! [ "${NVPD_USER}x" = x ]; then
-		ebegin "Starting nvidia-persistenced for ${NVPD_USER}"
-		NVPD_USER_ARG="--user ${NVPD_USER}"
-	else
-		ebegin "Starting nvidia-persistenced"
-	fi
-	start-stop-daemon --start --quiet --pidfile ${pidfile} \
-		--background --exec /opt/bin/nvidia-persistenced \
-		-- ${NVPD_USER_ARG} ${ARGS}
-	eend $?	
-}
-
-stop() {
-	ebegin "Stopping nvidia-persistenced"
-	start-stop-daemon --stop --quiet --pidfile ${pidfile}
-	eend $?
-}

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-settings-linker.patch b/x11-drivers/nvidia-drivers/files/nvidia-settings-linker.patch
deleted file mode 100644
index fe9d336413f..00000000000
--- a/x11-drivers/nvidia-drivers/files/nvidia-settings-linker.patch
+++ /dev/null
@@ -1,22 +0,0 @@
---- a/nvidia-settings-@PV@/utils.mk
-+++ b/nvidia-settings-@PV@/utils.mk
-@@ -475,7 +475,7 @@
- define READ_ONLY_OBJECT_FROM_FILE_RULE
-   $$(OUTPUTDIR)/$$(notdir $(1)).o: $(1)
- 	$(at_if_quiet)cd $$(dir $(1)); \
--	$$(call quiet_cmd_no_at,LD) -r -z noexecstack --format=binary \
-+	$$(call quiet_cmd_no_at,NVLD) -r -z noexecstack --format=binary \
- 	    $$(notdir $(1)) -o $$(OUTPUTDIR_ABSOLUTE)/$$(notdir $$@)
- 	$$(call quiet_cmd,OBJCOPY) \
- 	    --rename-section .data=.rodata,contents,alloc,load,data,readonly \
---- a/nvidia-settings-@PV@/src/libXNVCtrl/utils.mk
-+++ b/nvidia-settings-@PV@/src/libXNVCtrl/utils.mk
-@@ -475,7 +475,7 @@
- define READ_ONLY_OBJECT_FROM_FILE_RULE
-   $$(OUTPUTDIR)/$$(notdir $(1)).o: $(1)
- 	$(at_if_quiet)cd $$(dir $(1)); \
--	$$(call quiet_cmd_no_at,LD) -r -z noexecstack --format=binary \
-+	$$(call quiet_cmd_no_at,NVLD) -r -z noexecstack --format=binary \
- 	    $$(notdir $(1)) -o $$(OUTPUTDIR_ABSOLUTE)/$$(notdir $$@)
- 	$$(call quiet_cmd,OBJCOPY) \
- 	    --rename-section .data=.rodata,contents,alloc,load,data,readonly \

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-settings.desktop b/x11-drivers/nvidia-drivers/files/nvidia-settings.desktop
deleted file mode 100644
index b4b452ec829..00000000000
--- a/x11-drivers/nvidia-drivers/files/nvidia-settings.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=NVIDIA X Server Settings
-Comment=Configure NVIDIA X Server Settings
-Exec=/usr/bin/nvidia-settings
-Icon=nvidia-settings
-Categories=System;Settings;

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-smi.init b/x11-drivers/nvidia-drivers/files/nvidia-smi.init
deleted file mode 100644
index 8ee51e34893..00000000000
--- a/x11-drivers/nvidia-drivers/files/nvidia-smi.init
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2013 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-pidfile="/run/nvidia-smi.pid"
-
-depend() {
-    after modules
-}
-
-start() {
-	ebegin "Starting NVIDIA System Management Interface"
-	rm -f ${pidfile}
-	start-stop-daemon --start --quiet --pidfile ${pidfile} \
-		--make-pidfile --background --exec /opt/bin/nvidia-smi -- \
-		-q -l 300
-	eend $?
-}
-
-stop() {
-	ebegin "Stopping NVIDIA System Management Interface"
-	start-stop-daemon --stop --quiet --pidfile ${pidfile}
-	eend $?
-}

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-udev.sh-r1 b/x11-drivers/nvidia-drivers/files/nvidia-udev.sh-r1
deleted file mode 100644
index 6579bf74adb..00000000000
--- a/x11-drivers/nvidia-drivers/files/nvidia-udev.sh-r1
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-
-if [ $# -ne 1 ]; then
-	echo "Invalid args" >&2
-	exit 1
-fi
-
-case $1 in
-	add|ADD)
-		#hopefully this prevents infinite loops like bug #454740
-		if lsmod | grep -iq nvidia; then
-			/opt/bin/nvidia-smi > /dev/null
-		fi
-		;;
-	remove|REMOVE)
-		rm -f /dev/nvidia*
-		;;
-esac
-
-exit 0

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-uvm.udev-rule b/x11-drivers/nvidia-drivers/files/nvidia-uvm.udev-rule
deleted file mode 100644
index 0602a4353fe..00000000000
--- a/x11-drivers/nvidia-drivers/files/nvidia-uvm.udev-rule
+++ /dev/null
@@ -1 +0,0 @@
-KERNEL=="nvidia_uvm", RUN+="/bin/bash -c '/bin/mknod -m 660 /dev/nvidia-uvm c $$(grep nvidia-uvm /proc/devices | cut -d \  -f 1) 0; /bin/chgrp video /dev/nvidia-uvm'"

diff --git a/x11-drivers/nvidia-drivers/files/nvidia.udev-rule b/x11-drivers/nvidia-drivers/files/nvidia.udev-rule
deleted file mode 100644
index 2eb30bb0eba..00000000000
--- a/x11-drivers/nvidia-drivers/files/nvidia.udev-rule
+++ /dev/null
@@ -1,6 +0,0 @@
-ACTION=="add", DEVPATH=="/module/nvidia", SUBSYSTEM=="module", RUN+="nvidia-udev.sh $env{ACTION}"
-# Previously the ACTION was "add|remove" but one user on bug #376527 had a
-# problem until he recompiled udev-171-r5, which is one of the versions I
-# tested with and it was fine. I'm breaking the rules out just to be safe
-# so someone else doesn't have an issue
-ACTION=="remove", DEVPATH=="/module/nvidia", SUBSYSTEM=="module", RUN+="nvidia-udev.sh $env{ACTION}"

diff --git a/x11-drivers/nvidia-drivers/metadata.xml b/x11-drivers/nvidia-drivers/metadata.xml
index 294430ee9cf..107804d69d1 100644
--- a/x11-drivers/nvidia-drivers/metadata.xml
+++ b/x11-drivers/nvidia-drivers/metadata.xml
@@ -9,11 +9,8 @@
 		<email>soap@gentoo.org</email>
 	</maintainer>
 	<use>
-		<flag name="compat">Install non-GLVND libGL for backwards compatibility</flag>
 		<flag name="driver">Install kernel driver modules</flag>
-		<flag name="kms">Enable support for kernel mode setting (KMS)</flag>
 		<flag name="tools">Install additional tools such as nvidia-settings</flag>
-		<flag name="uvm">Install the Unified Memory kernel module (nvidia-uvm) for sharing memory between CPU and GPU in CUDA programs</flag>
 	</use>
 	<upstream>
 		<remote-id type="cpe">cpe:/a:nvidia:gpu_driver</remote-id>

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-460.56.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-460.56.ebuild
deleted file mode 100644
index 17311c655c7..00000000000
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-460.56.ebuild
+++ /dev/null
@@ -1,485 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit desktop flag-o-matic linux-info linux-mod multilib-minimal \
-	nvidia-driver systemd toolchain-funcs unpacker udev
-
-AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
-ARM64_NV_PACKAGE="NVIDIA-Linux-aarch64-${PV}"
-
-NV_URI="https://us.download.nvidia.com/XFree86/"
-SRC_URI="
-	amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
-	tools? (
-		https://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2
-	)"
-
-EMULTILIB_PKG="true"
-
-LICENSE="GPL-2 NVIDIA-r2"
-SLOT="0/${PV%%.*}"
-# TODO: for arm64, keyword virtual/opencl on arm64
-KEYWORDS="-* amd64"
-IUSE="compat +driver +kms multilib static-libs +tools uvm wayland +X"
-REQUIRED_USE="
-	tools? ( X )
-	static-libs? ( tools )"
-
-COMMON="
-	driver? ( acct-group/video )
-	tools? (
-		dev-libs/atk
-		dev-libs/glib:2
-		dev-libs/jansson
-		x11-libs/cairo
-		x11-libs/gdk-pixbuf
-		x11-libs/gtk+:3
-		x11-libs/libX11
-		x11-libs/libXext
-		x11-libs/libXrandr
-		x11-libs/libXv
-		x11-libs/libXxf86vm
-		x11-libs/pango[X]
-	)
-	X? (
-		app-misc/pax-utils
-		media-libs/libglvnd[X,${MULTILIB_USEDEP}]
-		>=x11-libs/libvdpau-1.0[${MULTILIB_USEDEP}]
-	)"
-DEPEND="
-	${COMMON}
-	virtual/linux-sources
-	tools? ( sys-apps/dbus )"
-RDEPEND="
-	${COMMON}
-	net-libs/libtirpc
-	uvm? ( >=virtual/opencl-3 )
-	wayland? ( dev-libs/wayland[${MULTILIB_USEDEP}] )
-	X? (
-		<x11-base/xorg-server-1.20.99:=
-		>=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
-		>=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
-		sys-libs/zlib[${MULTILIB_USEDEP}]
-	)"
-
-QA_PREBUILT="opt/* usr/lib*"
-S="${WORKDIR}"
-NV_KV_MAX_PLUS="5.12"
-CONFIG_CHECK="
-	!DEBUG_MUTEXES
-	~!I2C_NVIDIA_GPU
-	~!LOCKDEP
-	~DRM
-	~DRM_KMS_HELPER
-	~SYSVIPC"
-
-PATCHES=( "${FILESDIR}"/${PN}-440.26-locale.patch )
-
-pkg_pretend() {
-	nvidia-driver_check
-}
-
-pkg_setup() {
-	nvidia-driver_check
-
-	# try to turn off distcc and ccache for people that have a problem with it
-	export DISTCC_DISABLE=1
-	export CCACHE_DISABLE=1
-
-	if use driver; then
-		MODULE_NAMES="nvidia(video:${S}/kernel)"
-		use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
-		use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel) nvidia-drm(video:${S}/kernel)"
-
-		# This needs to run after MODULE_NAMES (so that the eclass checks
-		# whether the kernel supports loadable modules) but before BUILD_PARAMS
-		# is set (so that KV_DIR is populated).
-		linux-mod_pkg_setup
-
-		BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
-			SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
-
-		# linux-mod_src_compile calls set_arch_to_kernel, which
-		# sets the ARCH to x86 but NVIDIA's wrapping Makefile
-		# expects x86_64 or i386 and then converts it to x86
-		# later on in the build process
-		BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
-	fi
-}
-
-src_prepare() {
-	gunzip *1.gz || die
-
-	if use tools; then
-		cp "${FILESDIR}"/nvidia-settings-linker.patch "${WORKDIR}" || die
-		sed -i \
-			-e "s:@PV@:${PV}:g" \
-			"${WORKDIR}"/nvidia-settings-linker.patch \
-			|| die
-		eapply "${WORKDIR}"/nvidia-settings-linker.patch
-
-		# remove GTK2 support entirely (#592730)
-		sed -i \
-			-e '/^GTK2LIB = /d;/INSTALL.*GTK2LIB/,+1d' \
-			nvidia-settings-${PV}/src/Makefile || die
-	fi
-
-	default
-
-	if ! [[ -f nvidia_icd.json ]]; then
-		cp nvidia_icd.json.template nvidia_icd.json || die
-		sed -i -e 's:__NV_VK_ICD__:libGLX_nvidia.so.0:g' nvidia_icd.json || die
-	fi
-}
-
-src_configure() {
-	tc-export AR CC LD OBJCOPY
-	default
-}
-
-src_compile() {
-	pushd kernel >/dev/null || die
-	if use driver; then
-		BUILD_TARGETS=module linux-mod_src_compile \
-			KERNELRELEASE="${KV_FULL}" \
-			src="${KERNEL_DIR}"
-	fi
-	popd >/dev/null || die
-
-	if use tools; then
-		emake -C nvidia-settings-${PV}/src/libXNVCtrl \
-			DO_STRIP= \
-			LIBDIR="$(get_libdir)" \
-			NVLD="$(tc-getLD)" \
-			NV_VERBOSE=1 \
-			OUTPUTDIR=. \
-			RANLIB="$(tc-getRANLIB)"
-
-		emake -C nvidia-settings-${PV}/src \
-			DO_STRIP= \
-			GTK3_AVAILABLE=1 \
-			LIBDIR="$(get_libdir)" \
-			NVLD="$(tc-getLD)" \
-			NVML_ENABLED=0 \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			NV_VERBOSE=1 \
-			OUTPUTDIR=.
-	fi
-}
-
-# Install nvidia library:
-# the first parameter is the library to install
-# the second parameter is the provided soversion
-# the third parameter is the target directory if it is not /usr/lib
-donvidia() {
-	# Full path to library
-	nv_LIB="${1}"
-
-	# SOVER to use
-	nv_SOVER="$(scanelf -qF'%S#F' ${nv_LIB})"
-
-	# Where to install
-	nv_DEST="${2}"
-
-	# Get just the library name
-	nv_LIBNAME=$(basename "${nv_LIB}")
-
-	if [[ -n ${nv_DEST} ]]; then
-		exeinto ${nv_DEST}
-		action="doexe"
-	else
-		nv_DEST="/usr/$(get_libdir)"
-		action="dolib.so"
-	fi
-
-	# Install the library
-	${action} ${nv_LIB} || die "failed to install ${nv_LIBNAME}"
-
-	# If the library has a SONAME and SONAME does not match the library name,
-	# then we need to create a symlink
-	if [[ -n ${nv_SOVER} && ${nv_SOVER} != ${nv_LIBNAME} ]]; then
-		dosym ${nv_LIBNAME} ${nv_DEST}/${nv_SOVER}
-	fi
-
-	dosym ${nv_LIBNAME} ${nv_DEST}/${nv_LIBNAME/.so*/.so}
-}
-
-src_install() {
-	if use driver; then
-		linux-mod_src_install
-
-		# Add the aliases
-		# This file is tweaked with the appropriate video group in
-		# pkg_preinst, see bug #491414
-		insinto /etc/modprobe.d
-		newins "${FILESDIR}"/nvidia-460.conf nvidia.conf
-
-		if use uvm; then
-			doins "${FILESDIR}"/nvidia-rmmod.conf
-			udev_newrules "${FILESDIR}"/nvidia-uvm.udev-rule 99-nvidia-uvm.rules
-		else
-			sed -e 's|nvidia-uvm ||g' "${FILESDIR}"/nvidia-rmmod.conf \
-				> "${T}"/nvidia-rmmod.conf || die
-			doins "${T}"/nvidia-rmmod.conf
-		fi
-
-		# Ensures that our device nodes are created when not using X
-		exeinto "$(get_udevdir)"
-		newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
-		udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
-	fi
-
-	# NVIDIA kernel <-> userspace driver config lib
-	donvidia libnvidia-cfg.so.${PV}
-
-	# NVIDIA framebuffer capture library
-	donvidia libnvidia-fbc.so.${PV}
-
-	# NVIDIA video encode/decode <-> CUDA
-	donvidia libnvcuvid.so.${PV}
-	donvidia libnvidia-encode.so.${PV}
-
-	if use X; then
-		# Xorg DDX driver
-		exeinto /usr/$(get_libdir)/xorg/modules/drivers
-		doexe nvidia_drv.so
-
-		# Xorg GLX driver
-		donvidia libglxserver_nvidia.so.${PV} \
-			/usr/$(get_libdir)/xorg/modules/extensions
-
-		# Xorg nvidia.conf
-		insinto /usr/share/X11/xorg.conf.d
-		newins {,50-}nvidia-drm-outputclass.conf
-
-		insinto /usr/share/glvnd/egl_vendor.d
-		doins 10_nvidia.json
-	fi
-
-	if use wayland; then
-		insinto /usr/share/egl/egl_external_platform.d
-		doins 10_nvidia_wayland.json
-	fi
-
-	insinto /etc/vulkan/icd.d
-	doins nvidia_icd.json
-
-	insinto /etc/vulkan/implicit_layer.d
-	doins nvidia_layers.json
-
-	# OpenCL ICD for NVIDIA
-	insinto /etc/OpenCL/vendors
-	doins nvidia.icd
-
-	# Helper Apps
-	exeinto /opt/bin/
-
-	use X && doexe nvidia-xconfig
-
-	doexe nvidia-cuda-mps-control
-	doexe nvidia-cuda-mps-server
-	doexe nvidia-debugdump
-	doexe nvidia-persistenced
-	doexe nvidia-smi
-
-	# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
-	doexe nvidia-modprobe
-	fowners root:video /opt/bin/nvidia-modprobe
-	fperms 4710 /opt/bin/nvidia-modprobe
-	dosym ../../opt/bin/nvidia-modprobe /usr/bin/nvidia-modprobe
-
-	doman nvidia-cuda-mps-control.1
-	doman nvidia-modprobe.1
-	doman nvidia-persistenced.1
-	newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
-	newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
-	newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
-
-	if use tools; then
-		emake -C nvidia-settings-${PV}/src/ \
-			DESTDIR="${ED}" \
-			DO_STRIP= \
-			GTK3_AVAILABLE=1 \
-			LIBDIR="${ED}/usr/$(get_libdir)" \
-			NV_USE_BUNDLED_LIBJANSSON=0 \
-			NV_VERBOSE=1 \
-			OUTPUTDIR=. \
-			PREFIX=/usr \
-			install
-
-		if use static-libs; then
-			dolib.a nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
-
-			insinto /usr/include/NVCtrl
-			doins nvidia-settings-${PV}/src/libXNVCtrl/*.h
-		fi
-
-		insinto /usr/share/nvidia/
-		doins nvidia-application-profiles-${PV}-key-documentation
-
-		insinto /etc/nvidia
-		newins \
-			nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
-
-		doicon nvidia-settings.png
-		domenu "${FILESDIR}"/nvidia-settings.desktop
-
-		exeinto /etc/X11/xinit/xinitrc.d
-		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
-	fi
-
-	dobin nvidia-bug-report.sh
-
-	systemd_dounit *.service
-	dobin nvidia-sleep.sh
-	exeinto /lib/systemd/system-sleep
-	doexe nvidia
-
-	if has_multilib_profile && use multilib; then
-		local OABI=${ABI}
-		for ABI in $(multilib_get_enabled_abis); do
-			src_install-libs
-		done
-		ABI=${OABI}
-		unset OABI
-	else
-		src_install-libs
-	fi
-
-	is_final_abi || die "failed to iterate through all ABIs"
-
-	# Documentation
-	newdoc README.txt README
-	dodoc NVIDIA_Changelog
-	doman nvidia-smi.1
-	use X && doman nvidia-xconfig.1
-	use tools && doman nvidia-settings.1
-	doman nvidia-cuda-mps-control.1
-
-	readme.gentoo_create_doc
-
-	dodoc -r supported-gpus
-
-	docinto html
-	dodoc -r html/.
-}
-
-src_install-libs() {
-	local inslibdir=$(get_libdir)
-	local GL_ROOT="/usr/$(get_libdir)"
-	local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
-	local nv_libdir="${S}"
-
-	if has_multilib_profile && [[ ${ABI} == "x86" ]]; then
-		nv_libdir="${S}"/32
-	fi
-
-	if use X; then
-		NV_GLX_LIBRARIES=(
-			"libEGL_nvidia.so.${PV} ${GL_ROOT}"
-			"libGLESv1_CM_nvidia.so.${PV} ${GL_ROOT}"
-			"libGLESv2_nvidia.so.${PV} ${GL_ROOT}"
-			"libGLX_nvidia.so.${PV} ${GL_ROOT}"
-			"libOpenCL.so.1.0.0 ${CL_ROOT}"
-			"libcuda.so.${PV}"
-			"libnvcuvid.so.${PV}"
-			"libnvidia-compiler.so.${PV}"
-			"libnvidia-eglcore.so.${PV}"
-			"libnvidia-encode.so.${PV}"
-			"libnvidia-fbc.so.${PV}"
-			"libnvidia-glcore.so.${PV}"
-			"libnvidia-glsi.so.${PV}"
-			"libnvidia-glvkspirv.so.${PV}"
-			"libnvidia-ifr.so.${PV}"
-			"libnvidia-opencl.so.${PV}"
-			"libnvidia-ptxjitcompiler.so.${PV}"
-			"libvdpau_nvidia.so.${PV}"
-		)
-
-		if use wayland && [[ ${ABI} == "amd64" ]]; then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-egl-wayland.so.1.1.5"
-			)
-		fi
-
-		NV_GLX_LIBRARIES+=(
-			"libnvidia-ml.so.${PV}"
-			"libnvidia-tls.so.${PV}"
-		)
-
-		if [[ ${ABI} == "amd64" ]]; then
-			NV_GLX_LIBRARIES+=(
-				"libnvidia-cbl.so.${PV}"
-				"libnvidia-ngx.so.${PV}"
-				"libnvidia-rtcore.so.${PV}"
-				"libnvoptix.so.${PV}"
-			)
-		fi
-
-		local nv_lib
-		for nv_lib in "${NV_GLX_LIBRARIES[@]}"; do
-			donvidia "${nv_libdir}"/${nv_lib}
-		done
-	fi
-}
-
-pkg_preinst() {
-	if use driver; then
-		linux-mod_pkg_preinst
-
-		local videogroup="$(getent group video | cut -d ':' -f 3)"
-		if [[ -z ${videogroup} ]]; then
-			eerror "Failed to determine the video group gid"
-			die "Failed to determine the video group gid"
-		else
-			sed -i \
-				-e "s:PACKAGE:${PF}:g" \
-				-e "s:VIDEOGID:${videogroup}:" \
-				"${ED}"/etc/modprobe.d/nvidia.conf || die
-		fi
-	fi
-
-	# Clean the dynamic libGL stuff's home to ensure
-	# we dont have stale libs floating around
-	rm -rf "${EROOT}"/usr/lib/opengl/nvidia/* || die
-	# Make sure we nuke the old nvidia-glx's env.d file
-	rm -f "${EROOT}"/etc/env.d/09nvidia || die
-}
-
-pkg_postinst() {
-	use driver && linux-mod_pkg_postinst
-
-	readme.gentoo_print_elog
-
-	if ! use X; then
-		elog "You have elected to not install the X.org driver. Along with"
-		elog "this the OpenGL libraries and VDPAU libraries were not"
-		elog "installed. Additionally, once the driver is loaded your card"
-		elog "and fan will run at max speed which may not be desirable."
-		elog "Use the 'nvidia-smi' init script to have your card and fan"
-		elog "speed scale appropriately."
-		elog
-	fi
-	if ! use tools; then
-		elog "USE=tools controls whether the nvidia-settings application"
-		elog "is installed. If you would like to use it, enable that"
-		elog "flag and re-emerge this ebuild. Optionally you can install"
-		elog "media-video/nvidia-settings"
-		elog
-	fi
-
-	elog "To enable nvidia sleep services under systemd, run these commands:"
-	elog "	systemctl enable nvidia-suspend.service"
-	elog "	systemctl enable nvidia-hibernate.service"
-	elog "	systemctl enable nvidia-resume.service"
-	elog "Set the NVreg_TemporaryFilePath kernel module parameter to a"
-	elog "suitable path in case the default of /tmp does not work for you"
-	elog "For more information see:"
-	elog "${EROOT}/usr/share/doc/${PF}/html/powermanagement.html"
-}
-
-pkg_postrm() {
-	use driver && linux-mod_pkg_postrm
-}


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: x11-drivers/nvidia-drivers/, x11-drivers/nvidia-drivers/files/
@ 2021-07-21 19:44 Ionen Wolkens
  0 siblings, 0 replies; 33+ messages in thread
From: Ionen Wolkens @ 2021-07-21 19:44 UTC (permalink / raw
  To: gentoo-commits

commit:     701b87679ae89e02d11be22d235081fa55ae58be
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 21 14:42:42 2021 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Wed Jul 21 19:42:49 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=701b8767

x11-drivers/nvidia-drivers: rename 390.xx filesdir files

nvidia-390.conf was named the same as the other nvidia-*.conf,
but it serves a completely different purpose. Then nvidia-169.07
differed from the rest.

nvidia-390.conf -> nvidia-drm-outputclass-390.conf
nvidia-169.07   -> nvidia-390.conf

At same time, also adjust for prefix (as unlikely as it is, running
a prefix Xorg server with prefix nvidia-drivers[-driver] is possible).

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 x11-drivers/nvidia-drivers/files/nvidia-169.07      | 14 --------------
 x11-drivers/nvidia-drivers/files/nvidia-390.conf    | 21 ++++++++++++++-------
 .../files/nvidia-drm-outputclass-390.conf           |  7 +++++++
 .../nvidia-drivers/nvidia-drivers-390.143-r1.ebuild |  6 +++---
 4 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-169.07 b/x11-drivers/nvidia-drivers/files/nvidia-169.07
deleted file mode 100644
index a96b0cd1e40..00000000000
--- a/x11-drivers/nvidia-drivers/files/nvidia-169.07
+++ /dev/null
@@ -1,14 +0,0 @@
-# Nvidia drivers support
-alias char-major-195 nvidia
-alias /dev/nvidiactl char-major-195
-
-# To tweak the driver the following options can be used, note that
-# you should be careful, as it could cause instability!! For more 
-# options see /usr/share/doc/PACKAGE/README 
-#
-# !!! SECURITY WARNING !!!
-# DO NOT MODIFY OR REMOVE THE DEVICE FILE RELATED OPTIONS UNLESS YOU KNOW
-# WHAT YOU ARE DOING.
-# ONLY ADD TRUSTED USERS TO THE VIDEO GROUP, THESE USERS MAY BE ABLE TO CRASH,
-# COMPROMISE, OR IRREPARABLY DAMAGE THE MACHINE.
-options nvidia NVreg_DeviceFileMode=432 NVreg_DeviceFileUID=0 NVreg_DeviceFileGID=VIDEOGID NVreg_ModifyDeviceFiles=1

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-390.conf b/x11-drivers/nvidia-drivers/files/nvidia-390.conf
index 7666989fa47..a96b0cd1e40 100644
--- a/x11-drivers/nvidia-drivers/files/nvidia-390.conf
+++ b/x11-drivers/nvidia-drivers/files/nvidia-390.conf
@@ -1,7 +1,14 @@
-Section "OutputClass"
-    Identifier "nvidia"
-    MatchDriver "nvidia-drm"
-    Driver "nvidia"
-    Option "AllowEmptyInitialConfiguration"
-    ModulePath "/usr/%LIBDIR%/extensions/nvidia"
-EndSection
+# Nvidia drivers support
+alias char-major-195 nvidia
+alias /dev/nvidiactl char-major-195
+
+# To tweak the driver the following options can be used, note that
+# you should be careful, as it could cause instability!! For more 
+# options see /usr/share/doc/PACKAGE/README 
+#
+# !!! SECURITY WARNING !!!
+# DO NOT MODIFY OR REMOVE THE DEVICE FILE RELATED OPTIONS UNLESS YOU KNOW
+# WHAT YOU ARE DOING.
+# ONLY ADD TRUSTED USERS TO THE VIDEO GROUP, THESE USERS MAY BE ABLE TO CRASH,
+# COMPROMISE, OR IRREPARABLY DAMAGE THE MACHINE.
+options nvidia NVreg_DeviceFileMode=432 NVreg_DeviceFileUID=0 NVreg_DeviceFileGID=VIDEOGID NVreg_ModifyDeviceFiles=1

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drm-outputclass-390.conf b/x11-drivers/nvidia-drivers/files/nvidia-drm-outputclass-390.conf
new file mode 100644
index 00000000000..f459c69dad8
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-drm-outputclass-390.conf
@@ -0,0 +1,7 @@
+Section "OutputClass"
+	Identifier "nvidia"
+	MatchDriver "nvidia-drm"
+	Driver "nvidia"
+	Option "AllowEmptyInitialConfiguration"
+	ModulePath "@LIBDIR@/extensions/nvidia"
+EndSection

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-390.143-r1.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-390.143-r1.ebuild
index 86fc5834f0e..4d8f0d912d0 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-390.143-r1.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-390.143-r1.ebuild
@@ -163,8 +163,8 @@ src_prepare() {
 	sed 's/__NV_VK_ICD__/libGLX_nvidia.so.0/' \
 		nvidia_icd.json.template > nvidia_icd.json || die
 
-	sed "s/%LIBDIR%/$(get_libdir)/g" "${FILESDIR}/nvidia-390.conf" \
-		> nvidia-drm-outputclass.conf || die
+	sed "s|@LIBDIR@|${EPREFIX}/usr/$(get_libdir)|" \
+		"${FILESDIR}"/nvidia-drm-outputclass-390.conf > nvidia-drm-outputclass.conf || die
 
 	gzip -d nvidia-{cuda-mps-control,smi}.1.gz || die
 }
@@ -268,7 +268,7 @@ src_install() {
 		linux-mod_src_install
 
 		insinto /etc/modprobe.d
-		newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
+		newins "${FILESDIR}"/nvidia-390.conf nvidia.conf
 		doins "${FILESDIR}"/nvidia-blacklist-nouveau.conf
 		doins "${FILESDIR}"/nvidia-rmmod.conf
 	fi


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: x11-drivers/nvidia-drivers/, x11-drivers/nvidia-drivers/files/
@ 2022-05-31 19:11 Ionen Wolkens
  0 siblings, 0 replies; 33+ messages in thread
From: Ionen Wolkens @ 2022-05-31 19:11 UTC (permalink / raw
  To: gentoo-commits

commit:     e6d7e9f6548f13be4687fb761377be6bdf79d81f
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Tue May 31 19:03:56 2022 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Tue May 31 19:10:33 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e6d7e9f6

x11-drivers/nvidia-drivers: revert installation of PM rules

Turns out this is only needed if users manually enabled
DynamicPowerManagement (not default) and feel this should not be
installed by default (no revbump given not known to be harmful
and will be cleaned on kernel upgrades).

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 x11-drivers/nvidia-drivers/files/nvidia-470.rules           |  7 -------
 x11-drivers/nvidia-drivers/nvidia-drivers-470.129.06.ebuild | 11 +----------
 x11-drivers/nvidia-drivers/nvidia-drivers-470.62.30.ebuild  | 11 +----------
 x11-drivers/nvidia-drivers/nvidia-drivers-510.73.05.ebuild  | 11 +----------
 x11-drivers/nvidia-drivers/nvidia-drivers-515.43.04.ebuild  | 11 +----------
 x11-drivers/nvidia-drivers/nvidia-drivers-515.48.07.ebuild  | 11 +----------
 6 files changed, 5 insertions(+), 57 deletions(-)

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-470.rules b/x11-drivers/nvidia-drivers/files/nvidia-470.rules
deleted file mode 100644
index ba3cefef9876..000000000000
--- a/x11-drivers/nvidia-drivers/files/nvidia-470.rules
+++ /dev/null
@@ -1,7 +0,0 @@
-# Enable runtime PM for NVIDIA VGA/3D controller devices on driver bind
-ACTION=="bind", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030000", TEST=="power/control", ATTR{power/control}="auto"
-ACTION=="bind", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030200", TEST=="power/control", ATTR{power/control}="auto"
-
-# Disable runtime PM for NVIDIA VGA/3D controller devices on driver unbind
-ACTION=="unbind", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030000", TEST=="power/control", ATTR{power/control}="on"
-ACTION=="unbind", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030200", TEST=="power/control", ATTR{power/control}="on"

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-470.129.06.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-470.129.06.ebuild
index 0288dd432838..19ecb17aad10 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-470.129.06.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-470.129.06.ebuild
@@ -5,7 +5,7 @@ EAPI=8
 
 MODULES_OPTIONAL_USE="driver"
 inherit desktop flag-o-matic linux-mod multilib readme.gentoo-r1 \
-	systemd toolchain-funcs udev unpacker user-info
+	systemd toolchain-funcs unpacker user-info
 
 NV_KERNEL_MAX="5.18"
 NV_URI="https://download.nvidia.com/XFree86/"
@@ -367,9 +367,6 @@ https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers"
 	# 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
-
-	# udev rules taken from nvidia's README.txt to help with power management
-	use driver && udev_newrules "${FILESDIR}"/nvidia-470.rules 60-nvidia.rules
 }
 
 pkg_preinst() {
@@ -401,7 +398,6 @@ pkg_preinst() {
 
 pkg_postinst() {
 	linux-mod_pkg_postinst
-	use driver && udev_reload
 
 	readme.gentoo_print_elog
 
@@ -453,8 +449,3 @@ pkg_postinst() {
 		elog "supported by a few wayland compositors (e.g. kwin / mutter, not sway)."
 	fi
 }
-
-pkg_postrm() {
-	linux-mod_pkg_postrm
-	use driver && udev_reload
-}

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-470.62.30.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-470.62.30.ebuild
index 88c5511fa81a..8c77f921b745 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-470.62.30.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-470.62.30.ebuild
@@ -5,7 +5,7 @@ EAPI=8
 
 MODULES_OPTIONAL_USE="driver"
 inherit desktop flag-o-matic linux-mod multilib readme.gentoo-r1 \
-	systemd toolchain-funcs udev unpacker user-info
+	systemd toolchain-funcs unpacker user-info
 
 NV_KERNEL_MAX="5.15"
 NV_PIN="470.103.01"
@@ -363,9 +363,6 @@ https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers"
 	systemd_dounit systemd/system/nvidia-{hibernate,resume,suspend}.service
 
 	dobin nvidia-bug-report.sh
-
-	# udev rules taken from nvidia's README.txt to help with power management
-	use driver && udev_newrules "${FILESDIR}"/nvidia-470.rules 60-nvidia.rules
 }
 
 pkg_preinst() {
@@ -397,7 +394,6 @@ pkg_preinst() {
 
 pkg_postinst() {
 	linux-mod_pkg_postinst
-	use driver && udev_reload
 
 	readme.gentoo_print_elog
 
@@ -449,8 +445,3 @@ pkg_postinst() {
 		elog "supported by a few wayland compositors (e.g. kwin / mutter, not sway)."
 	fi
 }
-
-pkg_postrm() {
-	linux-mod_pkg_postrm
-	use driver && udev_reload
-}

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-510.73.05.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-510.73.05.ebuild
index c8428c85a142..0921e41c8ac8 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-510.73.05.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-510.73.05.ebuild
@@ -5,7 +5,7 @@ EAPI=8
 
 MODULES_OPTIONAL_USE="driver"
 inherit desktop flag-o-matic linux-mod multilib readme.gentoo-r1 \
-	systemd toolchain-funcs udev unpacker user-info
+	systemd toolchain-funcs unpacker user-info
 
 NV_KERNEL_MAX="5.18"
 NV_URI="https://download.nvidia.com/XFree86/"
@@ -380,9 +380,6 @@ https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers"
 	# 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
-
-	# udev rules taken from nvidia's README.txt to help with power management
-	use driver && udev_newrules "${FILESDIR}"/nvidia-470.rules 60-nvidia.rules
 }
 
 pkg_preinst() {
@@ -414,7 +411,6 @@ pkg_preinst() {
 
 pkg_postinst() {
 	linux-mod_pkg_postinst
-	use driver && udev_reload
 
 	readme.gentoo_print_elog
 
@@ -463,8 +459,3 @@ pkg_postinst() {
 		elog "Of note, may possibly cause issues with SLI and Reverse PRIME."
 	fi
 }
-
-pkg_postrm() {
-	linux-mod_pkg_postrm
-	use driver && udev_reload
-}

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-515.43.04.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-515.43.04.ebuild
index 6b86f430e3c4..b3f07bbc73fc 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-515.43.04.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-515.43.04.ebuild
@@ -5,7 +5,7 @@ EAPI=8
 
 MODULES_OPTIONAL_USE="driver"
 inherit desktop flag-o-matic linux-mod multilib readme.gentoo-r1 \
-	systemd toolchain-funcs udev unpacker user-info
+	systemd toolchain-funcs unpacker user-info
 
 NV_KERNEL_MAX="5.18"
 NV_URI="https://download.nvidia.com/XFree86/"
@@ -404,9 +404,6 @@ https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers"
 	# fails to detect version (i.e. mismatch, or with kernel-open)
 	dosym nvidia-application-profiles-${PV}-key-documentation \
 		${paths[APPLICATION_PROFILE]}/nvidia-application-profiles-key-documentation
-
-	# udev rules taken from nvidia's README.txt to help with power management
-	use driver && udev_newrules "${FILESDIR}"/nvidia-470.rules 60-nvidia.rules
 }
 
 pkg_preinst() {
@@ -438,7 +435,6 @@ pkg_preinst() {
 
 pkg_postinst() {
 	linux-mod_pkg_postinst
-	use driver && udev_reload
 
 	readme.gentoo_print_elog
 
@@ -498,8 +494,3 @@ pkg_postinst() {
 		elog "Of note, may possibly cause issues with SLI and Reverse PRIME."
 	fi
 }
-
-pkg_postrm() {
-	linux-mod_pkg_postrm
-	use driver && udev_reload
-}

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-515.48.07.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-515.48.07.ebuild
index 03d8a9d79a37..462e7a7ec053 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-515.48.07.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-515.48.07.ebuild
@@ -5,7 +5,7 @@ EAPI=8
 
 MODULES_OPTIONAL_USE="driver"
 inherit desktop flag-o-matic linux-mod multilib readme.gentoo-r1 \
-	systemd toolchain-funcs udev unpacker user-info
+	systemd toolchain-funcs unpacker user-info
 
 NV_KERNEL_MAX="5.18"
 NV_URI="https://download.nvidia.com/XFree86/"
@@ -403,9 +403,6 @@ https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers"
 	# fails to detect version (i.e. mismatch, or with kernel-open)
 	dosym nvidia-application-profiles-${PV}-key-documentation \
 		${paths[APPLICATION_PROFILE]}/nvidia-application-profiles-key-documentation
-
-	# udev rules taken from nvidia's README.txt to help with power management
-	use driver && udev_newrules "${FILESDIR}"/nvidia-470.rules 60-nvidia.rules
 }
 
 pkg_preinst() {
@@ -437,7 +434,6 @@ pkg_preinst() {
 
 pkg_postinst() {
 	linux-mod_pkg_postinst
-	use driver && udev_reload
 
 	readme.gentoo_print_elog
 
@@ -497,8 +493,3 @@ pkg_postinst() {
 		elog "Of note, may possibly cause issues with SLI and Reverse PRIME."
 	fi
 }
-
-pkg_postrm() {
-	linux-mod_pkg_postrm
-	use driver && udev_reload
-}


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: x11-drivers/nvidia-drivers/, x11-drivers/nvidia-drivers/files/
@ 2022-09-16  6:15 Ionen Wolkens
  0 siblings, 0 replies; 33+ messages in thread
From: Ionen Wolkens @ 2022-09-16  6:15 UTC (permalink / raw
  To: gentoo-commits

commit:     e1b84c5ad27be16032ac596f0cad88869b3c1741
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 16 05:14:10 2022 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Fri Sep 16 06:05:35 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e1b84c5a

x11-drivers/nvidia-drivers: fix building modules with clang15

Closes: https://bugs.gentoo.org/870238
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 .../files/nvidia-drivers-390.154-clang15.patch     |  81 ++++++++++++++++
 .../files/nvidia-drivers-470.141.03-clang15.patch  | 107 +++++++++++++++++++++
 .../nvidia-drivers/nvidia-drivers-390.154.ebuild   |   1 +
 .../nvidia-drivers-470.141.03.ebuild               |   1 +
 .../nvidia-drivers/nvidia-drivers-510.85.02.ebuild |   1 +
 .../nvidia-drivers/nvidia-drivers-515.49.15.ebuild |   4 +
 .../nvidia-drivers/nvidia-drivers-515.65.01.ebuild |   4 +
 7 files changed, 199 insertions(+)

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-390.154-clang15.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-390.154-clang15.patch
new file mode 100644
index 000000000000..85d502ca662f
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-390.154-clang15.patch
@@ -0,0 +1,81 @@
+https://bugs.gentoo.org/870238
+--- a/kernel/nvidia/nvlink_linux.c
++++ b/kernel/nvidia/nvlink_linux.c
+@@ -639 +639 @@
+-void * NVLINK_API_CALL nvlink_allocLock()
++void * NVLINK_API_CALL nvlink_allocLock(void)
+--- a/kernel/nvidia/os-interface.c
++++ b/kernel/nvidia/os-interface.c
+@@ -879 +879 @@
+-NV_STATUS NV_API_CALL os_flush_cpu_cache()
++NV_STATUS NV_API_CALL os_flush_cpu_cache(void)
+@@ -886 +886 @@
+-NV_STATUS NV_API_CALL os_flush_cpu_cache_all()
++NV_STATUS NV_API_CALL os_flush_cpu_cache_all(void)
+@@ -944 +944 @@
+-void NV_API_CALL os_flush_cpu_write_combine_buffer()
++void NV_API_CALL os_flush_cpu_write_combine_buffer(void)
+@@ -1073 +1073 @@
+-NvU32 NV_API_CALL os_get_cpu_number()
++NvU32 NV_API_CALL os_get_cpu_number(void)
+@@ -1080 +1080 @@
+-NvU32 NV_API_CALL os_get_cpu_count()
++NvU32 NV_API_CALL os_get_cpu_count(void)
+@@ -1155 +1155 @@
+-void NV_API_CALL os_dump_stack()
++void NV_API_CALL os_dump_stack(void)
+--- a/kernel/nvidia-uvm/uvm8_lock.c
++++ b/kernel/nvidia-uvm/uvm8_lock.c
+@@ -312 +312 @@
+-bool __uvm_thread_check_all_unlocked()
++bool __uvm_thread_check_all_unlocked(void)
+--- a/kernel/nvidia-uvm/uvm8_perf_heuristics.c
++++ b/kernel/nvidia-uvm/uvm8_perf_heuristics.c
+@@ -29 +29 @@
+-NV_STATUS uvm_perf_heuristics_init()
++NV_STATUS uvm_perf_heuristics_init(void)
+@@ -44 +44 @@
+-void uvm_perf_heuristics_exit()
++void uvm_perf_heuristics_exit(void)
+--- a/kernel/nvidia-uvm/uvm8_perf_prefetch.c
++++ b/kernel/nvidia-uvm/uvm8_perf_prefetch.c
+@@ -462 +462 @@
+-NV_STATUS uvm_perf_prefetch_init()
++NV_STATUS uvm_perf_prefetch_init(void)
+@@ -500 +500 @@
+-void uvm_perf_prefetch_exit()
++void uvm_perf_prefetch_exit(void)
+--- a/kernel/nvidia-uvm/uvm8_perf_thrashing.c
++++ b/kernel/nvidia-uvm/uvm8_perf_thrashing.c
+@@ -1324 +1324 @@
+-NV_STATUS uvm_perf_thrashing_init()
++NV_STATUS uvm_perf_thrashing_init(void)
+@@ -1401 +1401 @@
+-void uvm_perf_thrashing_exit()
++void uvm_perf_thrashing_exit(void)
+--- a/kernel/nvidia-uvm/uvm8_procfs.c
++++ b/kernel/nvidia-uvm/uvm8_procfs.c
+@@ -61 +61 @@
+-NV_STATUS uvm_procfs_init()
++NV_STATUS uvm_procfs_init(void)
+@@ -77 +77 @@
+-void uvm_procfs_exit()
++void uvm_procfs_exit(void)
+@@ -106 +106 @@
+-struct proc_dir_entry *uvm_procfs_get_gpu_base_dir()
++struct proc_dir_entry *uvm_procfs_get_gpu_base_dir(void)
+--- a/kernel/nvidia-uvm/uvm8_push.c
++++ b/kernel/nvidia-uvm/uvm8_push.c
+@@ -103 +103 @@
+-bool uvm_push_info_is_tracking_descriptions()
++bool uvm_push_info_is_tracking_descriptions(void)
+--- a/kernel/nvidia-uvm/uvm8_tools.c
++++ b/kernel/nvidia-uvm/uvm8_tools.c
+@@ -2041 +2041 @@
+-void uvm_tools_flush_events()
++void uvm_tools_flush_events(void)
+--- a/kernel/nvidia-uvm/uvm_common.c
++++ b/kernel/nvidia-uvm/uvm_common.c
+@@ -63 +63 @@
+-bool uvm_debug_prints_enabled()
++bool uvm_debug_prints_enabled(void)

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-470.141.03-clang15.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-470.141.03-clang15.patch
new file mode 100644
index 000000000000..71cb6cf7e980
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-470.141.03-clang15.patch
@@ -0,0 +1,107 @@
+https://bugs.gentoo.org/870238
+--- a/kernel/nvidia/nvlink_linux.c
++++ b/kernel/nvidia/nvlink_linux.c
+@@ -571 +571 @@
+-void * nvlink_allocLock()
++void * nvlink_allocLock(void)
+--- a/kernel/nvidia/os-interface.c
++++ b/kernel/nvidia/os-interface.c
+@@ -1076 +1076 @@
+-NvU32 NV_API_CALL os_get_cpu_number()
++NvU32 NV_API_CALL os_get_cpu_number(void)
+@@ -1083 +1083 @@
+-NvU32 NV_API_CALL os_get_cpu_count()
++NvU32 NV_API_CALL os_get_cpu_count(void)
+@@ -1136 +1136 @@
+-void NV_API_CALL os_dump_stack()
++void NV_API_CALL os_dump_stack(void)
+--- a/kernel/nvidia-uvm/uvm_common.c
++++ b/kernel/nvidia-uvm/uvm_common.c
+@@ -37 +37 @@
+-bool uvm_debug_prints_enabled()
++bool uvm_debug_prints_enabled(void)
+--- a/kernel/nvidia-uvm/uvm_gpu_access_counters.c
++++ b/kernel/nvidia-uvm/uvm_gpu_access_counters.c
+@@ -1527 +1527 @@
+-NV_STATUS uvm_perf_access_counters_init()
++NV_STATUS uvm_perf_access_counters_init(void)
+@@ -1538 +1538 @@
+-void uvm_perf_access_counters_exit()
++void uvm_perf_access_counters_exit(void)
+--- a/kernel/nvidia-uvm/uvm_lock.c
++++ b/kernel/nvidia-uvm/uvm_lock.c
+@@ -337 +337 @@
+-bool __uvm_thread_check_all_unlocked()
++bool __uvm_thread_check_all_unlocked(void)
+--- a/kernel/nvidia-uvm/uvm_migrate.c
++++ b/kernel/nvidia-uvm/uvm_migrate.c
+@@ -795 +795 @@
+-NV_STATUS uvm_migrate_init()
++NV_STATUS uvm_migrate_init(void)
+@@ -821 +821 @@
+-void uvm_migrate_exit()
++void uvm_migrate_exit(void)
+--- a/kernel/nvidia-uvm/uvm_migrate_pageable.c
++++ b/kernel/nvidia-uvm/uvm_migrate_pageable.c
+@@ -979 +979 @@
+-NV_STATUS uvm_migrate_pageable_init()
++NV_STATUS uvm_migrate_pageable_init(void)
+@@ -988 +988 @@
+-void uvm_migrate_pageable_exit()
++void uvm_migrate_pageable_exit(void)
+--- a/kernel/nvidia-uvm/uvm_perf_heuristics.c
++++ b/kernel/nvidia-uvm/uvm_perf_heuristics.c
+@@ -31 +31 @@
+-NV_STATUS uvm_perf_heuristics_init()
++NV_STATUS uvm_perf_heuristics_init(void)
+@@ -50 +50 @@
+-void uvm_perf_heuristics_exit()
++void uvm_perf_heuristics_exit(void)
+--- a/kernel/nvidia-uvm/uvm_perf_prefetch.c
++++ b/kernel/nvidia-uvm/uvm_perf_prefetch.c
+@@ -463 +463 @@
+-NV_STATUS uvm_perf_prefetch_init()
++NV_STATUS uvm_perf_prefetch_init(void)
+@@ -501 +501 @@
+-void uvm_perf_prefetch_exit()
++void uvm_perf_prefetch_exit(void)
+--- a/kernel/nvidia-uvm/uvm_perf_thrashing.c
++++ b/kernel/nvidia-uvm/uvm_perf_thrashing.c
+@@ -1955 +1955 @@
+-NV_STATUS uvm_perf_thrashing_init()
++NV_STATUS uvm_perf_thrashing_init(void)
+@@ -2014 +2014 @@
+-void uvm_perf_thrashing_exit()
++void uvm_perf_thrashing_exit(void)
+--- a/kernel/nvidia-uvm/uvm_procfs.c
++++ b/kernel/nvidia-uvm/uvm_procfs.c
+@@ -49 +49 @@
+-NV_STATUS uvm_procfs_init()
++NV_STATUS uvm_procfs_init(void)
+@@ -69 +69 @@
+-void uvm_procfs_exit()
++void uvm_procfs_exit(void)
+@@ -98 +98 @@
+-struct proc_dir_entry *uvm_procfs_get_gpu_base_dir()
++struct proc_dir_entry *uvm_procfs_get_gpu_base_dir(void)
+@@ -103 +103 @@
+-struct proc_dir_entry *uvm_procfs_get_cpu_base_dir()
++struct proc_dir_entry *uvm_procfs_get_cpu_base_dir(void)
+--- a/kernel/nvidia-uvm/uvm_push.c
++++ b/kernel/nvidia-uvm/uvm_push.c
+@@ -245 +245 @@
+-bool uvm_push_info_is_tracking_descriptions()
++bool uvm_push_info_is_tracking_descriptions(void)
+@@ -250 +250 @@
+-bool uvm_push_info_is_tracking_acquires()
++bool uvm_push_info_is_tracking_acquires(void)
+--- a/kernel/nvidia-uvm/uvm_thread_context.c
++++ b/kernel/nvidia-uvm/uvm_thread_context.c
+@@ -104 +104 @@
+-bool uvm_thread_context_wrapper_is_used()
++bool uvm_thread_context_wrapper_is_used(void)
+--- a/kernel/nvidia-uvm/uvm_tools.c
++++ b/kernel/nvidia-uvm/uvm_tools.c
+@@ -2144 +2144 @@
+-void uvm_tools_flush_events()
++void uvm_tools_flush_events(void)

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-390.154.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-390.154.ebuild
index a13b4048b927..b73a7c2ccd4e 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-390.154.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-390.154.ebuild
@@ -73,6 +73,7 @@ BDEPEND="
 QA_PREBUILT="opt/bin/* usr/lib*"
 
 PATCHES=(
+	"${FILESDIR}"/nvidia-drivers-390.154-clang15.patch
 	"${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch
 	"${FILESDIR}"/nvidia-settings-390.141-fno-common.patch
 	"${FILESDIR}"/nvidia-settings-390.144-desktop.patch

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-470.141.03.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-470.141.03.ebuild
index de3196b87ae6..cc7b2513a5a3 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-470.141.03.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-470.141.03.ebuild
@@ -76,6 +76,7 @@ BDEPEND="
 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
 	"${FILESDIR}"/nvidia-settings-390.144-desktop.patch
 	"${FILESDIR}"/nvidia-settings-390.144-no-gtk2.patch

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-510.85.02.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-510.85.02.ebuild
index 35ec0faaa70c..632cee27f396 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-510.85.02.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-510.85.02.ebuild
@@ -79,6 +79,7 @@ BDEPEND="
 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
 	"${FILESDIR}"/nvidia-settings-390.144-desktop.patch
 	"${FILESDIR}"/nvidia-settings-390.144-no-gtk2.patch

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-515.49.15.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-515.49.15.ebuild
index c2597443890a..628cd1a50969 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-515.49.15.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-515.49.15.ebuild
@@ -81,6 +81,7 @@ BDEPEND="
 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
 	"${FILESDIR}"/nvidia-settings-390.144-desktop.patch
 	"${FILESDIR}"/nvidia-settings-390.144-no-gtk2.patch
@@ -164,6 +165,9 @@ src_prepare() {
 	rm nvidia-xconfig && mv nvidia-xconfig{-${NV_PIN},} || die
 	mv open-gpu-kernel-modules-${PV} kernel-module-source || die
 
+	eapply --directory=kernel-module-source/kernel-open \
+		-p2 "${FILESDIR}"/nvidia-drivers-470.141.03-clang15.patch
+
 	default
 
 	# prevent detection of incomplete kernel DRM support (bug #603818)

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-515.65.01.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-515.65.01.ebuild
index f48badecc24c..c95218f51107 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-515.65.01.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-515.65.01.ebuild
@@ -81,6 +81,7 @@ BDEPEND="
 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
 	"${FILESDIR}"/nvidia-settings-390.144-desktop.patch
 	"${FILESDIR}"/nvidia-settings-390.144-no-gtk2.patch
@@ -164,6 +165,9 @@ src_prepare() {
 	rm nvidia-xconfig && mv nvidia-xconfig{-${PV},} || die
 	mv NVIDIA-kernel-module-source-${PV} kernel-module-source || die
 
+	eapply --directory=kernel-module-source/kernel-open \
+		-p2 "${FILESDIR}"/nvidia-drivers-470.141.03-clang15.patch
+
 	default
 
 	# prevent detection of incomplete kernel DRM support (bug #603818)


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: x11-drivers/nvidia-drivers/, x11-drivers/nvidia-drivers/files/
@ 2022-12-02 18:13 Ionen Wolkens
  0 siblings, 0 replies; 33+ messages in thread
From: Ionen Wolkens @ 2022-12-02 18:13 UTC (permalink / raw
  To: gentoo-commits

commit:     e353fc3204fbc812e1fda4777b3e8929fd946068
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Fri Dec  2 18:04:14 2022 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Fri Dec  2 18:12:58 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e353fc32

x11-drivers/nvidia-drivers: drop vulnerable 390.154, 470.141.03, ...

... 510.85.02, 515.65.01

Bug: https://bugs.gentoo.org/884045
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 x11-drivers/nvidia-drivers/Manifest                |  23 -
 .../files/nvidia-drivers-515.65.01-kernel6.patch   |  19 -
 .../nvidia-drivers/nvidia-drivers-390.154.ebuild   | 506 ------------------
 .../nvidia-drivers-470.141.03.ebuild               | 531 -------------------
 .../nvidia-drivers/nvidia-drivers-510.85.02.ebuild | 540 -------------------
 .../nvidia-drivers/nvidia-drivers-515.65.01.ebuild | 584 ---------------------
 6 files changed, 2203 deletions(-)

diff --git a/x11-drivers/nvidia-drivers/Manifest b/x11-drivers/nvidia-drivers/Manifest
index a59dd6faa3f0..135c72e9e161 100644
--- a/x11-drivers/nvidia-drivers/Manifest
+++ b/x11-drivers/nvidia-drivers/Manifest
@@ -1,65 +1,42 @@
 DIST NVIDIA-Linux-aarch64-510.108.03.run 211471630 BLAKE2B 4177e12907bb577d96734c33d0210eb753a763390aa1dde6e578d81dd47685bc3518af6c1dc2490e3ed488e9cede7e5705f8cf5e264f756de75d3a995c7d3f04 SHA512 fbd395d004d8a25d175958f8a9f9d4f19bc4e0662256e45cf9ed353613e2741f75e4fb2b87d5eb1625914c5ae3ab49e1b7025c8894d9e1cd0028a6d322836a67
-DIST NVIDIA-Linux-aarch64-510.85.02.run 211430737 BLAKE2B 80dbdae485a70c118bb4d6393fce80a0ac0392e38b959685428407b48786d543ec1651b5a38984c5218730e1766e4fb890a0afaa28a981a097cadaf516d9d135 SHA512 54faa9b68425dd046f42180560aaedf4805a7b9c5cfbb80b3729ed6eb61faf3ef619cce8fe0b2af30b810a1aa43279b0435decbdd5c35434a5aafc08b3354547
-DIST NVIDIA-Linux-aarch64-515.65.01.run 220195966 BLAKE2B f83292c15e1f2baf3e6d6460e4aa59a24e87787d5e5ed68e13bc2321b080582eb54392ca396406f35680d1f713926fd268617a13a1b0c7d9302aa6feb91bc9a0 SHA512 31ec7ba727bf14263eeadc3880bd8f2aaa0fe8c144aa216bb8af06a154dd1aa5f4a787fe386b20f5d739a49c80435bca5f6deba3010c593e1e54ecd29b4ab1b0
 DIST NVIDIA-Linux-aarch64-515.86.01.run 221097882 BLAKE2B f8562f9ef1d29451792e00f5489ae7bf63d1a9c5a13354f119667e5572f473abe14a82383c7f61251213ef16463c064059316c7da09a5d61207823b17a7183bf SHA512 43161f86143b1558d1f558acf4a060f53f538ea20e6235f76be24916fe4a9c374869645c7abf39eba66f1c2ca35f5d2b04f199bd1341b7ee6c1fdc879cb3ef96
 DIST NVIDIA-Linux-aarch64-525.60.11.run 261636786 BLAKE2B 1149a55e346e4fe122ba742b3c138c1896a6f151681e738a00dafca707c126d00ab3bf8104d4c138b995031addb1f58f8bf1ec19edbb634536497e33d2693711 SHA512 3ef51518771421279cc2125fbef73d8d93a9d70d75b3d74452c2d456ab228e0a4c2ff5eb93e93b3bd68e8d1698da02d5236a34bafec35c86260bbd45cf3a7db6
-DIST NVIDIA-Linux-x86-390.154.run 49362860 BLAKE2B 083d9dd234a37ec39a703ef7e0eb6ec165c24d2fcb5e92ca987c33df643d0604319eb65ef152c861acacd5a41858ab6b82c45c2c8ff270efc62b07727666daae SHA512 5064ae135d099a4b8b81cf4d29f0cc0dcbcd93f13cadb0378f5e20eefad47522bdab42c9130f22ac8a22a4bef22365321cb35dc53b0ba35374e2bedd44e5a5c2
 DIST NVIDIA-Linux-x86-390.157.run 49417041 BLAKE2B 435b5e0e60468cc74b41cc5d9b5bb0105d29c11a2d408457835212a96519c9334ecf19278b36749d3ff7f498f5b0ae45a2efae2d428703dac21245c62f1efebe SHA512 dae9ac2c12f9ad90f7441e00e01a984147c577892421911d7f67f6a31e616ac1cb7d434bc9c7f58fbd9b8ae909521b5bece607a63c79588c0bb9d99c6bad5fb0
-DIST NVIDIA-Linux-x86_64-390.154.run 84438529 BLAKE2B e1bd2982f9697e74b593380acf471e03192cd8d20f14bd9b43e6d5925421c518278e75515a0713be25b29bf99d7ea49c770adf2cede79736a03f323d5ed96a33 SHA512 cab7de6db783089c1e385da0296c43d2cbbe266bac2bc177044e279224a6ef9c76495b46c4b7056eb5a82b21932a2002e0c12f7659b446a2586f9df30a69a9a3
 DIST NVIDIA-Linux-x86_64-390.157.run 85835541 BLAKE2B 44b855cd11f3b2f231f9fb90492ae2e67a67ea3ea83c413e7c90956d38c9730a8bd0321281ae03c6afce633d102f5b499aed25622b9bfd31bdd2c98f0717e95b SHA512 4780503a4cff0180b1b1f37d20a6ba3438dd78b51fa7f69b98d35521835e5d61099129746929d51d63afa2d47b672b3e145e1e1897584dc3799e7f822c5b3a0a
-DIST NVIDIA-Linux-x86_64-470.141.03.run 272986406 BLAKE2B 12ef580dd98146715442e6b8e9f27bab4a12121f3edb2e291961f8dea96ec1b81d2c974d380018223999c67a7bec9873675487f436e60aab34e83b1a5b7065f1 SHA512 07aca8ea6aac5592060b4177ef43e9a3a5b2e3bc1a2d5959bf2ae349763fc62ed80b987af5607bf2d9a48e25c4e38e64970bca0177d63bd57a703d47debf5e18
 DIST NVIDIA-Linux-x86_64-470.161.03.run 272397700 BLAKE2B eaa94b7398b3aaadf30c33c95c95b167094ca56114e2e3032978b0959264ac8b8663181485eb1af0282a59b43f912c0ecd48e5eadcb06b6fda601b357ac49bc7 SHA512 26b1640f9427847b68233ffacf5c4a07e75ed9923429dfc9e5de3d7e5c1f109dfaf0fe0a0639cbd47f056784ed3e00e2e741d5c84532df79590a0c9ffa5ba625
 DIST NVIDIA-Linux-x86_64-510.108.03.run 329603898 BLAKE2B ec7327628cc0d5929f91fa7dcf09d741341b15a509169d8de187f66a99a9196077362bd9a370ba5e294fd644a3aee1bd3abfc45f20c9cb5b05660d299c9e0479 SHA512 70fbd91b0dc5db119acf20654854c417bb14889e84145e2675dc893e7247a9c34f90820cddb8202cf5c3219abc286c7014b247a2ce94bdb5681a1bca96f41a29
-DIST NVIDIA-Linux-x86_64-510.85.02.run 329836795 BLAKE2B f9f56a2498d223ee5a27b783bb2cffb8e77cdb9ed5139afce2bd6fc4e9eccb19b7068b9fa15b4e9f7242cfcdd1fe3f93faf342aae1eb5e9b32625663a0c32463 SHA512 ce04706b707d08f601ee23ed2f4b5d6b4c2e8c17d74557b720be64e0c0f4ff915bcf35efa2470c27d90a7e1bad4eab48e6d9b2b1f05442546d3324f2a10fa69b
 DIST NVIDIA-Linux-x86_64-515.49.25.run 362202449 BLAKE2B 6ca62c747d62e3518e5d2f9926b41e7b0e297523d7f10164ad66c98328b710590932e1cfbf95322914c454cb38395a0f14ea3a881c6b91389db09782e21f9a23 SHA512 3d727d602919eb5569397c09a9dfe42f33d4f2f12c76c106638fe7c5fbe05b671cdb4d2946174cec730e5bb8d2d2a16a8afd622ab981d99475f72aa4f6239a2b
-DIST NVIDIA-Linux-x86_64-515.65.01.run 364182561 BLAKE2B 552084a5347c0388f5cb0a6eecf41fb3d401356cbbbe957569e3eb0a4ca03b3db0dea0f7f6a37a6b66cf6d5377677ee57a6df73668002a13efd8140b153fcf03 SHA512 5221a4ac071eb39a37a841f19cfe4983286dc35e918956b40604404ef36c122612475df7b9a391a9a70bd60f44e598c8a0e5ec54ccc3e90d51f01e1b2fbe5e33
 DIST NVIDIA-Linux-x86_64-515.86.01.run 363743089 BLAKE2B aa03a0f059da99fa549cd9d672cef0194f2b22b349470d80ce626b3f4afb89b1f130b451735f92f5a66dfec02735bd6395053be609668371991837e3be4026cb SHA512 9a31e14afc017e847f1208577f597c490adb63c256d6dff1a9eae56b65cf85374a604516b0be9da7a43e9af93b3c5aec47b2ffefd6b4050a4b7e55f348cf4e7b
 DIST NVIDIA-Linux-x86_64-525.60.11.run 413889779 BLAKE2B 2e8f1dfdf3765f8764e245282b76780d405dadb23b66b118b8c48dd694477df79d370a5bbceef2ee93dd97191c354fd1263bbe787d6702a91495ad4f1082c114 SHA512 b31e8fe04f69815bbf9a11884f30a95f3566f6bddb5aa46f2758821685474df5e1a57c3698f9f0357f9eb42a3e2c54e171eb8337d960cea7511d58fba2d95c13
-DIST NVIDIA-kernel-module-source-515.65.01.tar.xz 7510104 BLAKE2B 806f895d2de136427702c21ae231ba0e304850b07f2f43f3f2f1ba7b0115b7c9bb36435ad53ade6c778ab74af976c4613427644c1c03e3a9df9ddcb6f79de0fc SHA512 2975a498d7dbeace6feae5611b27be640e05fedf5faa257abde839756f508bae238de59a3277fb3326a51c048d9478b19d9ef7968061aaac9f1f588851bdf983
 DIST NVIDIA-kernel-module-source-515.86.01.tar.xz 7504412 BLAKE2B 20b1b9eb6e2fbc7adfa0b78c6acc88c9da8346888c3d1f1ec01a6c1252feccfc104e338605bfaf7617f0b78c7d0de05b32577394714be3575aa67b37c0e843ca SHA512 075fb8b9c3f43f21f51035460a9bc306b11214eb029e950a5bfbc283dc1d3403210ae303148442d31b2c5bf618923bd1762ab5a91234d005f50177fc02fa8ba4
 DIST NVIDIA-kernel-module-source-525.60.11.tar.xz 10013356 BLAKE2B a1b8149a0a045e47db91ec9e4f80700aed39d38e305c0cd6fd6158cb59fb44910077109a40072741a871685ec58a50dbf1506c836f85cd393a5a9368554207da SHA512 b460214d393af863dce8e9ae34b95337d22e7ab9665898faffb471310a9e340667addf44af6029db09721b5286a6ee4852caa56b7fb26ba4877df23d8e9a2f80
-DIST nvidia-installer-390.154.tar.bz2 150301 BLAKE2B c9c91b19455823e42ccb9c9c49761f38bd3f85ddfe2fb4c159fe37f10a1d66f5b7b02d66b403881d863c905f86f1ecc1ac7393f051f1b7bee764ab1e15638218 SHA512 56ef5b845cd92a235473e868f81d6f94a1dc685e8bd113cc63be43d68a00f8f4eb74e239a2fec623a4ba89dd5c3690d5f97d06d71ca093570a05bd88757224fd
 DIST nvidia-installer-390.157.tar.bz2 150323 BLAKE2B 8058ca87a6dea956d564af9f7eab9b1fc82b1f2382bd5cb2f6d97cbe2e19292533522d5f8f2eacbeb16520372715fcb72f8f9b0998962af5d4e75522c8d74524 SHA512 93a7ece648602157496c8e27a88864ede341a100f5328a4c1a25faf8f0b94d252060e5e2f71d0c302fd0566c10773c30b76b3b5f431d8039b71c90a7969f7d7e
-DIST nvidia-installer-470.141.03.tar.bz2 146470 BLAKE2B 60694dba638a8214828c9f2eb191e6dd912775bc73d038bf7d658a70282e368b061777455180a07e1c08b381adeaa9349ffab95582265968a990f99cce21a93c SHA512 8b1d33ab29fbb49ce43a2a446a1f9ffaff2107f329b8c7e4741abacc78abbd3e9b2e6e6dbf4638a4223af3900e550f544535def40bf3628f7fb11b2ffecb9266
 DIST nvidia-installer-470.161.03.tar.bz2 146227 BLAKE2B 4c733877adbe5f44e2d112fe2401657c2e2809ff76d0eac29409be7c624e073d4a2fbcfb39eb706625d93d1f3c753d47271a6c2c660270824cfea350e07c751a SHA512 eab1308b85dd66ae4332aff766a237e77c763af45a0e62eba0958abcaa493950aa19edd95039d03e783d78d0ad1fe8348a13d5b64fa103410acfa6ad5f95a884
 DIST nvidia-installer-510.108.03.tar.bz2 144494 BLAKE2B de7c3f5c50350318a3e95bfbdd8fa7f51f187298497e88519f9d4719e26f310f2420ef8e500866cee0e6c22e888c4282a65e1edcc9c7e3d4d4799ff8e6856789 SHA512 b90efcc082b6de0ca42fe203ae0b60aafc8623377f31fd5262401e933bf630b11c843d5e02951374a9276e5d08eaa0c28bf2aa4987b8f9ae8719ada6e62ea7c1
-DIST nvidia-installer-510.85.02.tar.bz2 144326 BLAKE2B 08ee6fd80d8d22f8d644362bd292debfb0a47bd7592301daebd4e19675fca21af5e040d364dafd25a2d2c93f841495160fce7de0262322472c9b1c3ba2441711 SHA512 ff0ecc09441354c705a28621c0a8661b07c23f0ed0f25f1dcb995066c1fdfd486a5c7164d626316ff253f1c50264a2b46b970bf40c75fc6369e9e6698eb2e489
 DIST nvidia-installer-515.65.01.tar.bz2 144675 BLAKE2B 19e5b67c6972ba8435b215a20c8bcd62dd8c1e9a6ae6eac3209f7d9116397f32c43a8f5d8dd8d6d63ac4c6348c610daedde2908b7fd80a8d03ef2c7246b8b9b2 SHA512 0784249253d5e69eabb8c948ad1648d23f59c8c5c4021b5274af2d640de37b5a8b8a55e6ab979cefc2271162bdfce42fd8cbf4640c3c20f5171a032c8b4c44c0
 DIST nvidia-installer-515.86.01.tar.bz2 144637 BLAKE2B 840e2258224e0d19dfe092bc8e8d5986ff771a9fbacfc6c682c513e2757072b68252ebbe4ec8a491997db80f3e1c6879b9dc8f93134caf6f0e6ea3360253fbd9 SHA512 3f55ab79283f1730b5cf5898d9df97a78b8d86f0ac124af9e31c7a960f4a82e46bc262fc0cd8ae9c29c3bab65e2be1ca3565d0a470017a153fa58f61241b34b2
 DIST nvidia-installer-525.60.11.tar.bz2 147770 BLAKE2B 43422873cc894a3b083d8f1ad9dbdaa7bb4e2b0e83c563d223c0b2fadf84a95cc2f5805eb60766233c87d05b1dfb56c36c8d6a8fa84f3aa5a3676508e5a67abe SHA512 effb97a5bdc80c014c9174195d80c75948a99faedcb70747d16f9f77766e0d218bfb59ccff216e4332fa9926c9d965e6d24821ccd14b13595880c3434cece992
-DIST nvidia-modprobe-390.154.tar.bz2 35315 BLAKE2B 02d9f11345ceb13e073d4f43401e95d04dc4eb54fdb7eb8966b60450accf103a403c2d101be6a0548ae59bce7412fe491becf707b17c6a3dd50bb2eef864feff SHA512 09b5119ace0a48cc6fea92ed220a702a5033e7205d39bb111e49eb84f7b0fe193f8c3870da9f7df6816ea4c8cb91c2c776f54f448e423fbf8dfa7d3a7f96411b
 DIST nvidia-modprobe-390.157.tar.bz2 35306 BLAKE2B 80d202b39c2f95ec0f909712c2e101483af50124092c32efb33bd98ff58ddfb97b737ff07f1ddc941f688c1b4c26a15f392566d522e18506771f10422fcd571c SHA512 109bbe24a3758b568ea65fe1e9d78f69fae6108ec0497b796c885a3912825fe04ffd7389a3e22987f1a10a2926bf6eaa384faabc59478aa3ee244dd3ac91c6d3
-DIST nvidia-modprobe-470.141.03.tar.bz2 38359 BLAKE2B 08a1cb82f20f703258152f6317ffe50d4cf8398e8ca34c7e8a405094c246c381c67b20e8aac92937bf76e0db8c1edd87f984b371923aded9f25ff36661197072 SHA512 b9aaa1425234e63ef02ea02a6bff9f68ee497654afb5eeff7843e9589371d9f0941a20924a0157e1e0f08fe92f41ac13a2e5bc8db341a16538c28af35bb5fd57
 DIST nvidia-modprobe-470.161.03.tar.bz2 38348 BLAKE2B a137e38463f806d25e91d81faefaabc5cd5e51e6537b0a9e641ff96b6029c522eca3766b46a240bd5d25cf04fc11c8eca6b1ae2cbdcc17bc7f0d059fcba67fc7 SHA512 f3b95c22b600b1e09797ff346b7bddb7d84abab01b5383b08626e3172cae8c84fcb3d0ce6425769eafad9602656704c51b934131b3e0b7512de82e5acafcfd15
 DIST nvidia-modprobe-510.108.03.tar.bz2 39055 BLAKE2B c195f55a60eb058b2da704d2aea245aab82a5129ac974cf0d5eeb6b39256c749b7b7de144e067887eac3fb03061d4f87a9c694429078d0eb0242227df1a65a3f SHA512 9ba4fd40b06ffc2f880944dc4b58155a746422cbb02cd17f6af59e3975d46861f182d9257fe654c35d991f7799d95a0a0ed0fe4bfac4426d997a22e3b270fd37
-DIST nvidia-modprobe-510.85.02.tar.bz2 39061 BLAKE2B 5ee7e1f3199cf9cd1041d86b7048d0a063adab6d1a027b0937feeec8c3785fe222eb6fc151c23d855ec3db06db522d60ea9d4d962925bf80d2c90e76a519c181 SHA512 936647ae493d6a2a94ac1a99f7f6bfae0e5e5a27fd55b616937bfc568d2b768dcddd13cabace876f860329d7afb95a547f43e8b9cece5b7524a93111bc01b632
 DIST nvidia-modprobe-515.65.01.tar.bz2 39122 BLAKE2B 3184c3478170b7a9758123e3aed68ce5318a92ed055e6a5fb4cdee8c4e00885da0d22dfbb7b453dcb45b596f709fadfaf13e736b4d2fbc0547d0d802d6dab7b2 SHA512 20360282a5f59cc2e7c25bbb87220c2c4d5d2f3c458147f59a689f7f37b2ce59308ba4306a9ab2be5af592e277bf754205fd8c9d53f7eb85454bdc0636a2f33e
 DIST nvidia-modprobe-515.86.01.tar.bz2 39100 BLAKE2B 00157bc2cc78c58389772dd92c0e389420b93068c673153be32ae385efd50071ed9986c3bfe0d9242a539536c1cd3fd9c502ed7d00523aa653c7a9085a6333bb SHA512 14c82274bc87da0b4f2f8d3a53d02ea55fb003a32ed10a2259598db86655cccbf39fa6bded836cf2bb667c2eb842ae0ccfcf39fe32ee78ff291827673d02634c
 DIST nvidia-modprobe-525.60.11.tar.bz2 39987 BLAKE2B af7e3119e0b9af32bed30c097f2a9bf55f9e53795a251ca237d8c1cc6d6f07e6d0db41ea996a7410f3c76a89c16dc50e4798d2c0b7bd6e9a89a5532fd84d2849 SHA512 e6f6353ffc3e39f005c8c732bf8694b168ed96ab70df333622aa2f9f4715dd8cc1b3d8b2fdc1bd1fa704128d491c911fd2cd479d18572ab28d690297f19b2a3e
-DIST nvidia-persistenced-390.154.tar.bz2 48669 BLAKE2B 13739d3b32d7f5fddebc599d024968cd6fc2cd516da80bc2f0f4c61be01c622f13274157cce2997a051dafc19375c997927c0042c3fdbfecb4d0634463dfccd6 SHA512 efd6f15b9f4b91ab3c41d55138da48198889f3ee58b20b5e12cf0e47bb736cf559b69c679060563612a33c41b6187aec83052a1edf155438ed4935821aa2cf41
 DIST nvidia-persistenced-390.157.tar.bz2 48654 BLAKE2B 2cf6c92da90acff55e8c180a06b0c6a29d48be9fd8ca3c541202fd14f0697220fba6b66452942aa7ae7cc8821f5c5eb9fa8f7a31d2248624e5f9141d83a176b8 SHA512 70f0707ed6f2b877e69ef90cf782f66cbc9d2071db53ca09ceb7b89427b0fe176708517340621fa251539b7d481b238adeeb60261674eed74de1f62db6dbb72e
-DIST nvidia-persistenced-470.141.03.tar.bz2 46584 BLAKE2B 319363f61d78ff45d22561414d4607af787dd7cd23c8b895e663fd2cb308e4ae48945fdeafa2c344a0b3854692b8a118ae082333be5283d0cd0c2659bfb0d4a7 SHA512 efebf92b17017da2652db0c191d0d007bd5cd5ad02d13a3022530ccdb13ba06afc07ced961eb8de46d16f520a6805a96f4ec05738cac0d99eb8a38f68c3d3194
 DIST nvidia-persistenced-470.161.03.tar.bz2 46540 BLAKE2B 7a9af37c570fd50341a620cb8324294e4e29ebcd165f7254ca8c7a0d3010b40ee3f6721e2e6cddb5378629bc20014a4d916141e4109f6167c688c506c7e0852c SHA512 45c49cbb2a61fdcead639bf2032950f97a403fb70870c46c71003d30477bce2936bd2e2dc6ba234987cd2397dca958e83e78850289e70d07e4cb9818a8ddf8b9
 DIST nvidia-persistenced-510.108.03.tar.bz2 47222 BLAKE2B bed22370ff15df7097e927e07c444a405702f53b9e5591b816a5c0bf1d9f78a045571ece830db86d4724a9b0466a8d67f2e45ec010c69f603a9bce5cd2b8da48 SHA512 39df00ead66f7a6b0e001484333c0dda09fc30daf0df0c8fec4f5913fb88e7a2d214830e7f20632aaf89acdd9af1f11d78b50eacc10cc9bd2b534f390aad52f7
-DIST nvidia-persistenced-510.85.02.tar.bz2 47116 BLAKE2B 21fd8f0673fc7970a27395b2d227737184c35a1928215231e01f1a0f8f901e5f1556163dedc1d3941a4661910aed71d7184d06e8d54d412f6c1595a52d401250 SHA512 217f5bdf396b7b00ffccbb12f50113f183d8d44ae44278447d5b3515ffc1216821a833cc14cd963492e54b8d40340281f91dcc0520d1097455db52a5a6cc3bf7
 DIST nvidia-persistenced-515.65.01.tar.bz2 47160 BLAKE2B 841efe6670228fc7dca061e50e1d3ae5f281bf38eeacb95be2ea3c66f4fbcb7447ceea803fe1b80a7a4e7a5130698ea442e72fc8875a8043541a32cc80080f0a SHA512 7328303ac0ae62f2f7f5bdf4747d4820dd9f0174702d58cae0e701213346c1bd86cbcc51647d635ba501b1fb4e4cfbcd7b39e46e12b0b626c189666aaef6d2c4
 DIST nvidia-persistenced-515.86.01.tar.bz2 47153 BLAKE2B a7d213790895876453d34580f563ee0aee98ee145fdd8e7bdb726f91298da0f16a4101922a908d367af3ffd6ce1418128f7c5dc0a1e2789143832dc1b96ffc35 SHA512 ffe735178b3b5a0430bae8678b5f7fca407a0389de7f57a1789f67d3b4087cf7c638e6ded8a1cf7ef3ca642d0f889d9f2795fa0e18291101ef1b2a9e3bc4a174
 DIST nvidia-persistenced-525.60.11.tar.bz2 48053 BLAKE2B d0c8dbea492e8ca4ae4b1deaefebea5e73685ac1e4180b9415ec1214fe65bd3ebe360ebbf298c4b1ebac90ead3fc30c79c3e0073375dfcac39ab2e42a44fc3db SHA512 39f33e369884421a5776b88d8e0cced590c37edb987971bd0223f675ce5c8c2b8b4ad0d1c1d2eca03238eb6b0a70dc381a0cc90a52282e064245039005c7cc95
-DIST nvidia-settings-390.154.tar.bz2 1109136 BLAKE2B c351d6c950f037b06e8da1c5a481ed0a0951cae14878a1cac32ad58c29a301f1d9ac291f23873a57c7cb4b9ca93709d946adf8f91c937410d5f997696ca74729 SHA512 95321bffb6e6af7971ee0705a73ee3388cdb84dfd32e799d63c5b36e5c3ddd45de4091349d35c6af279a9aa6fea30b0ec0cb19b940e5b356768c580d8488d2df
 DIST nvidia-settings-390.157.tar.bz2 1108938 BLAKE2B d9ec1ab5d7f157d74627272adf752a671dd17e2ede02069437b6180b927fe315b15cc6416d584ab2f038b76fe01e5b64514a834f24d88ac16676e55205fdecdd SHA512 b16699009bf56a1ff3b623a528c58061c4f5a2c5c4a373756a07bcd667743a1df7c733a572d2d0baa835a904ac2fda8a5c85890dcc00c3a0f223e0467aea902d
-DIST nvidia-settings-470.141.03.tar.bz2 1062470 BLAKE2B 9970f75b289642dac72d28a1b9ddd26597f5de2a9c9a8eb8054886a142730fbc685440c8ab17a9fe8ed40b97d536ce3e85bc5d8b4e1be1ae15c52b21764a133b SHA512 7adef971201c3ea8d0b27de157d9c3412f71691ae5ae223d6457f5d64d6e7c8f9234716870f000aec19f3b89b9b0eca66bcc95a9a074a36f0d669bedb5a975c6
 DIST nvidia-settings-470.161.03.tar.bz2 1062425 BLAKE2B 20523f1e5ab39dfe8ac657afdfafe3d99df2cfb521a475f54804dd50233d4e2ac5dc5fb0e3394997963daa5d06bc2b55088ebdcbf894c16cc9d25aba316834c5 SHA512 61725a6f77930d9c12de6fef57d9f5bb93a5e62e60d0db1707b7f469bce00464192930c4f46e9074e7bcbc4922fc86e9b22ddfdf092f8f46b0c6820505e3b87e
 DIST nvidia-settings-510.108.03.tar.bz2 1075907 BLAKE2B 537d38bd6a5fdca0182af9a7604764c14fb832a1dd2f0d6f2eb1532f06f3822ed9e2190293c1300b7f8971990883ea491269e7ab4838cd724196742e21352ce0 SHA512 3eed794ad7988143719c6d905e375d514daa441d9ed71eca7eff6cae4cdf4fbf08331f9b0451bcd961920f1ffc1797a257943900eef45e225b312b61232275ef
-DIST nvidia-settings-510.85.02.tar.bz2 1075516 BLAKE2B dc69ca3340a55736a1a5134146632e3cb97bdf324f5d323e002d379b5e36f31fbd59d2ca51fe22e19e5c9ac50726f3c0bfab193e01a8b6667cec53780afa265c SHA512 48adfc6d753400bc3563ba4810d30a0fb2087d98e98303ca6fe17eaf4fd00bb5c0ce07650fd2978864b658be5bb9dc3abd226fcc1f4aa9909ba09b9d3d2ddbff
 DIST nvidia-settings-515.65.01.tar.bz2 1079461 BLAKE2B 95fccb9121ea1844c6f37024054d3a7cae73c93f6578714f15c84173b3dbb21dd6f23c1cbce744d7deedbd9f3d2a9bf80a4d057928ec59402bcbdf718e65de3c SHA512 ae3a127c28b5857a3dfec291e2a7f2ce7c6f1ece82890bdfa2f6f9d5506cc092b771e93d093621c4861ca7983d05741b0146a4f243f3b921447f287c88a839cc
 DIST nvidia-settings-515.86.01.tar.bz2 1080128 BLAKE2B eed02cf9b73fc12c1d862df71d7fe9a4e4e8486831d1940c6e5187b751abe02deb0ebc495d251ffcd401f8ce78b16077d5cd9272c0f472d8c6465a958bf66c85 SHA512 d2c50bf587f53336a1d80ae88b382ef04e8c9ef24893f8ec901934eebb1358038ed67ac7501d98257c486a0fe2e818edd91832b3f989311c061d7a8b85818229
 DIST nvidia-settings-525.60.11.tar.bz2 1086096 BLAKE2B 5abdfe9adb27b6056522ea25660a4751c13c8cbeec1a1a5d8b8eafca81cd71de7228184a52f88aba305409f4953a1fa02249a421c7f8b3dab826744ec2dac61c SHA512 c4151269e8eb2644ba8ad5f81f134152b4efa1ed7f5c40844a0163bab74093f4c02853665018cf2b73ac6d93aa0a4b8f55801cafcd271087f8ebb0a6c7bde146
-DIST nvidia-xconfig-390.154.tar.bz2 107145 BLAKE2B 8e221f182af0f7d7af3bc11acd4991ee0edd8f8a328545c0b7cfe37454b9ae02ea8d86f70c589446ed9e2e7f70fd0af05e8a1e965b854e61a97b67536b0007d3 SHA512 2e593ee519600e40b80d3c176ef3a1383a1ff51ba0ccce9c19b9d6ed6d122daa06769e992d4b8c0c64721011d84d5066a63932c34e55ec958802b61869f95350
 DIST nvidia-xconfig-390.157.tar.bz2 107399 BLAKE2B 0cbb3b1ba508ddc3ba4a161c290b31bf7a67f67880bdbd01171a962c5fa97ca945b1ef17932403f8589309380743f1da632c728d8accb6d4e56dbd895e7486bb SHA512 50b390811c9bf091b14add41f886925b17496b41006b7d3981d2398caa65cf5db8a579c8cebed78278384bf3acc629befb07b54339c61abcc75852c0dcb8b8ca
-DIST nvidia-xconfig-470.141.03.tar.bz2 108888 BLAKE2B 1701f6a7d81dd4eb7a17d79882b29d54c6343693e81d48b8862f8d03866081f5224ec562a54b03ce2d574dbb589f8ae5c78a003dd5cfa8e8fc6b977227e83a42 SHA512 e7d9c7ea3270552a23f3efc2a6bb89eb020e79b7cc8e96e2e7237ceab596319aa704b539ad6c21456073d1d8f8167bcacd8bd722e05a617b6620bc0431785ebf
 DIST nvidia-xconfig-470.161.03.tar.bz2 108669 BLAKE2B 6c12e38759ce64c5637d6301e2d5c89b8d53ad4df84beea276b76cf6927eb6ff9596534b7097088d41447886ebb79e00b037c747a47531b13a56373df7ef8969 SHA512 0cccb61c3b875b47fc78cda627aace3a730e7c267389e0fcd4ab780aefaae3c48d95d137becdba7fc12adb284ede9307c85a3ae347d31a57a6283fece6046a9a
 DIST nvidia-xconfig-510.108.03.tar.bz2 109729 BLAKE2B 48378155d57f9b4a2b58b044daa1f2f2ed9b897b77f0453f67c7b03200cc09689b628f88a87c0f4c8ae149f11cbe6364eda34c2636cc1e1fce33b799d8225138 SHA512 17462e7826225804685eaea4dba05252dce138f95c72285abe607ee1b2a6269d2f4e5c0833802037d29350d1218ed9982053871b0b08c4f5f329d497da299fab
-DIST nvidia-xconfig-510.85.02.tar.bz2 109790 BLAKE2B 09313f0f423c52c81550e8d94b82b88961bdab702bfa2086ffe148b517f82cdaada0ef5e2e5074c6bef174d64661ced63b4c52108c021e7cdadcb7b55cf8f6dc SHA512 5b9a0055643c9368689fd5d0fd47ddfb6352d903913271a577f8b0a8f92e0ce9700287c512269e91285ea9f385dcb4ed9c33410d5244234be7a7f34242df9bab
 DIST nvidia-xconfig-515.65.01.tar.bz2 109681 BLAKE2B b41b3ec377c79af6906a47c826d9930cc5ea6e85e8404e6882f3bc03cfccfa03d8ef7c280453ab29edb208173aeb576d33df00f92c225a86bc3cb571b352cdbc SHA512 6f0752e32af6772e85bd2799ea2d895bd5b5faee4c1b6813eb839e75af43d07ef09be6606e7dfc40491e07c25333e9c4145465f97dc0338053e8be1c19220bf9
 DIST nvidia-xconfig-515.86.01.tar.bz2 109747 BLAKE2B d6253f9d052be5aaa1a2be82bf4a36c971aae8b6e9f61e4ff5f27ec415d945bab8289678d6a2495ff7521c66478421090a452ceb19d87803de4290aeb7f69bba SHA512 f4e66f23d9227671158ee0b99b1ccc44f25dc6a910d3b00332d135fb94f21b67f581804b53a40945a652777c898e20069962721931c7b58d2c33d38925da5e35
 DIST nvidia-xconfig-525.60.11.tar.bz2 110561 BLAKE2B fd11b007dd7d27e82614ba98c44fc023e0d25bd1c9232645249a202d96de68ca63407886b29eb9a7e7f31c16f466ce59c491e4d0526d59bf1e6157297b8187cb SHA512 8080ebad3c58380dedbf7b7312d64b804c19b67f201840b3d9e4bf911a458d561fec7256030a6b0eacdd5cd1ec7e6cfbb4754b2e31b29d616c3e11caf3a8a531

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-515.65.01-kernel6.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-515.65.01-kernel6.patch
deleted file mode 100644
index 5cdf2f639c6b..000000000000
--- a/x11-drivers/nvidia-drivers/files/nvidia-drivers-515.65.01-kernel6.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-Normally avoid adding kernel support patches, but this one is very
-trivial and many want to use 6.0 early.
-
-Masked 515.76 has a more elaborate fix to ensure it works with
-all supported kernel branches (not all have this header), so
-this one should be conditional as a safety.
-
-Note older drivers branches have bigger issues and this is not
-sufficient, this will wait until their next release.
-
-https://github.com/NVIDIA/open-gpu-kernel-modules/pull/350
---- a/kernel/nvidia-drm/nvidia-drm-helper.h
-+++ b/kernel/nvidia-drm/nvidia-drm-helper.h
-@@ -109,4 +109,5 @@
-  */
- #include <drm/drm_crtc.h>
-+#include <drm/drm_framebuffer.h>
- 
- #if defined(drm_for_each_plane)

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-390.154.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-390.154.ebuild
deleted file mode 100644
index f99247334c44..000000000000
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-390.154.ebuild
+++ /dev/null
@@ -1,506 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-MODULES_OPTIONAL_USE="driver"
-inherit desktop flag-o-matic linux-mod multilib readme.gentoo-r1 \
-	systemd toolchain-funcs unpacker user-info
-
-NV_KERNEL_MAX="5.19"
-NV_URI="https://download.nvidia.com/XFree86/"
-
-DESCRIPTION="NVIDIA Accelerated Graphics Driver"
-HOMEPAGE="https://www.nvidia.com/download/index.aspx"
-SRC_URI="
-	amd64? ( ${NV_URI}Linux-x86_64/${PV}/NVIDIA-Linux-x86_64-${PV}.run )
-	x86? ( ${NV_URI}Linux-x86/${PV}/NVIDIA-Linux-x86-${PV}.run )
-	$(printf "${NV_URI}%s/%s-${PV}.tar.bz2 " \
-		nvidia-{installer,modprobe,persistenced,settings,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="0/${PV%%.*}"
-KEYWORDS="-* amd64 x86"
-IUSE="+X abi_x86_32 abi_x86_64 +driver persistenced +static-libs +tools"
-
-COMMON_DEPEND="
-	acct-group/video
-	sys-libs/glibc
-	persistenced? (
-		acct-user/nvpd
-		net-libs/libtirpc:=
-	)
-	tools? (
-		>=app-accessibility/at-spi2-core-2.46:2
-		dev-libs/glib:2
-		dev-libs/jansson:=
-		media-libs/harfbuzz:=
-		x11-libs/cairo
-		x11-libs/gdk-pixbuf:2
-		x11-libs/gtk+:3[X]
-		x11-libs/libX11
-		x11-libs/libXext
-		x11-libs/libXxf86vm
-		x11-libs/pango
-	)"
-RDEPEND="
-	${COMMON_DEPEND}
-	X? (
-		media-libs/libglvnd[X,abi_x86_32(-)?]
-		x11-libs/libX11[abi_x86_32(-)?]
-		x11-libs/libXext[abi_x86_32(-)?]
-	)"
-DEPEND="
-	${COMMON_DEPEND}
-	static-libs? (
-		x11-libs/libX11
-		x11-libs/libXext
-	)
-	tools? (
-		media-libs/libglvnd
-		sys-apps/dbus
-		x11-base/xorg-proto
-		x11-libs/libXrandr
-		x11-libs/libXv
-		x11-libs/libvdpau
-	)"
-BDEPEND="
-	sys-devel/m4
-	virtual/pkgconfig"
-
-QA_PREBUILT="opt/bin/* usr/lib*"
-
-PATCHES=(
-	"${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch
-	"${FILESDIR}"/nvidia-settings-390.141-fno-common.patch
-	"${FILESDIR}"/nvidia-settings-390.144-desktop.patch
-	"${FILESDIR}"/nvidia-settings-390.144-no-gtk2.patch
-	"${FILESDIR}"/nvidia-settings-390.144-raw-ldflags.patch
-)
-
-pkg_setup() {
-	use driver || return
-
-	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, be warned the modules may not load.
-	If run into problems, either unset or pass ibt=off to the kernel.
-	https://github.com/NVIDIA/open-gpu-kernel-modules/issues/256"
-
-	kernel_is -ge 5 8 && CONFIG_CHECK+=" X86_PAT" #817764
-
-	MODULE_NAMES="
-		nvidia(video:kernel)
-		nvidia-drm(video:kernel)
-		nvidia-modeset(video:kernel)
-		$(usev !x86 "nvidia-uvm(video:kernel)")"
-
-	linux-mod_pkg_setup
-
-	[[ ${MERGE_TYPE} == binary ]] && return
-
-	# do some extra checks manually as it gets messy to handle builtin-only
-	# and some other conditional checks through CONFIG_CHECK
-	# TODO?: maybe move other custom checks here for uniformity
-	local warn=()
-
-	if linux_chkconfig_builtin DRM_NOUVEAU; then
-		# suggest =m given keeps KMS_HELPER enabled and can serve as fallback
-		warn+=(
-			"  CONFIG_DRM_NOUVEAU: is builtin (=y), and will prevent loading NVIDIA"
-			"    modules (can be safely kept as a module (=m) instead)."
-		)
-	fi
-
-	if linux_chkconfig_builtin DRM_SIMPLEDRM; then
-		# wrt prebuilts, Fedora is pushing =y and gentoo-kernel-bin uses its
-		# configs (bug #840439), but without Fedora's kernel patch to
-		# workaround this issue (which is unlikely to work for us anyway)
-		# https://github.com/NVIDIA/open-gpu-kernel-modules/issues/228
-		warn+=(
-			"  CONFIG_DRM_SIMPLEDRM: is builtin (=y), and may conflict with NVIDIA"
-			"    (i.e. blanks when X/wayland starts, and tty loses display)."
-			"    For prebuilt kernels, unfortunately no known good workarounds."
-		)
-	fi
-
-	if ! linux_chkconfig_present FB_EFI &&
-		! linux_chkconfig_present FB_SIMPLE &&
-		! linux_chkconfig_present FB_VESA
-	then
-		# nvidia-drivers does not handle the tty (beside mode restoration) but,
-		# given few options are viable, try to warn if all missing
-		warn+=(
-			"  CONFIG_FB_(EFI|SIMPLE|VESA): none set, but note at least one is normally"
-			"    needed to get a display for the tty console. In most cases, it is"
-			"    recommended to enable FB_EFI=y and disable FB_SIMPLE (can be quirky)."
-			"    Non-EFI systems are likely to want FB_VESA=y. Users with multiple GPUs"
-			"    or not using the tty may be able to safely ignore this warning."
-		)
-	fi
-
-	if kernel_is -ge 5 18 13; then
-		# https://github.com/NVIDIA/open-gpu-kernel-modules/issues/341
-		if linux_chkconfig_present FB_SIMPLE; then
-			warn+=(
-				"  CONFIG_FB_SIMPLE: is set, recommended to disable and switch to FB_EFI"
-				"    as it is currently known broken with >=kernel-5.18.13 + NVIDIA."
-				"    https://github.com/NVIDIA/open-gpu-kernel-modules/issues/341"
-			)
-		fi
-
-		if linux_chkconfig_present SYSFB_SIMPLEFB &&
-			{ linux_chkconfig_present FB_EFI || linux_chkconfig_present FB_VESA; }
-		then
-			warn+=(
-				"  CONFIG_SYSFB_SIMPLEFB: is set, this may prevent FB_EFI or FB_VESA"
-				"    from providing a working tty console display (ignore if unused)."
-			)
-		fi
-	fi
-
-	(( ${#warn[@]} )) &&
-		ewarn "Detected potential configuration issues with used kernel:${warn[*]/#/$'\n'}"
-
-	BUILD_PARAMS='NV_VERBOSE=1 IGNORE_CC_MISMATCH=yes SYSSRC="${KV_DIR}" SYSOUT="${KV_OUT_DIR}"'
-	use x86 && BUILD_PARAMS+=' ARCH=i386'
-	BUILD_TARGETS="modules"
-
-	if linux_chkconfig_present CC_IS_CLANG; then
-		ewarn "Warning: clang-built kernel detected, using clang for modules (experimental)"
-		ewarn "Can use KERNEL_CC and KERNEL_LD environment variables to override if needed."
-
-		tc-is-clang || : "${KERNEL_CC:=${CHOST}-clang}"
-		if linux_chkconfig_present LD_IS_LLD; then
-			: "${KERNEL_LD:=ld.lld}"
-			if linux_chkconfig_present LTO_CLANG_THIN; then
-				# kernel enables cache by default leading to sandbox violations
-				BUILD_PARAMS+=' ldflags-y=--thinlto-cache-dir= LDFLAGS_MODULE=--thinlto-cache-dir='
-			fi
-		fi
-	fi
-	BUILD_PARAMS+=' ${KERNEL_CC:+CC="${KERNEL_CC}"} ${KERNEL_LD:+LD="${KERNEL_LD}"}'
-
-	if kernel_is -gt ${NV_KERNEL_MAX/./ }; then
-		ewarn "Kernel ${KV_MAJOR}.${KV_MINOR} is either known to break this version of ${PN}"
-		ewarn "or was not tested with it. It is recommended to use one of:"
-		ewarn "  <=sys-kernel/gentoo-kernel-${NV_KERNEL_MAX}.x"
-		ewarn "  <=sys-kernel/gentoo-sources-${NV_KERNEL_MAX}.x"
-		ewarn "You are free to try or use /etc/portage/patches, but support will"
-		ewarn "not be given and issues wait until NVIDIA releases a fixed version"
-		ewarn "(Gentoo will not accept patches for this)."
-		ewarn
-		ewarn "Do _not_ file a bug report if run into issues."
-		ewarn
-	fi
-}
-
-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-settings && mv nvidia-settings{-${PV},} || die
-	rm nvidia-xconfig && mv nvidia-xconfig{-${PV},} || die
-
-	eapply "${FILESDIR}"/nvidia-drivers-390.154-clang15$(usev {,-}x86).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
-
-	sed 's/__NV_VK_ICD__/libGLX_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
-
-	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 driver; then
-		if linux_chkconfig_present GCC_PLUGINS; then
-			mkdir "${T}"/plugin-test || die
-			echo "obj-m += test.o" > "${T}"/plugin-test/Kbuild || die
-			:> "${T}"/plugin-test/test.c || die
-			if [[ $(LC_ALL=C make -C "${KV_OUT_DIR}" ARCH="$(tc-arch-kernel)" \
-				HOSTCC="$(tc-getBUILD_CC)" M="${T}"/plugin-test 2>&1) \
-				=~ "error: incompatible gcc/plugin version" ]]
-			then
-				ewarn "Warning: detected kernel was built with different gcc/plugin versions,"
-				ewarn "you may need to 'make clean' and rebuild your kernel with the current"
-				ewarn "gcc version (or re-emerge for distribution kernels, including kernel-bin)."
-			fi
-		fi
-
-		linux-mod_src_compile
-	fi
-
-	if use persistenced; then
-		# 390.xx persistenced does not auto-detect libtirpc
-		LIBS=$($(tc-getPKG_CONFIG) --libs libtirpc || die) \
-			common_cflags=$($(tc-getPKG_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
-
-	if use tools; then
-		# cflags: avoid noisy logs, only use here and set first to let override
-		# ldflags: abi currently needed if LD=ld.lld
-		CFLAGS="-Wno-deprecated-declarations ${CFLAGS}" \
-			RAW_LDFLAGS="$(get_abi_LDFLAGS) $(raw-ldflags)" \
-			emake "${NV_ARGS[@]}" -C nvidia-settings
-	elif use static-libs; then
-		emake "${NV_ARGS[@]}" -C nvidia-settings/src build-xnvctrl
-	fi
-}
-
-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=(
-		# nvidia_icd(vulkan): skip with -X too as it uses libGLX_nvidia
-		$(usev !X "
-			libGLX_nvidia libglx
-			libnvidia-ifr
-			nvidia_icd.json")
-		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
-		nvidia-settings/doc/{FRAMELOCK,NV-CONTROL-API}.txt
-	)
-	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\
-$(usev driver "
-
-Like all out-of-tree kernel modules, it is necessary to rebuild
-${PN} after upgrading or rebuilding the Linux kernel
-by for example running \`emerge @module-rebuild\`. Alternatively,
-if using a distribution kernel (sys-kernel/gentoo-kernel{,-bin}),
-this can be automated by setting USE=dist-kernel globally.
-
-Loaded kernel modules also must not mismatch with the installed
-${PN} version (excluding -r revision), meaning should
-ensure \`eselect kernel list\` points to the kernel that will be
-booted before building and preferably reboot after upgrading
-${PN} (the ebuild will emit a warning if mismatching).
-
-See '${EPREFIX}/etc/modprobe.d/nvidia.conf' for modules options.")\
-$(use amd64 && usev !abi_x86_32 "
-
-Note that without USE=abi_x86_32 on ${PN}, 32bit applications
-(typically using wine / steam) will not be able to use GPU acceleration.")\
-$(usev X "
-
-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'")\
-$(usev x86 "
-
-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 general information on using ${PN}, please see:
-https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers"
-	readme.gentoo_create_doc
-
-	if use driver; then
-		linux-mod_src_install
-
-		insinto /etc/modprobe.d
-		newins "${FILESDIR}"/nvidia-390.conf nvidia.conf
-	fi
-
-	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
-
-	if use tools; then
-		emake "${NV_ARGS[@]}" -C nvidia-settings install
-
-		doicon nvidia-settings/doc/nvidia-settings.png
-		domenu nvidia-settings/doc/nvidia-settings.desktop
-
-		exeinto /etc/X11/xinit/xinitrc.d
-		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
-	fi
-
-	if use static-libs; then
-		dolib.a nvidia-settings/src/libXNVCtrl/libXNVCtrl.a
-
-		insinto /usr/include/NVCtrl
-		doins nvidia-settings/src/libXNVCtrl/NVCtrl{Lib,}.h
-	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
-
-	# 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
-}
-
-pkg_preinst() {
-	use driver || return
-	linux-mod_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() {
-	linux-mod_pkg_postinst
-
-	readme.gentoo_print_elog
-
-	if [[ -r /proc/driver/nvidia/version &&
-		$(</proc/driver/nvidia/version) != *"  ${PV}  "* ]]; then
-		ewarn "Currently loaded NVIDIA modules do not match the newly installed"
-		ewarn "libraries and may prevent launching GPU-accelerated applications."
-		use driver && ewarn "The easiest way to fix this is usually to reboot."
-	fi
-}

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-470.141.03.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-470.141.03.ebuild
deleted file mode 100644
index e5f75c5e95aa..000000000000
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-470.141.03.ebuild
+++ /dev/null
@@ -1,531 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-MODULES_OPTIONAL_USE="driver"
-inherit desktop flag-o-matic linux-mod multilib readme.gentoo-r1 \
-	systemd toolchain-funcs unpacker user-info
-
-NV_KERNEL_MAX="5.19"
-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,settings,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="0/${PV%%.*}"
-KEYWORDS="-* amd64"
-IUSE="+X abi_x86_32 abi_x86_64 +driver persistenced +static-libs +tools wayland"
-
-COMMON_DEPEND="
-	acct-group/video
-	sys-libs/glibc
-	persistenced? (
-		acct-user/nvpd
-		net-libs/libtirpc:=
-	)
-	tools? (
-		>=app-accessibility/at-spi2-core-2.46:2
-		dev-libs/glib:2
-		dev-libs/jansson:=
-		media-libs/harfbuzz:=
-		x11-libs/cairo
-		x11-libs/gdk-pixbuf:2
-		x11-libs/gtk+:3[X]
-		x11-libs/libX11
-		x11-libs/libXext
-		x11-libs/libXxf86vm
-		x11-libs/pango
-	)"
-RDEPEND="
-	${COMMON_DEPEND}
-	X? (
-		media-libs/libglvnd[X,abi_x86_32(-)?]
-		x11-libs/libX11[abi_x86_32(-)?]
-		x11-libs/libXext[abi_x86_32(-)?]
-	)
-	wayland? (
-		~gui-libs/egl-wayland-1.1.7
-		media-libs/libglvnd
-	)"
-DEPEND="
-	${COMMON_DEPEND}
-	static-libs? (
-		x11-libs/libX11
-		x11-libs/libXext
-	)
-	tools? (
-		media-libs/libglvnd
-		sys-apps/dbus
-		x11-base/xorg-proto
-		x11-libs/libXrandr
-		x11-libs/libXv
-		x11-libs/libvdpau
-	)"
-BDEPEND="
-	sys-devel/m4
-	virtual/pkgconfig"
-
-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
-	"${FILESDIR}"/nvidia-settings-390.144-desktop.patch
-	"${FILESDIR}"/nvidia-settings-390.144-no-gtk2.patch
-	"${FILESDIR}"/nvidia-settings-390.144-raw-ldflags.patch
-)
-
-pkg_setup() {
-	use driver || return
-
-	local CONFIG_CHECK="
-		PROC_FS
-		~DRM_KMS_HELPER
-		~SYSVIPC
-		~!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 wayland / nvidia-drm.modeset=1.
-	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, be warned the modules may not load.
-	If run into problems, either unset or pass ibt=off to the kernel.
-	https://github.com/NVIDIA/open-gpu-kernel-modules/issues/256"
-
-	use amd64 && kernel_is -ge 5 8 && CONFIG_CHECK+=" X86_PAT" #817764
-
-	MODULE_NAMES="
-		nvidia(video:kernel)
-		nvidia-drm(video:kernel)
-		nvidia-modeset(video:kernel)
-		nvidia-peermem(video:kernel)
-		nvidia-uvm(video:kernel)"
-
-	linux-mod_pkg_setup
-
-	[[ ${MERGE_TYPE} == binary ]] && return
-
-	# do some extra checks manually as it gets messy to handle builtin-only
-	# and some other conditional checks through CONFIG_CHECK
-	# TODO?: maybe move other custom checks here for uniformity
-	local warn=()
-
-	if linux_chkconfig_builtin DRM_NOUVEAU; then
-		# suggest =m given keeps KMS_HELPER enabled and can serve as fallback
-		warn+=(
-			"  CONFIG_DRM_NOUVEAU: is builtin (=y), and will prevent loading NVIDIA"
-			"    modules (can be safely kept as a module (=m) instead)."
-		)
-	fi
-
-	if linux_chkconfig_builtin DRM_SIMPLEDRM; then
-		# wrt prebuilts, Fedora is pushing =y and gentoo-kernel-bin uses its
-		# configs (bug #840439), but without Fedora's kernel patch to
-		# workaround this issue (which is unlikely to work for us anyway)
-		# https://github.com/NVIDIA/open-gpu-kernel-modules/issues/228
-		warn+=(
-			"  CONFIG_DRM_SIMPLEDRM: is builtin (=y), and may conflict with NVIDIA"
-			"    (i.e. blanks when X/wayland starts, and tty loses display)."
-			"    For prebuilt kernels, unfortunately no known good workarounds."
-		)
-	fi
-
-	if ! linux_chkconfig_present FB_EFI &&
-		! linux_chkconfig_present FB_SIMPLE &&
-		! linux_chkconfig_present FB_VESA
-	then
-		# nvidia-drivers does not handle the tty (beside mode restoration) but,
-		# given few options are viable, try to warn if all missing
-		warn+=(
-			"  CONFIG_FB_(EFI|SIMPLE|VESA): none set, but note at least one is normally"
-			"    needed to get a display for the tty console. In most cases, it is"
-			"    recommended to enable FB_EFI=y and disable FB_SIMPLE (can be quirky)."
-			"    Non-EFI systems are likely to want FB_VESA=y. Users with multiple GPUs"
-			"    or not using the tty may be able to safely ignore this warning."
-		)
-	fi
-
-	if kernel_is -ge 5 18 13; then
-		# https://github.com/NVIDIA/open-gpu-kernel-modules/issues/341
-		if linux_chkconfig_present FB_SIMPLE; then
-			warn+=(
-				"  CONFIG_FB_SIMPLE: is set, recommended to disable and switch to FB_EFI"
-				"    as it is currently known broken with >=kernel-5.18.13 + NVIDIA."
-				"    https://github.com/NVIDIA/open-gpu-kernel-modules/issues/341"
-			)
-		fi
-
-		if linux_chkconfig_present SYSFB_SIMPLEFB &&
-			{ linux_chkconfig_present FB_EFI || linux_chkconfig_present FB_VESA; }
-		then
-			warn+=(
-				"  CONFIG_SYSFB_SIMPLEFB: is set, this may prevent FB_EFI or FB_VESA"
-				"    from providing a working tty console display (ignore if unused)."
-			)
-		fi
-	fi
-
-	(( ${#warn[@]} )) &&
-		ewarn "Detected potential configuration issues with used kernel:${warn[*]/#/$'\n'}"
-
-	BUILD_PARAMS='NV_VERBOSE=1 IGNORE_CC_MISMATCH=yes SYSSRC="${KV_DIR}" SYSOUT="${KV_OUT_DIR}"'
-	BUILD_TARGETS="modules"
-
-	if linux_chkconfig_present CC_IS_CLANG; then
-		ewarn "Warning: clang-built kernel detected, using clang for modules (experimental)"
-		ewarn "Can use KERNEL_CC and KERNEL_LD environment variables to override if needed."
-
-		tc-is-clang || : "${KERNEL_CC:=${CHOST}-clang}"
-		if linux_chkconfig_present LD_IS_LLD; then
-			: "${KERNEL_LD:=ld.lld}"
-			if linux_chkconfig_present LTO_CLANG_THIN; then
-				# kernel enables cache by default leading to sandbox violations
-				BUILD_PARAMS+=' ldflags-y=--thinlto-cache-dir= LDFLAGS_MODULE=--thinlto-cache-dir='
-			fi
-		fi
-	fi
-	BUILD_PARAMS+=' ${KERNEL_CC:+CC="${KERNEL_CC}"} ${KERNEL_LD:+LD="${KERNEL_LD}"}'
-
-	if kernel_is -gt ${NV_KERNEL_MAX/./ }; then
-		ewarn "Kernel ${KV_MAJOR}.${KV_MINOR} is either known to break this version of ${PN}"
-		ewarn "or was not tested with it. It is recommended to use one of:"
-		ewarn "  <=sys-kernel/gentoo-kernel-${NV_KERNEL_MAX}.x"
-		ewarn "  <=sys-kernel/gentoo-sources-${NV_KERNEL_MAX}.x"
-		ewarn "You are free to try or use /etc/portage/patches, but support will"
-		ewarn "not be given and issues wait until NVIDIA releases a fixed version"
-		ewarn "(Gentoo will not accept patches for this)."
-		ewarn
-		ewarn "Do _not_ file a bug report if run into issues."
-		ewarn
-	fi
-}
-
-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-settings && mv nvidia-settings{-${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
-
-	# enable nvidia-drm.modeset=1 by default with USE=wayland
-	cp "${FILESDIR}"/nvidia-470.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
-
-	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=-fPIC #840389
-	)
-
-	if use driver; then
-		if linux_chkconfig_present GCC_PLUGINS; then
-			mkdir "${T}"/plugin-test || die
-			echo "obj-m += test.o" > "${T}"/plugin-test/Kbuild || die
-			:> "${T}"/plugin-test/test.c || die
-			if [[ $(LC_ALL=C make -C "${KV_OUT_DIR}" ARCH="$(tc-arch-kernel)" \
-				HOSTCC="$(tc-getBUILD_CC)" M="${T}"/plugin-test 2>&1) \
-				=~ "error: incompatible gcc/plugin version" ]]
-			then
-				ewarn "Warning: detected kernel was built with different gcc/plugin versions,"
-				ewarn "you may need to 'make clean' and rebuild your kernel with the current"
-				ewarn "gcc version (or re-emerge for distribution kernels, including kernel-bin)."
-			fi
-		fi
-
-		linux-mod_src_compile
-	fi
-
-	emake "${NV_ARGS[@]}" -C nvidia-modprobe
-	use persistenced && emake "${NV_ARGS[@]}" -C nvidia-persistenced
-	use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig
-
-	if use tools; then
-		# cflags: avoid noisy logs, only use here and set first to let override
-		# ldflags: abi currently needed if LD=ld.lld
-		CFLAGS="-Wno-deprecated-declarations ${CFLAGS}" \
-			RAW_LDFLAGS="$(get_abi_LDFLAGS) $(raw-ldflags)" \
-			emake "${NV_ARGS[@]}" -C nvidia-settings
-	elif use static-libs; then
-		emake "${NV_ARGS[@]}" -C nvidia-settings/src out/libXNVCtrl.a
-	fi
-}
-
-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=(
-		# nvidia_icd/layers(vulkan): skip with -X too as it uses libGLX_nvidia
-		$(usev !X "
-			libGLX_nvidia libglxserver_nvidia
-			libnvidia-ifr
-			nvidia_icd.json nvidia_layers.json")
-		$(usev !wayland libnvidia-vulkan-producer)
-		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")
-		$(usev !driver 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
-		nvidia-settings/doc/{FRAMELOCK,NV-CONTROL-API}.txt
-	)
-	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\
-$(usev driver "
-
-Like all out-of-tree kernel modules, it is necessary to rebuild
-${PN} after upgrading or rebuilding the Linux kernel
-by for example running \`emerge @module-rebuild\`. Alternatively,
-if using a distribution kernel (sys-kernel/gentoo-kernel{,-bin}),
-this can be automated by setting USE=dist-kernel globally.
-
-Loaded kernel modules also must not mismatch with the installed
-${PN} version (excluding -r revision), meaning should
-ensure \`eselect kernel list\` points to the kernel that will be
-booted before building and preferably reboot after upgrading
-${PN} (the ebuild will emit a warning if mismatching).
-
-See '${EPREFIX}/etc/modprobe.d/nvidia.conf' for modules options.")\
-$(use amd64 && usev !abi_x86_32 "
-
-Note that without USE=abi_x86_32 on ${PN}, 32bit applications
-(typically using wine / steam) will not be able to use GPU acceleration.")
-
-For general information on using ${PN}, please see:
-https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers"
-	readme.gentoo_create_doc
-
-	if use driver; then
-		linux-mod_src_install
-
-		insinto /etc/modprobe.d
-		doins "${T}"/nvidia.conf
-
-		# used for gpu verification with binpkgs (not kept, see pkg_preinst)
-		insinto /usr/share/nvidia
-		doins supported-gpus/supported-gpus.json
-	fi
-
-	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
-
-	if use tools; then
-		emake "${NV_ARGS[@]}" -C nvidia-settings install
-
-		doicon nvidia-settings/doc/nvidia-settings.png
-		domenu nvidia-settings/doc/nvidia-settings.desktop
-
-		exeinto /etc/X11/xinit/xinitrc.d
-		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
-	fi
-
-	if use static-libs; then
-		dolib.a nvidia-settings/src/out/libXNVCtrl.a
-
-		insinto /usr/include/NVCtrl
-		doins nvidia-settings/src/libXNVCtrl/NVCtrl{Lib,}.h
-	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
-
-	# 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
-}
-
-pkg_preinst() {
-	has_version "${CATEGORY}/${PN}[wayland]" && NV_HAD_WAYLAND=
-
-	use driver || return
-	linux-mod_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
-
-	# try to find driver mismatches using temporary supported-gpus.json
-	for g in $(grep -l 0x10de /sys/bus/pci/devices/*/vendor 2>/dev/null); do
-		g=$(grep -io "\"devid\":\"$(<${g%vendor}device)\"[^}]*branch\":\"[0-9]*" \
-			"${ED}"/usr/share/nvidia/supported-gpus.json 2>/dev/null)
-		if [[ ${g} ]]; then
-			g=$((${g##*\"}+1))
-			if ver_test -ge ${g}; then
-				NV_LEGACY_MASK=">=${CATEGORY}/${PN}-${g}"
-				break
-			fi
-		fi
-	done
-	rm "${ED}"/usr/share/nvidia/supported-gpus.json || die
-}
-
-pkg_postinst() {
-	linux-mod_pkg_postinst
-
-	readme.gentoo_print_elog
-
-	if [[ -r /proc/driver/nvidia/version &&
-		$(</proc/driver/nvidia/version) != *"  ${PV}  "* ]]; then
-		ewarn "Currently loaded NVIDIA modules do not match the newly installed"
-		ewarn "libraries and may prevent launching GPU-accelerated applications."
-		use driver && ewarn "The easiest way to fix this is usually to reboot."
-	fi
-
-	if [[ $(</proc/cmdline) == *slub_debug=[!-]* ]]; then
-		ewarn "Detected that the current kernel command line is using 'slub_debug=',"
-		ewarn "this may lead to system instability/freezes with this version of"
-		ewarn "${PN}. Bug: https://bugs.gentoo.org/796329"
-	fi
-
-	if [[ -v NV_LEGACY_MASK ]]; then
-		ewarn
-		ewarn "***WARNING***"
-		ewarn
-		ewarn "You are installing a version of ${PN} 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
-			ewarn "  echo '${NV_LEGACY_MASK}' > ${EROOT}/etc/portage/package.mask/${PN}"
-		else
-			ewarn "  echo '${NV_LEGACY_MASK}' >> ${EROOT}/etc/portage/package.mask"
-		fi
-		ewarn "...then downgrade to a legacy branch if possible. For details, see:"
-		ewarn "https://www.nvidia.com/object/IO_32667.html"
-	fi
-
-	if use wayland && use driver && [[ ! -v NV_HAD_WAYLAND ]]; then
-		elog
-		elog "With USE=wayland, this version of ${PN} sets nvidia-drm.modeset=1"
-		elog "in '${EROOT}/etc/modprobe.d/nvidia.conf'. This feature is considered"
-		elog "experimental but is required for wayland."
-		elog
-		elog "If you experience issues, either disable wayland or edit nvidia.conf."
-		elog "Of note, may possibly cause issues with SLI and Reverse PRIME."
-		elog
-		elog "This version of ${PN} only supports EGLStream which is only"
-		elog "supported by a few wayland compositors (e.g. kwin / mutter, not sway),"
-		elog "and is barely tested (X11 is recommended for this legacy branch)."
-	fi
-}

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-510.85.02.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-510.85.02.ebuild
deleted file mode 100644
index 6e8d98a46955..000000000000
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-510.85.02.ebuild
+++ /dev/null
@@ -1,540 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-MODULES_OPTIONAL_USE="driver"
-inherit desktop flag-o-matic linux-mod multilib readme.gentoo-r1 \
-	systemd toolchain-funcs unpacker user-info
-
-NV_KERNEL_MAX="5.19"
-NV_URI="https://download.nvidia.com/XFree86/"
-
-DESCRIPTION="NVIDIA Accelerated Graphics Driver"
-HOMEPAGE="https://www.nvidia.com/download/index.aspx"
-SRC_URI="
-	amd64? ( ${NV_URI}Linux-x86_64/${PV}/NVIDIA-Linux-x86_64-${PV}.run )
-	arm64? ( ${NV_URI}Linux-aarch64/${PV}/NVIDIA-Linux-aarch64-${PV}.run )
-	$(printf "${NV_URI}%s/%s-${PV}.tar.bz2 " \
-		nvidia-{installer,modprobe,persistenced,settings,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="0/${PV%%.*}"
-KEYWORDS="-* amd64 ~arm64"
-IUSE="+X abi_x86_32 abi_x86_64 +driver persistenced +static-libs +tools wayland"
-
-COMMON_DEPEND="
-	acct-group/video
-	sys-libs/glibc
-	X? ( x11-libs/libpciaccess )
-	persistenced? (
-		acct-user/nvpd
-		net-libs/libtirpc:=
-	)
-	tools? (
-		>=app-accessibility/at-spi2-core-2.46:2
-		dev-libs/glib:2
-		dev-libs/jansson:=
-		media-libs/harfbuzz:=
-		x11-libs/cairo
-		x11-libs/gdk-pixbuf:2
-		x11-libs/gtk+:3[X]
-		x11-libs/libX11
-		x11-libs/libXext
-		x11-libs/libXxf86vm
-		x11-libs/pango
-	)"
-RDEPEND="
-	${COMMON_DEPEND}
-	X? (
-		media-libs/libglvnd[X,abi_x86_32(-)?]
-		x11-libs/libX11[abi_x86_32(-)?]
-		x11-libs/libXext[abi_x86_32(-)?]
-	)
-	wayland? (
-		gui-libs/egl-gbm
-		=gui-libs/egl-wayland-1.1.9*
-		media-libs/libglvnd
-	)"
-DEPEND="
-	${COMMON_DEPEND}
-	static-libs? (
-		x11-libs/libX11
-		x11-libs/libXext
-	)
-	tools? (
-		media-libs/libglvnd
-		sys-apps/dbus
-		x11-base/xorg-proto
-		x11-libs/libXrandr
-		x11-libs/libXv
-		x11-libs/libvdpau
-	)"
-BDEPEND="
-	sys-devel/m4
-	virtual/pkgconfig"
-
-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
-	"${FILESDIR}"/nvidia-settings-390.144-desktop.patch
-	"${FILESDIR}"/nvidia-settings-390.144-no-gtk2.patch
-	"${FILESDIR}"/nvidia-settings-390.144-raw-ldflags.patch
-)
-
-pkg_setup() {
-	use driver || return
-
-	local CONFIG_CHECK="
-		PROC_FS
-		~DRM_KMS_HELPER
-		~SYSVIPC
-		~!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 wayland / nvidia-drm.modeset=1.
-	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, be warned the modules may not load.
-	If run into problems, either unset or pass ibt=off to the kernel.
-	https://github.com/NVIDIA/open-gpu-kernel-modules/issues/256"
-
-	use amd64 && kernel_is -ge 5 8 && CONFIG_CHECK+=" X86_PAT" #817764
-
-	MODULE_NAMES="
-		nvidia(video:kernel)
-		nvidia-drm(video:kernel)
-		nvidia-modeset(video:kernel)
-		nvidia-peermem(video:kernel)
-		nvidia-uvm(video:kernel)"
-
-	linux-mod_pkg_setup
-
-	[[ ${MERGE_TYPE} == binary ]] && return
-
-	# do some extra checks manually as it gets messy to handle builtin-only
-	# and some other conditional checks through CONFIG_CHECK
-	# TODO?: maybe move other custom checks here for uniformity
-	local warn=()
-
-	if linux_chkconfig_builtin DRM_NOUVEAU; then
-		# suggest =m given keeps KMS_HELPER enabled and can serve as fallback
-		warn+=(
-			"  CONFIG_DRM_NOUVEAU: is builtin (=y), and will prevent loading NVIDIA"
-			"    modules (can be safely kept as a module (=m) instead)."
-		)
-	fi
-
-	if linux_chkconfig_builtin DRM_SIMPLEDRM; then
-		# wrt prebuilts, Fedora is pushing =y and gentoo-kernel-bin uses its
-		# configs (bug #840439), but without Fedora's kernel patch to
-		# workaround this issue (which is unlikely to work for us anyway)
-		# https://github.com/NVIDIA/open-gpu-kernel-modules/issues/228
-		warn+=(
-			"  CONFIG_DRM_SIMPLEDRM: is builtin (=y), and may conflict with NVIDIA"
-			"    (i.e. blanks when X/wayland starts, and tty loses display)."
-			"    For prebuilt kernels, unfortunately no known good workarounds."
-		)
-	fi
-
-	if ! linux_chkconfig_present FB_EFI &&
-		! linux_chkconfig_present FB_SIMPLE &&
-		! linux_chkconfig_present FB_VESA
-	then
-		# nvidia-drivers does not handle the tty (beside mode restoration) but,
-		# given few options are viable, try to warn if all missing
-		warn+=(
-			"  CONFIG_FB_(EFI|SIMPLE|VESA): none set, but note at least one is normally"
-			"    needed to get a display for the tty console. In most cases, it is"
-			"    recommended to enable FB_EFI=y and disable FB_SIMPLE (can be quirky)."
-			"    Non-EFI systems are likely to want FB_VESA=y. Users with multiple GPUs"
-			"    or not using the tty may be able to safely ignore this warning."
-		)
-	fi
-
-	if kernel_is -ge 5 18 13; then
-		# https://github.com/NVIDIA/open-gpu-kernel-modules/issues/341
-		if linux_chkconfig_present FB_SIMPLE; then
-			warn+=(
-				"  CONFIG_FB_SIMPLE: is set, recommended to disable and switch to FB_EFI"
-				"    as it is currently known broken with >=kernel-5.18.13 + NVIDIA."
-				"    https://github.com/NVIDIA/open-gpu-kernel-modules/issues/341"
-			)
-		fi
-
-		if linux_chkconfig_present SYSFB_SIMPLEFB &&
-			{ linux_chkconfig_present FB_EFI || linux_chkconfig_present FB_VESA; }
-		then
-			warn+=(
-				"  CONFIG_SYSFB_SIMPLEFB: is set, this may prevent FB_EFI or FB_VESA"
-				"    from providing a working tty console display (ignore if unused)."
-			)
-		fi
-	fi
-
-	(( ${#warn[@]} )) &&
-		ewarn "Detected potential configuration issues with used kernel:${warn[*]/#/$'\n'}"
-
-	BUILD_PARAMS='NV_VERBOSE=1 IGNORE_CC_MISMATCH=yes SYSSRC="${KV_DIR}" SYSOUT="${KV_OUT_DIR}"'
-	BUILD_TARGETS="modules"
-
-	if linux_chkconfig_present CC_IS_CLANG; then
-		ewarn "Warning: clang-built kernel detected, using clang for modules (experimental)"
-		ewarn "Can use KERNEL_CC and KERNEL_LD environment variables to override if needed."
-
-		tc-is-clang || : "${KERNEL_CC:=${CHOST}-clang}"
-		if linux_chkconfig_present LD_IS_LLD; then
-			: "${KERNEL_LD:=ld.lld}"
-			if linux_chkconfig_present LTO_CLANG_THIN; then
-				# kernel enables cache by default leading to sandbox violations
-				BUILD_PARAMS+=' ldflags-y=--thinlto-cache-dir= LDFLAGS_MODULE=--thinlto-cache-dir='
-			fi
-		fi
-	fi
-	BUILD_PARAMS+=' ${KERNEL_CC:+CC="${KERNEL_CC}"} ${KERNEL_LD:+LD="${KERNEL_LD}"}'
-
-	if kernel_is -gt ${NV_KERNEL_MAX/./ }; then
-		ewarn "Kernel ${KV_MAJOR}.${KV_MINOR} is either known to break this version of ${PN}"
-		ewarn "or was not tested with it. It is recommended to use one of:"
-		ewarn "  <=sys-kernel/gentoo-kernel-${NV_KERNEL_MAX}.x"
-		ewarn "  <=sys-kernel/gentoo-sources-${NV_KERNEL_MAX}.x"
-		ewarn "You are free to try or use /etc/portage/patches, but support will"
-		ewarn "not be given and issues wait until NVIDIA releases a fixed version"
-		ewarn "(Gentoo will not accept patches for this)."
-		ewarn
-		ewarn "Do _not_ file a bug report if run into issues."
-		ewarn
-	fi
-}
-
-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-settings && mv nvidia-settings{-${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
-
-	# adjust service files
-	sed 's/__USER__/nvpd/' \
-		nvidia-persistenced/init/systemd/nvidia-persistenced.service.template \
-		> "${T}"/nvidia-persistenced.service || die
-	use !amd64 || sed -i "s|/usr|${EPREFIX}/opt|" systemd/system/nvidia-powerd.service || die
-
-	# enable nvidia-drm.modeset=1 by default with USE=wayland
-	cp "${FILESDIR}"/nvidia-470.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
-
-	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=-fPIC #840389
-	)
-
-	if use driver; then
-		if linux_chkconfig_present GCC_PLUGINS; then
-			mkdir "${T}"/plugin-test || die
-			echo "obj-m += test.o" > "${T}"/plugin-test/Kbuild || die
-			:> "${T}"/plugin-test/test.c || die
-			if [[ $(LC_ALL=C make -C "${KV_OUT_DIR}" ARCH="$(tc-arch-kernel)" \
-				HOSTCC="$(tc-getBUILD_CC)" M="${T}"/plugin-test 2>&1) \
-				=~ "error: incompatible gcc/plugin version" ]]
-			then
-				ewarn "Warning: detected kernel was built with different gcc/plugin versions,"
-				ewarn "you may need to 'make clean' and rebuild your kernel with the current"
-				ewarn "gcc version (or re-emerge for distribution kernels, including kernel-bin)."
-			fi
-		fi
-
-		linux-mod_src_compile
-	fi
-
-	emake "${NV_ARGS[@]}" -C nvidia-modprobe
-	use persistenced && emake "${NV_ARGS[@]}" -C nvidia-persistenced
-	use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig
-
-	if use tools; then
-		# cflags: avoid noisy logs, only use here and set first to let override
-		# ldflags: abi currently needed if LD=ld.lld
-		CFLAGS="-Wno-deprecated-declarations ${CFLAGS}" \
-			RAW_LDFLAGS="$(get_abi_LDFLAGS) $(raw-ldflags)" \
-			emake "${NV_ARGS[@]}" -C nvidia-settings
-	elif use static-libs; then
-		emake "${NV_ARGS[@]}" -C nvidia-settings/src out/libXNVCtrl.a
-	fi
-}
-
-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
-		[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=(
-		# nvidia_icd/layers(vulkan): skip with -X too as it uses libGLX_nvidia
-		$(usev !X "
-			libGLX_nvidia libglxserver_nvidia
-			nvidia_icd.json nvidia_layers.json")
-		$(usev !wayland libnvidia-vulkan-producer)
-		libGLX_indirect # non-glvnd unused fallback
-		libnvidia-gtk nvidia-{settings,xconfig} # built from source
-		libnvidia-egl-gbm 15_nvidia_gbm # gui-libs/egl-gbm
-		libnvidia-egl-wayland 10_nvidia_wayland # gui-libs/egl-wayland
-	)
-	local skip_modules=(
-		$(usev !X "nvfbc vdpau xdriver")
-		$(usev !driver 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 SYSTEMD_UNIT # handled separately / unused
-	)
-
-	local DOCS=(
-		README.txt NVIDIA_Changelog supported-gpus/supported-gpus.json
-		nvidia-settings/doc/{FRAMELOCK,NV-CONTROL-API}.txt
-	)
-	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\
-$(usev driver "
-
-Like all out-of-tree kernel modules, it is necessary to rebuild
-${PN} after upgrading or rebuilding the Linux kernel
-by for example running \`emerge @module-rebuild\`. Alternatively,
-if using a distribution kernel (sys-kernel/gentoo-kernel{,-bin}),
-this can be automated by setting USE=dist-kernel globally.
-
-Loaded kernel modules also must not mismatch with the installed
-${PN} version (excluding -r revision), meaning should
-ensure \`eselect kernel list\` points to the kernel that will be
-booted before building and preferably reboot after upgrading
-${PN} (the ebuild will emit a warning if mismatching).
-
-See '${EPREFIX}/etc/modprobe.d/nvidia.conf' for modules options.")\
-$(use amd64 && usev !abi_x86_32 "
-
-Note that without USE=abi_x86_32 on ${PN}, 32bit applications
-(typically using wine / steam) will not be able to use GPU acceleration.")
-
-For general information on using ${PN}, please see:
-https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers"
-	readme.gentoo_create_doc
-
-	if use driver; then
-		linux-mod_src_install
-
-		insinto /etc/modprobe.d
-		doins "${T}"/nvidia.conf
-
-		# used for gpu verification with binpkgs (not kept, see pkg_preinst)
-		insinto /usr/share/nvidia
-		doins supported-gpus/supported-gpus.json
-	fi
-
-	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
-
-	if use tools; then
-		emake "${NV_ARGS[@]}" -C nvidia-settings install
-
-		doicon nvidia-settings/doc/nvidia-settings.png
-		domenu nvidia-settings/doc/nvidia-settings.desktop
-
-		exeinto /etc/X11/xinit/xinitrc.d
-		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
-	fi
-
-	if use static-libs; then
-		dolib.a nvidia-settings/src/out/libXNVCtrl.a
-
-		insinto /usr/include/NVCtrl
-		doins nvidia-settings/src/libXNVCtrl/NVCtrl{Lib,}.h
-	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]} =~ _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
-
-	# 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 amd64; then
-		systemd_dounit systemd/system/nvidia-powerd.service
-		dodoc 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
-}
-
-pkg_preinst() {
-	has_version "${CATEGORY}/${PN}[wayland]" && NV_HAD_WAYLAND=
-
-	use driver || return
-	linux-mod_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
-
-	# try to find driver mismatches using temporary supported-gpus.json
-	for g in $(grep -l 0x10de /sys/bus/pci/devices/*/vendor 2>/dev/null); do
-		g=$(grep -io "\"devid\":\"$(<${g%vendor}device)\"[^}]*branch\":\"[0-9]*" \
-			"${ED}"/usr/share/nvidia/supported-gpus.json 2>/dev/null)
-		if [[ ${g} ]]; then
-			g=$((${g##*\"}+1))
-			if ver_test -ge ${g}; then
-				NV_LEGACY_MASK=">=${CATEGORY}/${PN}-${g}"
-				break
-			fi
-		fi
-	done
-	rm "${ED}"/usr/share/nvidia/supported-gpus.json || die
-}
-
-pkg_postinst() {
-	linux-mod_pkg_postinst
-
-	readme.gentoo_print_elog
-
-	if [[ -r /proc/driver/nvidia/version &&
-		$(</proc/driver/nvidia/version) != *"  ${PV}  "* ]]; then
-		ewarn "Currently loaded NVIDIA modules do not match the newly installed"
-		ewarn "libraries and may prevent launching GPU-accelerated applications."
-		use driver && ewarn "The easiest way to fix this is usually to reboot."
-	fi
-
-	if [[ $(</proc/cmdline) == *slub_debug=[!-]* ]]; then
-		ewarn "Detected that the current kernel command line is using 'slub_debug=',"
-		ewarn "this may lead to system instability/freezes with this version of"
-		ewarn "${PN}. Bug: https://bugs.gentoo.org/796329"
-	fi
-
-	if [[ -v NV_LEGACY_MASK ]]; then
-		ewarn
-		ewarn "***WARNING***"
-		ewarn
-		ewarn "You are installing a version of ${PN} 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
-			ewarn "  echo '${NV_LEGACY_MASK}' > ${EROOT}/etc/portage/package.mask/${PN}"
-		else
-			ewarn "  echo '${NV_LEGACY_MASK}' >> ${EROOT}/etc/portage/package.mask"
-		fi
-		ewarn "...then downgrade to a legacy branch if possible. For details, see:"
-		ewarn "https://www.nvidia.com/object/IO_32667.html"
-	fi
-
-	if use wayland && use driver && [[ ! -v NV_HAD_WAYLAND ]]; then
-		elog
-		elog "With USE=wayland, this version of ${PN} sets nvidia-drm.modeset=1"
-		elog "in '${EROOT}/etc/modprobe.d/nvidia.conf'. This feature is considered"
-		elog "experimental but is required for wayland."
-		elog
-		elog "If you experience issues, either disable wayland or edit nvidia.conf."
-		elog "Of note, may possibly cause issues with SLI and Reverse PRIME."
-	fi
-}

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-515.65.01.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-515.65.01.ebuild
deleted file mode 100644
index 434a96dd7873..000000000000
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-515.65.01.ebuild
+++ /dev/null
@@ -1,584 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-MODULES_OPTIONAL_USE="driver"
-inherit desktop flag-o-matic linux-mod multilib readme.gentoo-r1 \
-	systemd toolchain-funcs unpacker user-info
-
-NV_KERNEL_MAX="6.0"
-NV_URI="https://download.nvidia.com/XFree86/"
-
-DESCRIPTION="NVIDIA Accelerated Graphics Driver"
-HOMEPAGE="https://www.nvidia.com/download/index.aspx"
-SRC_URI="
-	amd64? ( ${NV_URI}Linux-x86_64/${PV}/NVIDIA-Linux-x86_64-${PV}.run )
-	arm64? ( ${NV_URI}Linux-aarch64/${PV}/NVIDIA-Linux-aarch64-${PV}.run )
-	$(printf "${NV_URI}%s/%s-${PV}.tar.bz2 " \
-		nvidia-{installer,modprobe,persistenced,settings,xconfig}{,})
-	${NV_URI}NVIDIA-kernel-module-source/NVIDIA-kernel-module-source-${PV}.tar.xz"
-# 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="0/${PV%%.*}"
-KEYWORDS="-* amd64 ~arm64"
-IUSE="+X abi_x86_32 abi_x86_64 +driver kernel-open persistenced +static-libs +tools wayland"
-REQUIRED_USE="kernel-open? ( driver )"
-
-COMMON_DEPEND="
-	acct-group/video
-	sys-libs/glibc
-	X? ( x11-libs/libpciaccess )
-	persistenced? (
-		acct-user/nvpd
-		net-libs/libtirpc:=
-	)
-	tools? (
-		>=app-accessibility/at-spi2-core-2.46:2
-		dev-libs/glib:2
-		dev-libs/jansson:=
-		media-libs/harfbuzz:=
-		x11-libs/cairo
-		x11-libs/gdk-pixbuf:2
-		x11-libs/gtk+:3[X]
-		x11-libs/libX11
-		x11-libs/libXext
-		x11-libs/libXxf86vm
-		x11-libs/pango
-	)"
-RDEPEND="
-	${COMMON_DEPEND}
-	X? (
-		media-libs/libglvnd[X,abi_x86_32(-)?]
-		x11-libs/libX11[abi_x86_32(-)?]
-		x11-libs/libXext[abi_x86_32(-)?]
-	)
-	wayland? (
-		gui-libs/egl-gbm
-		>=gui-libs/egl-wayland-1.1.10
-		media-libs/libglvnd
-	)"
-DEPEND="
-	${COMMON_DEPEND}
-	static-libs? (
-		x11-libs/libX11
-		x11-libs/libXext
-	)
-	tools? (
-		media-libs/libglvnd
-		sys-apps/dbus
-		x11-base/xorg-proto
-		x11-libs/libXrandr
-		x11-libs/libXv
-		x11-libs/libvdpau
-	)"
-BDEPEND="
-	sys-devel/m4
-	virtual/pkgconfig"
-
-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
-	"${FILESDIR}"/nvidia-settings-390.144-desktop.patch
-	"${FILESDIR}"/nvidia-settings-390.144-no-gtk2.patch
-	"${FILESDIR}"/nvidia-settings-390.144-raw-ldflags.patch
-)
-
-pkg_setup() {
-	use driver || return
-
-	local CONFIG_CHECK="
-		PROC_FS
-		~DRM_KMS_HELPER
-		~SYSVIPC
-		~!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 wayland / nvidia-drm.modeset=1.
-	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, be warned the modules may not load.
-	If run into problems, either unset or pass ibt=off to the kernel.
-	https://github.com/NVIDIA/open-gpu-kernel-modules/issues/256"
-
-	use amd64 && kernel_is -ge 5 8 && CONFIG_CHECK+=" X86_PAT" #817764
-
-	use kernel-open && CONFIG_CHECK+=" MMU_NOTIFIER" #843827
-	local ERROR_MMU_NOTIFIER="CONFIG_MMU_NOTIFIER: is not set but needed to build with USE=kernel-open.
-	Cannot be directly selected in the kernel's menuconfig, and may need
-	selection of another option that requires it such as CONFIG_KVM."
-
-	MODULE_NAMES="
-		nvidia(video:kernel)
-		nvidia-drm(video:kernel)
-		nvidia-modeset(video:kernel)
-		nvidia-peermem(video:kernel)
-		nvidia-uvm(video:kernel)"
-	use kernel-open &&
-		MODULE_NAMES=${MODULE_NAMES//:kernel/:kernel-module-source:kernel-module-source/kernel-open}
-
-	linux-mod_pkg_setup
-
-	[[ ${MERGE_TYPE} == binary ]] && return
-
-	# do some extra checks manually as it gets messy to handle builtin-only
-	# and some other conditional checks through CONFIG_CHECK
-	# TODO?: maybe move other custom checks here for uniformity
-	local warn=()
-
-	if linux_chkconfig_builtin DRM_NOUVEAU; then
-		# suggest =m given keeps KMS_HELPER enabled and can serve as fallback
-		warn+=(
-			"  CONFIG_DRM_NOUVEAU: is builtin (=y), and will prevent loading NVIDIA"
-			"    modules (can be safely kept as a module (=m) instead)."
-		)
-	fi
-
-	if linux_chkconfig_builtin DRM_SIMPLEDRM; then
-		# wrt prebuilts, Fedora is pushing =y and gentoo-kernel-bin uses its
-		# configs (bug #840439), but without Fedora's kernel patch to
-		# workaround this issue (which is unlikely to work for us anyway)
-		# https://github.com/NVIDIA/open-gpu-kernel-modules/issues/228
-		warn+=(
-			"  CONFIG_DRM_SIMPLEDRM: is builtin (=y), and may conflict with NVIDIA"
-			"    (i.e. blanks when X/wayland starts, and tty loses display)."
-			"    For prebuilt kernels, unfortunately no known good workarounds."
-		)
-	fi
-
-	if ! linux_chkconfig_present FB_EFI &&
-		! linux_chkconfig_present FB_SIMPLE &&
-		! linux_chkconfig_present FB_VESA
-	then
-		# nvidia-drivers does not handle the tty (beside mode restoration) but,
-		# given few options are viable, try to warn if all missing
-		warn+=(
-			"  CONFIG_FB_(EFI|SIMPLE|VESA): none set, but note at least one is normally"
-			"    needed to get a display for the tty console. In most cases, it is"
-			"    recommended to enable FB_EFI=y and disable FB_SIMPLE (can be quirky)."
-			"    Non-EFI systems are likely to want FB_VESA=y. Users with multiple GPUs"
-			"    or not using the tty may be able to safely ignore this warning."
-		)
-	fi
-
-	if kernel_is -ge 5 18 13; then
-		# https://github.com/NVIDIA/open-gpu-kernel-modules/issues/341
-		if linux_chkconfig_present FB_SIMPLE; then
-			warn+=(
-				"  CONFIG_FB_SIMPLE: is set, recommended to disable and switch to FB_EFI"
-				"    as it is currently known broken with >=kernel-5.18.13 + NVIDIA."
-				"    https://github.com/NVIDIA/open-gpu-kernel-modules/issues/341"
-			)
-		fi
-
-		if linux_chkconfig_present SYSFB_SIMPLEFB &&
-			{ linux_chkconfig_present FB_EFI || linux_chkconfig_present FB_VESA; }
-		then
-			warn+=(
-				"  CONFIG_SYSFB_SIMPLEFB: is set, this may prevent FB_EFI or FB_VESA"
-				"    from providing a working tty console display (ignore if unused)."
-			)
-		fi
-	fi
-
-	(( ${#warn[@]} )) &&
-		ewarn "Detected potential configuration issues with used kernel:${warn[*]/#/$'\n'}"
-
-	BUILD_PARAMS='NV_VERBOSE=1 IGNORE_CC_MISMATCH=yes SYSSRC="${KV_DIR}" SYSOUT="${KV_OUT_DIR}"'
-	BUILD_TARGETS="modules"
-
-	if linux_chkconfig_present CC_IS_CLANG; then
-		ewarn "Warning: clang-built kernel detected, using clang for modules (experimental)"
-		ewarn "Can use KERNEL_CC and KERNEL_LD environment variables to override if needed."
-
-		tc-is-clang || : "${KERNEL_CC:=${CHOST}-clang}"
-		if linux_chkconfig_present LD_IS_LLD; then
-			: "${KERNEL_LD:=ld.lld}"
-			if linux_chkconfig_present LTO_CLANG_THIN; then
-				# kernel enables cache by default leading to sandbox violations
-				BUILD_PARAMS+=' ldflags-y=--thinlto-cache-dir= LDFLAGS_MODULE=--thinlto-cache-dir='
-			fi
-		fi
-	fi
-	BUILD_PARAMS+=' ${KERNEL_CC:+CC="${KERNEL_CC}"} ${KERNEL_LD:+LD="${KERNEL_LD}"}'
-
-	if kernel_is -gt ${NV_KERNEL_MAX/./ }; then
-		ewarn "Kernel ${KV_MAJOR}.${KV_MINOR} is either known to break this version of ${PN}"
-		ewarn "or was not tested with it. It is recommended to use one of:"
-		ewarn "  <=sys-kernel/gentoo-kernel-${NV_KERNEL_MAX}.x"
-		ewarn "  <=sys-kernel/gentoo-sources-${NV_KERNEL_MAX}.x"
-		ewarn "You are free to try or use /etc/portage/patches, but support will"
-		ewarn "not be given and issues wait until NVIDIA releases a fixed version"
-		ewarn "(Gentoo will not accept patches for this)."
-		ewarn
-		ewarn "Do _not_ file a bug report if run into issues."
-		ewarn
-	fi
-}
-
-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-settings && mv nvidia-settings{-${PV},} || die
-	rm nvidia-xconfig && mv nvidia-xconfig{-${PV},} || die
-	mv NVIDIA-kernel-module-source-${PV} kernel-module-source || die
-
-	eapply --directory=kernel-module-source/kernel-open \
-		-p2 "${FILESDIR}"/nvidia-drivers-470.141.03-clang15.patch
-
-	if kernel_is -ge 6; then # conditional as a safety, see patch
-		eapply "${FILESDIR}"/nvidia-drivers-515.65.01-kernel6.patch
-		eapply --directory=kernel-module-source/kernel-open \
-			-p2 "${FILESDIR}"/nvidia-drivers-515.65.01-kernel6.patch
-	fi
-
-	default
-
-	# prevent detection of incomplete kernel DRM support (bug #603818)
-	sed 's/defined(CONFIG_DRM/defined(CONFIG_DRM_KMS_HELPER/g' \
-		-i kernel{,-module-source/kernel-open}/conftest.sh || die
-
-	# adjust service files
-	sed 's/__USER__/nvpd/' \
-		nvidia-persistenced/init/systemd/nvidia-persistenced.service.template \
-		> "${T}"/nvidia-persistenced.service || die
-	use !amd64 || sed -i "s|/usr|${EPREFIX}/opt|" systemd/system/nvidia-powerd.service || die
-
-	# enable nvidia-drm.modeset=1 by default with USE=wayland
-	cp "${FILESDIR}"/nvidia-470.conf "${T}"/nvidia.conf || die
-	use !wayland || sed -i '/^#.*modeset=1$/s/^#//' "${T}"/nvidia.conf || die
-
-	# makefile attempts to install wayland library even if not built
-	use wayland || sed -i 's/ WAYLAND_LIB_install$//' \
-		nvidia-settings/src/Makefile || die
-
-	# temporary option, nvidia will remove in the future
-	use !kernel-open ||
-		sed -i '/blacklist/a\
-\
-# Enable using kernel-open with workstation GPUs (experimental)\
-options nvidia NVreg_OpenRmEnableUnsupportedGpus=1' "${T}"/nvidia.conf || die
-}
-
-src_compile() {
-	tc-export AR CC CXX LD OBJCOPY OBJDUMP
-
-	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
-		WAYLAND_AVAILABLE=$(usex wayland 1 0)
-		XNVCTRL_CFLAGS=-fPIC #840389
-	)
-
-	if use driver; then
-		if linux_chkconfig_present GCC_PLUGINS; then
-			mkdir "${T}"/plugin-test || die
-			echo "obj-m += test.o" > "${T}"/plugin-test/Kbuild || die
-			:> "${T}"/plugin-test/test.c || die
-			if [[ $(LC_ALL=C make -C "${KV_OUT_DIR}" ARCH="$(tc-arch-kernel)" \
-				HOSTCC="$(tc-getBUILD_CC)" M="${T}"/plugin-test 2>&1) \
-				=~ "error: incompatible gcc/plugin version" ]]
-			then
-				ewarn "Warning: detected kernel was built with different gcc/plugin versions,"
-				ewarn "you may need to 'make clean' and rebuild your kernel with the current"
-				ewarn "gcc version (or re-emerge for distribution kernels, including kernel-bin)."
-			fi
-		fi
-
-		linux-mod_src_compile
-	fi
-
-	emake "${NV_ARGS[@]}" -C nvidia-modprobe
-	use persistenced && emake "${NV_ARGS[@]}" -C nvidia-persistenced
-	use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig
-
-	if use tools; then
-		# cflags: avoid noisy logs, only use here and set first to let override
-		# ldflags: abi currently needed if LD=ld.lld
-		CFLAGS="-Wno-deprecated-declarations ${CFLAGS}" \
-			RAW_LDFLAGS="$(get_abi_LDFLAGS) $(raw-ldflags)" \
-			emake "${NV_ARGS[@]}" -C nvidia-settings
-	elif use static-libs; then
-		emake "${NV_ARGS[@]}" -C nvidia-settings/src out/libXNVCtrl.a
-	fi
-}
-
-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
-		[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=(
-		# nvidia_icd/layers(vulkan): skip with -X too as it uses libGLX_nvidia
-		$(usev !X "
-			libGLX_nvidia libglxserver_nvidia
-			nvidia_icd.json nvidia_layers.json")
-		$(usev !wayland libnvidia-vulkan-producer)
-		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
-	)
-	local skip_modules=(
-		$(usev !X "nvfbc vdpau xdriver")
-		$(usev !driver 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 SYSTEMD_UNIT # handled separately / unused
-	)
-
-	local DOCS=(
-		README.txt NVIDIA_Changelog supported-gpus/supported-gpus.json
-		nvidia-settings/doc/{FRAMELOCK,NV-CONTROL-API}.txt
-	)
-	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\
-$(usev driver "
-
-Like all out-of-tree kernel modules, it is necessary to rebuild
-${PN} after upgrading or rebuilding the Linux kernel
-by for example running \`emerge @module-rebuild\`. Alternatively,
-if using a distribution kernel (sys-kernel/gentoo-kernel{,-bin}),
-this can be automated by setting USE=dist-kernel globally.
-
-Loaded kernel modules also must not mismatch with the installed
-${PN} version (excluding -r revision), meaning should
-ensure \`eselect kernel list\` points to the kernel that will be
-booted before building and preferably reboot after upgrading
-${PN} (the ebuild will emit a warning if mismatching).
-
-See '${EPREFIX}/etc/modprobe.d/nvidia.conf' for modules options.")\
-$(use amd64 && usev !abi_x86_32 "
-
-Note that without USE=abi_x86_32 on ${PN}, 32bit applications
-(typically using wine / steam) will not be able to use GPU acceleration.")
-
-For general information on using ${PN}, please see:
-https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers"
-	readme.gentoo_create_doc
-
-	if use driver; then
-		linux-mod_src_install
-
-		insinto /etc/modprobe.d
-		doins "${T}"/nvidia.conf
-
-		# used for gpu verification with binpkgs (not kept, see pkg_preinst)
-		insinto /usr/share/nvidia
-		doins supported-gpus/supported-gpus.json
-	fi
-
-	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
-
-	if use tools; then
-		emake "${NV_ARGS[@]}" -C nvidia-settings install
-
-		doicon nvidia-settings/doc/nvidia-settings.png
-		domenu nvidia-settings/doc/nvidia-settings.desktop
-
-		exeinto /etc/X11/xinit/xinitrc.d
-		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
-	fi
-
-	if use static-libs; then
-		dolib.a nvidia-settings/src/out/libXNVCtrl.a
-
-		insinto /usr/include/NVCtrl
-		doins nvidia-settings/src/libXNVCtrl/NVCtrl{Lib,}.h
-	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]} =~ _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
-
-	# 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 amd64; then
-		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
-}
-
-pkg_preinst() {
-	has_version "${CATEGORY}/${PN}[wayland]" && NV_HAD_WAYLAND=
-
-	use driver || return
-	linux-mod_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
-
-	# try to find driver mismatches using temporary supported-gpus.json
-	for g in $(grep -l 0x10de /sys/bus/pci/devices/*/vendor 2>/dev/null); do
-		g=$(grep -io "\"devid\":\"$(<${g%vendor}device)\"[^}]*branch\":\"[0-9]*" \
-			"${ED}"/usr/share/nvidia/supported-gpus.json 2>/dev/null)
-		if [[ ${g} ]]; then
-			g=$((${g##*\"}+1))
-			if ver_test -ge ${g}; then
-				NV_LEGACY_MASK=">=${CATEGORY}/${PN}-${g}"
-				break
-			fi
-		fi
-	done
-	rm "${ED}"/usr/share/nvidia/supported-gpus.json || die
-}
-
-pkg_postinst() {
-	linux-mod_pkg_postinst
-
-	readme.gentoo_print_elog
-
-	if [[ -r /proc/driver/nvidia/version &&
-		$(</proc/driver/nvidia/version) != *"  ${PV}  "* ]]; then
-		ewarn "Currently loaded NVIDIA modules do not match the newly installed"
-		ewarn "libraries and may prevent launching GPU-accelerated applications."
-		use driver && ewarn "The easiest way to fix this is usually to reboot."
-	fi
-
-	if [[ $(</proc/cmdline) == *slub_debug=[!-]* ]]; then
-		ewarn "Detected that the current kernel command line is using 'slub_debug=',"
-		ewarn "this may lead to system instability/freezes with this version of"
-		ewarn "${PN}. Bug: https://bugs.gentoo.org/796329"
-	fi
-
-	if [[ -v NV_LEGACY_MASK ]]; then
-		ewarn
-		ewarn "***WARNING***"
-		ewarn
-		ewarn "You are installing a version of ${PN} 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
-			ewarn "  echo '${NV_LEGACY_MASK}' > ${EROOT}/etc/portage/package.mask/${PN}"
-		else
-			ewarn "  echo '${NV_LEGACY_MASK}' >> ${EROOT}/etc/portage/package.mask"
-		fi
-		ewarn "...then downgrade to a legacy branch if possible. For details, see:"
-		ewarn "https://www.nvidia.com/object/IO_32667.html"
-	fi
-
-	if use kernel-open; then
-		ewarn
-		ewarn "Open source variant of ${PN} was selected, be warned it is experimental"
-		ewarn "and only usable with Turing / Ampere and later GPUs, aka GTX 1650+."
-		ewarn "Please also see: ${EROOT}/usr/share/doc/${PF}/html/kernel_open.html"
-		ewarn
-		ewarn "Many features are not yet implemented in the drivers and limitations are"
-		ewarn "to be expected. Please do not report non-build/packaging bugs to Gentoo."
-		ewarn "Switch back to USE=-kernel-open to restore functionality if needed for now."
-	fi
-
-	if use wayland && use driver && [[ ! -v NV_HAD_WAYLAND ]]; then
-		elog
-		elog "With USE=wayland, this version of ${PN} sets nvidia-drm.modeset=1"
-		elog "in '${EROOT}/etc/modprobe.d/nvidia.conf'. This feature is considered"
-		elog "experimental but is required for wayland."
-		elog
-		elog "If you experience issues, either disable wayland or edit nvidia.conf."
-		elog "Of note, may possibly cause issues with SLI and Reverse PRIME."
-	fi
-}


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: x11-drivers/nvidia-drivers/, x11-drivers/nvidia-drivers/files/
@ 2023-02-28 17:00 Ionen Wolkens
  0 siblings, 0 replies; 33+ messages in thread
From: Ionen Wolkens @ 2023-02-28 17:00 UTC (permalink / raw
  To: gentoo-commits

commit:     e2c6ebc2286383a5eb9d7220f9d6cbe2d64a7274
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 28 16:06:59 2023 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Tue Feb 28 16:59:48 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e2c6ebc2

x11-drivers/nvidia-drivers: add 530.30.02 (unkeyworded beta)

These betas are usually good enough for ~arch, but let's be
conservative and wait until next non-beta version to keyword
(users should feel free to opt-in now if they want to).

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 x11-drivers/nvidia-drivers/Manifest                |   8 +
 .../files/nvidia-settings-530.30.02-desktop.patch  |  11 +
 .../nvidia-drivers/nvidia-drivers-530.30.02.ebuild | 628 +++++++++++++++++++++
 3 files changed, 647 insertions(+)

diff --git a/x11-drivers/nvidia-drivers/Manifest b/x11-drivers/nvidia-drivers/Manifest
index c7ed73cceaa4..f2fbc998ec07 100644
--- a/x11-drivers/nvidia-drivers/Manifest
+++ b/x11-drivers/nvidia-drivers/Manifest
@@ -2,6 +2,7 @@ DIST NVIDIA-Linux-aarch64-510.108.03.run 211471630 BLAKE2B 4177e12907bb577d96734
 DIST NVIDIA-Linux-aarch64-515.86.01.run 221097882 BLAKE2B f8562f9ef1d29451792e00f5489ae7bf63d1a9c5a13354f119667e5572f473abe14a82383c7f61251213ef16463c064059316c7da09a5d61207823b17a7183bf SHA512 43161f86143b1558d1f558acf4a060f53f538ea20e6235f76be24916fe4a9c374869645c7abf39eba66f1c2ca35f5d2b04f199bd1341b7ee6c1fdc879cb3ef96
 DIST NVIDIA-Linux-aarch64-525.85.05.run 262667903 BLAKE2B e6e4d2d8a90f5abbfc4d67ee1a74c062fcd91b4d46d247702e937d8e82c2ddeac19418a74908b90d31265819dfa93791c53cb111b41fe51732851c9d2e74c21e SHA512 85312583dbd55791273308aa3c3bf43241e0b28cbe850e56bd6997dcedd2db51af337d062587886ca4000cf39428a748c87d6e270648e09d4f0870856757a7d0
 DIST NVIDIA-Linux-aarch64-525.89.02.run 263020466 BLAKE2B 7f912746c186450b09b7e4b0e26731a8480a02e02a6d0009c1c96e33f91dd47604b262e8d42568b8c9127598cf17a19e7bf5cf29472a9e2b1cc8d765b2b39370 SHA512 a74d11453522dde936c022b6c8ef8df0349a10f825caaab3e7a58002f4afcd12160865ad9e5745b055430d978ebdcc0583dfe8b339ba60eead99517d49ee7191
+DIST NVIDIA-Linux-aarch64-530.30.02.run 218532678 BLAKE2B 96abcd638192c21556eb04969776c6c0ab0ab566b74de9455d0d4130bf4abd78dc12c93781f9fdf571ed1c07a59a71f893d4cf9fb9c0fc7298117cd58d02aaad SHA512 ed9a0c057e6cf97a1cf166f11b684427e7c93ae7ad1a0f00f8ef674b73aaa555d8134fe18d85ba8a233d4e68972e92f27501c1165e1cb1bc709174c679c06e32
 DIST NVIDIA-Linux-x86-390.157.run 49417041 BLAKE2B 435b5e0e60468cc74b41cc5d9b5bb0105d29c11a2d408457835212a96519c9334ecf19278b36749d3ff7f498f5b0ae45a2efae2d428703dac21245c62f1efebe SHA512 dae9ac2c12f9ad90f7441e00e01a984147c577892421911d7f67f6a31e616ac1cb7d434bc9c7f58fbd9b8ae909521b5bece607a63c79588c0bb9d99c6bad5fb0
 DIST NVIDIA-Linux-x86_64-390.157.run 85835541 BLAKE2B 44b855cd11f3b2f231f9fb90492ae2e67a67ea3ea83c413e7c90956d38c9730a8bd0321281ae03c6afce633d102f5b499aed25622b9bfd31bdd2c98f0717e95b SHA512 4780503a4cff0180b1b1f37d20a6ba3438dd78b51fa7f69b98d35521835e5d61099129746929d51d63afa2d47b672b3e145e1e1897584dc3799e7f822c5b3a0a
 DIST NVIDIA-Linux-x86_64-470.161.03.run 272397700 BLAKE2B eaa94b7398b3aaadf30c33c95c95b167094ca56114e2e3032978b0959264ac8b8663181485eb1af0282a59b43f912c0ecd48e5eadcb06b6fda601b357ac49bc7 SHA512 26b1640f9427847b68233ffacf5c4a07e75ed9923429dfc9e5de3d7e5c1f109dfaf0fe0a0639cbd47f056784ed3e00e2e741d5c84532df79590a0c9ffa5ba625
@@ -10,37 +11,44 @@ DIST NVIDIA-Linux-x86_64-515.86.01.run 363743089 BLAKE2B aa03a0f059da99fa549cd9d
 DIST NVIDIA-Linux-x86_64-525.47.11.run 416273031 BLAKE2B fc9c5fb8b12a2a1a27750cd2692ca58552d60ad3647574c7489c4fa813960df027e604789344a9e46e6ecbc74f50e54e07bfd83883f73b3608a33cca55fd9a4e SHA512 13901de0aa26d0919695481b5bbe4c109dc0f4e58ec51692932c763ca741c8b9514096bd3859f95950de0d81c66f24f08ba9141771bf3a3d84eadb4219a81c4c
 DIST NVIDIA-Linux-x86_64-525.85.05.run 415131239 BLAKE2B 38bdcce884011cfc0a1b5d08807c0a163ac7807621f3ec69feabbdf27af9e0409491db893912776b05a45f8f56c06f281a84074ab8ff21a71774b890bdff2cf8 SHA512 db30b9186cdcf22b2dde267c08a10cadfc3d37190c57a26a71e282b0f661b187b5b28764418eacf8b2344ebfa8feb7480ae1de31b3bc3026feaf9482a3b51741
 DIST NVIDIA-Linux-x86_64-525.89.02.run 414116295 BLAKE2B 22a6da77876557c256cb5571b6ae78133bc150ceb16aaf331a332bdd891df40beac07ac70efedb11ec2458fcdf2a23247b54274d509a2b54e50f4da1251425e7 SHA512 a991c5a843957aa81cf619c39d699100ff69fc723fb195c68fd50cd69ee9d5651a223d3b5d254c8c1b7c8cad09e24846ba4e64869a8b3777e85cd3e5ba515bb5
+DIST NVIDIA-Linux-x86_64-530.30.02.run 344142236 BLAKE2B 68a7bc7baf8f09fa827c9e370e70a2c00d083554d4926eec523923815b71722c28c990cfb9b689e4cd5ed990de42f884e66a57a30f6ad87fe4cd3654c2fa2c9c SHA512 62a497a3f1b2f32692f756113a34caaf193f4d4d2488e02b832c9ebb8ef1a8c72722ae29b044068fac8c7edc25376ebb50cfc26e28ca9a74f37895138260de22
 DIST NVIDIA-kernel-module-source-515.86.01.tar.xz 7504412 BLAKE2B 20b1b9eb6e2fbc7adfa0b78c6acc88c9da8346888c3d1f1ec01a6c1252feccfc104e338605bfaf7617f0b78c7d0de05b32577394714be3575aa67b37c0e843ca SHA512 075fb8b9c3f43f21f51035460a9bc306b11214eb029e950a5bfbc283dc1d3403210ae303148442d31b2c5bf618923bd1762ab5a91234d005f50177fc02fa8ba4
 DIST NVIDIA-kernel-module-source-525.85.05.tar.xz 10081192 BLAKE2B b80f1893fe18dcb62ad2d1daaa7c1642e8699c7acda0bf55a104e10824ece908e45e8202949262fce5459b3bebe3582fa52aa506333989388eea94d65e26da11 SHA512 1ed3e69d959d68a351541483cbf552730ec1748faee3bacf1b9f0099650bc3244ed11a4aee84e51187321f59fbedaa92d24a66439265c9f2e436db82a6876ee0
 DIST NVIDIA-kernel-module-source-525.89.02.tar.xz 10094060 BLAKE2B 950058e9441302ffef78440be6fa3c25c0d768ea09433bcd943989cdc42e265ce78f3eb4447d77e834c7ffdee61a9bc09abc8bf10fa7f1dc0f75bc43c2c4ea55 SHA512 5044130d0a9a1237ae4ebaf6016e4959230fdeb2d5100cb8068906d2759246c4aeb965686cca67a498d0699e9d3b16f6e005b1eb342a32169a8f05dfd03d3730
+DIST NVIDIA-kernel-module-source-530.30.02.tar.xz 10484236 BLAKE2B 378bd1aeff96272452d90162c314dc2b05072cbec93b0be10cf974d889e178000005e1f1eee200ce85fcb80e7223a63c81cec95585189f90877be22352d8b83e SHA512 af03ed04af1c538f343c7f81497139bcadcec9d5dd2a607d9f6f9ca96b4e073c3dd4a0eec3a88e4e020e09c346fe7aaa007cff9af5b36814b2f14b66abaa266c
 DIST nvidia-installer-390.157.tar.bz2 150323 BLAKE2B 8058ca87a6dea956d564af9f7eab9b1fc82b1f2382bd5cb2f6d97cbe2e19292533522d5f8f2eacbeb16520372715fcb72f8f9b0998962af5d4e75522c8d74524 SHA512 93a7ece648602157496c8e27a88864ede341a100f5328a4c1a25faf8f0b94d252060e5e2f71d0c302fd0566c10773c30b76b3b5f431d8039b71c90a7969f7d7e
 DIST nvidia-installer-470.161.03.tar.bz2 146227 BLAKE2B 4c733877adbe5f44e2d112fe2401657c2e2809ff76d0eac29409be7c624e073d4a2fbcfb39eb706625d93d1f3c753d47271a6c2c660270824cfea350e07c751a SHA512 eab1308b85dd66ae4332aff766a237e77c763af45a0e62eba0958abcaa493950aa19edd95039d03e783d78d0ad1fe8348a13d5b64fa103410acfa6ad5f95a884
 DIST nvidia-installer-510.108.03.tar.bz2 144494 BLAKE2B de7c3f5c50350318a3e95bfbdd8fa7f51f187298497e88519f9d4719e26f310f2420ef8e500866cee0e6c22e888c4282a65e1edcc9c7e3d4d4799ff8e6856789 SHA512 b90efcc082b6de0ca42fe203ae0b60aafc8623377f31fd5262401e933bf630b11c843d5e02951374a9276e5d08eaa0c28bf2aa4987b8f9ae8719ada6e62ea7c1
 DIST nvidia-installer-515.86.01.tar.bz2 144637 BLAKE2B 840e2258224e0d19dfe092bc8e8d5986ff771a9fbacfc6c682c513e2757072b68252ebbe4ec8a491997db80f3e1c6879b9dc8f93134caf6f0e6ea3360253fbd9 SHA512 3f55ab79283f1730b5cf5898d9df97a78b8d86f0ac124af9e31c7a960f4a82e46bc262fc0cd8ae9c29c3bab65e2be1ca3565d0a470017a153fa58f61241b34b2
 DIST nvidia-installer-525.85.05.tar.bz2 147738 BLAKE2B 08d1f0e8d50a51b2057d190c0fe17d0b5ba1e313541cfff3ccd782348d2049ff85ef7b4e0c2a6dbdbb074a51b536db04cc11b856d02e22c2775788155163db39 SHA512 9b59a0ae0f64974d67f95a55bf21b1cda887ce60a5f8de07d83684ed36271e0fab15d50105e56df7bb6343e2749e014d174c7c7cdd37981983f178c246348f9d
 DIST nvidia-installer-525.89.02.tar.bz2 147686 BLAKE2B 0ffc3750f497ea9b8023d1a48e6b8c537971a6a616cdb465a4af5072d6c3c577ca439a1b573e1eacb7cf302d405b8e1b582efaaefadcaf39e33742ed22998dd9 SHA512 9d6b71c8a332caf052b642d8205830136b51151a04818dfda36e0b5adb5f3e2111c128f410a50239c38483225b38712b781fc0bce6dbc5fb8c7a6787f73f5104
+DIST nvidia-installer-530.30.02.tar.bz2 147913 BLAKE2B f59e5224b5b7929ff54ba666c66b8d9373d90755edd6552f009b35e69f217b29c49c9a00e2d74eeecbbddc99a38c3f580250a7b0c1f56e07d074aa301b736bbb SHA512 cb8d5ae2b3e4d41935d51c219cae6e7953d732157bc848b54da15ffb862621a17bc44f0fce5310de8c52178a5fcd5cb1a6828dec31abe85225d1cb5800185667
 DIST nvidia-modprobe-390.157.tar.bz2 35306 BLAKE2B 80d202b39c2f95ec0f909712c2e101483af50124092c32efb33bd98ff58ddfb97b737ff07f1ddc941f688c1b4c26a15f392566d522e18506771f10422fcd571c SHA512 109bbe24a3758b568ea65fe1e9d78f69fae6108ec0497b796c885a3912825fe04ffd7389a3e22987f1a10a2926bf6eaa384faabc59478aa3ee244dd3ac91c6d3
 DIST nvidia-modprobe-470.161.03.tar.bz2 38348 BLAKE2B a137e38463f806d25e91d81faefaabc5cd5e51e6537b0a9e641ff96b6029c522eca3766b46a240bd5d25cf04fc11c8eca6b1ae2cbdcc17bc7f0d059fcba67fc7 SHA512 f3b95c22b600b1e09797ff346b7bddb7d84abab01b5383b08626e3172cae8c84fcb3d0ce6425769eafad9602656704c51b934131b3e0b7512de82e5acafcfd15
 DIST nvidia-modprobe-510.108.03.tar.bz2 39055 BLAKE2B c195f55a60eb058b2da704d2aea245aab82a5129ac974cf0d5eeb6b39256c749b7b7de144e067887eac3fb03061d4f87a9c694429078d0eb0242227df1a65a3f SHA512 9ba4fd40b06ffc2f880944dc4b58155a746422cbb02cd17f6af59e3975d46861f182d9257fe654c35d991f7799d95a0a0ed0fe4bfac4426d997a22e3b270fd37
 DIST nvidia-modprobe-515.86.01.tar.bz2 39100 BLAKE2B 00157bc2cc78c58389772dd92c0e389420b93068c673153be32ae385efd50071ed9986c3bfe0d9242a539536c1cd3fd9c502ed7d00523aa653c7a9085a6333bb SHA512 14c82274bc87da0b4f2f8d3a53d02ea55fb003a32ed10a2259598db86655cccbf39fa6bded836cf2bb667c2eb842ae0ccfcf39fe32ee78ff291827673d02634c
 DIST nvidia-modprobe-525.85.05.tar.bz2 40018 BLAKE2B c065dcf143af716c02bae44c86f4325a6c4714aa937c3ea8a54ee3b4cfdd96a86bbad8f481daf8493dbd0e1400e301d58492d9996d16098d649a9e73d8ee824d SHA512 bddef88dece5e06711a4b47b9762ede13431470f2d1082a217737f6bd726ee3278acb1ea526c24198033ee6bbc0add5398d5ce90ea00c9e189a49b13842d72fe
 DIST nvidia-modprobe-525.89.02.tar.bz2 40010 BLAKE2B 5c7ee71c5f88a2680c5236abb9bb7ebdb3d09d42282663f33330ef75ffbbbe0f6cbb00e2b500426bd18d31f29a872e7a4ca532185baa8f7660eaaa47105a93ca SHA512 e29204f855291524a25c5db0e930d78aba539a374523293baf0c3c86c0c4c1c336f0d6473d0862b2e942efb2fefb1c2732cdfa20dde8f981b047ba34e48f2138
+DIST nvidia-modprobe-530.30.02.tar.bz2 40007 BLAKE2B 65e7b078e65653765aaa6a243bde81f88f9d5fd7d2ca3650bf35b8033b2ba533875510d6d8f92122b488835c9ca641437ad81e0668c740cde5326404d7b385ca SHA512 747ae9b1fbf841bd4bc0d197da4551b9da73db61f402921caafcc6ea4243d7f14b69522ee450d45154246d97d01fa8ab3060d23cace759a1bc3654ba66417c6c
 DIST nvidia-persistenced-390.157.tar.bz2 48654 BLAKE2B 2cf6c92da90acff55e8c180a06b0c6a29d48be9fd8ca3c541202fd14f0697220fba6b66452942aa7ae7cc8821f5c5eb9fa8f7a31d2248624e5f9141d83a176b8 SHA512 70f0707ed6f2b877e69ef90cf782f66cbc9d2071db53ca09ceb7b89427b0fe176708517340621fa251539b7d481b238adeeb60261674eed74de1f62db6dbb72e
 DIST nvidia-persistenced-470.161.03.tar.bz2 46540 BLAKE2B 7a9af37c570fd50341a620cb8324294e4e29ebcd165f7254ca8c7a0d3010b40ee3f6721e2e6cddb5378629bc20014a4d916141e4109f6167c688c506c7e0852c SHA512 45c49cbb2a61fdcead639bf2032950f97a403fb70870c46c71003d30477bce2936bd2e2dc6ba234987cd2397dca958e83e78850289e70d07e4cb9818a8ddf8b9
 DIST nvidia-persistenced-510.108.03.tar.bz2 47222 BLAKE2B bed22370ff15df7097e927e07c444a405702f53b9e5591b816a5c0bf1d9f78a045571ece830db86d4724a9b0466a8d67f2e45ec010c69f603a9bce5cd2b8da48 SHA512 39df00ead66f7a6b0e001484333c0dda09fc30daf0df0c8fec4f5913fb88e7a2d214830e7f20632aaf89acdd9af1f11d78b50eacc10cc9bd2b534f390aad52f7
 DIST nvidia-persistenced-515.86.01.tar.bz2 47153 BLAKE2B a7d213790895876453d34580f563ee0aee98ee145fdd8e7bdb726f91298da0f16a4101922a908d367af3ffd6ce1418128f7c5dc0a1e2789143832dc1b96ffc35 SHA512 ffe735178b3b5a0430bae8678b5f7fca407a0389de7f57a1789f67d3b4087cf7c638e6ded8a1cf7ef3ca642d0f889d9f2795fa0e18291101ef1b2a9e3bc4a174
 DIST nvidia-persistenced-525.85.05.tar.bz2 48165 BLAKE2B b0d396e22b2ec2d09d156b0024d308edf65ff5de1afb5d20e1fa33329f84776b7892f69feb2707a4d199bcce491ff647f24368f312f65df575bbadbe8fa31584 SHA512 8154c49072079b55ac9b6ea784004c47a4906b0ba1f2ef1cfc7f90bc7cb2259b14dd5655d0b36496f2546719f9b928f68689e4f449186913286fa838fc1fec13
 DIST nvidia-persistenced-525.89.02.tar.bz2 48135 BLAKE2B b7f0d085d18a45468bbb9d85a84ef9b7917d29f5158a836bacdbba7f3a3c05a2b6470b1a2b2a0f817396f234e620318a0d139ee8380783bb12511d764a09b235 SHA512 927a89de9392fa545e7ecd11f952c00657df92e6b1cfde6cff69851b09c04796a439768a8c6fb3b1b0e322239554ab029bf8235164f5e28ecf997b31733bef28
+DIST nvidia-persistenced-530.30.02.tar.bz2 48184 BLAKE2B d118d0c626ad24162f9ced705ea9db849638b719d5b16da0d0152ebac00a181eeac10f49524552cf9929b91ce6957cead958c845eadcd86d9646004adca2430c SHA512 9c2cc9396011cfbe8ea1e086605f12c17b8571e16eb37c1b25c1531ba95a8b5bf7fcdcdec6c5d455f767eb850c45b054e2edf3355dadd3c62102163a6bd106a5
 DIST nvidia-settings-390.157.tar.bz2 1108938 BLAKE2B d9ec1ab5d7f157d74627272adf752a671dd17e2ede02069437b6180b927fe315b15cc6416d584ab2f038b76fe01e5b64514a834f24d88ac16676e55205fdecdd SHA512 b16699009bf56a1ff3b623a528c58061c4f5a2c5c4a373756a07bcd667743a1df7c733a572d2d0baa835a904ac2fda8a5c85890dcc00c3a0f223e0467aea902d
 DIST nvidia-settings-470.161.03.tar.bz2 1062425 BLAKE2B 20523f1e5ab39dfe8ac657afdfafe3d99df2cfb521a475f54804dd50233d4e2ac5dc5fb0e3394997963daa5d06bc2b55088ebdcbf894c16cc9d25aba316834c5 SHA512 61725a6f77930d9c12de6fef57d9f5bb93a5e62e60d0db1707b7f469bce00464192930c4f46e9074e7bcbc4922fc86e9b22ddfdf092f8f46b0c6820505e3b87e
 DIST nvidia-settings-510.108.03.tar.bz2 1075907 BLAKE2B 537d38bd6a5fdca0182af9a7604764c14fb832a1dd2f0d6f2eb1532f06f3822ed9e2190293c1300b7f8971990883ea491269e7ab4838cd724196742e21352ce0 SHA512 3eed794ad7988143719c6d905e375d514daa441d9ed71eca7eff6cae4cdf4fbf08331f9b0451bcd961920f1ffc1797a257943900eef45e225b312b61232275ef
 DIST nvidia-settings-515.86.01.tar.bz2 1080128 BLAKE2B eed02cf9b73fc12c1d862df71d7fe9a4e4e8486831d1940c6e5187b751abe02deb0ebc495d251ffcd401f8ce78b16077d5cd9272c0f472d8c6465a958bf66c85 SHA512 d2c50bf587f53336a1d80ae88b382ef04e8c9ef24893f8ec901934eebb1358038ed67ac7501d98257c486a0fe2e818edd91832b3f989311c061d7a8b85818229
 DIST nvidia-settings-525.85.05.tar.bz2 1087280 BLAKE2B 2513d4b6e07c890249b2ab29ce1241666af8c939e5925854298ba858aca3e46f100a9327476cb75be0b056aee40153907780f021ff617d6fb8fe4d87604258b0 SHA512 f61f17f752392b7c39b7d5457b868eaa724020301288ce72621839135ed58b1c0979c491c111818d91f96e1253be74182aae6f538ade59e28071b420bd1a1a97
 DIST nvidia-settings-525.89.02.tar.bz2 1087020 BLAKE2B 5c1716a112046c09a390b0fd8212d32fb000e0214da6f5245722d2f84a9797509ef9b730a0774a4b719b9cd06afaa809262f1772a62a9c2eb386d7ab874a3ec3 SHA512 bd0527173a23e5c2142dca1a4a00f4844c8f83707627555812034ad2d23b0fa861cef047f3b83e3db3d0aaeb30411f745bf9ae892b576bb502169259a4e48893
+DIST nvidia-settings-530.30.02.tar.bz2 1086298 BLAKE2B 630cb04012119a6f13410d95c357d2cd4fbe792cc738aac13299809fa0f91ebfadc9f41661db2b2b75c654b063b89464ba510fd7810ec615e9fa965c1080e2b4 SHA512 b954e8e7b3430fa2377e28f29a9f02bbac1abe1f87cb54c2d2708248aec8df02a7f71b6a3738db523a4b571253101c2fe1814a461d741c7052d64ff096a67bb5
 DIST nvidia-xconfig-390.157.tar.bz2 107399 BLAKE2B 0cbb3b1ba508ddc3ba4a161c290b31bf7a67f67880bdbd01171a962c5fa97ca945b1ef17932403f8589309380743f1da632c728d8accb6d4e56dbd895e7486bb SHA512 50b390811c9bf091b14add41f886925b17496b41006b7d3981d2398caa65cf5db8a579c8cebed78278384bf3acc629befb07b54339c61abcc75852c0dcb8b8ca
 DIST nvidia-xconfig-470.161.03.tar.bz2 108669 BLAKE2B 6c12e38759ce64c5637d6301e2d5c89b8d53ad4df84beea276b76cf6927eb6ff9596534b7097088d41447886ebb79e00b037c747a47531b13a56373df7ef8969 SHA512 0cccb61c3b875b47fc78cda627aace3a730e7c267389e0fcd4ab780aefaae3c48d95d137becdba7fc12adb284ede9307c85a3ae347d31a57a6283fece6046a9a
 DIST nvidia-xconfig-510.108.03.tar.bz2 109729 BLAKE2B 48378155d57f9b4a2b58b044daa1f2f2ed9b897b77f0453f67c7b03200cc09689b628f88a87c0f4c8ae149f11cbe6364eda34c2636cc1e1fce33b799d8225138 SHA512 17462e7826225804685eaea4dba05252dce138f95c72285abe607ee1b2a6269d2f4e5c0833802037d29350d1218ed9982053871b0b08c4f5f329d497da299fab
 DIST nvidia-xconfig-515.86.01.tar.bz2 109747 BLAKE2B d6253f9d052be5aaa1a2be82bf4a36c971aae8b6e9f61e4ff5f27ec415d945bab8289678d6a2495ff7521c66478421090a452ceb19d87803de4290aeb7f69bba SHA512 f4e66f23d9227671158ee0b99b1ccc44f25dc6a910d3b00332d135fb94f21b67f581804b53a40945a652777c898e20069962721931c7b58d2c33d38925da5e35
 DIST nvidia-xconfig-525.85.05.tar.bz2 110595 BLAKE2B 249263ad84c72c5682836bc3717774b95238197319a88b35adb9174e6023c385c49bf95ed1bf89a6d4fef0ba445a9802e437324358bddbe999f61849ea68afc0 SHA512 b2cad5f509e817e1e9f43bfce279a512d5899dbbb3dae212161b1ce7237ac3598e335779fbb7abb8b77327827838d7d310522f0b0a014498cff26f4ed5824841
 DIST nvidia-xconfig-525.89.02.tar.bz2 111065 BLAKE2B 762354ad413253389ca8f57fbfcc483a0b26026420f24f0b72af03716b4226e7a97d95a0e0a88e161200dac5d2257792ab0ae8b581436c3b92c733cf75a80a21 SHA512 a90df9a051472962aa7423fab3bcf6dbaab4669a223181da41922ec65c5c78927c68fef43c8031685439f037bae9d4553d7b388878109d45c8bdd5004cbf954f
+DIST nvidia-xconfig-530.30.02.tar.bz2 110940 BLAKE2B 28a641642cb924fe15455fdf6d1b0861d08d475cbb4b69c23535857a1e3a28b133bc063f3f74241d55ee6def5d4ba70066943fcc1b5ae0ad80478466abbdeba7 SHA512 595ff2cbbe3393c38e7daa7ea72ff21f2e77773c7bf284f0b72aca41b587e6c87405e513b88aea74784853bf371c02de0924a327ad23be4042353b19c3e2fc1e
 DIST open-gpu-kernel-modules-525.47.11.tar.gz 10311870 BLAKE2B 50e6d021014eb05fab8baa6f1f0c9698e6e8b1c573788fc3a91918b457674dfb7f13a70e8020643eb431fe053eef585122eaf48366989afe39b497ade9f1010b SHA512 9d551e7fc121eafb508faf2fd564df878259ec59c926ea7aa1b8c0b77a28eb7011419e045aa4513a644b82d9ac7c7e8e12d5dcee1ebf2b7b58c17fba26cab5d3

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-settings-530.30.02-desktop.patch b/x11-drivers/nvidia-drivers/files/nvidia-settings-530.30.02-desktop.patch
new file mode 100644
index 000000000000..d1cdbcec448a
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-settings-530.30.02-desktop.patch
@@ -0,0 +1,11 @@
+These __PLACEHOLDER__ are replaced by nvidia-installer which we don't use.
+--- a/nvidia-settings/doc/nvidia-settings.desktop
++++ b/nvidia-settings/doc/nvidia-settings.desktop
+@@ -5,5 +5,5 @@
+ Comment=Configure NVIDIA X Server Settings
+-Exec=__UTILS_PATH__/nvidia-settings
++Exec=nvidia-settings
+ Icon=nvidia-settings
+-Categories=__NVIDIA_SETTINGS_DESKTOP_CATEGORIES__
++Categories=System;HardwareSettings;
+ 

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-530.30.02.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-530.30.02.ebuild
new file mode 100644
index 000000000000..42ca4a2076b0
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-530.30.02.ebuild
@@ -0,0 +1,628 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+MODULES_OPTIONAL_USE="driver"
+inherit desktop flag-o-matic linux-mod multilib readme.gentoo-r1 \
+	systemd toolchain-funcs unpacker user-info
+
+NV_KERNEL_MAX="6.2"
+NV_URI="https://download.nvidia.com/XFree86/"
+
+DESCRIPTION="NVIDIA Accelerated Graphics Driver"
+HOMEPAGE="https://www.nvidia.com/download/index.aspx"
+SRC_URI="
+	amd64? ( ${NV_URI}Linux-x86_64/${PV}/NVIDIA-Linux-x86_64-${PV}.run )
+	arm64? ( ${NV_URI}Linux-aarch64/${PV}/NVIDIA-Linux-aarch64-${PV}.run )
+	$(printf "${NV_URI}%s/%s-${PV}.tar.bz2 " \
+		nvidia-{installer,modprobe,persistenced,settings,xconfig}{,})
+	${NV_URI}NVIDIA-kernel-module-source/NVIDIA-kernel-module-source-${PV}.tar.xz"
+# 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="0/${PV%%.*}"
+#KEYWORDS="-* ~amd64 ~arm64" # beta branch
+IUSE="+X abi_x86_32 abi_x86_64 +driver kernel-open persistenced +static-libs +tools wayland"
+REQUIRED_USE="kernel-open? ( driver )"
+
+COMMON_DEPEND="
+	acct-group/video
+	sys-libs/glibc
+	X? ( x11-libs/libpciaccess )
+	persistenced? (
+		acct-user/nvpd
+		net-libs/libtirpc:=
+	)
+	tools? (
+		>=app-accessibility/at-spi2-core-2.46:2
+		dev-libs/glib:2
+		dev-libs/jansson:=
+		media-libs/harfbuzz:=
+		x11-libs/cairo
+		x11-libs/gdk-pixbuf:2
+		x11-libs/gtk+:3[X]
+		x11-libs/libX11
+		x11-libs/libXext
+		x11-libs/libXxf86vm
+		x11-libs/pango
+	)"
+RDEPEND="
+	${COMMON_DEPEND}
+	X? (
+		media-libs/libglvnd[X,abi_x86_32(-)?]
+		x11-libs/libX11[abi_x86_32(-)?]
+		x11-libs/libXext[abi_x86_32(-)?]
+	)
+	wayland? (
+		gui-libs/egl-gbm
+		>=gui-libs/egl-wayland-1.1.10
+		media-libs/libglvnd
+	)"
+DEPEND="
+	${COMMON_DEPEND}
+	static-libs? (
+		x11-libs/libX11
+		x11-libs/libXext
+	)
+	tools? (
+		media-libs/libglvnd
+		sys-apps/dbus
+		x11-base/xorg-proto
+		x11-libs/libXrandr
+		x11-libs/libXv
+		x11-libs/libvdpau
+	)"
+BDEPEND="
+	sys-devel/m4
+	virtual/pkgconfig"
+
+QA_PREBUILT="lib/firmware/* opt/bin/* usr/lib*"
+
+PATCHES=(
+	"${FILESDIR}"/nvidia-kernel-module-source-515.86.01-raw-ldflags.patch
+	"${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch
+	"${FILESDIR}"/nvidia-settings-390.144-raw-ldflags.patch
+	"${FILESDIR}"/nvidia-settings-530.30.02-desktop.patch
+)
+
+pkg_setup() {
+	use driver || return
+
+	local CONFIG_CHECK="
+		PROC_FS
+		~DRM_KMS_HELPER
+		~SYSVIPC
+		~!LOCKDEP
+		~!SLUB_DEBUG_ON
+		!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 wayland / nvidia-drm.modeset=1.
+	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."
+
+	use amd64 && kernel_is -ge 5 8 && CONFIG_CHECK+=" X86_PAT" #817764
+
+	use kernel-open && CONFIG_CHECK+=" MMU_NOTIFIER" #843827
+	local ERROR_MMU_NOTIFIER="CONFIG_MMU_NOTIFIER: is not set but needed to build with USE=kernel-open.
+	Cannot be directly selected in the kernel's menuconfig, and may need
+	selection of another option that requires it such as CONFIG_KVM."
+
+	MODULE_NAMES="
+		nvidia(video:kernel)
+		nvidia-drm(video:kernel)
+		nvidia-modeset(video:kernel)
+		nvidia-peermem(video:kernel)
+		nvidia-uvm(video:kernel)"
+	use kernel-open &&
+		MODULE_NAMES=${MODULE_NAMES//:kernel/:kernel-module-source:kernel-module-source/kernel-open}
+
+	linux-mod_pkg_setup
+
+	[[ ${MERGE_TYPE} == binary ]] && return
+
+	# do some extra checks manually as it gets messy to handle builtin-only
+	# and some other conditional checks through CONFIG_CHECK
+	# TODO?: maybe move other custom checks here for uniformity
+	local warn=()
+
+	if linux_chkconfig_builtin DRM_NOUVEAU; then
+		# suggest =m given keeps KMS_HELPER enabled and can serve as fallback
+		warn+=(
+			"  CONFIG_DRM_NOUVEAU: is builtin (=y), and will prevent loading NVIDIA"
+			"    modules (can be safely kept as a module (=m) instead)."
+		)
+	fi
+
+	if linux_chkconfig_builtin DRM_SIMPLEDRM; then
+		# wrt prebuilts, Fedora is pushing =y and gentoo-kernel-bin uses its
+		# configs (bug #840439), but without Fedora's kernel patch to
+		# workaround this issue (which is unlikely to work for us anyway)
+		# https://github.com/NVIDIA/open-gpu-kernel-modules/issues/228
+		warn+=(
+			"  CONFIG_DRM_SIMPLEDRM: is builtin (=y), and may conflict with NVIDIA"
+			"    (i.e. blanks when X/wayland starts, and tty loses display)."
+			"    For prebuilt kernels, unfortunately no known good workarounds."
+		)
+	fi
+
+	if ! linux_chkconfig_present FB_EFI &&
+		! linux_chkconfig_present FB_SIMPLE &&
+		! linux_chkconfig_present FB_VESA
+	then
+		# nvidia-drivers does not handle the tty (beside mode restoration) but,
+		# given few options are viable, try to warn if all missing
+		warn+=(
+			"  CONFIG_FB_(EFI|SIMPLE|VESA): none set, but note at least one is normally"
+			"    needed to get a display for the tty console. In most cases, it is"
+			"    recommended to enable FB_EFI=y and disable FB_SIMPLE (can be quirky)."
+			"    Non-EFI systems are likely to want FB_VESA=y. Users with multiple GPUs"
+			"    or not using the tty may be able to safely ignore this warning."
+		)
+	fi
+
+	if kernel_is -ge 5 18 13; then
+		if linux_chkconfig_present FB_SIMPLE; then
+			warn+=(
+				"  CONFIG_FB_SIMPLE: is set, recommended to disable and switch to FB_EFI or"
+				"    FB_VESA as it currently may be broken with >=kernel-5.18.13 + NVIDIA:"
+				"    https://github.com/NVIDIA/open-gpu-kernel-modules/issues/341"
+				"    (feel free to ignore this if it works for you)"
+			)
+		fi
+
+		if linux_chkconfig_present SYSFB_SIMPLEFB &&
+			{ linux_chkconfig_present FB_EFI || linux_chkconfig_present FB_VESA; }
+		then
+			warn+=(
+				"  CONFIG_SYSFB_SIMPLEFB: is set, this may prevent FB_EFI or FB_VESA"
+				"    from providing a working tty console display (ignore if unused)."
+			)
+		fi
+	fi
+
+	(( ${#warn[@]} )) &&
+		ewarn "Detected potential configuration issues with used kernel:${warn[*]/#/$'\n'}"
+
+	BUILD_PARAMS='NV_VERBOSE=1 IGNORE_CC_MISMATCH=yes SYSSRC="${KV_DIR}" SYSOUT="${KV_OUT_DIR}"'
+	BUILD_TARGETS="modules"
+
+	# Try to match toolchain with kernel only for modules
+	# (experimental, ideally this should be handled in linux-mod.eclass)
+	nvidia-tc-set() {
+		local -n var=KERNEL_${1}
+		if [[ ! -v var ]]; then
+			read -r var < <(type -P "${@:2}") ||
+				die "failed to find in PATH at least one of: ${*:2}"
+			einfo "Forcing '${var}' for modules (set ${!var} to override)"
+		fi
+	}
+
+	local tool switch
+	if linux_chkconfig_present CC_IS_GCC; then
+		if ! tc-is-gcc; then
+			switch=
+			nvidia-tc-set CC {${CHOST}-,}gcc
+			nvidia-tc-set CXX {${CHOST}-,}g++ # needed by kernel-open
+		fi
+	elif linux_chkconfig_present CC_IS_CLANG; then
+		ewarn "Warning: using ${PN} with a clang-built kernel is largely untested"
+		if ! tc-is-clang; then
+			switch=llvm-
+			nvidia-tc-set CC {${CHOST}-,}clang
+			nvidia-tc-set CXX {${CHOST}-,}clang++
+		fi
+	fi
+
+	if linux_chkconfig_present LD_IS_BFD; then
+		# tc-ld-is-bfd needs https://github.com/gentoo/gentoo/pull/28355
+		[[ $(LC_ALL=C $(tc-getLD) --version 2>/dev/null) == "GNU ld"* ]] ||
+			nvidia-tc-set LD {${CHOST}-,}{ld.bfd,ld}
+	elif linux_chkconfig_present LD_IS_LLD; then
+		tc-ld-is-lld || nvidia-tc-set LD {${CHOST}-,}{ld.lld,lld}
+	fi
+
+	if [[ -v switch ]]; then
+		# only need llvm-nm for lto, but use complete set to be safe
+		for tool in AR NM OBJCOPY OBJDUMP READELF STRIP; do
+			case $(LC_ALL=C $(tc-get${tool}) --version 2>/dev/null) in
+				LLVM*|llvm*) [[ ! ${switch} ]];;
+				*) [[ ${switch} ]];;
+			esac && nvidia-tc-set ${tool} {${CHOST}-,}${switch}${tool,,}
+		done
+	fi
+
+	# pass unconditionally given exports are semi-ignored except CC/LD
+	for tool in CC CXX LD AR NM OBJCOPY OBJDUMP READELF STRIP; do
+		BUILD_PARAMS+=" ${tool}=\"\${KERNEL_${tool}:-\$(tc-get${tool})}\""
+	done
+
+	if linux_chkconfig_present LTO_CLANG_THIN; then
+		# kernel enables cache by default leading to sandbox violations
+		BUILD_PARAMS+=' ldflags-y=--thinlto-cache-dir= LDFLAGS_MODULE=--thinlto-cache-dir='
+	fi
+
+	if kernel_is -gt ${NV_KERNEL_MAX/./ }; then
+		ewarn "Kernel ${KV_MAJOR}.${KV_MINOR} is either known to break this version of ${PN}"
+		ewarn "or was not tested with it. It is recommended to use one of:"
+		ewarn "  <=sys-kernel/gentoo-kernel-${NV_KERNEL_MAX}.x"
+		ewarn "  <=sys-kernel/gentoo-sources-${NV_KERNEL_MAX}.x"
+		ewarn "You are free to try or use /etc/portage/patches, but support will"
+		ewarn "not be given and issues wait until NVIDIA releases a fixed version"
+		ewarn "(Gentoo will not accept patches for this)."
+		ewarn
+		ewarn "Do _not_ file a bug report if run into issues."
+		ewarn
+	fi
+}
+
+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-settings && mv nvidia-settings{-${PV},} || die
+	rm nvidia-xconfig && mv nvidia-xconfig{-${PV},} || die
+	mv NVIDIA-kernel-module-source-${PV} kernel-module-source || die
+
+	default
+
+	# prevent detection of incomplete kernel DRM support (bug #603818)
+	sed 's/defined(CONFIG_DRM/defined(CONFIG_DRM_KMS_HELPER/g' \
+		-i kernel{,-module-source/kernel-open}/conftest.sh || die
+
+	# adjust service files
+	sed 's/__USER__/nvpd/' \
+		nvidia-persistenced/init/systemd/nvidia-persistenced.service.template \
+		> "${T}"/nvidia-persistenced.service || die
+	use !amd64 || sed -i "s|/usr|${EPREFIX}/opt|" systemd/system/nvidia-powerd.service || die
+
+	# enable nvidia-drm.modeset=1 by default with USE=wayland
+	cp "${FILESDIR}"/nvidia-470.conf "${T}"/nvidia.conf || die
+	use !wayland || sed -i '/^#.*modeset=1$/s/^#//' "${T}"/nvidia.conf || die
+
+	# makefile attempts to install wayland library even if not built
+	use wayland || sed -i 's/ WAYLAND_LIB_install$//' \
+		nvidia-settings/src/Makefile || die
+
+	# temporary option, nvidia will remove in the future
+	use !kernel-open ||
+		sed -i '/blacklist/a\
+\
+# Enable using kernel-open with workstation GPUs (experimental)\
+options nvidia NVreg_OpenRmEnableUnsupportedGpus=1' "${T}"/nvidia.conf || die
+}
+
+src_compile() {
+	tc-export AR CC CXX LD OBJCOPY OBJDUMP
+	local -x RAW_LDFLAGS="$(get_abi_LDFLAGS) $(raw-ldflags)" # raw-ldflags.patch
+
+	local xnvflags=-fPIC #840389
+	# lto static libraries tend to cause problems without fat objects
+	is-flagq '-flto@(|=*)' && 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}"
+	)
+
+	if use driver; then
+		if linux_chkconfig_present GCC_PLUGINS; then
+			mkdir "${T}"/plugin-test || die
+			echo "obj-m += test.o" > "${T}"/plugin-test/Kbuild || die
+			:> "${T}"/plugin-test/test.c || die
+			if [[ $(LC_ALL=C make -C "${KV_OUT_DIR}" ARCH="$(tc-arch-kernel)" \
+				HOSTCC="$(tc-getBUILD_CC)" CC="${CC}" M="${T}"/plugin-test 2>&1) \
+				=~ "error: incompatible gcc/plugin version" ]]
+			then
+				eerror "Detected kernel was built with a different gcc/plugin version,"
+				eerror "Please 'make clean' and rebuild your kernel with the current"
+				eerror "gcc (or re-emerge for distribution kernels, including kernel-bin)."
+				die "kernel ${KV_FULL} needs to be rebuilt"
+			fi
+		fi
+
+		local o_cflags=${CFLAGS} o_cxxflags=${CXXFLAGS} o_ldflags=${LDFLAGS}
+		if use kernel-open; then
+			# building the nvidia "blob" fails with lto, and also need
+			# to strip in case of a different toolchain for the kernel
+			filter-lto
+			strip-unsupported-flags
+		fi
+		linux-mod_src_compile
+		CFLAGS=${o_cflags} CXXFLAGS=${o_cxxflags} LDFLAGS=${o_ldflags}
+	fi
+
+	emake "${NV_ARGS[@]}" -C nvidia-modprobe
+	use persistenced && emake "${NV_ARGS[@]}" -C nvidia-persistenced
+	use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig
+
+	if use tools; then
+		# cflags: avoid noisy logs, only use here and set first to let override
+		CFLAGS="-Wno-deprecated-declarations ${CFLAGS}" \
+			emake "${NV_ARGS[@]}" -C nvidia-settings
+	elif use static-libs; then
+		# pretend GTK+3 is available, not actually used (bug #880879)
+		emake "${NV_ARGS[@]}" BUILD_GTK3LIB=1 \
+			-C nvidia-settings/src out/libXNVCtrl.a
+	fi
+}
+
+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
+		[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=(
+		# nvidia_icd/layers(vulkan): skip with -X too as it uses libGLX_nvidia
+		$(usev !X "
+			libGLX_nvidia libglxserver_nvidia
+			nvidia_icd.json nvidia_layers.json")
+		$(usev !wayland libnvidia-vulkan-producer)
+		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
+	)
+	local skip_modules=(
+		$(usev !X "nvfbc vdpau xdriver")
+		$(usev !driver 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 SYSTEMD_UNIT # handled separately / unused
+	)
+
+	local DOCS=(
+		README.txt NVIDIA_Changelog supported-gpus/supported-gpus.json
+		nvidia-settings/doc/{FRAMELOCK,NV-CONTROL-API}.txt
+	)
+	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\
+$(usev driver "
+
+Like all out-of-tree kernel modules, it is necessary to rebuild
+${PN} after upgrading or rebuilding the Linux kernel
+by for example running \`emerge @module-rebuild\`. Alternatively,
+if using a distribution kernel (sys-kernel/gentoo-kernel{,-bin}),
+this can be automated by setting USE=dist-kernel globally.
+
+Loaded kernel modules also must not mismatch with the installed
+${PN} version (excluding -r revision), meaning should
+ensure \`eselect kernel list\` points to the kernel that will be
+booted before building and preferably reboot after upgrading
+${PN} (the ebuild will emit a warning if mismatching).
+
+See '${EPREFIX}/etc/modprobe.d/nvidia.conf' for modules options.")\
+$(use amd64 && usev !abi_x86_32 "
+
+Note that without USE=abi_x86_32 on ${PN}, 32bit applications
+(typically using wine / steam) will not be able to use GPU acceleration.")
+
+For general information on using ${PN}, please see:
+https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers"
+	readme.gentoo_create_doc
+
+	if use driver; then
+		linux-mod_src_install
+
+		insinto /etc/modprobe.d
+		doins "${T}"/nvidia.conf
+
+		# used for gpu verification with binpkgs (not kept, see pkg_preinst)
+		insinto /usr/share/nvidia
+		doins supported-gpus/supported-gpus.json
+	fi
+
+	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
+
+	if use tools; then
+		emake "${NV_ARGS[@]}" -C nvidia-settings install
+
+		doicon nvidia-settings/doc/nvidia-settings.png
+		domenu nvidia-settings/doc/nvidia-settings.desktop
+
+		exeinto /etc/X11/xinit/xinitrc.d
+		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
+	fi
+
+	if use static-libs; then
+		dolib.a nvidia-settings/src/out/libXNVCtrl.a
+
+		insinto /usr/include/NVCtrl
+		doins nvidia-settings/src/libXNVCtrl/NVCtrl{Lib,}.h
+	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]} =~ _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
+
+	# 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 amd64; then
+		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]}
+}
+
+pkg_preinst() {
+	has_version "${CATEGORY}/${PN}[wayland]" && NV_HAD_WAYLAND=
+
+	use driver || return
+	linux-mod_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
+
+	# try to find driver mismatches using temporary supported-gpus.json
+	for g in $(grep -l 0x10de /sys/bus/pci/devices/*/vendor 2>/dev/null); do
+		g=$(grep -io "\"devid\":\"$(<${g%vendor}device)\"[^}]*branch\":\"[0-9]*" \
+			"${ED}"/usr/share/nvidia/supported-gpus.json 2>/dev/null)
+		if [[ ${g} ]]; then
+			g=$((${g##*\"}+1))
+			if ver_test -ge ${g}; then
+				NV_LEGACY_MASK=">=${CATEGORY}/${PN}-${g}"
+				break
+			fi
+		fi
+	done
+	rm "${ED}"/usr/share/nvidia/supported-gpus.json || die
+}
+
+pkg_postinst() {
+	linux-mod_pkg_postinst
+
+	readme.gentoo_print_elog
+
+	if [[ -r /proc/driver/nvidia/version &&
+		$(</proc/driver/nvidia/version) != *"  ${PV}  "* ]]; then
+		ewarn "Currently loaded NVIDIA modules do not match the newly installed"
+		ewarn "libraries and may prevent launching GPU-accelerated applications."
+		use driver && ewarn "The easiest way to fix this is usually to reboot."
+	fi
+
+	if [[ $(</proc/cmdline) == *slub_debug=[!-]* ]]; then
+		ewarn "Detected that the current kernel command line is using 'slub_debug=',"
+		ewarn "this may lead to system instability/freezes with this version of"
+		ewarn "${PN}. Bug: https://bugs.gentoo.org/796329"
+	fi
+
+	if [[ -v NV_LEGACY_MASK ]]; then
+		ewarn
+		ewarn "***WARNING***"
+		ewarn
+		ewarn "You are installing a version of ${PN} 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
+			ewarn "  echo '${NV_LEGACY_MASK}' > ${EROOT}/etc/portage/package.mask/${PN}"
+		else
+			ewarn "  echo '${NV_LEGACY_MASK}' >> ${EROOT}/etc/portage/package.mask"
+		fi
+		ewarn "...then downgrade to a legacy branch if possible. For details, see:"
+		ewarn "https://www.nvidia.com/object/IO_32667.html"
+	fi
+
+	if use kernel-open; then
+		ewarn
+		ewarn "Open source variant of ${PN} was selected, be warned it is experimental"
+		ewarn "and only usable with Turing / Ampere and later GPUs, aka GTX 1650+."
+		ewarn "Please also see: ${EROOT}/usr/share/doc/${PF}/html/kernel_open.html"
+		ewarn
+		ewarn "Many features are not yet implemented in the drivers and limitations are"
+		ewarn "to be expected. Please do not report non-build/packaging bugs to Gentoo."
+		ewarn "Switch back to USE=-kernel-open to restore functionality if needed for now."
+	fi
+
+	if use wayland && use driver && [[ ! -v NV_HAD_WAYLAND ]]; then
+		elog
+		elog "With USE=wayland, this version of ${PN} sets nvidia-drm.modeset=1"
+		elog "in '${EROOT}/etc/modprobe.d/nvidia.conf'. This feature is considered"
+		elog "experimental but is required for wayland."
+		elog
+		elog "If you experience issues, either disable wayland or edit nvidia.conf."
+		elog "Of note, may possibly cause issues with SLI and Reverse PRIME."
+	fi
+}


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: x11-drivers/nvidia-drivers/, x11-drivers/nvidia-drivers/files/
@ 2023-06-18  1:53 Ionen Wolkens
  0 siblings, 0 replies; 33+ messages in thread
From: Ionen Wolkens @ 2023-06-18  1:53 UTC (permalink / raw
  To: gentoo-commits

commit:     ec717d8006b9e69a6171786a57731710cedf19dc
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 18 01:42:42 2023 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Sun Jun 18 01:53:43 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ec717d80

x11-drivers/nvidia-drivers: backport clang options fix to 525 branch

Technically 0/390+470+515 also need this, but they have bigger issues
with clang-16 and I can only recommend to not use clang with old
branches. NVIDIA may update 470 for clang in the future though, the
others are unlikely.

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 .../nvidia-drivers-525.116.04-clang-unused-option.patch | 17 +++++++++++++++++
 .../nvidia-drivers/nvidia-drivers-525.116.04-r2.ebuild  |  1 +
 .../nvidia-drivers/nvidia-drivers-525.47.27.ebuild      |  1 +
 3 files changed, 19 insertions(+)

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-525.116.04-clang-unused-option.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-525.116.04-clang-unused-option.patch
new file mode 100644
index 000000000000..5842bdd2a757
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-525.116.04-clang-unused-option.patch
@@ -0,0 +1,17 @@
+clang-15.0.7(?) or so may abort when the unused option -MD is passed,
+option removal is backported fro nvidia-535 branch
+
+Note patch is kept without context given the lines below change constantly
+(version) preventing from applying same patch to multiple versions.
+
+https://github.com/NVIDIA/open-gpu-kernel-modules/issues/506
+--- a/kernel/Kbuild
++++ b/kernel/Kbuild
+@@ -73 +73 @@
+-EXTRA_CFLAGS += -Wall -MD $(DEFINES) $(INCLUDES) -Wno-cast-qual -Wno-error -Wno-format-extra-args
++EXTRA_CFLAGS += -Wall $(DEFINES) $(INCLUDES) -Wno-cast-qual -Wno-error -Wno-format-extra-args
+--- a/kernel-module-source/kernel-open/Kbuild
++++ b/kernel-module-source/kernel-open/Kbuild
+@@ -73 +73 @@
+-EXTRA_CFLAGS += -Wall -MD $(DEFINES) $(INCLUDES) -Wno-cast-qual -Wno-error -Wno-format-extra-args
++EXTRA_CFLAGS += -Wall $(DEFINES) $(INCLUDES) -Wno-cast-qual -Wno-error -Wno-format-extra-args

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-525.116.04-r2.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-525.116.04-r2.ebuild
index 2abd1c113768..d2462ba8997f 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-525.116.04-r2.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-525.116.04-r2.ebuild
@@ -81,6 +81,7 @@ BDEPEND="
 QA_PREBUILT="lib/firmware/* opt/bin/* usr/lib*"
 
 PATCHES=(
+	"${FILESDIR}"/nvidia-drivers-525.116.04-clang-unused-option.patch
 	"${FILESDIR}"/nvidia-kernel-module-source-515.86.01-raw-ldflags.patch
 	"${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch
 	"${FILESDIR}"/nvidia-settings-390.144-desktop.patch

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-525.47.27.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-525.47.27.ebuild
index 6b8d1b4212dc..eff4973c2be8 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-525.47.27.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-525.47.27.ebuild
@@ -82,6 +82,7 @@ BDEPEND="
 QA_PREBUILT="lib/firmware/* opt/bin/* usr/lib*"
 
 PATCHES=(
+	"${FILESDIR}"/nvidia-drivers-525.116.04-clang-unused-option.patch
 	"${FILESDIR}"/nvidia-kernel-module-source-515.86.01-raw-ldflags.patch
 	"${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch
 	"${FILESDIR}"/nvidia-settings-390.144-desktop.patch


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: x11-drivers/nvidia-drivers/, x11-drivers/nvidia-drivers/files/
@ 2024-01-15 23:03 Ionen Wolkens
  0 siblings, 0 replies; 33+ messages in thread
From: Ionen Wolkens @ 2024-01-15 23:03 UTC (permalink / raw
  To: gentoo-commits

commit:     9b89609eb1e84c5f5077039c7ff1d7865a81f85f
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 15 22:28:24 2024 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Mon Jan 15 23:00:44 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9b89609e

x11-drivers/nvidia-drivers: fix build with upcoming gcc14

Trivial and proper fix for 5xx branches, NVIDIA seems to be
(now) keeping track of implicits and incompatibles beside
missing this one hidden behind 2>/dev/null and kernel >=5.18.

Can't say the same for the legacy branches (390 and 470), and
rather than worry about these going for the lame life support
treatment with -Wno-error= there. 470 has hope to be fixed
properly by NVIDIA still but this is likely there forever in
the not supported + masked 390.

No need for revbumps, with gcc13 the test simply functions
properly and does what's right, while with 14 it's just a
build-time issue (and legacy branches are unchanged).

Closes: https://bugs.gentoo.org/921370
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 .../files/nvidia-drivers-525.147.05-gcc14.patch    | 32 ++++++++++++++++++++++
 .../nvidia-drivers/nvidia-drivers-390.157.ebuild   | 11 ++++++++
 .../nvidia-drivers-470.223.02.ebuild               | 13 +++++++++
 .../nvidia-drivers-525.147.05.ebuild               |  1 +
 .../nvidia-drivers-535.146.02.ebuild               |  1 +
 .../nvidia-drivers/nvidia-drivers-535.43.22.ebuild |  1 +
 .../nvidia-drivers-545.29.06-r1.ebuild             |  1 +
 7 files changed, 60 insertions(+)

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-525.147.05-gcc14.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-525.147.05-gcc14.patch
new file mode 100644
index 000000000000..799f80b79f7e
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-525.147.05-gcc14.patch
@@ -0,0 +1,32 @@
+https://bugs.gentoo.org/921370
+https://forums.developer.nvidia.com/t/279072
+--- a/kernel/conftest.sh
++++ b/kernel/conftest.sh
+@@ -4807,6 +4807,11 @@
+             CODE="
+             #include <drm/drm_gem.h>
++            #if defined(NV_LINUX_IOSYS_MAP_H_PRESENT)
++            typedef struct iosys_map nv_sysio_map_t;
++            #else
++            typedef struct dma_buf_map nv_sysio_map_t;
++            #endif
+             int conftest_drm_gem_object_vmap_has_map_arg(
+-                    struct drm_gem_object *obj, struct dma_buf_map *map) {
++                    struct drm_gem_object *obj, nv_sysio_map_t *map) {
+                 return obj->funcs->vmap(obj, map);
+             }"
+--- a/kernel-module-source/kernel-open/conftest.sh
++++ b/kernel-module-source/kernel-open/conftest.sh
+@@ -4807,6 +4807,11 @@
+             CODE="
+             #include <drm/drm_gem.h>
++            #if defined(NV_LINUX_IOSYS_MAP_H_PRESENT)
++            typedef struct iosys_map nv_sysio_map_t;
++            #else
++            typedef struct dma_buf_map nv_sysio_map_t;
++            #endif
+             int conftest_drm_gem_object_vmap_has_map_arg(
+-                    struct drm_gem_object *obj, struct dma_buf_map *map) {
++                    struct drm_gem_object *obj, nv_sysio_map_t *map) {
+                 return obj->funcs->vmap(obj, map);
+             }"

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-390.157.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-390.157.ebuild
index e722d7730c3d..364d03fab92d 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-390.157.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-390.157.ebuild
@@ -151,6 +151,16 @@ src_compile() {
 	tc-export AR CC CXX LD OBJCOPY OBJDUMP
 	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[@]}")"
+	use modules && KERNEL_CC+=" $(CC=${KERNEL_CC} test-flags-CC "${noerr[@]}")"
+
 	NV_ARGS=(
 		PREFIX="${EPREFIX}"/usr
 		HOST_CC="$(tc-getBUILD_CC)"
@@ -162,6 +172,7 @@ src_compile() {
 	local modlist=( nvidia{,-drm,-modeset}=video:kernel )
 	use x86 || modlist+=( nvidia-uvm=video:kernel )
 	local modargs=(
+		CC="${KERNEL_CC}" # for the above gcc14 workarounds
 		IGNORE_CC_MISMATCH=yes NV_VERBOSE=1
 		SYSOUT="${KV_OUT_DIR}" SYSSRC="${KV_DIR}"
 	)

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-470.223.02.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-470.223.02.ebuild
index d9f0ac99c1b1..a81c071f8b6d 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-470.223.02.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-470.223.02.ebuild
@@ -148,6 +148,18 @@ src_compile() {
 	tc-export AR CC CXX LD OBJCOPY OBJDUMP
 	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[@]}")"
+	use modules && KERNEL_CC+=" $(CC=${KERNEL_CC} test-flags-CC "${noerr[@]}")"
+
 	local xnvflags=-fPIC #840389
 	# lto static libraries tend to cause problems without fat objects
 	is-flagq '-flto@(|=*)' && xnvflags+=" $(test-flags-CC -ffat-lto-objects)"
@@ -163,6 +175,7 @@ src_compile() {
 
 	local modlist=( nvidia{,-drm,-modeset,-peermem,-uvm}=video:kernel )
 	local modargs=(
+		CC="${KERNEL_CC}" # for the above gcc14 workarounds
 		IGNORE_CC_MISMATCH=yes NV_VERBOSE=1
 		SYSOUT="${KV_OUT_DIR}" SYSSRC="${KV_DIR}"
 	)

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-525.147.05.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-525.147.05.ebuild
index bf6ccdee2c2e..8198376cd815 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-525.147.05.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-525.147.05.ebuild
@@ -88,6 +88,7 @@ QA_PREBUILT="lib/firmware/* opt/bin/* usr/lib*"
 
 PATCHES=(
 	"${FILESDIR}"/nvidia-drivers-525.116.04-clang-unused-option.patch
+	"${FILESDIR}"/nvidia-drivers-525.147.05-gcc14.patch
 	"${FILESDIR}"/nvidia-kernel-module-source-515.86.01-raw-ldflags.patch
 	"${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch
 	"${FILESDIR}"/nvidia-settings-390.144-desktop.patch

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-535.146.02.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-535.146.02.ebuild
index 3f1e1c192353..9097157c2346 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-535.146.02.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-535.146.02.ebuild
@@ -88,6 +88,7 @@ BDEPEND="
 QA_PREBUILT="lib/firmware/* opt/bin/* usr/lib*"
 
 PATCHES=(
+	"${FILESDIR}"/nvidia-drivers-525.147.05-gcc14.patch
 	"${FILESDIR}"/nvidia-kernel-module-source-515.86.01-raw-ldflags.patch
 	"${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch
 	"${FILESDIR}"/nvidia-settings-390.144-raw-ldflags.patch

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-535.43.22.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-535.43.22.ebuild
index 8c94a78cb103..1c4a52826bb9 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-535.43.22.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-535.43.22.ebuild
@@ -91,6 +91,7 @@ BDEPEND="
 QA_PREBUILT="lib/firmware/* opt/bin/* usr/lib*"
 
 PATCHES=(
+	"${FILESDIR}"/nvidia-drivers-525.147.05-gcc14.patch
 	"${FILESDIR}"/nvidia-kernel-module-source-515.86.01-raw-ldflags.patch
 	"${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch
 	"${FILESDIR}"/nvidia-settings-390.144-raw-ldflags.patch

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-545.29.06-r1.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-545.29.06-r1.ebuild
index 635d62b67243..8150845d19c5 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-545.29.06-r1.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-545.29.06-r1.ebuild
@@ -87,6 +87,7 @@ BDEPEND="
 QA_PREBUILT="lib/firmware/* opt/bin/* usr/lib*"
 
 PATCHES=(
+	"${FILESDIR}"/nvidia-drivers-525.147.05-gcc14.patch
 	"${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch
 	"${FILESDIR}"/nvidia-settings-530.30.02-desktop.patch
 )


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: x11-drivers/nvidia-drivers/, x11-drivers/nvidia-drivers/files/
@ 2024-02-01 21:06 Ionen Wolkens
  0 siblings, 0 replies; 33+ messages in thread
From: Ionen Wolkens @ 2024-02-01 21:06 UTC (permalink / raw
  To: gentoo-commits

commit:     c64caf5352e8b82edbaa2204aaf055cbcabfc8d1
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Thu Feb  1 19:58:45 2024 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Thu Feb  1 21:05:17 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c64caf53

x11-drivers/nvidia-drivers: fix build w/ kernel 6.1.76+6.6.15+6.7.3

NVIDIA already confirmed to be planning a release without pfn_valid,
so this is temporary until then. May need revisiting for older kernels
if change is further backported.

bug #923456 could be closed but leaving open for visibility for now.

Bug: https://bugs.gentoo.org/923456
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 .../nvidia-drivers-470.223.02-gpl-pfn_valid.patch  | 62 ++++++++++++++++++++++
 .../nvidia-drivers-470.223.02.ebuild               |  1 +
 .../nvidia-drivers-525.147.05.ebuild               |  1 +
 .../nvidia-drivers-535.146.02.ebuild               |  1 +
 .../nvidia-drivers-535.154.05.ebuild               |  1 +
 .../nvidia-drivers/nvidia-drivers-535.43.23.ebuild |  1 +
 .../nvidia-drivers-545.29.06-r1.ebuild             |  1 +
 .../nvidia-drivers/nvidia-drivers-550.40.07.ebuild |  1 +
 8 files changed, 69 insertions(+)

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-470.223.02-gpl-pfn_valid.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-470.223.02-gpl-pfn_valid.patch
new file mode 100644
index 000000000000..e0da3fcc2f87
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-470.223.02-gpl-pfn_valid.patch
@@ -0,0 +1,62 @@
+linux-6.1.76, 6.6.15, and 6.7.3 have modified the non-ARCH-specific
+pfn_valid() to use __rcu_read_lock/unlock[1] that is marked GPL and
+cannot be used here[2][3][4] unless use the open source variant.
+
+As a workaround, reuse the old implementation until NVIDIA makes
+a fixed release (due to no longer be using pfn_valid[5], likely
+with its own implementation similarly to this patch).
+
+Safe to use with kernel >=5.15 or so but older ones had a different
+pfn_valid implementation. However 5.15 and older branches are
+"currently" not affected, so simply limit to >=6.1.76.
+
+[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/include/linux/mmzone.h?h=v6.7.3&id=3a01daace71b521563c38bbbf874e14c3e58adb7
+[2] https://bugs.gentoo.org/923456
+[3] https://forums.developer.nvidia.com/t/280908
+[4] https://github.com/NVIDIA/open-gpu-kernel-modules/issues/594
+[5] https://github.com/NVIDIA/open-gpu-kernel-modules/issues/594#issuecomment-1916197641
+--- a/kernel/common/inc/nv-linux.h
++++ b/kernel/common/inc/nv-linux.h
+@@ -1990,2 +1990,23 @@
+ 
++#if defined(CONFIG_HAVE_ARCH_PFN_VALID) || LINUX_VERSION_CODE < KERNEL_VERSION(6,1,76)
++#  define nv_pfn_valid pfn_valid
++#else
++/* pre-6.1.76 kernel pfn_valid version without GPL rcu_read_lock/unlock() */
++static inline int nv_pfn_valid(unsigned long pfn)
++{
++        struct mem_section *ms;
++
++        if (PHYS_PFN(PFN_PHYS(pfn)) != pfn)
++                return 0;
++
++        if (pfn_to_section_nr(pfn) >= NR_MEM_SECTIONS)
++                return 0;
++
++        ms = __pfn_to_section(pfn);
++        if (!valid_section(ms))
++                return 0;
++
++        return early_section(ms) || pfn_section_valid(ms, pfn);
++}
++#endif
+ #endif  /* _NV_LINUX_H_ */
+--- a/kernel/nvidia/nv-mmap.c
++++ b/kernel/nvidia/nv-mmap.c
+@@ -576,3 +576,3 @@
+             if (!IS_REG_OFFSET(nv, access_start, access_len) &&
+-                (pfn_valid(PFN_DOWN(mmap_start))))
++                (nv_pfn_valid(PFN_DOWN(mmap_start))))
+             {
+--- a/kernel/nvidia/os-mlock.c
++++ b/kernel/nvidia/os-mlock.c
+@@ -102,3 +102,3 @@
+         if ((nv_follow_pfn(vma, (start + (i * PAGE_SIZE)), &pfn) < 0) ||
+-            (!pfn_valid(pfn)))
++            (!nv_pfn_valid(pfn)))
+         {
+@@ -176,3 +176,3 @@
+ 
+-    if (pfn_valid(pfn))
++    if (nv_pfn_valid(pfn))
+     {

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-470.223.02.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-470.223.02.ebuild
index 36142dbc5a6d..1dc53d0b7a19 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-470.223.02.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-470.223.02.ebuild
@@ -83,6 +83,7 @@ QA_PREBUILT="lib/firmware/* opt/bin/* usr/lib*"
 
 PATCHES=(
 	"${FILESDIR}"/nvidia-drivers-470.141.03-clang15.patch
+	"${FILESDIR}"/nvidia-drivers-470.223.02-gpl-pfn_valid.patch
 	"${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch
 	"${FILESDIR}"/nvidia-settings-390.144-desktop.patch
 	"${FILESDIR}"/nvidia-settings-390.144-no-gtk2.patch

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-525.147.05.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-525.147.05.ebuild
index 88e1b916d113..3b43c86bcab8 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-525.147.05.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-525.147.05.ebuild
@@ -87,6 +87,7 @@ BDEPEND="
 QA_PREBUILT="lib/firmware/* opt/bin/* usr/lib*"
 
 PATCHES=(
+	"${FILESDIR}"/nvidia-drivers-470.223.02-gpl-pfn_valid.patch
 	"${FILESDIR}"/nvidia-drivers-525.116.04-clang-unused-option.patch
 	"${FILESDIR}"/nvidia-drivers-525.147.05-gcc14.patch
 	"${FILESDIR}"/nvidia-kernel-module-source-515.86.01-raw-ldflags.patch

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-535.146.02.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-535.146.02.ebuild
index 4c38e242a855..38ad82d3c314 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-535.146.02.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-535.146.02.ebuild
@@ -88,6 +88,7 @@ BDEPEND="
 QA_PREBUILT="lib/firmware/* opt/bin/* usr/lib*"
 
 PATCHES=(
+	"${FILESDIR}"/nvidia-drivers-470.223.02-gpl-pfn_valid.patch
 	"${FILESDIR}"/nvidia-drivers-525.147.05-gcc14.patch
 	"${FILESDIR}"/nvidia-kernel-module-source-515.86.01-raw-ldflags.patch
 	"${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-535.154.05.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-535.154.05.ebuild
index 4c38e242a855..38ad82d3c314 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-535.154.05.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-535.154.05.ebuild
@@ -88,6 +88,7 @@ BDEPEND="
 QA_PREBUILT="lib/firmware/* opt/bin/* usr/lib*"
 
 PATCHES=(
+	"${FILESDIR}"/nvidia-drivers-470.223.02-gpl-pfn_valid.patch
 	"${FILESDIR}"/nvidia-drivers-525.147.05-gcc14.patch
 	"${FILESDIR}"/nvidia-kernel-module-source-515.86.01-raw-ldflags.patch
 	"${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-535.43.23.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-535.43.23.ebuild
index 5e197cccc108..8dbcdaa46159 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-535.43.23.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-535.43.23.ebuild
@@ -91,6 +91,7 @@ BDEPEND="
 QA_PREBUILT="lib/firmware/* opt/bin/* usr/lib*"
 
 PATCHES=(
+	"${FILESDIR}"/nvidia-drivers-470.223.02-gpl-pfn_valid.patch
 	"${FILESDIR}"/nvidia-drivers-525.147.05-gcc14.patch
 	"${FILESDIR}"/nvidia-kernel-module-source-515.86.01-raw-ldflags.patch
 	"${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-545.29.06-r1.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-545.29.06-r1.ebuild
index e22d74f46e2c..59fb67e327b0 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-545.29.06-r1.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-545.29.06-r1.ebuild
@@ -87,6 +87,7 @@ BDEPEND="
 QA_PREBUILT="lib/firmware/* opt/bin/* usr/lib*"
 
 PATCHES=(
+	"${FILESDIR}"/nvidia-drivers-470.223.02-gpl-pfn_valid.patch
 	"${FILESDIR}"/nvidia-drivers-525.147.05-gcc14.patch
 	"${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch
 	"${FILESDIR}"/nvidia-settings-530.30.02-desktop.patch

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-550.40.07.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-550.40.07.ebuild
index 3c3500782cb2..e52744d51ff0 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-550.40.07.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-550.40.07.ebuild
@@ -88,6 +88,7 @@ BDEPEND="
 QA_PREBUILT="lib/firmware/* opt/bin/* usr/lib*"
 
 PATCHES=(
+	"${FILESDIR}"/nvidia-drivers-470.223.02-gpl-pfn_valid.patch
 	"${FILESDIR}"/nvidia-drivers-525.147.05-gcc14.patch
 	"${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch
 	"${FILESDIR}"/nvidia-settings-530.30.02-desktop.patch


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: x11-drivers/nvidia-drivers/, x11-drivers/nvidia-drivers/files/
@ 2024-02-26 13:23 Ionen Wolkens
  0 siblings, 0 replies; 33+ messages in thread
From: Ionen Wolkens @ 2024-02-26 13:23 UTC (permalink / raw
  To: gentoo-commits

commit:     bedad30951c3fa7e63da7454ad66f86a7b34845d
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 26 12:39:57 2024 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Mon Feb 26 13:23:26 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bedad309

x11-drivers/nvidia-drivers: add 470.239.06

Also drop USE=wayland, last time I tried to use this with 470 not only
was it very limited due to the lack of GBM support, but it was starting
to break in horrible ways (e.g. flickering).

This been incompatible with newer egl-wayland, and 1.1.7 is filed with
problems. Users often find it annoying that portage warns that it
skipped the egl-wayland update too (USE=wayland is default on desktop
profiles even if they don't use it, so it was still annoying).

470 users should really just stick to Xorg (sorry).

Note nvidia-drm.modeset=1 was enabled with USE=wayland, disabling may
possibly have unexpected effects for some users even on Xorg. Re-enable
in nvidia.conf manually if you need this.

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 x11-drivers/nvidia-drivers/Manifest                |   6 +
 x11-drivers/nvidia-drivers/files/nvidia-470.conf   |   2 +-
 .../nvidia-drivers-470.239.06.ebuild               | 438 +++++++++++++++++++++
 3 files changed, 445 insertions(+), 1 deletion(-)

diff --git a/x11-drivers/nvidia-drivers/Manifest b/x11-drivers/nvidia-drivers/Manifest
index d11a0ff72e2a..497e088adf9c 100644
--- a/x11-drivers/nvidia-drivers/Manifest
+++ b/x11-drivers/nvidia-drivers/Manifest
@@ -5,6 +5,7 @@ DIST NVIDIA-Linux-aarch64-550.40.07.run 235818826 BLAKE2B 0065b78fc98db27e9478c5
 DIST NVIDIA-Linux-x86-390.157.run 49417041 BLAKE2B 435b5e0e60468cc74b41cc5d9b5bb0105d29c11a2d408457835212a96519c9334ecf19278b36749d3ff7f498f5b0ae45a2efae2d428703dac21245c62f1efebe SHA512 dae9ac2c12f9ad90f7441e00e01a984147c577892421911d7f67f6a31e616ac1cb7d434bc9c7f58fbd9b8ae909521b5bece607a63c79588c0bb9d99c6bad5fb0
 DIST NVIDIA-Linux-x86_64-390.157.run 85835541 BLAKE2B 44b855cd11f3b2f231f9fb90492ae2e67a67ea3ea83c413e7c90956d38c9730a8bd0321281ae03c6afce633d102f5b499aed25622b9bfd31bdd2c98f0717e95b SHA512 4780503a4cff0180b1b1f37d20a6ba3438dd78b51fa7f69b98d35521835e5d61099129746929d51d63afa2d47b672b3e145e1e1897584dc3799e7f822c5b3a0a
 DIST NVIDIA-Linux-x86_64-470.223.02.run 270557540 BLAKE2B fc766d193baf5ef89994188e1589b98429d4e6ddfb925ac2126b5db3d18096a2504303aa79b23401ca8b21878fe76057c3b4e1baa06b76d069fae322634aea9a SHA512 66e470343b6f0c04703c81169cd03674be06b5315db738cab64308ec073b5bf5b87508b58ac8b6288d10e95307072d99e874e7884207a323a3dd08887bbc8750
+DIST NVIDIA-Linux-x86_64-470.239.06.run 272849102 BLAKE2B 556c8f7058b83d8c4c7ccb2f62619ac001f7c3868b80ee091e2949fb7b35e136fec83c15efcf4dd4c99d312f8c36f83c76e250d18d091e053355396b8347af11 SHA512 92bdfb11db405071cd58deed2a0853448932657e256258e0a0bda5069f00485e2b6e49b4a0eeff499a4991be4f884273f3564c164110b1ed1f5d924506f13e2d
 DIST NVIDIA-Linux-x86_64-525.147.05.run 414135234 BLAKE2B 77a12905771772804a5e5cf36df3e5032fe0160ac7c8a1b4ea002f65dac3732d9c900c1787a3e26d08b951a8de4893467cc7a80d424e017990d12669354d4191 SHA512 0c7b31715fce6a7bd77a2d9f9a3dca54a929a7790d748051576f62cdaeaeb6a9d0f3fbb13f0b20a51966bdb9470acdbc9ee529a9e84f38a9c834a1bd28d81773
 DIST NVIDIA-Linux-x86_64-535.154.05.run 341691657 BLAKE2B 63a56771eea30d467e5a8eb4ab4746e80bda7f055c02bb130cf188b6fc30bc91427c903ac43db0837cc3855cb29f44dc1832afd76d3e39ba111e83f6f60e9d2d SHA512 29c54814ed1d93abb7888c821feb14cc419ca76db70f0a57ee56777b7b48f252303562efb8ebe026b9ce6ae624064e9e185414fbe8e5818c241de9fb576ad480
 DIST NVIDIA-Linux-x86_64-535.43.28.run 341943540 BLAKE2B 845ead98e8609cdde80ceb25aab0a982e001e5fea3d05002a4d37faafd755895444f06d125620969e45ebd5e439d6834fd0f615a2755ed88de367ad9c2598664 SHA512 27e3a2e2ab117929f1bd18002d87067d2b386d131a7a10ec6099925f341c5a56ba8e8617f861cc60c02cae6065e518c0ec27f2d0845657250c258e0313e919f5
@@ -16,30 +17,35 @@ DIST NVIDIA-kernel-module-source-545.29.06.tar.xz 12679556 BLAKE2B b842951e05646
 DIST NVIDIA-kernel-module-source-550.40.07.tar.xz 13403688 BLAKE2B bfe488c0e6852ca00ecfa07214a14165b3ca27f56cedebf25d2c50f87292ed4893d2a74ded1b0a60f1aabcd8553cbbc11320cf79d3d603ed0d1fdacff0f8346d SHA512 35b34a11d9417aa22334608172415fcd45766f6c1d80d4352f37ae7dd3077899ef6e2e656310ab4eea5a6141b3dd5b30b15b2abc23dbea7bc2d2e2ce3dadfa28
 DIST nvidia-installer-390.157.tar.bz2 150323 BLAKE2B 8058ca87a6dea956d564af9f7eab9b1fc82b1f2382bd5cb2f6d97cbe2e19292533522d5f8f2eacbeb16520372715fcb72f8f9b0998962af5d4e75522c8d74524 SHA512 93a7ece648602157496c8e27a88864ede341a100f5328a4c1a25faf8f0b94d252060e5e2f71d0c302fd0566c10773c30b76b3b5f431d8039b71c90a7969f7d7e
 DIST nvidia-installer-470.223.02.tar.bz2 146233 BLAKE2B 8a9b1396289a0a9ca381084e9e4e0256d8b05e12f75b60ad324bd3e9f1797126a7149631ab081d1abaa74727524d372b6cc4fc99fa4646a366bd34e889116534 SHA512 ba7121ece68b5596238ae9b15b51fad8f753144859e314ea3b25eece7b583b86cf1d4e0c777152a4ba74eefadb6c3005152096b0049f7ba273ca06e6581ffccb
+DIST nvidia-installer-470.239.06.tar.bz2 146286 BLAKE2B c288c0455e6426d0e18ab7b9f5c0437af50420bdf86cebd798dd3aca463341e831808ecb297d9c3233d50a4e9dac435f8114d6eb2ed2fcb6c39be7824c3dc95c SHA512 e60f6d295649557c3c316174fb37ca0ae6e57604bc3880a3b5929b33ff6d7cc8ef74a118f9075795b81d36b6a4107a02fbad0acbca18b78d05e5d9e7998c82a8
 DIST nvidia-installer-525.147.05.tar.bz2 147986 BLAKE2B 982e1a95bc255b960913cba1e78675845db472534af6cae054c74ebf82b1e4407211166249b164299f0f81ec643b7c1190e5960ac3c7844322ca42c23dc0a90a SHA512 171f9c235b2bf41dc40a875576e8cad0f4c78ba574e72db3f1ff3644701f327916121ae493cea1aed93f4826d96ef1833e98502d2d4272f4f536bab03f20e5cb
 DIST nvidia-installer-535.154.05.tar.bz2 148509 BLAKE2B e86663adb2b11355997675bf636e48818441c1bce294287c01ce87fde70441918eb4888939d8bd5f0ce743c00d8a5bf3cf6448395a8dfcbe3abfc86898c32636 SHA512 af7e57b2d3f2763c1fa0e8cc264b090b0a350b4d69e80eecf03c636a5df73cebf826dbe3b01200f113fb86811b1ba8bd468130262e28e5cb0fe43829017148dc
 DIST nvidia-installer-545.29.06.tar.bz2 155580 BLAKE2B a738741659225b5c5395fd7c588c1db8ae0fcc405bdfe8691297aa3414707daf5d9a7457fdec4556bea1f9df8f40765948da2c4a39f1d1a799b77170f75df00a SHA512 a5ee3f927a1ed21dc74fba7b37330db6ec132ece623bd2a0c8b0dcf7926ba981f5f119cc37b4fd1938e5ff5da85261bea2f59b2e54937d7e954a80fa01718715
 DIST nvidia-installer-550.40.07.tar.bz2 155535 BLAKE2B 680fa517e97b007f553976128a3c8a2e77db68f66fafab9434681d75e73daa5fa177fd83b25c3f1388b0d99a0702971ce52fc44e546c7362bd4fe378b1b956d1 SHA512 bbd5c58eff01f7cada865b5b32e53d6480499994ddc886b3d97eb59a1b78c1a683922999523ad11fcc50e5c7ac872dc01be2e11c99ef61f70f4cee36eb5f5f7b
 DIST nvidia-modprobe-390.157.tar.bz2 35306 BLAKE2B 80d202b39c2f95ec0f909712c2e101483af50124092c32efb33bd98ff58ddfb97b737ff07f1ddc941f688c1b4c26a15f392566d522e18506771f10422fcd571c SHA512 109bbe24a3758b568ea65fe1e9d78f69fae6108ec0497b796c885a3912825fe04ffd7389a3e22987f1a10a2926bf6eaa384faabc59478aa3ee244dd3ac91c6d3
 DIST nvidia-modprobe-470.223.02.tar.bz2 38796 BLAKE2B f3d7dfaa21a2d65e0ef18144c00342b85dfc7d1a0bc8ae6d242139da5ec6a99ab65cb28ee559db3e6df6c9d5c1cb31185608a8b8f95c716ae28279972f0892df SHA512 e111c75c91f0369da77eb1793be93e785b9f658c537f5af9e1631370d66a6328d464aab13c788d02bf5f9ff7977e76c97aea9432b70f55e7024f8d0461031743
+DIST nvidia-modprobe-470.239.06.tar.bz2 38783 BLAKE2B d572bfb18b0ff99606a5ca909c0f4e45709d69dbcbba43ce37e570d4dfa2dae11fab352129879418af2af26d8ad20eb976e9c2e4d181895bdbec00beb61a9fc6 SHA512 9293b33b4c14e5f873846fba3526059b6605d70a4d7e35c7032c3ed89cc7a6a71e04b344695093d97ed3280ec2094988105144e8c66dc037ed5eb8292022eec0
 DIST nvidia-modprobe-525.147.05.tar.bz2 40439 BLAKE2B 3029d39cce928b3f6a6baeb57391ddd412a35e36d880b3036dedf083b6df979ec531360421bdd347aa223821006ae3610b115277804c22614a221258944ea37f SHA512 25939b278bd2354ff787f1d10771d19baa6c691c5243bc647a556e40c4f38c16f6a248b2ce0b4a328d80b768147a188cb2d8b54e39fbfa4cf436d1f3b1b6440f
 DIST nvidia-modprobe-535.154.05.tar.bz2 40711 BLAKE2B c31de0caffac865f2d1c9535af7a60660eb742c3b8eedf9b0e9a0c8623c90378da635066dbfcc66df5fdd85da124bd13ce90cef727e898fe059a6d615d9c0ae4 SHA512 0d18e6de5cac243bf4ac26e25a5502bbadadd8ea8db8d639071eb7ad9a68ff76ff3b2ab233bff26a3e2d4f61ad8824baef0d6d9e4baa8b989442779e64f44f48
 DIST nvidia-modprobe-545.29.06.tar.bz2 41148 BLAKE2B fc9099e61d38f7bb18eb66ef5097bd27ee134ccd8752d8d19c3be274b5671be54fc446bf6df01d63683ced9c8183f5fd24f09e5d04501a5f4775ad2d24747679 SHA512 ad0eae9fed0e8ec75bdae29dff01c4d90b595650991cc7cffbf1069c4ed257665d50f38374ba3f365d18f69c902fbcf69ee526053d3ac37a1156f5531a64ff66
 DIST nvidia-modprobe-550.40.07.tar.bz2 41282 BLAKE2B 74d81380f07ab9540a8e208d7b8505e7f7757649a51434ceeb30c5e832a9ab3975c5d46d3a4fd678e7d125465918eb7a280871d9908cc7f04cf3127eda43b5b7 SHA512 d984220a2e65da4f5e27c743960a91e56ee9135aad0924b3265a107c4e67cfb3a2c723fb24676db86aace129c30aef21747ffe2499db168428131d46652f06ac
 DIST nvidia-persistenced-390.157.tar.bz2 48654 BLAKE2B 2cf6c92da90acff55e8c180a06b0c6a29d48be9fd8ca3c541202fd14f0697220fba6b66452942aa7ae7cc8821f5c5eb9fa8f7a31d2248624e5f9141d83a176b8 SHA512 70f0707ed6f2b877e69ef90cf782f66cbc9d2071db53ca09ceb7b89427b0fe176708517340621fa251539b7d481b238adeeb60261674eed74de1f62db6dbb72e
 DIST nvidia-persistenced-470.223.02.tar.bz2 46659 BLAKE2B d024e3d4d0062789eb3fb49325434737741b347e262571725d24d0e7e9d6a92316cd6e94d1d34b2b3ced8ace3ce7b5c88d3387dae162af29fb745ff94ed69b7c SHA512 c8b8d04390579d885076c401cbe27e1e103bc82fa4fd0f4182590721df9999078b6358f762f6c00a98c1aeda64aea4790a11556f26d4a68a55bdc889eb580a03
+DIST nvidia-persistenced-470.239.06.tar.bz2 46554 BLAKE2B 41d8ba35f68dd4609cd215249913790b150c22410c3c6b3675d7003136b660f427e14d48abb9495851d18028042ecbd1cf0557bad877fe5b0e5e6cf15d90b77c SHA512 69ff1cf92e90e5ef87d44764abf165cf3540d321264962dc09e093bb9c1e767f468e9d1e989f43a14d1ba47fc24f1e34252bf478743a80f51373d4bd20baf6fa
 DIST nvidia-persistenced-525.147.05.tar.bz2 48089 BLAKE2B a9cbf291fae9d7af50a9633fa5e197939674825e72150883b4e89e72165a512c164b4d79522f5b6c329e980e1145d958ba592202e5b73edfd32b149457714982 SHA512 e9685d330d32a5e9864b45a7e099e78ef873188972700747c158c3ab1fc95ea036726c793207fba33d4a50f17b92802366ce1ad38dd110b86ee923f48e622cfe
 DIST nvidia-persistenced-535.154.05.tar.bz2 48573 BLAKE2B 873a322fca3483b120892b26b50f9a758d8d3d67d2d4a76509bf7d6f5e346ab21cebf50f989fe30fac23c4f99a70a942c9b0cf256bd43b752115ad8d4f6d9834 SHA512 9c91f5ff1a94422761b8d14d33fe8b764597542af9a7b9ce9b39b4f94b8909d745bd1abae74eecb1a7a66fd4eed0312e71a64325b9f9037a0b5631251260abbd
 DIST nvidia-persistenced-545.29.06.tar.bz2 49046 BLAKE2B a31eb1de6c019f33cb3084627a7f79e216abbcfffbf89f8b043ee86aa9210fee441d9145b941f543bd8b9e369f5ab5a833817f7159a6013b06a7aedec78d2270 SHA512 816ee602aaae2f02ae7d8d0412fed951560e4fc29a7f4cdac3aeddf6bc0e3b10d14dc473f9ffeb7fff9ebacc889008bf502b71a12fd1df1e29cdcae2ca930c78
 DIST nvidia-persistenced-550.40.07.tar.bz2 49661 BLAKE2B 2fee744cb3b2cf16dbca12df8904acc93e86f32c738925b74c61dc2d51f1b6016452a2a2238bf22294d7cb6a2677ebd17a9d5a25220ae08ec78f97941dda408e SHA512 8bf07b5680403f555beb9c1e1eb9163e30fdbabfe3b73d71832624daa9891523acd2db759220250344e19a1fe1385814942802d4004eaa216fcf644f85488fa2
 DIST nvidia-settings-390.157.tar.bz2 1108938 BLAKE2B d9ec1ab5d7f157d74627272adf752a671dd17e2ede02069437b6180b927fe315b15cc6416d584ab2f038b76fe01e5b64514a834f24d88ac16676e55205fdecdd SHA512 b16699009bf56a1ff3b623a528c58061c4f5a2c5c4a373756a07bcd667743a1df7c733a572d2d0baa835a904ac2fda8a5c85890dcc00c3a0f223e0467aea902d
 DIST nvidia-settings-470.223.02.tar.bz2 1062462 BLAKE2B 1d1403d3c2a0a242bdb61403a533b7e7ae2876ff5440fcc837706e428371dc07008e1ea4616cff00dafa426782efadd7013acddd2e3bad92a3e5aa44f8e416c4 SHA512 3fb21133cb4bc48d564d04f0bfedeb4527d7c031f3ff8a185eb87ed9ed008fa77863f65fc3f8aa6bfd6674a8ccc707b90761b271809ffd1ba543bb71dcc01954
+DIST nvidia-settings-470.239.06.tar.bz2 1062310 BLAKE2B 1154421feafe40a0ce0e980374a60f325801f52a03af9f96ea9411c61de6c7bf8049dd2750204ae53a570ebe600c7972cdefcee84886fb2a6c170affd00d51bc SHA512 a1f70491bb8bb06a802c3db36858c8956fb93db463b46c13bd8dc4fa81ff4aea01bb53ebbc9b4d18da241c4442e8d17cb4204fdcbb5a8ad3e23275b7205bf3c1
 DIST nvidia-settings-525.147.05.tar.bz2 1088088 BLAKE2B cea74a20ed8208f99cb586bd40fe2cafeec55ca2db19b2c0691d3bcabadc09941ff8288e940582e63f10d8f6cd7e8813e1c5776bf65cdc7b6ee291a8b3a7e28f SHA512 9c29a477b32db3f4324d7c6d28b8da9f3de5286e39f8c67bae88a93c3d3ee0c3f0a0f3e0c29c1fa8ba01b7311623569df27e349d6148ed70b3fd42ebd36f0dcd
 DIST nvidia-settings-535.154.05.tar.bz2 1094300 BLAKE2B 1fbba9f1ffb44dacf9659c773d8cb4f6cda9d50529e3c50a2a08f62b5e89a5a678dbcfd2ab6dec55b51ef471ba6071b21b5798949bae8a71e1746f8023082b46 SHA512 8d9c27225b688d89bbf7fab6ed10ad59f035e9a5a102d12c00e34312f4991041d34475ff11a931565381112ac02361bb70aff9ad6b7642d08550ffaafb7996b4
 DIST nvidia-settings-545.29.06.tar.bz2 1095301 BLAKE2B f0022219d3e8b4ab3d5b2f75d5ab792883d82526d3a7cc5773bfc8468c14345b056a8b1db6ab47f3c3be1ba75c198b548cf9e382e7a8e3150d6045ff72af9618 SHA512 6af294920315bb1d86c607e4339410cde7170b0374cf89e94e9f929b9639ce952f8db6da002f252b6717a74110c4385f2f35f16ec52a21ea164f85127048842c
 DIST nvidia-settings-550.40.07.tar.bz2 1099521 BLAKE2B 3acbb3654eba654e32535251d42c14c9f87627761efbcc7914e0cf19072fdbf00146e83db4c07a585c3023dec2f5d36a55a8e83cf9c7933e798a5977577380dc SHA512 5ef5f5593d91c1bfdd79ab5bfc50f6a2c3c246d991a56b81158845f37845acc9122d9659b048629c82c5e5e70c3c243c03f85c90816fc261a6dfd07a870f55d7
 DIST nvidia-xconfig-390.157.tar.bz2 107399 BLAKE2B 0cbb3b1ba508ddc3ba4a161c290b31bf7a67f67880bdbd01171a962c5fa97ca945b1ef17932403f8589309380743f1da632c728d8accb6d4e56dbd895e7486bb SHA512 50b390811c9bf091b14add41f886925b17496b41006b7d3981d2398caa65cf5db8a579c8cebed78278384bf3acc629befb07b54339c61abcc75852c0dcb8b8ca
 DIST nvidia-xconfig-470.223.02.tar.bz2 109065 BLAKE2B 824a4cfbfc2bc56005a4c7fae79268c4fa52aec935c30c2b39e3ee595826731e5472a3a25e6781ada5576e132fe91728d8c3902dd3c24755bed548f7e007a0a1 SHA512 c32974ca248854977a5a3107750c24321ddc269a5e95f3ef81e0de6854504fe08df2033240c6225a6b49d38cb2b8edebd71a07064c99f09add371cba67fbce1d
+DIST nvidia-xconfig-470.239.06.tar.bz2 108687 BLAKE2B e400a59b4626b37abd12893438774737f18500771c8fd8d63e7060e80463a8599f7248fda542096a5e9bcac700595cec151494695e68dc7667c89509eeb14646 SHA512 aec235f65c9f568c6717a37fe0f16b8100ffbba7731975bac5c17802b70f1ec1ff235e08c09a0bc9de0c63a705018ce76acc8252a39f56c300b9e2a556f3612a
 DIST nvidia-xconfig-525.147.05.tar.bz2 110987 BLAKE2B 49116c8922b5c14eaa88b6230a824447609a885f7d97df28ed4f3b9a2e146a213f31f9f184aadd38c4c9f692f0a1476d0db0704b55947ce95cbbeebcb9a683da SHA512 4b7c02de6080924eee5ee9fe770e632404b380529e5ee40a8d0f259a5c96d6915e83c26113b3c65434ce461c959347b3651abc15de7c40def16c46bb3f6faeae
 DIST nvidia-xconfig-535.154.05.tar.bz2 110612 BLAKE2B 2197351ea9b33a79db6e4e8e877d28914c8b5be90a90512721f10fdde8e51e3155123e1bbba9804cf812c9876413221b96cb06d619aae5a7becf06c3d5935c01 SHA512 c9abd2bf0ba275f2054636331f76dbedf85a72a24cb7f706d09a6d6c61fc2e4e689e8aca9a4b182197dc93f2fc0360dbbc071befb6cd7c781dbc5363e95669bf
 DIST nvidia-xconfig-545.29.06.tar.bz2 110995 BLAKE2B 6c32bc45215f3d0ae65f5430eea46d93ec85b8b10d1d85f3ea40dfd358587cbc2b5493341e4da190586d2da5278abbd9dfb9b907f159448143715a8835d736fb SHA512 cfb3b1e1c96062d2e32c6fcf22410f8f3977b56097ef97de1e01ce325a381ad77e77a0e33a5deeb2889cc7dc74aa13c1a0796800696d60e5e1dcee7a7779d52b

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-470.conf b/x11-drivers/nvidia-drivers/files/nvidia-470.conf
index 912eb1392855..74126224c6ce 100644
--- a/x11-drivers/nvidia-drivers/files/nvidia-470.conf
+++ b/x11-drivers/nvidia-drivers/files/nvidia-470.conf
@@ -5,7 +5,7 @@
 # Comment out the following line if you wish to allow nouveau.
 blacklist nouveau
 
-# Kernel Mode Setting (notably needed for EGLStream/Wayland)
+# Kernel Mode Setting (needed for wayland but is hardly usable with legacy 470)
 # Enabling may possibly cause issues with SLI and Reverse PRIME.
 #options nvidia-drm modeset=1
 

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-470.239.06.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-470.239.06.ebuild
new file mode 100644
index 000000000000..9a558b2485f1
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-470.239.06.ebuild
@@ -0,0 +1,438 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+MODULES_OPTIONAL_IUSE=+modules
+inherit desktop flag-o-matic linux-mod-r1 multilib readme.gentoo-r1
+inherit systemd toolchain-funcs unpacker user-info
+
+MODULES_KERNEL_MAX=6.7
+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,settings,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="0/${PV%%.*}"
+KEYWORDS="-* ~amd64"
+IUSE="+X abi_x86_32 abi_x86_64 persistenced +static-libs +tools"
+
+COMMON_DEPEND="
+	acct-group/video
+	persistenced? (
+		acct-user/nvpd
+		net-libs/libtirpc:=
+	)
+	tools? (
+		>=app-accessibility/at-spi2-core-2.46:2
+		dev-libs/glib:2
+		dev-libs/jansson:=
+		media-libs/harfbuzz:=
+		x11-libs/cairo
+		x11-libs/gdk-pixbuf:2
+		x11-libs/gtk+:3[X]
+		x11-libs/libX11
+		x11-libs/libXext
+		x11-libs/libXxf86vm
+		x11-libs/pango
+	)
+"
+RDEPEND="
+	${COMMON_DEPEND}
+	sys-libs/glibc
+	X? (
+		media-libs/libglvnd[X,abi_x86_32(-)?]
+		x11-libs/libX11[abi_x86_32(-)?]
+		x11-libs/libXext[abi_x86_32(-)?]
+	)
+"
+DEPEND="
+	${COMMON_DEPEND}
+	static-libs? (
+		x11-base/xorg-proto
+		x11-libs/libX11
+		x11-libs/libXext
+	)
+	tools? (
+		media-libs/libglvnd
+		sys-apps/dbus
+		x11-base/xorg-proto
+		x11-libs/libXrandr
+		x11-libs/libXv
+		x11-libs/libvdpau
+	)
+"
+BDEPEND="
+	sys-devel/m4
+	virtual/pkgconfig
+"
+
+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
+	"${FILESDIR}"/nvidia-settings-390.144-desktop.patch
+	"${FILESDIR}"/nvidia-settings-390.144-no-gtk2.patch
+	"${FILESDIR}"/nvidia-settings-390.144-raw-ldflags.patch
+)
+
+pkg_setup() {
+	use modules && [[ ${MERGE_TYPE} != binary ]] || return
+
+	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
+
+	use amd64 && kernel_is -ge 5 8 && CONFIG_CHECK+=" X86_PAT" #817764
+
+	linux-mod-r1_pkg_setup
+}
+
+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-settings && mv nvidia-settings{-${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[@]}")"
+	use modules && KERNEL_CC+=" $(CC=${KERNEL_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}"
+	)
+
+	local modlist=( nvidia{,-drm,-modeset,-peermem,-uvm}=video:kernel )
+	local modargs=(
+		CC="${KERNEL_CC}" # for the above gcc14 workarounds
+		IGNORE_CC_MISMATCH=yes NV_VERBOSE=1
+		SYSOUT="${KV_OUT_DIR}" SYSSRC="${KV_DIR}"
+	)
+
+	# temporary workaround for bug #914468
+	use modules &&
+		CPP="${KERNEL_CC} -E" tc-is-clang && addpredict "${KV_OUT_DIR}"
+
+	linux-mod-r1_src_compile
+	emake "${NV_ARGS[@]}" -C nvidia-modprobe
+	use persistenced && emake "${NV_ARGS[@]}" -C nvidia-persistenced
+	use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig
+
+	if use tools; then
+		# avoid noisy *very* noisy logs with deprecation warnings
+		CFLAGS="-Wno-deprecated-declarations ${CFLAGS}" \
+			emake "${NV_ARGS[@]}" -C nvidia-settings
+	elif use static-libs; then
+		emake "${NV_ARGS[@]}" -C nvidia-settings/src out/libXNVCtrl.a
+	fi
+}
+
+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 !modules 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
+		nvidia-settings/doc/{FRAMELOCK,NV-CONTROL-API}.txt
+	)
+	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\
+$(usev modules "
+
+Like all out-of-tree kernel modules, it is necessary to rebuild
+${PN} after upgrading or rebuilding the Linux kernel
+by for example running \`emerge @module-rebuild\`. Alternatively,
+if using a distribution kernel (sys-kernel/gentoo-kernel{,-bin}),
+this can be automated by setting USE=dist-kernel globally.
+
+Loaded kernel modules also must not mismatch with the installed
+${PN} version (excluding -r revision), meaning should
+ensure \`eselect kernel list\` points to the kernel that will be
+booted before building and preferably reboot after upgrading
+${PN} (the ebuild will emit a warning if mismatching).
+
+See '${EPREFIX}/etc/modprobe.d/nvidia.conf' for modules options.")\
+$(use amd64 && usev !abi_x86_32 "
+
+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
+
+	if use modules; then
+		linux-mod-r1_src_install
+
+		insinto /etc/modprobe.d
+		newins "${FILESDIR}"/nvidia-470.conf nvidia.conf
+
+		# used for gpu verification with binpkgs (not kept, see pkg_preinst)
+		insinto /usr/share/nvidia
+		doins supported-gpus/supported-gpus.json
+	fi
+
+	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
+
+	if use tools; then
+		emake "${NV_ARGS[@]}" -C nvidia-settings install
+
+		doicon nvidia-settings/doc/nvidia-settings.png
+		domenu nvidia-settings/doc/nvidia-settings.desktop
+
+		exeinto /etc/X11/xinit/xinitrc.d
+		newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
+	fi
+
+	if use static-libs; then
+		dolib.a nvidia-settings/src/out/libXNVCtrl.a
+
+		insinto /usr/include/NVCtrl
+		doins nvidia-settings/src/libXNVCtrl/NVCtrl{Lib,}.h
+	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"'
+}
+
+pkg_preinst() {
+	use modules || return
+
+	# 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
+
+	# try to find driver mismatches using temporary supported-gpus.json
+	for g in $(grep -l 0x10de /sys/bus/pci/devices/*/vendor 2>/dev/null); do
+		g=$(grep -io "\"devid\":\"$(<${g%vendor}device)\"[^}]*branch\":\"[0-9]*" \
+			"${ED}"/usr/share/nvidia/supported-gpus.json 2>/dev/null)
+		if [[ ${g} ]]; then
+			g=$((${g##*\"}+1))
+			if ver_test -ge ${g}; then
+				NV_LEGACY_MASK=">=${CATEGORY}/${PN}-${g}"
+				break
+			fi
+		fi
+	done
+	rm "${ED}"/usr/share/nvidia/supported-gpus.json || die
+}
+
+pkg_postinst() {
+	linux-mod-r1_pkg_postinst
+
+	readme.gentoo_print_elog
+
+	if [[ -r /proc/driver/nvidia/version &&
+		$(</proc/driver/nvidia/version) != *"  ${PV}  "* ]]; then
+		ewarn "Currently loaded NVIDIA modules do not match the newly installed"
+		ewarn "libraries and may prevent launching GPU-accelerated applications."
+		if use modules; then
+			ewarn "Easiest way to fix this is normally to reboot. If still run into issues"
+			ewarn "(e.g. API mismatch messages in the \`dmesg\` output), please verify"
+			ewarn "that the running kernel is ${KV_FULL} and that (if used) the"
+			ewarn "initramfs does not include NVIDIA modules (or at least, not old ones)."
+		fi
+	fi
+
+	if [[ $(</proc/cmdline) == *slub_debug=[!-]* ]]; then
+		ewarn "Detected that the current kernel command line is using 'slub_debug=',"
+		ewarn "this may lead to system instability/freezes with this version of"
+		ewarn "${PN}. Bug: https://bugs.gentoo.org/796329"
+	fi
+
+	if [[ -v NV_LEGACY_MASK ]]; then
+		ewarn
+		ewarn "***WARNING***"
+		ewarn
+		ewarn "You are installing a version of ${PN} 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
+			ewarn "  echo '${NV_LEGACY_MASK}' > ${EROOT}/etc/portage/package.mask/${PN}"
+		else
+			ewarn "  echo '${NV_LEGACY_MASK}' >> ${EROOT}/etc/portage/package.mask"
+		fi
+		ewarn "...then downgrade to a legacy[1] branch if possible (not all old versions"
+		ewarn "are available or fully functional, may need to consider nouveau[2])."
+		ewarn "[1] https://www.nvidia.com/object/IO_32667.html"
+		ewarn "[2] https://wiki.gentoo.org/wiki/Nouveau"
+	fi
+}


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: x11-drivers/nvidia-drivers/, x11-drivers/nvidia-drivers/files/
@ 2024-09-14 10:52 Ionen Wolkens
  0 siblings, 0 replies; 33+ messages in thread
From: Ionen Wolkens @ 2024-09-14 10:52 UTC (permalink / raw
  To: gentoo-commits

commit:     a0f953fc4720a191288b7e28c1df4ab50eb9a598
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Fri Sep  6 09:13:41 2024 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Sat Sep 14 10:49:26 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a0f953fc

x11-drivers/nvidia-drivers: use PreserveVideoMemoryAllocations=1

(Disclaimer: I do not have the right setup to test any of this, but
doing it blind given the increasing amount of affected users -- call
for testing has shown that it should work as expected albeit users
with more custom setups such as suspend without elogind/systemd will
need to pay attention to warnings given breakage *is* expected).

Was formerly disabled because it broke sleep with elogind, systemd if
the units were not enabled, and other custom methods to enable sleep.

However, =0 is limited and is seemingly broken with wayland (typically
resulting in graphical corruption after resume). GDM straight up refuse
to show a wayland session if it's not set wrt bug #873160, and several
Plasma 6 users been reporting issues and its upstream also instructs
distributions to set this.

So this adds a elogind hook, enables systemd units by default (much
like it is for the elogind hook), and at least warn for the last case
which is considered semi-unsupported.

elogind does have its own HandleNvidiaSleep option, but it is intended
for old drivers which did not ship a nvidia-sleep.sh and reports seem to
show that it may not be working properly. Ebuild warns that it should be
disabled instead, and also tries to warn if there is old custom scripts
installed by the user.

One downside of hook vs the option is that hooks are not told if using
suspend or hibernate and this sends the wrong message to the drivers
(albeit not known to be an issue at the moment).

May not fix everything wrt bug #693384, but believe this is the best
we can do downstream unless someone knows better, and so closing it.
There are plenty of issues unrelated to elogind too, ideally would
need users to compare with systemd before filing more elogind sleep
bugs unless know exactly what is causing issues in elogind.

wrt bug #873160, this only fix *one* thing that the gdm udev rules
check and so may not mean will necessarily start seeing wayland in
gdm. Rules currently need =1, systemd-only, and a non-hybrid setup
(aka just nvidia, no offloading). See also the general bug #939201.

Straight-to-stable may not be the best idea, but wanted to simplify
and not revbump the 3 .conf, duplicate them, and adjust every ebuilds
further for this (believe it *should* be ok, or at least not make
things worse for typical users). Also want to deliver the fix early
to plasma 6 users newly using wayland by default.

Closes: https://bugs.gentoo.org/693384
Closes: https://bugs.gentoo.org/873160
Closes: https://github.com/gentoo/gentoo/pull/38482
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 x11-drivers/nvidia-drivers/files/nvidia-470.conf   |  8 ++--
 x11-drivers/nvidia-drivers/files/nvidia-545.conf   |  8 ++--
 x11-drivers/nvidia-drivers/files/nvidia-555.conf   |  8 ++--
 .../nvidia-drivers/files/system-sleep.elogind      |  7 +++
 ....ebuild => nvidia-drivers-470.256.02-r1.ebuild} | 56 ++++++++++++++++++++++
 ....ebuild => nvidia-drivers-525.147.05-r1.ebuild} | 56 ++++++++++++++++++++++
 ....ebuild => nvidia-drivers-535.183.01-r1.ebuild} | 56 ++++++++++++++++++++++
 ....ebuild => nvidia-drivers-550.107.02-r1.ebuild} | 56 ++++++++++++++++++++++
 ...1.ebuild => nvidia-drivers-550.40.71-r1.ebuild} | 56 ++++++++++++++++++++++
 ...3.ebuild => nvidia-drivers-560.35.03-r1.ebuild} | 56 ++++++++++++++++++++++
 10 files changed, 358 insertions(+), 9 deletions(-)

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-470.conf b/x11-drivers/nvidia-drivers/files/nvidia-470.conf
index 2b87b67602e0..4dd0badfb271 100644
--- a/x11-drivers/nvidia-drivers/files/nvidia-470.conf
+++ b/x11-drivers/nvidia-drivers/files/nvidia-470.conf
@@ -9,10 +9,12 @@ blacklist nouveau
 # Enabling may possibly cause issues with SLI and Reverse PRIME.
 #options nvidia-drm modeset=1
 
-# Suspend options. Allocations=0 recommended over =1 unless enable nvidia's
-# systemd sleep services (nvidia-hibernate, nvidia-resume, nvidia-suspend).
+# Suspend options. Note that Allocations=1 requires suspend hooks currently
+# only used when either systemd or elogind is used to suspend. If using
+# neither or have issues, try Allocations=0 (revert if it does not help
+# as =0 is not recommended).
 options nvidia \
-	NVreg_PreserveVideoMemoryAllocations=0 \
+	NVreg_PreserveVideoMemoryAllocations=1 \
 	NVreg_TemporaryFilePath=/var/tmp
 
 # !!! Security Warning !!!

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-545.conf b/x11-drivers/nvidia-drivers/files/nvidia-545.conf
index d5be9b654091..7c399e0c9490 100644
--- a/x11-drivers/nvidia-drivers/files/nvidia-545.conf
+++ b/x11-drivers/nvidia-drivers/files/nvidia-545.conf
@@ -14,10 +14,12 @@ blacklist nouveau
 # experimental, "may" cause issues X mode switching, sleep, or more).
 #options nvidia-drm fbdev=1
 
-# Suspend options. Allocations=0 recommended over =1 unless enable nvidia's
-# systemd sleep services (nvidia-hibernate, nvidia-resume, nvidia-suspend).
+# Suspend options. Note that Allocations=1 requires suspend hooks currently
+# only used when either systemd or elogind is used to suspend. If using
+# neither or have issues, try Allocations=0 (revert if it does not help
+# as =0 is not recommended).
 options nvidia \
-	NVreg_PreserveVideoMemoryAllocations=0 \
+	NVreg_PreserveVideoMemoryAllocations=1 \
 	NVreg_TemporaryFilePath=/var/tmp
 
 # !!! Security Warning !!!

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-555.conf b/x11-drivers/nvidia-drivers/files/nvidia-555.conf
index 98bd87c43080..7f83ba752025 100644
--- a/x11-drivers/nvidia-drivers/files/nvidia-555.conf
+++ b/x11-drivers/nvidia-drivers/files/nvidia-555.conf
@@ -20,10 +20,12 @@ blacklist nouveau
 # Cannot be disabled if using USE="kernel-open".
 #options nvidia NVreg_EnableGpuFirmware=0
 
-# Suspend options. Allocations=0 recommended over =1 unless enable nvidia's
-# systemd sleep services (nvidia-hibernate, nvidia-resume, nvidia-suspend).
+# Suspend options. Note that Allocations=1 requires suspend hooks currently
+# only used when either systemd or elogind is used to suspend. If using
+# neither or have issues, try Allocations=0 (revert if it does not help
+# as =0 is not recommended).
 options nvidia \
-	NVreg_PreserveVideoMemoryAllocations=0 \
+	NVreg_PreserveVideoMemoryAllocations=1 \
 	NVreg_TemporaryFilePath=/var/tmp
 
 # !!! Security Warning !!!

diff --git a/x11-drivers/nvidia-drivers/files/system-sleep.elogind b/x11-drivers/nvidia-drivers/files/system-sleep.elogind
new file mode 100644
index 000000000000..d36e2697b86c
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/system-sleep.elogind
@@ -0,0 +1,7 @@
+#!/bin/sh
+case ${1-} in
+	pre)	nvidia-sleep.sh suspend;;
+	# run in background given resume is flaky if elogind did not finish
+	post)	nvidia-sleep.sh resume &;;
+	*)	exit 1;;
+esac

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-470.256.02.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-470.256.02-r1.ebuild
similarity index 82%
rename from x11-drivers/nvidia-drivers/nvidia-drivers-470.256.02.ebuild
rename to x11-drivers/nvidia-drivers/nvidia-drivers-470.256.02-r1.ebuild
index 72647eb64cb8..5223357f1af2 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-470.256.02.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-470.256.02-r1.ebuild
@@ -358,6 +358,22 @@ documentation that is installed alongside this README."
 
 	dobin nvidia-bug-report.sh
 
+	# enabling is needed for sleep to work properly and little reason not to do
+	# it unconditionally for a better user experience
+	: "$(systemd_get_systemunitdir)"
+	local unitdir=${_#"${EPREFIX}"}
+	# not using relative symlinks to match systemd's own links
+	dosym {"${unitdir}",/etc/systemd/system/systemd-hibernate.service.wants}/nvidia-hibernate.service
+	dosym {"${unitdir}",/etc/systemd/system/systemd-hibernate.service.wants}/nvidia-resume.service
+	dosym {"${unitdir}",/etc/systemd/system/systemd-suspend.service.wants}/nvidia-suspend.service
+	dosym {"${unitdir}",/etc/systemd/system/systemd-suspend.service.wants}/nvidia-resume.service
+	# also add a custom elogind hook to do the equivalent of the above
+	exeinto /usr/lib/elogind/system-sleep
+	newexe "${FILESDIR}"/system-sleep.elogind nvidia
+	# <elogind-255.5 used a different path (bug #939216), keep a compat symlink
+	# TODO: cleanup after 255.5 been stable for a few months
+	dosym {/usr/lib,/"${libdir}"}/elogind/system-sleep/nvidia
+
 	# 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
@@ -435,4 +451,44 @@ pkg_postinst() {
 		ewarn "[1] https://www.nvidia.com/object/IO_32667.html"
 		ewarn "[2] https://wiki.gentoo.org/wiki/Nouveau"
 	fi
+
+	# these can be removed after some time, only to help the transition
+	# given users are unlikely to do further custom solutions if it works
+	# (see also https://github.com/elogind/elogind/issues/272)
+	if grep -riq "^[^#]*HandleNvidiaSleep=yes" "${EROOT}"/etc/elogind/sleep.conf.d/ 2>/dev/null
+	then
+		ewarn
+		ewarn "!!! WARNING !!!"
+		ewarn "Detected HandleNvidiaSleep=yes in ${EROOT}/etc/elogind/sleep.conf.d/."
+		ewarn "This 'could' cause issues if used in combination with the new hook"
+		ewarn "installed by the ebuild to handle sleep using the official upstream"
+		ewarn "script. It is recommended to disable the option."
+	fi
+	if [[ $(realpath "${EROOT}"{/etc,{/usr,}/lib*}/elogind/system-sleep | sort | uniq | \
+		xargs -d'\n' grep -Ril nvidia 2>/dev/null | wc -l) -gt 2 ]]
+	then
+		ewarn
+		ewarn "!!! WARNING !!!"
+		ewarn "Detected a custom script at ${EROOT}{/etc,{/usr,}/lib*}/elogind/system-sleep"
+		ewarn "referencing NVIDIA. This version of ${PN} has installed its own"
+		ewarn "hook at ${EROOT}/usr/lib/elogind/system-sleep/nvidia and it is recommended"
+		ewarn "to remove the custom one to avoid potential issues."
+		ewarn
+		ewarn "Feel free to ignore this warning if you know the other NVIDIA-related"
+		ewarn "scripts can be used together. The warning will be removed in the future."
+	fi
+	if [[ ${REPLACING_VERSIONS##* } ]] &&
+		ver_test ${REPLACING_VERSIONS##* } -lt 470.256.02-r1 # may get repeated
+	then
+		elog
+		elog "For suspend/sleep, 'NVreg_PreserveVideoMemoryAllocations=1' is now default"
+		elog "with this version of ${PN}. This is recommended (or required) by"
+		elog "major DEs especially with wayland but, *if* experience regressions with"
+		elog "suspend, try reverting to =0 in '${EROOT}/etc/modprobe.d/nvidia.conf'."
+		elog
+		elog "May notably be an issue when using neither systemd nor elogind to suspend."
+		elog
+		elog "Also, the systemd suspend/hibernate/resume services are now enabled by"
+		elog "default, and for openrc+elogind a similar hook has been installed."
+	fi
 }

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-525.147.05.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-525.147.05-r1.ebuild
similarity index 85%
rename from x11-drivers/nvidia-drivers/nvidia-drivers-525.147.05.ebuild
rename to x11-drivers/nvidia-drivers/nvidia-drivers-525.147.05-r1.ebuild
index 69c715a9288b..de085dd0ad2b 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-525.147.05.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-525.147.05-r1.ebuild
@@ -422,6 +422,22 @@ documentation that is installed alongside this README."
 		doins nvidia-dbus.conf
 	fi
 
+	# enabling is needed for sleep to work properly and little reason not to do
+	# it unconditionally for a better user experience
+	: "$(systemd_get_systemunitdir)"
+	local unitdir=${_#"${EPREFIX}"}
+	# not using relative symlinks to match systemd's own links
+	dosym {"${unitdir}",/etc/systemd/system/systemd-hibernate.service.wants}/nvidia-hibernate.service
+	dosym {"${unitdir}",/etc/systemd/system/systemd-hibernate.service.wants}/nvidia-resume.service
+	dosym {"${unitdir}",/etc/systemd/system/systemd-suspend.service.wants}/nvidia-suspend.service
+	dosym {"${unitdir}",/etc/systemd/system/systemd-suspend.service.wants}/nvidia-resume.service
+	# also add a custom elogind hook to do the equivalent of the above
+	exeinto /usr/lib/elogind/system-sleep
+	newexe "${FILESDIR}"/system-sleep.elogind nvidia
+	# <elogind-255.5 used a different path (bug #939216), keep a compat symlink
+	# TODO: cleanup after 255.5 been stable for a few months
+	dosym {/usr/lib,/"${libdir}"}/elogind/system-sleep/nvidia
+
 	# 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
@@ -518,4 +534,44 @@ pkg_postinst() {
 		elog "If you experience issues, either disable wayland or edit nvidia.conf."
 		elog "Of note, may possibly cause issues with SLI and Reverse PRIME."
 	fi
+
+	# these can be removed after some time, only to help the transition
+	# given users are unlikely to do further custom solutions if it works
+	# (see also https://github.com/elogind/elogind/issues/272)
+	if grep -riq "^[^#]*HandleNvidiaSleep=yes" "${EROOT}"/etc/elogind/sleep.conf.d/ 2>/dev/null
+	then
+		ewarn
+		ewarn "!!! WARNING !!!"
+		ewarn "Detected HandleNvidiaSleep=yes in ${EROOT}/etc/elogind/sleep.conf.d/."
+		ewarn "This 'could' cause issues if used in combination with the new hook"
+		ewarn "installed by the ebuild to handle sleep using the official upstream"
+		ewarn "script. It is recommended to disable the option."
+	fi
+	if [[ $(realpath "${EROOT}"{/etc,{/usr,}/lib*}/elogind/system-sleep | sort | uniq | \
+		xargs -d'\n' grep -Ril nvidia 2>/dev/null | wc -l) -gt 2 ]]
+	then
+		ewarn
+		ewarn "!!! WARNING !!!"
+		ewarn "Detected a custom script at ${EROOT}{/etc,{/usr,}/lib*}/elogind/system-sleep"
+		ewarn "referencing NVIDIA. This version of ${PN} has installed its own"
+		ewarn "hook at ${EROOT}/usr/lib/elogind/system-sleep/nvidia and it is recommended"
+		ewarn "to remove the custom one to avoid potential issues."
+		ewarn
+		ewarn "Feel free to ignore this warning if you know the other NVIDIA-related"
+		ewarn "scripts can be used together. The warning will be removed in the future."
+	fi
+	if [[ ${REPLACING_VERSIONS##* } ]] &&
+		ver_test ${REPLACING_VERSIONS##* } -lt 525.147.05-r1 # may get repeated
+	then
+		elog
+		elog "For suspend/sleep, 'NVreg_PreserveVideoMemoryAllocations=1' is now default"
+		elog "with this version of ${PN}. This is recommended (or required) by"
+		elog "major DEs especially with wayland but, *if* experience regressions with"
+		elog "suspend, try reverting to =0 in '${EROOT}/etc/modprobe.d/nvidia.conf'."
+		elog
+		elog "May notably be an issue when using neither systemd nor elogind to suspend."
+		elog
+		elog "Also, the systemd suspend/hibernate/resume services are now enabled by"
+		elog "default, and for openrc+elogind a similar hook has been installed."
+	fi
 }

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-535.183.01.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-535.183.01-r1.ebuild
similarity index 85%
rename from x11-drivers/nvidia-drivers/nvidia-drivers-535.183.01.ebuild
rename to x11-drivers/nvidia-drivers/nvidia-drivers-535.183.01-r1.ebuild
index b6e7ae3c70c1..340237b6525e 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-535.183.01.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-535.183.01-r1.ebuild
@@ -422,6 +422,22 @@ documentation that is installed alongside this README."
 		doins nvidia-dbus.conf
 	fi
 
+	# enabling is needed for sleep to work properly and little reason not to do
+	# it unconditionally for a better user experience
+	: "$(systemd_get_systemunitdir)"
+	local unitdir=${_#"${EPREFIX}"}
+	# not using relative symlinks to match systemd's own links
+	dosym {"${unitdir}",/etc/systemd/system/systemd-hibernate.service.wants}/nvidia-hibernate.service
+	dosym {"${unitdir}",/etc/systemd/system/systemd-hibernate.service.wants}/nvidia-resume.service
+	dosym {"${unitdir}",/etc/systemd/system/systemd-suspend.service.wants}/nvidia-suspend.service
+	dosym {"${unitdir}",/etc/systemd/system/systemd-suspend.service.wants}/nvidia-resume.service
+	# also add a custom elogind hook to do the equivalent of the above
+	exeinto /usr/lib/elogind/system-sleep
+	newexe "${FILESDIR}"/system-sleep.elogind nvidia
+	# <elogind-255.5 used a different path (bug #939216), keep a compat symlink
+	# TODO: cleanup after 255.5 been stable for a few months
+	dosym {/usr/lib,/"${libdir}"}/elogind/system-sleep/nvidia
+
 	# 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
@@ -518,4 +534,44 @@ pkg_postinst() {
 		elog "If you experience issues, either disable wayland or edit nvidia.conf."
 		elog "Of note, may possibly cause issues with SLI and Reverse PRIME."
 	fi
+
+	# these can be removed after some time, only to help the transition
+	# given users are unlikely to do further custom solutions if it works
+	# (see also https://github.com/elogind/elogind/issues/272)
+	if grep -riq "^[^#]*HandleNvidiaSleep=yes" "${EROOT}"/etc/elogind/sleep.conf.d/ 2>/dev/null
+	then
+		ewarn
+		ewarn "!!! WARNING !!!"
+		ewarn "Detected HandleNvidiaSleep=yes in ${EROOT}/etc/elogind/sleep.conf.d/."
+		ewarn "This 'could' cause issues if used in combination with the new hook"
+		ewarn "installed by the ebuild to handle sleep using the official upstream"
+		ewarn "script. It is recommended to disable the option."
+	fi
+	if [[ $(realpath "${EROOT}"{/etc,{/usr,}/lib*}/elogind/system-sleep | sort | uniq | \
+		xargs -d'\n' grep -Ril nvidia 2>/dev/null | wc -l) -gt 2 ]]
+	then
+		ewarn
+		ewarn "!!! WARNING !!!"
+		ewarn "Detected a custom script at ${EROOT}{/etc,{/usr,}/lib*}/elogind/system-sleep"
+		ewarn "referencing NVIDIA. This version of ${PN} has installed its own"
+		ewarn "hook at ${EROOT}/usr/lib/elogind/system-sleep/nvidia and it is recommended"
+		ewarn "to remove the custom one to avoid potential issues."
+		ewarn
+		ewarn "Feel free to ignore this warning if you know the other NVIDIA-related"
+		ewarn "scripts can be used together. The warning will be removed in the future."
+	fi
+	if [[ ${REPLACING_VERSIONS##* } ]] &&
+		ver_test ${REPLACING_VERSIONS##* } -lt 535.183.01-r1 # may get repeated
+	then
+		elog
+		elog "For suspend/sleep, 'NVreg_PreserveVideoMemoryAllocations=1' is now default"
+		elog "with this version of ${PN}. This is recommended (or required) by"
+		elog "major DEs especially with wayland but, *if* experience regressions with"
+		elog "suspend, try reverting to =0 in '${EROOT}/etc/modprobe.d/nvidia.conf'."
+		elog
+		elog "May notably be an issue when using neither systemd nor elogind to suspend."
+		elog
+		elog "Also, the systemd suspend/hibernate/resume services are now enabled by"
+		elog "default, and for openrc+elogind a similar hook has been installed."
+	fi
 }

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-550.107.02.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-550.107.02-r1.ebuild
similarity index 84%
rename from x11-drivers/nvidia-drivers/nvidia-drivers-550.107.02.ebuild
rename to x11-drivers/nvidia-drivers/nvidia-drivers-550.107.02-r1.ebuild
index 42c25308f23a..430c45687498 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-550.107.02.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-550.107.02-r1.ebuild
@@ -400,6 +400,22 @@ documentation that is installed alongside this README."
 		doins nvidia-dbus.conf
 	fi
 
+	# enabling is needed for sleep to work properly and little reason not to do
+	# it unconditionally for a better user experience
+	: "$(systemd_get_systemunitdir)"
+	local unitdir=${_#"${EPREFIX}"}
+	# not using relative symlinks to match systemd's own links
+	dosym {"${unitdir}",/etc/systemd/system/systemd-hibernate.service.wants}/nvidia-hibernate.service
+	dosym {"${unitdir}",/etc/systemd/system/systemd-hibernate.service.wants}/nvidia-resume.service
+	dosym {"${unitdir}",/etc/systemd/system/systemd-suspend.service.wants}/nvidia-suspend.service
+	dosym {"${unitdir}",/etc/systemd/system/systemd-suspend.service.wants}/nvidia-resume.service
+	# also add a custom elogind hook to do the equivalent of the above
+	exeinto /usr/lib/elogind/system-sleep
+	newexe "${FILESDIR}"/system-sleep.elogind nvidia
+	# <elogind-255.5 used a different path (bug #939216), keep a compat symlink
+	# TODO: cleanup after 255.5 been stable for a few months
+	dosym {/usr/lib,/"${libdir}"}/elogind/system-sleep/nvidia
+
 	# 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
@@ -497,4 +513,44 @@ pkg_postinst() {
 		elog "If you experience issues, either disable wayland or edit nvidia.conf."
 		elog "Of note, may possibly cause issues with SLI and Reverse PRIME."
 	fi
+
+	# these can be removed after some time, only to help the transition
+	# given users are unlikely to do further custom solutions if it works
+	# (see also https://github.com/elogind/elogind/issues/272)
+	if grep -riq "^[^#]*HandleNvidiaSleep=yes" "${EROOT}"/etc/elogind/sleep.conf.d/ 2>/dev/null
+	then
+		ewarn
+		ewarn "!!! WARNING !!!"
+		ewarn "Detected HandleNvidiaSleep=yes in ${EROOT}/etc/elogind/sleep.conf.d/."
+		ewarn "This 'could' cause issues if used in combination with the new hook"
+		ewarn "installed by the ebuild to handle sleep using the official upstream"
+		ewarn "script. It is recommended to disable the option."
+	fi
+	if [[ $(realpath "${EROOT}"{/etc,{/usr,}/lib*}/elogind/system-sleep | sort | uniq | \
+		xargs -d'\n' grep -Ril nvidia 2>/dev/null | wc -l) -gt 2 ]]
+	then
+		ewarn
+		ewarn "!!! WARNING !!!"
+		ewarn "Detected a custom script at ${EROOT}{/etc,{/usr,}/lib*}/elogind/system-sleep"
+		ewarn "referencing NVIDIA. This version of ${PN} has installed its own"
+		ewarn "hook at ${EROOT}/usr/lib/elogind/system-sleep/nvidia and it is recommended"
+		ewarn "to remove the custom one to avoid potential issues."
+		ewarn
+		ewarn "Feel free to ignore this warning if you know the other NVIDIA-related"
+		ewarn "scripts can be used together. The warning will be removed in the future."
+	fi
+	if [[ ${REPLACING_VERSIONS##* } ]] &&
+		ver_test ${REPLACING_VERSIONS##* } -lt 550.107.02-r1 # may get repeated
+	then
+		elog
+		elog "For suspend/sleep, 'NVreg_PreserveVideoMemoryAllocations=1' is now default"
+		elog "with this version of ${PN}. This is recommended (or required) by"
+		elog "major DEs especially with wayland but, *if* experience regressions with"
+		elog "suspend, try reverting to =0 in '${EROOT}/etc/modprobe.d/nvidia.conf'."
+		elog
+		elog "May notably be an issue when using neither systemd nor elogind to suspend."
+		elog
+		elog "Also, the systemd suspend/hibernate/resume services are now enabled by"
+		elog "default, and for openrc+elogind a similar hook has been installed."
+	fi
 }

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-550.40.71.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-550.40.71-r1.ebuild
similarity index 84%
rename from x11-drivers/nvidia-drivers/nvidia-drivers-550.40.71.ebuild
rename to x11-drivers/nvidia-drivers/nvidia-drivers-550.40.71-r1.ebuild
index 0b678cefa151..de02b58759b9 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-550.40.71.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-550.40.71-r1.ebuild
@@ -402,6 +402,22 @@ documentation that is installed alongside this README."
 		doins nvidia-dbus.conf
 	fi
 
+	# enabling is needed for sleep to work properly and little reason not to do
+	# it unconditionally for a better user experience
+	: "$(systemd_get_systemunitdir)"
+	local unitdir=${_#"${EPREFIX}"}
+	# not using relative symlinks to match systemd's own links
+	dosym {"${unitdir}",/etc/systemd/system/systemd-hibernate.service.wants}/nvidia-hibernate.service
+	dosym {"${unitdir}",/etc/systemd/system/systemd-hibernate.service.wants}/nvidia-resume.service
+	dosym {"${unitdir}",/etc/systemd/system/systemd-suspend.service.wants}/nvidia-suspend.service
+	dosym {"${unitdir}",/etc/systemd/system/systemd-suspend.service.wants}/nvidia-resume.service
+	# also add a custom elogind hook to do the equivalent of the above
+	exeinto /usr/lib/elogind/system-sleep
+	newexe "${FILESDIR}"/system-sleep.elogind nvidia
+	# <elogind-255.5 used a different path (bug #939216), keep a compat symlink
+	# TODO: cleanup after 255.5 been stable for a few months
+	dosym {/usr/lib,/"${libdir}"}/elogind/system-sleep/nvidia
+
 	# 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
@@ -499,4 +515,44 @@ pkg_postinst() {
 		elog "If you experience issues, either disable wayland or edit nvidia.conf."
 		elog "Of note, may possibly cause issues with SLI and Reverse PRIME."
 	fi
+
+	# these can be removed after some time, only to help the transition
+	# given users are unlikely to do further custom solutions if it works
+	# (see also https://github.com/elogind/elogind/issues/272)
+	if grep -riq "^[^#]*HandleNvidiaSleep=yes" "${EROOT}"/etc/elogind/sleep.conf.d/ 2>/dev/null
+	then
+		ewarn
+		ewarn "!!! WARNING !!!"
+		ewarn "Detected HandleNvidiaSleep=yes in ${EROOT}/etc/elogind/sleep.conf.d/."
+		ewarn "This 'could' cause issues if used in combination with the new hook"
+		ewarn "installed by the ebuild to handle sleep using the official upstream"
+		ewarn "script. It is recommended to disable the option."
+	fi
+	if [[ $(realpath "${EROOT}"{/etc,{/usr,}/lib*}/elogind/system-sleep | sort | uniq | \
+		xargs -d'\n' grep -Ril nvidia 2>/dev/null | wc -l) -gt 2 ]]
+	then
+		ewarn
+		ewarn "!!! WARNING !!!"
+		ewarn "Detected a custom script at ${EROOT}{/etc,{/usr,}/lib*}/elogind/system-sleep"
+		ewarn "referencing NVIDIA. This version of ${PN} has installed its own"
+		ewarn "hook at ${EROOT}/usr/lib/elogind/system-sleep/nvidia and it is recommended"
+		ewarn "to remove the custom one to avoid potential issues."
+		ewarn
+		ewarn "Feel free to ignore this warning if you know the other NVIDIA-related"
+		ewarn "scripts can be used together. The warning will be removed in the future."
+	fi
+	if [[ ${REPLACING_VERSIONS##* } ]] &&
+		ver_test ${REPLACING_VERSIONS##* } -lt 550.40.71-r1 # may get repeated
+	then
+		elog
+		elog "For suspend/sleep, 'NVreg_PreserveVideoMemoryAllocations=1' is now default"
+		elog "with this version of ${PN}. This is recommended (or required) by"
+		elog "major DEs especially with wayland but, *if* experience regressions with"
+		elog "suspend, try reverting to =0 in '${EROOT}/etc/modprobe.d/nvidia.conf'."
+		elog
+		elog "May notably be an issue when using neither systemd nor elogind to suspend."
+		elog
+		elog "Also, the systemd suspend/hibernate/resume services are now enabled by"
+		elog "default, and for openrc+elogind a similar hook has been installed."
+	fi
 }

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-560.35.03.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-560.35.03-r1.ebuild
similarity index 85%
rename from x11-drivers/nvidia-drivers/nvidia-drivers-560.35.03.ebuild
rename to x11-drivers/nvidia-drivers/nvidia-drivers-560.35.03-r1.ebuild
index 7201283bfb9f..31a3eab6d6e2 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-560.35.03.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-560.35.03-r1.ebuild
@@ -405,6 +405,22 @@ documentation that is installed alongside this README."
 		doins nvidia-dbus.conf
 	fi
 
+	# enabling is needed for sleep to work properly and little reason not to do
+	# it unconditionally for a better user experience
+	: "$(systemd_get_systemunitdir)"
+	local unitdir=${_#"${EPREFIX}"}
+	# not using relative symlinks to match systemd's own links
+	dosym {"${unitdir}",/etc/systemd/system/systemd-hibernate.service.wants}/nvidia-hibernate.service
+	dosym {"${unitdir}",/etc/systemd/system/systemd-hibernate.service.wants}/nvidia-resume.service
+	dosym {"${unitdir}",/etc/systemd/system/systemd-suspend.service.wants}/nvidia-suspend.service
+	dosym {"${unitdir}",/etc/systemd/system/systemd-suspend.service.wants}/nvidia-resume.service
+	# also add a custom elogind hook to do the equivalent of the above
+	exeinto /usr/lib/elogind/system-sleep
+	newexe "${FILESDIR}"/system-sleep.elogind nvidia
+	# <elogind-255.5 used a different path (bug #939216), keep a compat symlink
+	# TODO: cleanup after 255.5 been stable for a few months
+	dosym {/usr/lib,/"${libdir}"}/elogind/system-sleep/nvidia
+
 	# 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
@@ -512,4 +528,44 @@ pkg_postinst() {
 		elog "enables the use of the GSP firmware by default. *If* experience regressions,"
 		elog "please see '${EROOT}/etc/modprobe.d/nvidia.conf' to optionally disable."
 	fi
+
+	# these can be removed after some time, only to help the transition
+	# given users are unlikely to do further custom solutions if it works
+	# (see also https://github.com/elogind/elogind/issues/272)
+	if grep -riq "^[^#]*HandleNvidiaSleep=yes" "${EROOT}"/etc/elogind/sleep.conf.d/ 2>/dev/null
+	then
+		ewarn
+		ewarn "!!! WARNING !!!"
+		ewarn "Detected HandleNvidiaSleep=yes in ${EROOT}/etc/elogind/sleep.conf.d/."
+		ewarn "This 'could' cause issues if used in combination with the new hook"
+		ewarn "installed by the ebuild to handle sleep using the official upstream"
+		ewarn "script. It is recommended to disable the option."
+	fi
+	if [[ $(realpath "${EROOT}"{/etc,{/usr,}/lib*}/elogind/system-sleep | sort | uniq | \
+		xargs -d'\n' grep -Ril nvidia 2>/dev/null | wc -l) -gt 2 ]]
+	then
+		ewarn
+		ewarn "!!! WARNING !!!"
+		ewarn "Detected a custom script at ${EROOT}{/etc,{/usr,}/lib*}/elogind/system-sleep"
+		ewarn "referencing NVIDIA. This version of ${PN} has installed its own"
+		ewarn "hook at ${EROOT}/usr/lib/elogind/system-sleep/nvidia and it is recommended"
+		ewarn "to remove the custom one to avoid potential issues."
+		ewarn
+		ewarn "Feel free to ignore this warning if you know the other NVIDIA-related"
+		ewarn "scripts can be used together. The warning will be removed in the future."
+	fi
+	if [[ ${REPLACING_VERSIONS##* } ]] &&
+		ver_test ${REPLACING_VERSIONS##* } -lt 560.35.03-r1 # may get repeated
+	then
+		elog
+		elog "For suspend/sleep, 'NVreg_PreserveVideoMemoryAllocations=1' is now default"
+		elog "with this version of ${PN}. This is recommended (or required) by"
+		elog "major DEs especially with wayland but, *if* experience regressions with"
+		elog "suspend, try reverting to =0 in '${EROOT}/etc/modprobe.d/nvidia.conf'."
+		elog
+		elog "May notably be an issue when using neither systemd nor elogind to suspend."
+		elog
+		elog "Also, the systemd suspend/hibernate/resume services are now enabled by"
+		elog "default, and for openrc+elogind a similar hook has been installed."
+	fi
 }


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: x11-drivers/nvidia-drivers/, x11-drivers/nvidia-drivers/files/
@ 2024-11-18  9:06 Ionen Wolkens
  0 siblings, 0 replies; 33+ messages in thread
From: Ionen Wolkens @ 2024-11-18  9:06 UTC (permalink / raw
  To: gentoo-commits

commit:     9bd3fd74d941e3362dff2105a91e86a4a458f322
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 18 08:24:37 2024 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Mon Nov 18 09:02:34 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9bd3fd74

x11-drivers/nvidia-drivers: bump KERNEL_MAX to 6.12 where possible

Don't really recommend 6.12 yet, but it *should* mostly work.

There *may* be issues for which it is unclear if they were
limited to older 6.12-rc1 or so and not the actual 6.12.
It's possible that some issues only surface with specific
kernel configs and so they're hard to pick up.

Normally don't do patches, but in this case it compiles even
though it's going to be semi-broken without it at runtime.
FOP_UNSIGNED_OFFSET is unset for <6.12 so this should have
no impact for older kernels.

0/vulkan fails to build, and 0/470 was already broken with 6.10.

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 .../nvidia-drivers-565.57.01-kernel-6.12.patch     | 25 ++++++++++++++++++++++
 .../nvidia-drivers-535.216.01-r1.ebuild            |  3 ++-
 .../nvidia-drivers-550.127.05-r1.ebuild            |  3 ++-
 .../nvidia-drivers-565.57.01-r3.ebuild             |  3 ++-
 4 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-565.57.01-kernel-6.12.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-565.57.01-kernel-6.12.patch
new file mode 100644
index 000000000000..de964d520dde
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-565.57.01-kernel-6.12.patch
@@ -0,0 +1,25 @@
+https://github.com/NVIDIA/open-gpu-kernel-modules/issues/712
+https://forums.developer.nvidia.com/t/patch-for-565-57-01-linux-kernel-6-12/313260
+https://github.com/Binary-Eater/open-gpu-kernel-modules/commit/8ac26d3c66ea88b0f80504bdd1e907658b41609d.patch
+--- a/kernel/nvidia-drm/nvidia-drm-drv.c
++++ b/kernel/nvidia-drm/nvidia-drm-drv.c
+@@ -1712,4 +1712,8 @@
+ 
+     .llseek         = noop_llseek,
++
++#if defined(FOP_UNSIGNED_OFFSET)
++    .fop_flags      = FOP_UNSIGNED_OFFSET,
++#endif
+ };
+ 
+--- a/kernel-module-source/kernel-open/nvidia-drm/nvidia-drm-drv.c
++++ b/kernel-module-source/kernel-open/nvidia-drm/nvidia-drm-drv.c
+@@ -1712,4 +1712,8 @@
+ 
+     .llseek         = noop_llseek,
++
++#if defined(FOP_UNSIGNED_OFFSET)
++    .fop_flags      = FOP_UNSIGNED_OFFSET,
++#endif
+ };
+ 

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-535.216.01-r1.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-535.216.01-r1.ebuild
index 9e36108889c6..fdd7ee295a8d 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-535.216.01-r1.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-535.216.01-r1.ebuild
@@ -7,7 +7,7 @@ MODULES_OPTIONAL_IUSE=+modules
 inherit desktop flag-o-matic linux-mod-r1 multilib readme.gentoo-r1
 inherit systemd toolchain-funcs unpacker user-info
 
-MODULES_KERNEL_MAX=6.11
+MODULES_KERNEL_MAX=6.12
 NV_URI="https://download.nvidia.com/XFree86/"
 
 DESCRIPTION="NVIDIA Accelerated Graphics Driver"
@@ -93,6 +93,7 @@ PATCHES=(
 	"${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch
 	"${FILESDIR}"/nvidia-settings-390.144-raw-ldflags.patch
 	"${FILESDIR}"/nvidia-settings-530.30.02-desktop.patch
+	"${FILESDIR}"/nvidia-drivers-565.57.01-kernel-6.12.patch
 )
 
 pkg_setup() {

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-550.127.05-r1.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-550.127.05-r1.ebuild
index f34ae07f3e62..222d95fdaa81 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-550.127.05-r1.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-550.127.05-r1.ebuild
@@ -7,7 +7,7 @@ MODULES_OPTIONAL_IUSE=+modules
 inherit desktop flag-o-matic linux-mod-r1 readme.gentoo-r1
 inherit systemd toolchain-funcs unpacker user-info
 
-MODULES_KERNEL_MAX=6.11
+MODULES_KERNEL_MAX=6.12
 NV_URI="https://download.nvidia.com/XFree86/"
 
 DESCRIPTION="NVIDIA Accelerated Graphics Driver"
@@ -90,6 +90,7 @@ QA_PREBUILT="lib/firmware/* opt/bin/* usr/lib*"
 PATCHES=(
 	"${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch
 	"${FILESDIR}"/nvidia-settings-530.30.02-desktop.patch
+	"${FILESDIR}"/nvidia-drivers-565.57.01-kernel-6.12.patch
 )
 
 pkg_setup() {

diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-565.57.01-r3.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-565.57.01-r3.ebuild
index 6f2fc8b8718f..ab706faf496f 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-565.57.01-r3.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-565.57.01-r3.ebuild
@@ -7,7 +7,7 @@ MODULES_OPTIONAL_IUSE=+modules
 inherit desktop flag-o-matic linux-mod-r1 readme.gentoo-r1
 inherit systemd toolchain-funcs unpacker user-info
 
-MODULES_KERNEL_MAX=6.11
+MODULES_KERNEL_MAX=6.12
 NV_URI="https://download.nvidia.com/XFree86/"
 
 DESCRIPTION="NVIDIA Accelerated Graphics Driver"
@@ -94,6 +94,7 @@ QA_PREBUILT="lib/firmware/* opt/bin/* usr/lib*"
 PATCHES=(
 	"${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch
 	"${FILESDIR}"/nvidia-settings-530.30.02-desktop.patch
+	"${FILESDIR}"/nvidia-drivers-565.57.01-kernel-6.12.patch
 )
 
 pkg_setup() {


^ permalink raw reply related	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2024-11-18  9:06 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-21 19:44 [gentoo-commits] repo/gentoo:master commit in: x11-drivers/nvidia-drivers/, x11-drivers/nvidia-drivers/files/ Ionen Wolkens
  -- strict thread matches above, loose matches on Subject: below --
2024-11-18  9:06 Ionen Wolkens
2024-09-14 10:52 Ionen Wolkens
2024-02-26 13:23 Ionen Wolkens
2024-02-01 21:06 Ionen Wolkens
2024-01-15 23:03 Ionen Wolkens
2023-06-18  1:53 Ionen Wolkens
2023-02-28 17:00 Ionen Wolkens
2022-12-02 18:13 Ionen Wolkens
2022-09-16  6:15 Ionen Wolkens
2022-05-31 19:11 Ionen Wolkens
2021-04-21 12:22 David Seifert
2021-03-21 15:53 David Seifert
2021-03-21 15:53 David Seifert
2020-12-07 12:57 David Seifert
2020-08-25 17:44 Matt Turner
2019-11-29  1:59 Mike Gilbert
2019-03-03 13:11 Jeroen Roovers
2019-01-16 10:00 Jeroen Roovers
2018-06-30  8:17 Jeroen Roovers
2017-10-31 11:26 Jeroen Roovers
2017-10-07  9:44 Jeroen Roovers
2017-09-27 16:11 Jeroen Roovers
2017-05-06 10:59 Jeroen Roovers
2017-03-30  7:29 Jeroen Roovers
2017-02-15  6:53 Jeroen Roovers
2016-11-27 10:46 Jeroen Roovers
2016-11-02  7:53 Jeroen Roovers
2016-08-17  5:49 Jeroen Roovers
2016-07-24 11:37 Jeroen Roovers
2016-01-31 19:19 Jeroen Roovers
2016-01-31  9:23 Jeroen Roovers
2015-12-06  5:32 Jeroen Roovers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox