summaryrefslogtreecommitdiff
path: root/sys-kernel/nvidia-drivers-dkms
diff options
context:
space:
mode:
Diffstat (limited to 'sys-kernel/nvidia-drivers-dkms')
-rw-r--r--sys-kernel/nvidia-drivers-dkms/Manifest1
-rw-r--r--sys-kernel/nvidia-drivers-dkms/files/nvidia-drivers-dkms-304.137-conf.patch17
-rw-r--r--sys-kernel/nvidia-drivers-dkms/files/nvidia-drivers-dkms-304.137-kernel-4.14.patch27
-rw-r--r--sys-kernel/nvidia-drivers-dkms/nvidia-drivers-dkms-304.137.ebuild47
4 files changed, 92 insertions, 0 deletions
diff --git a/sys-kernel/nvidia-drivers-dkms/Manifest b/sys-kernel/nvidia-drivers-dkms/Manifest
index 858e871a..c6bac581 100644
--- a/sys-kernel/nvidia-drivers-dkms/Manifest
+++ b/sys-kernel/nvidia-drivers-dkms/Manifest
@@ -1 +1,2 @@
+DIST NVIDIA-Linux-x86_64-304.137.run 70087133 SHA256 eb1f56db3a2bea13e3ccde7b5ae14abe8cd6c6dbe69af4c71c68a623cc96e3e2 SHA512 d7fae1e486005ffa2f2bf7f14f901bf5156fc784407a9acfea584f49bdab92ff5f4d0fb66c4c5b2800a461fc06aebb7d760bcb59f69ce4f2cb4e03e11816b3e9 WHIRLPOOL d6dee3634b0d6052c8fbaedc6e24c893af9c9d4f0f0a7836827bfaf26313f3877f398e6cfd22c27527c30dd37347206375d9c7e642cdc9a43a682bc787b1122b
DIST NVIDIA-Linux-x86_64-384.98.run 80981256 SHA256 fb10b66d9a835c8a5fca9bf2aeb2a240732108b1d6fd11dea19c326463c6b6bb SHA512 cd337d538d5a35f52b90a4437f44146f4982484c68171ee3570c2ff44b4bd96e0a65223a141770fbe3a7794e68832386a1d2bbaf66cff7f4cafba8462ef402b5 WHIRLPOOL 638700b0c209b27e99267b90c5e6e674946c1fef3dc65233195a3cca580a1bcc6684dd6a8c42f1a0ca1641784c4edf0db941e9c9b1cbcff57c01b116911660ff
diff --git a/sys-kernel/nvidia-drivers-dkms/files/nvidia-drivers-dkms-304.137-conf.patch b/sys-kernel/nvidia-drivers-dkms/files/nvidia-drivers-dkms-304.137-conf.patch
new file mode 100644
index 00000000..ddac89d1
--- /dev/null
+++ b/sys-kernel/nvidia-drivers-dkms/files/nvidia-drivers-dkms-304.137-conf.patch
@@ -0,0 +1,17 @@
+diff -Nur a/kernel/dkms.conf b/kernel/dkms.conf
+--- a/kernel/dkms.conf 2017-09-14 21:51:09.000000000 +0100
++++ b/kernel/dkms.conf 2017-12-22 15:26:51.868319934 +0000
+@@ -1,7 +1,9 @@
+-PACKAGE_NAME="nvidia"
++PACKAGE_NAME="nvidia-drivers-dkms"
+ PACKAGE_VERSION="304.137"
+-BUILT_MODULE_NAME[0]="$PACKAGE_NAME"
+-DEST_MODULE_LOCATION[0]="/kernel/drivers/video"
++AUTOINSTALL="yes"
++
+ MAKE[0]="make module SYSSRC=${kernel_source_dir}"
+ CLEAN="make clean"
+-AUTOINSTALL="yes"
++
++BUILT_MODULE_NAME[0]="nvidia"
++DEST_MODULE_LOCATION[0]="/extra/dkms"
diff --git a/sys-kernel/nvidia-drivers-dkms/files/nvidia-drivers-dkms-304.137-kernel-4.14.patch b/sys-kernel/nvidia-drivers-dkms/files/nvidia-drivers-dkms-304.137-kernel-4.14.patch
new file mode 100644
index 00000000..74523080
--- /dev/null
+++ b/sys-kernel/nvidia-drivers-dkms/files/nvidia-drivers-dkms-304.137-kernel-4.14.patch
@@ -0,0 +1,27 @@
+diff -Nur a/kernel/nv-drm.c b/kernel/nv-drm.c
+--- a/kernel/nv-drm.c 2017-09-14 21:51:09.000000000 +0100
++++ b/kernel/nv-drm.c 2017-12-22 15:29:01.080842070 +0000
+@@ -121,8 +121,12 @@
+ {
+ int ret = 0;
+ #if defined(NV_DRM_AVAILABLE)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)
++ ret = drm_legacy_pci_init(&nv_drm_driver, pci_driver);
++#else
+ ret = drm_pci_init(&nv_drm_driver, pci_driver);
+ #endif
++#endif
+ return ret;
+ }
+
+@@ -131,6 +135,10 @@
+ )
+ {
+ #if defined(NV_DRM_AVAILABLE)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)
++ drm_legacy_pci_exit(&nv_drm_driver, pci_driver);
++#else
+ drm_pci_exit(&nv_drm_driver, pci_driver);
+ #endif
++#endif
+ }
diff --git a/sys-kernel/nvidia-drivers-dkms/nvidia-drivers-dkms-304.137.ebuild b/sys-kernel/nvidia-drivers-dkms/nvidia-drivers-dkms-304.137.ebuild
new file mode 100644
index 00000000..798696a1
--- /dev/null
+++ b/sys-kernel/nvidia-drivers-dkms/nvidia-drivers-dkms-304.137.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils
+
+NV_URI="http://us.download.nvidia.com/XFree86/"
+AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
+
+DESCRIPTION="NVIDIA driver sources for linux"
+HOMEPAGE="http://www.nvidia.com/"
+SRC_URI="amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )"
+
+LICENSE="GPL-2 NVIDIA-r2"
+SLOT="0/${PV}"
+KEYWORDS="amd64"
+IUSE=""
+
+DEPEND="sys-kernel/dkms"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${AMD64_NV_PACKAGE}"
+
+src_unpack() {
+ sh ${DISTDIR}/${AMD64_NV_PACKAGE}.run --extract-only
+}
+
+src_prepare() {
+ epatch ${FILESDIR}/${P}-conf.patch
+ epatch ${FILESDIR}/${P}-kernel-4.14.patch
+}
+
+src_install() {
+ dodir /usr/src/${P}
+ insinto /usr/src/${P}
+ doins -r "${S}"/kernel/*
+}
+
+pkg_postinst() {
+ dkms add ${PN}/${PV}
+}
+
+pkg_prerm() {
+ dkms remove ${PN}/${PV} --all
+}