summaryrefslogtreecommitdiff
path: root/x11-drivers
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-08-08 20:11:47 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-08-08 20:11:47 +0100
commitf625b9919a60a30f1bd860f7d1b2eac183ced593 (patch)
tree7543f00925ff7277e31881de0a87801681f6f92f /x11-drivers
parente3872864be25f7421015bef2732fa57c0c9fb726 (diff)
gentoo resync : 08.08.2018
Diffstat (limited to 'x11-drivers')
-rw-r--r--x11-drivers/Manifest.gzbin6208 -> 6209 bytes
-rw-r--r--x11-drivers/nvidia-drivers/Manifest6
-rw-r--r--x11-drivers/nvidia-drivers/nvidia-drivers-396.45.ebuild2
-rw-r--r--x11-drivers/nvidia-drivers/nvidia-drivers-396.51.ebuild581
4 files changed, 587 insertions, 2 deletions
diff --git a/x11-drivers/Manifest.gz b/x11-drivers/Manifest.gz
index 76301958bb62..b1977b5e9f22 100644
--- a/x11-drivers/Manifest.gz
+++ b/x11-drivers/Manifest.gz
Binary files differ
diff --git a/x11-drivers/nvidia-drivers/Manifest b/x11-drivers/nvidia-drivers/Manifest
index cae116b3872b..77baa6c59493 100644
--- a/x11-drivers/nvidia-drivers/Manifest
+++ b/x11-drivers/nvidia-drivers/Manifest
@@ -37,6 +37,7 @@ DIST NVIDIA-FreeBSD-x86_64-390.67.tar.gz 63611003 BLAKE2B 093d61fa03a64e6c61920c
DIST NVIDIA-FreeBSD-x86_64-390.77.tar.gz 63638514 BLAKE2B 8a63f1c93cb24400ce099ffe76d2453e6980674554378a2e135e32a976212f75c335e104e52ad5039216b06286bc350e49a8fd1c61b987e1be3f3cf3bdd08f38 SHA512 f2bb8f9b5afe6ddaaa6395835592763d6f36814b37d8234f7372a0039324bcd88fa4e7f1ff5da7205bcdaac0f0d96ac8d72fe66db15e2adeee06a86fcb4d3199
DIST NVIDIA-FreeBSD-x86_64-396.24.tar.gz 60839222 BLAKE2B 4baa266d945525a8f43d69e14df1b045d5a2e7212eb3a92208f8efb454642e657ea3cf00a9e625ef5efa9f54c8a9e2f87ef4847696368de13b88a0721364d9af SHA512 28c456cfc9f779bed84d671e104f2ea68940053aed2dc7964390e84ec553a9062be6b5108a78f123c129c25548a7b3027060da67417c64f857b23c95ae9f908b
DIST NVIDIA-FreeBSD-x86_64-396.45.tar.gz 60850050 BLAKE2B 1bc8e761fbe38637ee17f996ec74f63c4e9da7cea6d38029fe2fcad5cd85da73e10773e019e2744d522aefecee2d6a8d3852db6ad5b9e1e746bc36ccdb4b7c9c SHA512 76955be8e86645376856bdbda7339601b88067e6b4d39b768ec86586eced7e77a437eb990bcf0fa77b3671968b00df91b53be53e1cdcd45d3e0c6a96ab5f1d77
+DIST NVIDIA-FreeBSD-x86_64-396.51.tar.gz 60903199 BLAKE2B adaf32bce51a11a15f71dfb3fb66a203237a6e153437cd4c95bd5d9d7d694b9b959d7e599d9481e3201eff243655e2d3e39cbea72bf40d9c40448d4b55cf22ed SHA512 903af39b5d8681d80f0016db4fe7a4b84cc2c1325c295be6c44b95aa98006d395f46b9d26ca5f08aea8998ca62f1c51eb4b1c0c2b3d082943d35c4bb437a57ef
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
@@ -64,6 +65,7 @@ DIST NVIDIA-Linux-x86_64-390.67.run 82272406 BLAKE2B b0aafce048e6cf62fde5d86a282
DIST NVIDIA-Linux-x86_64-390.77.run 82722543 BLAKE2B 46bc7b365b4a8bd2d9444ccccec0ef427a1bbf19546db21c01d765332e8ff12fd297991166895815c96bb8d1a6153df5178578ebfaffbf7875396a8bb5578ad8 SHA512 6273ab0dee2fb70a5675166d4a49059f2cb46528408e292ac334b6210eb54be7caa56479274404ab773a4e9ba4c5a9a2e0568cb5ca7f15dea448a59ec2e72cde
DIST NVIDIA-Linux-x86_64-396.24.run 86545234 BLAKE2B be297b4585275362608cb5119c9f7f77bcf7895bd1320603cb5f8034ee5f1dfa6d0150e58d4a11dd4656b50476d6cb6a372c18db54d33fdd685250ceb0793d3f SHA512 dfe837804d01e903cdf980353add0227362771cd252e4a7d8aff99fc489e5535edfda51ed1a20b9d60e23f1a9e7312f23309c59c67ff0a09a9b9214e52f09077
DIST NVIDIA-Linux-x86_64-396.45.run 87016131 BLAKE2B 988392f69fc4f1f60acd03bee50245d836976728c81bbd21e5542b13e0bd93589a2bf8482d544e868f294e32de65b62c13512e465ec25afaae1ae405ae4beb3c SHA512 243253ebc83e4bc5116223ecaa29e55786a611484d9a0fba302f9f87961576bbd7f367422635725173662f013e27ef88a09f7282c9fe9912f9fe4665bdf06822
+DIST NVIDIA-Linux-x86_64-396.51.run 86541408 BLAKE2B 2cc41d2f6fe73a49c322828a9001383d8a23890a6d1d18593b649e18b77d2424fe588fdfbfd71fce6819a4620c4ba21d8e8ce7f2a8aa8411961099d40cf54edd SHA512 961c1a5b27a0f6cb54e387133a8d4038ddda0df39e70e84a637d8d64eaeb4ec937e37d6a737179d72750785614d20ade5e99f0668e3d53fef2cfa70241de4fe3
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.gz 2114647 BLAKE2B 26413fde8397e748fae362984039286c53a7fe104228452f3188b5e77b084ff4bf00131e77359ff5e92dfc325680c1f662950175cf806403d2a524ba86158f51 SHA512 7a374be56c8be52767d73a048029d9e55dc2abcf2f6a97eb4931544c927c85a1103a206be9e8d1ffcef36fec2caf2416f33699ad4d51e7dca17e4e844c37a595
@@ -75,6 +77,7 @@ DIST nvidia-settings-390.67.tar.bz2 1109133 BLAKE2B 3ac68f374d439c900ddbaa5eda9e
DIST nvidia-settings-390.77.tar.bz2 1109358 BLAKE2B ee59fff5a679301b0e1f24fce3a13ee4e216d48afd73473a1ec3729067e85308d3df3b8ce1d4394b5a7836e40298c6623a0652ee3f23fbdd1a00ebdc82136f22 SHA512 130c8b9382984df597040475b29a8b61cad6eb76ef241214ab327f08a4c335176f3bda49a0c1a565a1bd8d64ab70cf1c00b7d316f343b7387dd03be7c9684f21
DIST nvidia-settings-396.24.tar.bz2 1115673 BLAKE2B 5b0bd156505e99a5b788fc61458c902cc1760d999b18c8c6309986d8c315eabc65cb2fea9ef6a823acbe57c4a11bf67938575afffb36fea91320416fe40a7507 SHA512 841470a324bb09683fcd863474f987a525a38213432be3bf4288a48671c674692f44642d260f3d2d0710e485e323153f867d0bda4cfa9b11d0e3c61a36370353
DIST nvidia-settings-396.45.tar.bz2 1116216 BLAKE2B 85769b7e3152bf2ff029083d5e1cf695751fa713b9db858d77f344f19266b545e8f70a07dcb3b017dd6ab901e25df6acd15a1e584bc65efec1a3d24cdd56cfca SHA512 2ec1c1e2ba79a95c1199724c476b8433ea34b7c88acfabf9b49484073d8b0251a7f466bfe71f501772915ea77fdc34b4bc539fc62e8844a06c28af7570fe0bee
+DIST nvidia-settings-396.51.tar.bz2 1116520 BLAKE2B e7362bf71d0c7e595a17e398aacfe53ad845e1d29db6792e0d4e7769663c9eba1267c95c8a629473f7419d05ab48c02ff198bebee11db8a3d9de1ed4444c4124 SHA512 139fde3ab704562db5d7247b0ccd578260baf2650de24d6844a02439d6847681181681fb6bf84fc962434597259887b735b1cb2e596ab5112924d70ba4c6fc6f
EBUILD nvidia-drivers-304.137.ebuild 13647 BLAKE2B ff0bc9bc9d98a5f38ebd791c696291d6c88d0e10ab68509c73ae7b9e1f8b3188027627dd02b99329b551c77819a4bf2d77625762d6ff2bbe25c3bbe14afdd0e5 SHA512 617d92a8eca878b7a69b7bedead069b672d827c48e7531da49d985a913d4295039d8f5d9e2566c9ee9192cc5191bd3c70400310ea682b71c479df6082692e70c
EBUILD nvidia-drivers-340.107.ebuild 14648 BLAKE2B 3456f822cf41e497637b880898189ee040b2113779fb28ba2a04193180ac3769e00d61e80e697f779f50dd55b055a95dfc480f8e2f6fe5d78a30219ddda5c30e SHA512 d3df565fdb9425fe568eb16c9dc7ca50ff832a54629012a92a5d8c3e60f358f4a286f371b14cc6365dc8465bc78e1a1bdf5cbd4ca9ce26497ad4cacd695cfcd8
EBUILD nvidia-drivers-375.82.ebuild 15848 BLAKE2B f89ad536d15a0df282744c7c26c995dc1d94b8af60e2a7fe3d40a06134526b8eba96c06ae999ae55efca4a21655893a4e53498d0f729f1b35affe891b81438cb SHA512 4778befb48304ed07f9e47174eaf0e519dcdc261906151246e54f3fb8383c5fb5c45b45e42165d69523057007ab44a9c7b400a907ddd167dfdd29dc422995f93
@@ -85,5 +88,6 @@ EBUILD nvidia-drivers-387.34.ebuild 16295 BLAKE2B 0e6e77ed5654425bf03e358d5d8c53
EBUILD nvidia-drivers-390.67.ebuild 16291 BLAKE2B 7a3748763d42bc2f51b7410b89a0309ec865d5d61b73ce74d51e2c05201ec6072e1494b1e1be4fcc7124e61416a5bfab2639c860b1b55a49101746544d29fda3 SHA512 a1e483782e37a18cc3476c4027fc549a5f02e325a2ae8d263e0670915ddc793c9986ff46b05f9dc0900135d034d8316165b3ed7f143b38f6f460a13ba403e553
EBUILD nvidia-drivers-390.77.ebuild 16293 BLAKE2B 5263b9481915c21b9df6c4477697e541dd10f5103fd98d2c66f45166dc9e8bbe425490f483396d3bb3bb5bfa9dabb202116d649f782a9c902d728dfa8d940b2f SHA512 b03219ab61b1b39f7d3c9ca00cd3442b15511c6bc93a82053f89560cdafb540492c0b91d081aab19d4e04960b6df3aaba819607e51a44698faad29a14bfe1e30
EBUILD nvidia-drivers-396.24-r1.ebuild 15944 BLAKE2B 08a71847cda1985aaf86817cd865e4943de4ce25609a1db42861c07cc063456afec1abdd8e46c3fdba49c05bc57fd4b66a46f9a2e4e42e029355becad028fd87 SHA512 e9717a8d09b68f9fa9f44fba55e612cde824c4eb64287fd95fd3ccf47797e56fe137f6a93907249dc5f060af9607c52b9e125a0fdf9b859f53e11b154eb0e471
-EBUILD nvidia-drivers-396.45.ebuild 15945 BLAKE2B 01bcf2d8b1e4423fb89412075bbda270a018fad08166c4c4351bc57fa225107142c9dd007f22407cb224e0261f430a79787d06dd21d8f04075cfdcfef8dd8e20 SHA512 c742ec64ce005a4f7e9937ce2e6eb959920aa4ee6dfcda7b140423619990c954959fc6e6ae39417cb8f7e72f085fe06abeaf9585718b289fc003dd822e3280ce
+EBUILD nvidia-drivers-396.45.ebuild 15944 BLAKE2B 08a71847cda1985aaf86817cd865e4943de4ce25609a1db42861c07cc063456afec1abdd8e46c3fdba49c05bc57fd4b66a46f9a2e4e42e029355becad028fd87 SHA512 e9717a8d09b68f9fa9f44fba55e612cde824c4eb64287fd95fd3ccf47797e56fe137f6a93907249dc5f060af9607c52b9e125a0fdf9b859f53e11b154eb0e471
+EBUILD nvidia-drivers-396.51.ebuild 15945 BLAKE2B 01bcf2d8b1e4423fb89412075bbda270a018fad08166c4c4351bc57fa225107142c9dd007f22407cb224e0261f430a79787d06dd21d8f04075cfdcfef8dd8e20 SHA512 c742ec64ce005a4f7e9937ce2e6eb959920aa4ee6dfcda7b140423619990c954959fc6e6ae39417cb8f7e72f085fe06abeaf9585718b289fc003dd822e3280ce
MISC metadata.xml 1275 BLAKE2B df5cb10ac396802437bf6efb3e80226124c11d6167bef2b64c3e525c17fb27213b13d7413ef909469440804a373b6e5c7088c53e0a6b44897860b7276ac3de6b SHA512 464ba5638a5d82a6e6bcbfe11b52759846f9f81e3f223cc313e0059b923427f21dab95b84595d6bffad4441fec96fe5f01044be572b72add8196a812f5682edb
diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-396.45.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-396.45.ebuild
index 49a63be02100..2c010974326d 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-396.45.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-396.45.ebuild
@@ -23,7 +23,7 @@ SRC_URI="
LICENSE="GPL-2 NVIDIA-r2"
SLOT="0/${PV%.*}"
-KEYWORDS="-* ~amd64 ~amd64-fbsd"
+KEYWORDS="-* amd64 ~amd64-fbsd"
RESTRICT="bindist mirror"
EMULTILIB_PKG="true"
diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-396.51.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-396.51.ebuild
new file mode 100644
index 000000000000..49a63be02100
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-396.51.ebuild
@@ -0,0 +1,581 @@
+# 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}"
+
+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 )
+ 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 18; then
+ ewarn "Gentoo supports kernels which are supported by NVIDIA"
+ ewarn "which are limited to the following kernels:"
+ ewarn "<sys-kernel/gentoo-sources-4.18"
+ ewarn "<sys-kernel/vanilla-sources-4.18"
+ 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"
+
+ # 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
+ 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-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
+}