Gentoo Archives: gentoo-commits

From: Jeroen Roovers <jer@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: x11-drivers/nvidia-drivers/
Date: Sun, 31 Jan 2016 19:24:52
Message-Id: 1454268287.7478f7d9145daa2ae1b03a0a386e55f345bb1b86.jer@gentoo
1 commit: 7478f7d9145daa2ae1b03a0a386e55f345bb1b86
2 Author: Jeroen Roovers <jer <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jan 31 19:24:32 2016 +0000
4 Commit: Jeroen Roovers <jer <AT> gentoo <DOT> org>
5 CommitDate: Sun Jan 31 19:24:47 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7478f7d9
7
8 x11-drivers/nvidia-drivers: Old.
9
10 Package-Manager: portage-2.2.27
11
12 .../nvidia-drivers/nvidia-drivers-340.96-r1.ebuild | 480 ------------------
13 .../nvidia-drivers/nvidia-drivers-340.96-r2.ebuild | 517 --------------------
14 .../nvidia-drivers/nvidia-drivers-346.96-r2.ebuild | 489 -------------------
15 .../nvidia-drivers/nvidia-drivers-346.96-r3.ebuild | 528 --------------------
16 .../nvidia-drivers/nvidia-drivers-352.79-r1.ebuild | 527 --------------------
17 .../nvidia-drivers/nvidia-drivers-358.16-r2.ebuild | 539 ---------------------
18 .../nvidia-drivers/nvidia-drivers-361.18-r2.ebuild | 530 --------------------
19 7 files changed, 3610 deletions(-)
20
21 diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-340.96-r1.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-340.96-r1.ebuild
22 deleted file mode 100644
23 index 294bc96..0000000
24 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-340.96-r1.ebuild
25 +++ /dev/null
26 @@ -1,480 +0,0 @@
27 -# Copyright 1999-2015 Gentoo Foundation
28 -# Distributed under the terms of the GNU General Public License v2
29 -# $Id$
30 -
31 -EAPI=5
32 -
33 -inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \
34 - portability toolchain-funcs unpacker user udev
35 -
36 -NV_URI="http://us.download.nvidia.com/XFree86/"
37 -X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
38 -AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
39 -X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
40 -AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
41 -
42 -DESCRIPTION="NVIDIA Accelerated Graphics Driver"
43 -HOMEPAGE="http://www.nvidia.com/"
44 -SRC_URI="
45 - amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
46 - amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
47 - x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
48 - x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
49 -"
50 -
51 -LICENSE="GPL-2 NVIDIA-r2"
52 -SLOT="0/${PV%.*}"
53 -KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
54 -IUSE="acpi multilib kernel_FreeBSD kernel_linux pax_kernel +tools +X uvm"
55 -RESTRICT="bindist mirror strip"
56 -EMULTILIB_PKG="true"
57 -
58 -COMMON="
59 - app-eselect/eselect-opencl
60 - kernel_linux? ( >=sys-libs/glibc-2.6.1 )
61 - X? (
62 - >=app-eselect/eselect-opengl-1.0.9
63 - )
64 -"
65 -DEPEND="
66 - ${COMMON}
67 - app-arch/xz-utils
68 - kernel_linux? ( virtual/linux-sources )
69 -"
70 -RDEPEND="
71 - ${COMMON}
72 - acpi? ( sys-power/acpid )
73 - tools? (
74 - dev-libs/atk
75 - dev-libs/glib:2
76 - x11-libs/gdk-pixbuf
77 - >=x11-libs/gtk+-2.4:2
78 - x11-libs/libX11
79 - x11-libs/libXext
80 - x11-libs/pango[X]
81 - )
82 - X? (
83 - <x11-base/xorg-server-1.18.99:=
84 - >=x11-libs/libvdpau-0.3-r1
85 - multilib? (
86 - >=x11-libs/libX11-1.6.2[abi_x86_32]
87 - >=x11-libs/libXext-1.3.2[abi_x86_32]
88 - )
89 - )
90 -"
91 -
92 -REQUIRED_USE="tools? ( X )"
93 -
94 -QA_PREBUILT="opt/* usr/lib*"
95 -
96 -S=${WORKDIR}/
97 -
98 -pkg_pretend() {
99 -
100 - if use amd64 && has_multilib_profile && \
101 - [ "${DEFAULT_ABI}" != "amd64" ]; then
102 - eerror "This ebuild doesn't currently support changing your default ABI"
103 - die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
104 - fi
105 -
106 - if use kernel_linux && kernel_is ge 4 4; then
107 - ewarn "Gentoo supports kernels which are supported by NVIDIA"
108 - ewarn "which are limited to the following kernels:"
109 - ewarn "<sys-kernel/gentoo-sources-4.4"
110 - ewarn "<sys-kernel/vanilla-sources-4.4"
111 - ewarn ""
112 - ewarn "You are free to utilize epatch_user to provide whatever"
113 - ewarn "support you feel is appropriate, but will not receive"
114 - ewarn "support as a result of those changes."
115 - ewarn ""
116 - ewarn "Do not file a bug report about this."
117 - ewarn ""
118 - fi
119 -
120 - # Since Nvidia ships many different series of drivers, we need to give the user
121 - # some kind of guidance as to what version they should install. This tries
122 - # to point the user in the right direction but can't be perfect. check
123 - # nvidia-driver.eclass
124 - nvidia-driver-check-warning
125 -
126 - # Kernel features/options to check for
127 - CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
128 - use x86 && CONFIG_CHECK+=" ~HIGHMEM"
129 -
130 - # Now do the above checks
131 - use kernel_linux && check_extra_config
132 -}
133 -
134 -pkg_setup() {
135 - # try to turn off distcc and ccache for people that have a problem with it
136 - export DISTCC_DISABLE=1
137 - export CCACHE_DISABLE=1
138 -
139 - if use kernel_linux; then
140 - MODULE_NAMES="nvidia(video:${S}/kernel)"
141 - use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel/uvm)"
142 -
143 - # This needs to run after MODULE_NAMES (so that the eclass checks
144 - # whether the kernel supports loadable modules) but before BUILD_PARAMS
145 - # is set (so that KV_DIR is populated).
146 - linux-mod_pkg_setup
147 -
148 - BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
149 - SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC)"
150 -
151 - # linux-mod_src_compile calls set_arch_to_kernel, which
152 - # sets the ARCH to x86 but NVIDIA's wrapping Makefile
153 - # expects x86_64 or i386 and then converts it to x86
154 - # later on in the build process
155 - BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
156 - fi
157 -
158 - # set variables to where files are in the package structure
159 - if use kernel_FreeBSD; then
160 - use x86-fbsd && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
161 - use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
162 - NV_DOC="${S}/doc"
163 - NV_OBJ="${S}/obj"
164 - NV_SRC="${S}/src"
165 - NV_MAN="${S}/x11/man"
166 - NV_X11="${S}/obj"
167 - NV_SOVER=1
168 - elif use kernel_linux; then
169 - NV_DOC="${S}"
170 - NV_OBJ="${S}"
171 - NV_SRC="${S}/kernel"
172 - NV_MAN="${S}"
173 - NV_X11="${S}"
174 - NV_SOVER=${PV}
175 - else
176 - die "Could not determine proper NVIDIA package"
177 - fi
178 -}
179 -
180 -src_prepare() {
181 - # Please add a brief description for every added patch
182 -
183 - if use kernel_linux; then
184 - if kernel_is lt 2 6 9 ; then
185 - eerror "You must build this against 2.6.9 or higher kernels."
186 - fi
187 -
188 - # If greater than 2.6.5 use M= instead of SUBDIR=
189 -# convert_to_m "${NV_SRC}"/Makefile.kbuild
190 - fi
191 -
192 - if use pax_kernel; then
193 - ewarn "Using PAX patches is not supported. You will be asked to"
194 - ewarn "use a standard kernel should you have issues. Should you"
195 - ewarn "need support with these patches, contact the PaX team."
196 - epatch "${FILESDIR}"/${PN}-331.13-pax-usercopy.patch
197 - epatch "${FILESDIR}"/${PN}-337.12-pax-constify.patch
198 - fi
199 -
200 - # Allow user patches so they can support RC kernels and whatever else
201 - epatch_user
202 -}
203 -
204 -src_compile() {
205 - # This is already the default on Linux, as there's no toplevel Makefile, but
206 - # on FreeBSD there's one and triggers the kernel module build, as we install
207 - # it by itself, pass this.
208 -
209 - cd "${NV_SRC}"
210 - if use kernel_FreeBSD; then
211 - MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
212 - LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
213 - elif use kernel_linux; then
214 - use uvm && MAKEOPTS=-j1
215 - linux-mod_src_compile
216 - fi
217 -}
218 -
219 -# Install nvidia library:
220 -# the first parameter is the library to install
221 -# the second parameter is the provided soversion
222 -# the third parameter is the target directory if its not /usr/lib
223 -donvidia() {
224 - # Full path to library minus SOVER
225 - MY_LIB="$1"
226 -
227 - # SOVER to use
228 - MY_SOVER="$2"
229 -
230 - # Where to install
231 - MY_DEST="$3"
232 -
233 - if [[ -z "${MY_DEST}" ]]; then
234 - MY_DEST="/usr/$(get_libdir)"
235 - action="dolib.so"
236 - else
237 - exeinto ${MY_DEST}
238 - action="doexe"
239 - fi
240 -
241 - # Get just the library name
242 - libname=$(basename $1)
243 -
244 - # Install the library with the correct SOVER
245 - ${action} ${MY_LIB}.${MY_SOVER} || \
246 - die "failed to install ${libname}"
247 -
248 - # If SOVER wasn't 1, then we need to create a .1 symlink
249 - if [[ "${MY_SOVER}" != "1" ]]; then
250 - dosym ${libname}.${MY_SOVER} \
251 - ${MY_DEST}/${libname}.1 || \
252 - die "failed to create ${libname} symlink"
253 - fi
254 -
255 - # Always create the symlink from the raw lib to the .1
256 - dosym ${libname}.1 \
257 - ${MY_DEST}/${libname} || \
258 - die "failed to create ${libname} symlink"
259 -}
260 -
261 -src_install() {
262 - if use kernel_linux; then
263 - linux-mod_src_install
264 -
265 - # Add the aliases
266 - # This file is tweaked with the appropriate video group in
267 - # pkg_preinst, see bug #491414
268 - insinto /etc/modprobe.d
269 - newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
270 - use uvm && doins "${FILESDIR}"/nvidia-uvm.conf
271 -
272 - # Ensures that our device nodes are created when not using X
273 - exeinto "$(get_udevdir)"
274 - newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
275 - udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
276 - elif use kernel_FreeBSD; then
277 - if use x86-fbsd; then
278 - insinto /boot/modules
279 - doins "${S}/src/nvidia.kld"
280 - fi
281 -
282 - exeinto /boot/modules
283 - doexe "${S}/src/nvidia.ko"
284 - fi
285 -
286 - # NVIDIA kernel <-> userspace driver config lib
287 - donvidia ${NV_OBJ}/libnvidia-cfg.so ${NV_SOVER}
288 -
289 - # NVIDIA framebuffer capture library
290 - donvidia ${NV_OBJ}/libnvidia-fbc.so ${NV_SOVER}
291 -
292 - # NVIDIA video encode/decode <-> CUDA
293 - if use kernel_linux; then
294 - donvidia ${NV_OBJ}/libnvcuvid.so ${NV_SOVER}
295 - donvidia ${NV_OBJ}/libnvidia-encode.so ${NV_SOVER}
296 - fi
297 -
298 - if use X; then
299 - # Xorg DDX driver
300 - insinto /usr/$(get_libdir)/xorg/modules/drivers
301 - doins ${NV_X11}/nvidia_drv.so
302 -
303 - # Xorg GLX driver
304 - donvidia ${NV_X11}/libglx.so ${NV_SOVER} \
305 - /usr/$(get_libdir)/opengl/nvidia/extensions
306 - fi
307 -
308 - # OpenCL ICD for NVIDIA
309 - if use kernel_linux; then
310 - insinto /etc/OpenCL/vendors
311 - doins ${NV_OBJ}/nvidia.icd
312 - fi
313 -
314 - # Documentation
315 - dohtml ${NV_DOC}/html/*
316 - if use kernel_FreeBSD; then
317 - dodoc "${NV_DOC}/README"
318 - use X && doman "${NV_MAN}/nvidia-xconfig.1"
319 - use tools && doman "${NV_MAN}/nvidia-settings.1"
320 - else
321 - # Docs
322 - newdoc "${NV_DOC}/README.txt" README
323 - dodoc "${NV_DOC}/NVIDIA_Changelog"
324 - doman "${NV_MAN}/nvidia-smi.1.gz"
325 - use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
326 - use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
327 - doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
328 - fi
329 -
330 - # Helper Apps
331 - exeinto /opt/bin/
332 -
333 - if use X; then
334 - doexe ${NV_OBJ}/nvidia-xconfig
335 - fi
336 -
337 - if use kernel_linux ; then
338 - doexe ${NV_OBJ}/nvidia-cuda-mps-control
339 - doexe ${NV_OBJ}/nvidia-cuda-mps-server
340 - doexe ${NV_OBJ}/nvidia-debugdump
341 - doexe ${NV_OBJ}/nvidia-persistenced
342 - doexe ${NV_OBJ}/nvidia-smi
343 -
344 - # install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
345 - doexe ${NV_OBJ}/nvidia-modprobe
346 - fowners root:video /opt/bin/nvidia-modprobe
347 - fperms 4710 /opt/bin/nvidia-modprobe
348 - dosym /{opt,usr}/bin/nvidia-modprobe
349 -
350 - doman nvidia-cuda-mps-control.1.gz
351 - doman nvidia-modprobe.1.gz
352 - doman nvidia-persistenced.1.gz
353 - newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
354 - newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
355 - newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
356 - fi
357 -
358 - if use tools; then
359 - doexe ${NV_OBJ}/nvidia-settings
360 - insinto /usr/share/nvidia/
361 - doins nvidia-application-profiles-${PV}-key-documentation
362 - insinto /etc/nvidia
363 - newins nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
364 - fi
365 -
366 - dobin ${NV_OBJ}/nvidia-bug-report.sh
367 -
368 - # Desktop entries for nvidia-settings
369 - if use tools ; then
370 - # There is no icon in the FreeBSD tarball.
371 - use kernel_FreeBSD || newicon ${NV_OBJ}/nvidia-settings.png ${PN}-settings.png
372 - domenu "${FILESDIR}"/${PN}-settings.desktop
373 - exeinto /etc/X11/xinit/xinitrc.d
374 - doexe "${FILESDIR}"/95-nvidia-settings
375 - fi
376 -
377 - #doenvd "${FILESDIR}"/50nvidia-prelink-blacklist
378 -
379 - if has_multilib_profile && use multilib ; then
380 - local OABI=${ABI}
381 - for ABI in $(get_install_abis) ; do
382 - src_install-libs
383 - done
384 - ABI=${OABI}
385 - unset OABI
386 - else
387 - src_install-libs
388 - fi
389 -
390 - is_final_abi || die "failed to iterate through all ABIs"
391 -
392 - readme.gentoo_create_doc
393 -}
394 -
395 -src_install-libs() {
396 - local inslibdir=$(get_libdir)
397 - local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
398 - local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
399 - local libdir=${NV_OBJ}
400 -
401 - if use kernel_linux && has_multilib_profile && \
402 - [[ ${ABI} == "x86" ]] ; then
403 - libdir=${NV_OBJ}/32
404 - fi
405 -
406 - if use X; then
407 - # The GLX libraries
408 - donvidia ${libdir}/libEGL.so ${NV_SOVER} ${GL_ROOT}
409 - donvidia ${libdir}/libGL.so ${NV_SOVER} ${GL_ROOT}
410 - donvidia ${libdir}/libGLESv1_CM.so ${NV_SOVER} ${GL_ROOT}
411 - donvidia ${libdir}/libnvidia-eglcore.so ${NV_SOVER}
412 - donvidia ${libdir}/libnvidia-glcore.so ${NV_SOVER}
413 - donvidia ${libdir}/libnvidia-glsi.so ${NV_SOVER}
414 - donvidia ${libdir}/libnvidia-ifr.so ${NV_SOVER}
415 - if use kernel_FreeBSD; then
416 - donvidia ${libdir}/libnvidia-tls.so ${NV_SOVER}
417 - else
418 - donvidia ${libdir}/tls/libnvidia-tls.so ${NV_SOVER}
419 - fi
420 -
421 - # VDPAU
422 - donvidia ${libdir}/libvdpau_nvidia.so ${NV_SOVER}
423 -
424 - # GLES v2 libraries
425 - insinto ${GL_ROOT}
426 - doexe ${libdir}/libGLESv2.so.${PV}
427 - dosym libGLESv2.so.${PV} ${GL_ROOT}/libGLESv2.so.2
428 - dosym libGLESv2.so.2 ${GL_ROOT}/libGLESv2.so
429 - fi
430 -
431 - # NVIDIA monitoring library
432 - if use kernel_linux ; then
433 - donvidia ${libdir}/libnvidia-ml.so ${NV_SOVER}
434 - fi
435 -
436 - # CUDA & OpenCL
437 - if use kernel_linux; then
438 - donvidia ${libdir}/libcuda.so ${NV_SOVER}
439 - donvidia ${libdir}/libnvidia-compiler.so ${NV_SOVER}
440 - donvidia ${libdir}/libOpenCL.so 1.0.0 ${CL_ROOT}
441 - donvidia ${libdir}/libnvidia-opencl.so ${NV_SOVER}
442 - fi
443 -}
444 -
445 -pkg_preinst() {
446 - if use kernel_linux; then
447 - linux-mod_pkg_preinst
448 -
449 - local videogroup="$(egetent group video | cut -d ':' -f 3)"
450 - if [ -z "${videogroup}" ]; then
451 - eerror "Failed to determine the video group gid"
452 - die "Failed to determine the video group gid"
453 - else
454 - sed -i \
455 - -e "s:PACKAGE:${PF}:g" \
456 - -e "s:VIDEOGID:${videogroup}:" \
457 - "${D}"/etc/modprobe.d/nvidia.conf || die
458 - fi
459 - fi
460 -
461 - # Clean the dynamic libGL stuff's home to ensure
462 - # we dont have stale libs floating around
463 - if [ -d "${ROOT}"/usr/lib/opengl/nvidia ] ; then
464 - rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
465 - fi
466 - # Make sure we nuke the old nvidia-glx's env.d file
467 - if [ -e "${ROOT}"/etc/env.d/09nvidia ] ; then
468 - rm -f "${ROOT}"/etc/env.d/09nvidia
469 - fi
470 -}
471 -
472 -pkg_postinst() {
473 - use kernel_linux && linux-mod_pkg_postinst
474 -
475 - # Switch to the nvidia implementation
476 - use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
477 - "${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
478 -
479 - readme.gentoo_print_elog
480 -
481 - if ! use X; then
482 - elog "You have elected to not install the X.org driver. Along with"
483 - elog "this the OpenGL libraries and VDPAU libraries were not"
484 - elog "installed. Additionally, once the driver is loaded your card"
485 - elog "and fan will run at max speed which may not be desirable."
486 - elog "Use the 'nvidia-smi' init script to have your card and fan"
487 - elog "speed scale appropriately."
488 - elog
489 - fi
490 - if ! use tools; then
491 - elog "USE=tools controls whether the nvidia-settings application"
492 - elog "is installed. If you would like to use it, enable that"
493 - elog "flag and re-emerge this ebuild. Optionally you can install"
494 - elog "media-video/nvidia-settings"
495 - elog
496 - fi
497 -}
498 -
499 -pkg_prerm() {
500 - use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
501 -}
502 -
503 -pkg_postrm() {
504 - use kernel_linux && linux-mod_pkg_postrm
505 - use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
506 -}
507
508 diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-340.96-r2.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-340.96-r2.ebuild
509 deleted file mode 100644
510 index a7a3be0..0000000
511 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-340.96-r2.ebuild
512 +++ /dev/null
513 @@ -1,517 +0,0 @@
514 -# Copyright 1999-2015 Gentoo Foundation
515 -# Distributed under the terms of the GNU General Public License v2
516 -# $Id$
517 -
518 -EAPI=5
519 -
520 -inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \
521 - portability toolchain-funcs unpacker user udev
522 -
523 -NV_URI="http://us.download.nvidia.com/XFree86/"
524 -X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
525 -AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
526 -X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
527 -AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
528 -
529 -DESCRIPTION="NVIDIA Accelerated Graphics Driver"
530 -HOMEPAGE="http://www.nvidia.com/"
531 -SRC_URI="
532 - amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
533 - amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
534 - x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
535 - x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
536 - tools? ( ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2 )
537 -"
538 -
539 -LICENSE="GPL-2 NVIDIA-r2"
540 -SLOT="0/${PV%.*}"
541 -KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
542 -IUSE="acpi multilib kernel_FreeBSD kernel_linux pax_kernel static-libs +tools +X uvm"
543 -RESTRICT="bindist mirror strip"
544 -EMULTILIB_PKG="true"
545 -
546 -COMMON="
547 - app-eselect/eselect-opencl
548 - kernel_linux? ( >=sys-libs/glibc-2.6.1 )
549 - tools? (
550 - dev-libs/atk
551 - dev-libs/glib:2
552 - dev-libs/jansson
553 - x11-libs/gdk-pixbuf
554 - >=x11-libs/gtk+-2.4:2
555 - x11-libs/libX11
556 - x11-libs/libXext
557 - x11-libs/pango[X]
558 - )
559 - X? (
560 - >=app-eselect/eselect-opengl-1.0.9
561 - )
562 -"
563 -DEPEND="
564 - ${COMMON}
565 - app-arch/xz-utils
566 - kernel_linux? ( virtual/linux-sources )
567 -"
568 -RDEPEND="
569 - ${COMMON}
570 - acpi? ( sys-power/acpid )
571 - tools? ( !media-video/nvidia-settings )
572 - X? (
573 - <x11-base/xorg-server-1.18.99:=
574 - >=x11-libs/libvdpau-0.3-r1
575 - multilib? (
576 - >=x11-libs/libX11-1.6.2[abi_x86_32]
577 - >=x11-libs/libXext-1.3.2[abi_x86_32]
578 - )
579 - )
580 -"
581 -
582 -REQUIRED_USE="tools? ( X )"
583 -
584 -QA_PREBUILT="opt/* usr/lib*"
585 -
586 -S=${WORKDIR}/
587 -
588 -pkg_pretend() {
589 - if use amd64 && has_multilib_profile && \
590 - [ "${DEFAULT_ABI}" != "amd64" ]; then
591 - eerror "This ebuild doesn't currently support changing your default ABI"
592 - die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
593 - fi
594 -
595 - if use kernel_linux && kernel_is ge 4 4; then
596 - ewarn "Gentoo supports kernels which are supported by NVIDIA"
597 - ewarn "which are limited to the following kernels:"
598 - ewarn "<sys-kernel/gentoo-sources-4.4"
599 - ewarn "<sys-kernel/vanilla-sources-4.4"
600 - ewarn ""
601 - ewarn "You are free to utilize epatch_user to provide whatever"
602 - ewarn "support you feel is appropriate, but will not receive"
603 - ewarn "support as a result of those changes."
604 - ewarn ""
605 - ewarn "Do not file a bug report about this."
606 - ewarn ""
607 - fi
608 -
609 - # Since Nvidia ships many different series of drivers, we need to give the user
610 - # some kind of guidance as to what version they should install. This tries
611 - # to point the user in the right direction but can't be perfect. check
612 - # nvidia-driver.eclass
613 - nvidia-driver-check-warning
614 -
615 - # Kernel features/options to check for
616 - CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
617 - use x86 && CONFIG_CHECK+=" ~HIGHMEM"
618 -
619 - # Now do the above checks
620 - use kernel_linux && check_extra_config
621 -}
622 -
623 -pkg_setup() {
624 - # try to turn off distcc and ccache for people that have a problem with it
625 - export DISTCC_DISABLE=1
626 - export CCACHE_DISABLE=1
627 -
628 - if use kernel_linux; then
629 - MODULE_NAMES="nvidia(video:${S}/kernel)"
630 - use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel/uvm)"
631 -
632 - # This needs to run after MODULE_NAMES (so that the eclass checks
633 - # whether the kernel supports loadable modules) but before BUILD_PARAMS
634 - # is set (so that KV_DIR is populated).
635 - linux-mod_pkg_setup
636 -
637 - BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
638 - SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC)"
639 -
640 - # linux-mod_src_compile calls set_arch_to_kernel, which
641 - # sets the ARCH to x86 but NVIDIA's wrapping Makefile
642 - # expects x86_64 or i386 and then converts it to x86
643 - # later on in the build process
644 - BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
645 - fi
646 -
647 - # set variables to where files are in the package structure
648 - if use kernel_FreeBSD; then
649 - use x86-fbsd && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
650 - use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
651 - NV_DOC="${S}/doc"
652 - NV_OBJ="${S}/obj"
653 - NV_SRC="${S}/src"
654 - NV_MAN="${S}/x11/man"
655 - NV_X11="${S}/obj"
656 - NV_SOVER=1
657 - elif use kernel_linux; then
658 - NV_DOC="${S}"
659 - NV_OBJ="${S}"
660 - NV_SRC="${S}/kernel"
661 - NV_MAN="${S}"
662 - NV_X11="${S}"
663 - NV_SOVER=${PV}
664 - else
665 - die "Could not determine proper NVIDIA package"
666 - fi
667 -}
668 -
669 -src_prepare() {
670 - # Please add a brief description for every added patch
671 -
672 - if use kernel_linux; then
673 - if kernel_is lt 2 6 9 ; then
674 - eerror "You must build this against 2.6.9 or higher kernels."
675 - fi
676 -
677 - # If greater than 2.6.5 use M= instead of SUBDIR=
678 -# convert_to_m "${NV_SRC}"/Makefile.kbuild
679 - fi
680 -
681 - if use pax_kernel; then
682 - ewarn "Using PAX patches is not supported. You will be asked to"
683 - ewarn "use a standard kernel should you have issues. Should you"
684 - ewarn "need support with these patches, contact the PaX team."
685 - epatch "${FILESDIR}"/${PN}-331.13-pax-usercopy.patch
686 - epatch "${FILESDIR}"/${PN}-337.12-pax-constify.patch
687 - fi
688 -
689 - # Allow user patches so they can support RC kernels and whatever else
690 - epatch_user
691 -}
692 -
693 -src_compile() {
694 - # This is already the default on Linux, as there's no toplevel Makefile, but
695 - # on FreeBSD there's one and triggers the kernel module build, as we install
696 - # it by itself, pass this.
697 -
698 - cd "${NV_SRC}"
699 - if use kernel_FreeBSD; then
700 - MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
701 - LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
702 - elif use kernel_linux; then
703 - use uvm && MAKEOPTS=-j1
704 - linux-mod_src_compile
705 - fi
706 -
707 - if use tools; then
708 - emake -C "${S}"/nvidia-settings-${PV}/src/libXNVCtrl clean
709 - emake -C "${S}"/nvidia-settings-${PV}/src/libXNVCtrl \
710 - AR="$(tc-getAR)" \
711 - CC="$(tc-getCC)" \
712 - RANLIB="$(tc-getRANLIB)" \
713 - libXNVCtrl.a
714 - emake -C "${S}"/nvidia-settings-${PV}/src \
715 - AR="$(tc-getAR)" \
716 - CC="$(tc-getCC)" \
717 - LD="$(tc-getCC)" \
718 - LIBDIR="$(get_libdir)" \
719 - NVML_ENABLED=0 \
720 - NV_USE_BUNDLED_LIBJANSSON=0 \
721 - NV_VERBOSE=1 \
722 - RANLIB="$(tc-getRANLIB)" \
723 - STRIP_CMD=true
724 - fi
725 -}
726 -
727 -# Install nvidia library:
728 -# the first parameter is the library to install
729 -# the second parameter is the provided soversion
730 -# the third parameter is the target directory if its not /usr/lib
731 -donvidia() {
732 - # Full path to library minus SOVER
733 - MY_LIB="$1"
734 -
735 - # SOVER to use
736 - MY_SOVER="$2"
737 -
738 - # Where to install
739 - MY_DEST="$3"
740 -
741 - if [[ -z "${MY_DEST}" ]]; then
742 - MY_DEST="/usr/$(get_libdir)"
743 - action="dolib.so"
744 - else
745 - exeinto ${MY_DEST}
746 - action="doexe"
747 - fi
748 -
749 - # Get just the library name
750 - libname=$(basename $1)
751 -
752 - # Install the library with the correct SOVER
753 - ${action} ${MY_LIB}.${MY_SOVER} || \
754 - die "failed to install ${libname}"
755 -
756 - # If SOVER wasn't 1, then we need to create a .1 symlink
757 - if [[ "${MY_SOVER}" != "1" ]]; then
758 - dosym ${libname}.${MY_SOVER} \
759 - ${MY_DEST}/${libname}.1 || \
760 - die "failed to create ${libname} symlink"
761 - fi
762 -
763 - # Always create the symlink from the raw lib to the .1
764 - dosym ${libname}.1 \
765 - ${MY_DEST}/${libname} || \
766 - die "failed to create ${libname} symlink"
767 -}
768 -
769 -src_install() {
770 - if use kernel_linux; then
771 - linux-mod_src_install
772 -
773 - # Add the aliases
774 - # This file is tweaked with the appropriate video group in
775 - # pkg_preinst, see bug #491414
776 - insinto /etc/modprobe.d
777 - newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
778 - use uvm && doins "${FILESDIR}"/nvidia-uvm.conf
779 -
780 - # Ensures that our device nodes are created when not using X
781 - exeinto "$(get_udevdir)"
782 - newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
783 - udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
784 - elif use kernel_FreeBSD; then
785 - if use x86-fbsd; then
786 - insinto /boot/modules
787 - doins "${S}/src/nvidia.kld"
788 - fi
789 -
790 - exeinto /boot/modules
791 - doexe "${S}/src/nvidia.ko"
792 - fi
793 -
794 - # NVIDIA kernel <-> userspace driver config lib
795 - donvidia ${NV_OBJ}/libnvidia-cfg.so ${NV_SOVER}
796 -
797 - # NVIDIA framebuffer capture library
798 - donvidia ${NV_OBJ}/libnvidia-fbc.so ${NV_SOVER}
799 -
800 - # NVIDIA video encode/decode <-> CUDA
801 - if use kernel_linux; then
802 - donvidia ${NV_OBJ}/libnvcuvid.so ${NV_SOVER}
803 - donvidia ${NV_OBJ}/libnvidia-encode.so ${NV_SOVER}
804 - fi
805 -
806 - if use X; then
807 - # Xorg DDX driver
808 - insinto /usr/$(get_libdir)/xorg/modules/drivers
809 - doins ${NV_X11}/nvidia_drv.so
810 -
811 - # Xorg GLX driver
812 - donvidia ${NV_X11}/libglx.so ${NV_SOVER} \
813 - /usr/$(get_libdir)/opengl/nvidia/extensions
814 - fi
815 -
816 - # OpenCL ICD for NVIDIA
817 - if use kernel_linux; then
818 - insinto /etc/OpenCL/vendors
819 - doins ${NV_OBJ}/nvidia.icd
820 - fi
821 -
822 - # Documentation
823 - dohtml ${NV_DOC}/html/*
824 - if use kernel_FreeBSD; then
825 - dodoc "${NV_DOC}/README"
826 - use X && doman "${NV_MAN}/nvidia-xconfig.1"
827 - use tools && doman "${NV_MAN}/nvidia-settings.1"
828 - else
829 - # Docs
830 - newdoc "${NV_DOC}/README.txt" README
831 - dodoc "${NV_DOC}/NVIDIA_Changelog"
832 - doman "${NV_MAN}/nvidia-smi.1.gz"
833 - use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
834 - use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
835 - doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
836 - fi
837 -
838 - # Helper Apps
839 - exeinto /opt/bin/
840 -
841 - if use X; then
842 - doexe ${NV_OBJ}/nvidia-xconfig
843 - fi
844 -
845 - if use kernel_linux ; then
846 - doexe ${NV_OBJ}/nvidia-cuda-mps-control
847 - doexe ${NV_OBJ}/nvidia-cuda-mps-server
848 - doexe ${NV_OBJ}/nvidia-debugdump
849 - doexe ${NV_OBJ}/nvidia-persistenced
850 - doexe ${NV_OBJ}/nvidia-smi
851 -
852 - # install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
853 - doexe ${NV_OBJ}/nvidia-modprobe
854 - fowners root:video /opt/bin/nvidia-modprobe
855 - fperms 4710 /opt/bin/nvidia-modprobe
856 - dosym /{opt,usr}/bin/nvidia-modprobe
857 -
858 - doman nvidia-cuda-mps-control.1.gz
859 - doman nvidia-modprobe.1.gz
860 - doman nvidia-persistenced.1.gz
861 - newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
862 - newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
863 - newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
864 - fi
865 -
866 - if use tools; then
867 - emake -C "${S}"/nvidia-settings-${PV}/src/ \
868 - DESTDIR="${D}" \
869 - LIBDIR="${D}/usr/$(get_libdir)" \
870 - PREFIX=/usr \
871 - NV_USE_BUNDLED_LIBJANSSON=0 \
872 - install
873 -
874 - if use static-libs; then
875 - dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
876 -
877 - insinto /usr/include/NVCtrl
878 - doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
879 - fi
880 -
881 - insinto /usr/share/nvidia/
882 - doins nvidia-application-profiles-${PV}-key-documentation
883 -
884 - insinto /etc/nvidia
885 - newins \
886 - nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
887 -
888 - # There is no icon in the FreeBSD tarball.
889 - use kernel_FreeBSD || \
890 - newicon ${NV_OBJ}/nvidia-settings.png ${PN}-settings.png
891 -
892 - domenu "${FILESDIR}"/${PN}-settings.desktop
893 -
894 - exeinto /etc/X11/xinit/xinitrc.d
895 - doexe "${FILESDIR}"/95-nvidia-settings
896 -
897 - fi
898 -
899 - dobin ${NV_OBJ}/nvidia-bug-report.sh
900 -
901 - #doenvd "${FILESDIR}"/50nvidia-prelink-blacklist
902 -
903 - if has_multilib_profile && use multilib ; then
904 - local OABI=${ABI}
905 - for ABI in $(get_install_abis) ; do
906 - src_install-libs
907 - done
908 - ABI=${OABI}
909 - unset OABI
910 - else
911 - src_install-libs
912 - fi
913 -
914 - is_final_abi || die "failed to iterate through all ABIs"
915 -
916 - readme.gentoo_create_doc
917 -}
918 -
919 -src_install-libs() {
920 - local inslibdir=$(get_libdir)
921 - local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
922 - local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
923 - local libdir=${NV_OBJ}
924 -
925 - if use kernel_linux && has_multilib_profile && \
926 - [[ ${ABI} == "x86" ]] ; then
927 - libdir=${NV_OBJ}/32
928 - fi
929 -
930 - if use X; then
931 - # The GLX libraries
932 - donvidia ${libdir}/libEGL.so ${NV_SOVER} ${GL_ROOT}
933 - donvidia ${libdir}/libGL.so ${NV_SOVER} ${GL_ROOT}
934 - donvidia ${libdir}/libGLESv1_CM.so ${NV_SOVER} ${GL_ROOT}
935 - donvidia ${libdir}/libnvidia-eglcore.so ${NV_SOVER}
936 - donvidia ${libdir}/libnvidia-glcore.so ${NV_SOVER}
937 - donvidia ${libdir}/libnvidia-glsi.so ${NV_SOVER}
938 - donvidia ${libdir}/libnvidia-ifr.so ${NV_SOVER}
939 - if use kernel_FreeBSD; then
940 - donvidia ${libdir}/libnvidia-tls.so ${NV_SOVER}
941 - else
942 - donvidia ${libdir}/tls/libnvidia-tls.so ${NV_SOVER}
943 - fi
944 -
945 - # VDPAU
946 - donvidia ${libdir}/libvdpau_nvidia.so ${NV_SOVER}
947 -
948 - # GLES v2 libraries
949 - insinto ${GL_ROOT}
950 - doexe ${libdir}/libGLESv2.so.${PV}
951 - dosym libGLESv2.so.${PV} ${GL_ROOT}/libGLESv2.so.2
952 - dosym libGLESv2.so.2 ${GL_ROOT}/libGLESv2.so
953 - fi
954 -
955 - # NVIDIA monitoring library
956 - if use kernel_linux ; then
957 - donvidia ${libdir}/libnvidia-ml.so ${NV_SOVER}
958 - fi
959 -
960 - # CUDA & OpenCL
961 - if use kernel_linux; then
962 - donvidia ${libdir}/libcuda.so ${NV_SOVER}
963 - donvidia ${libdir}/libnvidia-compiler.so ${NV_SOVER}
964 - donvidia ${libdir}/libOpenCL.so 1.0.0 ${CL_ROOT}
965 - donvidia ${libdir}/libnvidia-opencl.so ${NV_SOVER}
966 - fi
967 -}
968 -
969 -pkg_preinst() {
970 - if use kernel_linux; then
971 - linux-mod_pkg_preinst
972 -
973 - local videogroup="$(egetent group video | cut -d ':' -f 3)"
974 - if [ -z "${videogroup}" ]; then
975 - eerror "Failed to determine the video group gid"
976 - die "Failed to determine the video group gid"
977 - else
978 - sed -i \
979 - -e "s:PACKAGE:${PF}:g" \
980 - -e "s:VIDEOGID:${videogroup}:" \
981 - "${D}"/etc/modprobe.d/nvidia.conf || die
982 - fi
983 - fi
984 -
985 - # Clean the dynamic libGL stuff's home to ensure
986 - # we dont have stale libs floating around
987 - if [ -d "${ROOT}"/usr/lib/opengl/nvidia ] ; then
988 - rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
989 - fi
990 - # Make sure we nuke the old nvidia-glx's env.d file
991 - if [ -e "${ROOT}"/etc/env.d/09nvidia ] ; then
992 - rm -f "${ROOT}"/etc/env.d/09nvidia
993 - fi
994 -}
995 -
996 -pkg_postinst() {
997 - use kernel_linux && linux-mod_pkg_postinst
998 -
999 - # Switch to the nvidia implementation
1000 - use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
1001 - "${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
1002 -
1003 - readme.gentoo_print_elog
1004 -
1005 - if ! use X; then
1006 - elog "You have elected to not install the X.org driver. Along with"
1007 - elog "this the OpenGL libraries and VDPAU libraries were not"
1008 - elog "installed. Additionally, once the driver is loaded your card"
1009 - elog "and fan will run at max speed which may not be desirable."
1010 - elog "Use the 'nvidia-smi' init script to have your card and fan"
1011 - elog "speed scale appropriately."
1012 - elog
1013 - fi
1014 - if ! use tools; then
1015 - elog "USE=tools controls whether the nvidia-settings application"
1016 - elog "is installed. If you would like to use it, enable that"
1017 - elog "flag and re-emerge this ebuild. Optionally you can install"
1018 - elog "media-video/nvidia-settings"
1019 - elog
1020 - fi
1021 -}
1022 -
1023 -pkg_prerm() {
1024 - use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
1025 -}
1026 -
1027 -pkg_postrm() {
1028 - use kernel_linux && linux-mod_pkg_postrm
1029 - use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
1030 -}
1031
1032 diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-346.96-r2.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-346.96-r2.ebuild
1033 deleted file mode 100644
1034 index 9a45b18..0000000
1035 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-346.96-r2.ebuild
1036 +++ /dev/null
1037 @@ -1,489 +0,0 @@
1038 -# Copyright 1999-2015 Gentoo Foundation
1039 -# Distributed under the terms of the GNU General Public License v2
1040 -# $Id$
1041 -
1042 -EAPI=5
1043 -
1044 -inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \
1045 - portability toolchain-funcs unpacker user udev
1046 -
1047 -NV_URI="http://us.download.nvidia.com/XFree86/"
1048 -X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
1049 -AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
1050 -X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
1051 -AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
1052 -
1053 -DESCRIPTION="NVIDIA Accelerated Graphics Driver"
1054 -HOMEPAGE="http://www.nvidia.com/"
1055 -SRC_URI="
1056 - amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
1057 - amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
1058 - x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
1059 - x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
1060 -"
1061 -
1062 -LICENSE="GPL-2 NVIDIA-r2"
1063 -SLOT="0/${PV%.*}"
1064 -KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
1065 -RESTRICT="bindist mirror strip"
1066 -EMULTILIB_PKG="true"
1067 -
1068 -IUSE="acpi multilib kernel_FreeBSD kernel_linux pax_kernel +tools gtk2 gtk3 +X uvm"
1069 -REQUIRED_USE="
1070 - tools? ( X || ( gtk2 gtk3 ) )
1071 -"
1072 -
1073 -COMMON="
1074 - app-eselect/eselect-opencl
1075 - kernel_linux? ( >=sys-libs/glibc-2.6.1 )
1076 - X? (
1077 - >=app-eselect/eselect-opengl-1.0.9
1078 - )
1079 -"
1080 -DEPEND="
1081 - ${COMMON}
1082 - app-arch/xz-utils
1083 - kernel_linux? ( virtual/linux-sources )
1084 -"
1085 -RDEPEND="
1086 - ${COMMON}
1087 - acpi? ( sys-power/acpid )
1088 - tools? (
1089 - dev-libs/atk
1090 - dev-libs/glib:2
1091 - x11-libs/gdk-pixbuf
1092 - gtk2? ( >=x11-libs/gtk+-2.4:2 )
1093 - gtk3? ( x11-libs/gtk+:3 )
1094 - x11-libs/libX11
1095 - x11-libs/libXext
1096 - x11-libs/pango[X]
1097 - )
1098 - X? (
1099 - <x11-base/xorg-server-1.18.99:=
1100 - >=x11-libs/libvdpau-0.3-r1
1101 - multilib? (
1102 - >=x11-libs/libX11-1.6.2[abi_x86_32]
1103 - >=x11-libs/libXext-1.3.2[abi_x86_32]
1104 - )
1105 - )
1106 -"
1107 -
1108 -QA_PREBUILT="opt/* usr/lib*"
1109 -
1110 -S=${WORKDIR}/
1111 -
1112 -pkg_pretend() {
1113 - if use amd64 && has_multilib_profile && \
1114 - [ "${DEFAULT_ABI}" != "amd64" ]; then
1115 - eerror "This ebuild doesn't currently support changing your default ABI"
1116 - die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
1117 - fi
1118 -
1119 - if use kernel_linux && kernel_is ge 4 3; then
1120 - ewarn "Gentoo supports kernels which are supported by NVIDIA"
1121 - ewarn "which are limited to the following kernels:"
1122 - ewarn "<sys-kernel/gentoo-sources-4.3"
1123 - ewarn "<sys-kernel/vanilla-sources-4.3"
1124 - ewarn ""
1125 - ewarn "You are free to utilize epatch_user to provide whatever"
1126 - ewarn "support you feel is appropriate, but will not receive"
1127 - ewarn "support as a result of those changes."
1128 - ewarn ""
1129 - ewarn "Do not file a bug report about this."
1130 - fi
1131 -
1132 - # Since Nvidia ships many different series of drivers, we need to give the user
1133 - # some kind of guidance as to what version they should install. This tries
1134 - # to point the user in the right direction but can't be perfect. check
1135 - # nvidia-driver.eclass
1136 - nvidia-driver-check-warning
1137 -
1138 - # Kernel features/options to check for
1139 - CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
1140 - use x86 && CONFIG_CHECK+=" ~HIGHMEM"
1141 -
1142 - # Now do the above checks
1143 - use kernel_linux && check_extra_config
1144 -}
1145 -
1146 -pkg_setup() {
1147 - # try to turn off distcc and ccache for people that have a problem with it
1148 - export DISTCC_DISABLE=1
1149 - export CCACHE_DISABLE=1
1150 -
1151 - if use kernel_linux; then
1152 - MODULE_NAMES="nvidia(video:${S}/kernel)"
1153 - use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel/uvm)"
1154 -
1155 - # This needs to run after MODULE_NAMES (so that the eclass checks
1156 - # whether the kernel supports loadable modules) but before BUILD_PARAMS
1157 - # is set (so that KV_DIR is populated).
1158 - linux-mod_pkg_setup
1159 -
1160 - BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
1161 - SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC)"
1162 -
1163 - # linux-mod_src_compile calls set_arch_to_kernel, which
1164 - # sets the ARCH to x86 but NVIDIA's wrapping Makefile
1165 - # expects x86_64 or i386 and then converts it to x86
1166 - # later on in the build process
1167 - BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
1168 - fi
1169 -
1170 - # set variables to where files are in the package structure
1171 - if use kernel_FreeBSD; then
1172 - use x86-fbsd && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
1173 - use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
1174 - NV_DOC="${S}/doc"
1175 - NV_OBJ="${S}/obj"
1176 - NV_SRC="${S}/src"
1177 - NV_MAN="${S}/x11/man"
1178 - NV_X11="${S}/obj"
1179 - NV_SOVER=1
1180 - elif use kernel_linux; then
1181 - NV_DOC="${S}"
1182 - NV_OBJ="${S}"
1183 - NV_SRC="${S}/kernel"
1184 - NV_MAN="${S}"
1185 - NV_X11="${S}"
1186 - NV_SOVER=${PV}
1187 - else
1188 - die "Could not determine proper NVIDIA package"
1189 - fi
1190 -}
1191 -
1192 -src_prepare() {
1193 - # Please add a brief description for every added patch
1194 -
1195 - if use kernel_linux; then
1196 - if kernel_is lt 2 6 9 ; then
1197 - eerror "You must build this against 2.6.9 or higher kernels."
1198 - fi
1199 -
1200 - # If greater than 2.6.5 use M= instead of SUBDIR=
1201 -# convert_to_m "${NV_SRC}"/Makefile.kbuild
1202 - fi
1203 -
1204 - if use pax_kernel; then
1205 - ewarn "Using PAX patches is not supported. You will be asked to"
1206 - ewarn "use a standard kernel should you have issues. Should you"
1207 - ewarn "need support with these patches, contact the PaX team."
1208 - epatch "${FILESDIR}"/${PN}-346.16-pax-usercopy.patch
1209 - epatch "${FILESDIR}"/${PN}-346.16-pax-constify.patch
1210 - fi
1211 -
1212 - # Allow user patches so they can support RC kernels and whatever else
1213 - epatch_user
1214 -}
1215 -
1216 -src_compile() {
1217 - # This is already the default on Linux, as there's no toplevel Makefile, but
1218 - # on FreeBSD there's one and triggers the kernel module build, as we install
1219 - # it by itself, pass this.
1220 -
1221 - cd "${NV_SRC}"
1222 - if use kernel_FreeBSD; then
1223 - MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
1224 - LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
1225 - elif use kernel_linux; then
1226 - MAKEOPTS=-j1
1227 - linux-mod_src_compile
1228 - fi
1229 -}
1230 -
1231 -# Install nvidia library:
1232 -# the first parameter is the library to install
1233 -# the second parameter is the provided soversion
1234 -# the third parameter is the target directory if its not /usr/lib
1235 -donvidia() {
1236 - # Full path to library minus SOVER
1237 - MY_LIB="$1"
1238 -
1239 - # SOVER to use
1240 - MY_SOVER="$2"
1241 -
1242 - # Where to install
1243 - MY_DEST="$3"
1244 -
1245 - if [[ -z "${MY_DEST}" ]]; then
1246 - MY_DEST="/usr/$(get_libdir)"
1247 - action="dolib.so"
1248 - else
1249 - exeinto ${MY_DEST}
1250 - action="doexe"
1251 - fi
1252 -
1253 - # Get just the library name
1254 - libname=$(basename $1)
1255 -
1256 - # Install the library with the correct SOVER
1257 - ${action} ${MY_LIB}.${MY_SOVER} || \
1258 - die "failed to install ${libname}"
1259 -
1260 - # If SOVER wasn't 1, then we need to create a .1 symlink
1261 - if [[ "${MY_SOVER}" != "1" ]]; then
1262 - dosym ${libname}.${MY_SOVER} \
1263 - ${MY_DEST}/${libname}.1 || \
1264 - die "failed to create ${libname} symlink"
1265 - fi
1266 -
1267 - # Always create the symlink from the raw lib to the .1
1268 - dosym ${libname}.1 \
1269 - ${MY_DEST}/${libname} || \
1270 - die "failed to create ${libname} symlink"
1271 -}
1272 -
1273 -src_install() {
1274 - if use kernel_linux; then
1275 - linux-mod_src_install
1276 -
1277 - # Add the aliases
1278 - # This file is tweaked with the appropriate video group in
1279 - # pkg_preinst, see bug #491414
1280 - insinto /etc/modprobe.d
1281 - newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
1282 - use uvm && doins "${FILESDIR}"/nvidia-uvm.conf
1283 -
1284 - # Ensures that our device nodes are created when not using X
1285 - exeinto "$(get_udevdir)"
1286 - newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
1287 - udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
1288 - elif use kernel_FreeBSD; then
1289 - if use x86-fbsd; then
1290 - insinto /boot/modules
1291 - doins "${S}/src/nvidia.kld"
1292 - fi
1293 -
1294 - exeinto /boot/modules
1295 - doexe "${S}/src/nvidia.ko"
1296 - fi
1297 -
1298 - # NVIDIA kernel <-> userspace driver config lib
1299 - donvidia ${NV_OBJ}/libnvidia-cfg.so ${NV_SOVER}
1300 -
1301 - # NVIDIA framebuffer capture library
1302 - donvidia ${NV_OBJ}/libnvidia-fbc.so ${NV_SOVER}
1303 -
1304 - # NVIDIA video encode/decode <-> CUDA
1305 - if use kernel_linux; then
1306 - donvidia ${NV_OBJ}/libnvcuvid.so ${NV_SOVER}
1307 - donvidia ${NV_OBJ}/libnvidia-encode.so ${NV_SOVER}
1308 - fi
1309 -
1310 - if use X; then
1311 - # Xorg DDX driver
1312 - insinto /usr/$(get_libdir)/xorg/modules/drivers
1313 - doins ${NV_X11}/nvidia_drv.so
1314 -
1315 - # Xorg GLX driver
1316 - donvidia ${NV_X11}/libglx.so ${NV_SOVER} \
1317 - /usr/$(get_libdir)/opengl/nvidia/extensions
1318 -
1319 - # Xorg nvidia.conf
1320 - if has_version '>=x11-base/xorg-server-1.16'; then
1321 - insinto /usr/share/X11/xorg.conf.d
1322 - newins {,50-}nvidia-drm-outputclass.conf
1323 - fi
1324 - fi
1325 -
1326 - # OpenCL ICD for NVIDIA
1327 - if use kernel_linux; then
1328 - insinto /etc/OpenCL/vendors
1329 - doins ${NV_OBJ}/nvidia.icd
1330 - fi
1331 -
1332 - # Documentation
1333 - dohtml ${NV_DOC}/html/*
1334 - if use kernel_FreeBSD; then
1335 - dodoc "${NV_DOC}/README"
1336 - use X && doman "${NV_MAN}/nvidia-xconfig.1"
1337 - use tools && doman "${NV_MAN}/nvidia-settings.1"
1338 - else
1339 - # Docs
1340 - newdoc "${NV_DOC}/README.txt" README
1341 - dodoc "${NV_DOC}/NVIDIA_Changelog"
1342 - doman "${NV_MAN}/nvidia-smi.1.gz"
1343 - use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
1344 - use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
1345 - doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
1346 - fi
1347 -
1348 - # Helper Apps
1349 - exeinto /opt/bin/
1350 -
1351 - if use X; then
1352 - doexe ${NV_OBJ}/nvidia-xconfig
1353 - fi
1354 -
1355 - if use kernel_linux ; then
1356 - doexe ${NV_OBJ}/nvidia-cuda-mps-control
1357 - doexe ${NV_OBJ}/nvidia-cuda-mps-server
1358 - doexe ${NV_OBJ}/nvidia-debugdump
1359 - doexe ${NV_OBJ}/nvidia-persistenced
1360 - doexe ${NV_OBJ}/nvidia-smi
1361 -
1362 - # install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
1363 - doexe ${NV_OBJ}/nvidia-modprobe
1364 - fowners root:video /opt/bin/nvidia-modprobe
1365 - fperms 4710 /opt/bin/nvidia-modprobe
1366 - dosym /{opt,usr}/bin/nvidia-modprobe
1367 -
1368 - doman nvidia-cuda-mps-control.1.gz
1369 - doman nvidia-modprobe.1.gz
1370 - doman nvidia-persistenced.1.gz
1371 - newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
1372 - newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
1373 - newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
1374 - fi
1375 -
1376 - if use tools; then
1377 - doexe ${NV_OBJ}/nvidia-settings
1378 - use gtk2 && donvidia libnvidia-gtk2.so ${PV}
1379 - use gtk3 && donvidia libnvidia-gtk3.so ${PV}
1380 - insinto /usr/share/nvidia/
1381 - doins nvidia-application-profiles-${PV}-key-documentation
1382 - insinto /etc/nvidia
1383 - newins nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
1384 - fi
1385 -
1386 - dobin ${NV_OBJ}/nvidia-bug-report.sh
1387 -
1388 - # Desktop entries for nvidia-settings
1389 - if use tools ; then
1390 - # There is no icon in the FreeBSD tarball.
1391 - use kernel_FreeBSD || newicon ${NV_OBJ}/nvidia-settings.png ${PN}-settings.png
1392 - domenu "${FILESDIR}"/${PN}-settings.desktop
1393 - exeinto /etc/X11/xinit/xinitrc.d
1394 - doexe "${FILESDIR}"/95-nvidia-settings
1395 - fi
1396 -
1397 - #doenvd "${FILESDIR}"/50nvidia-prelink-blacklist
1398 -
1399 - if has_multilib_profile && use multilib ; then
1400 - local OABI=${ABI}
1401 - for ABI in $(get_install_abis) ; do
1402 - src_install-libs
1403 - done
1404 - ABI=${OABI}
1405 - unset OABI
1406 - else
1407 - src_install-libs
1408 - fi
1409 -
1410 - is_final_abi || die "failed to iterate through all ABIs"
1411 -
1412 - readme.gentoo_create_doc
1413 -}
1414 -
1415 -src_install-libs() {
1416 - local inslibdir=$(get_libdir)
1417 - local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
1418 - local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
1419 - local libdir=${NV_OBJ}
1420 -
1421 - if use kernel_linux && has_multilib_profile && \
1422 - [[ ${ABI} == "x86" ]] ; then
1423 - libdir=${NV_OBJ}/32
1424 - fi
1425 -
1426 - if use X; then
1427 - # The GLX libraries
1428 - donvidia ${libdir}/libEGL.so ${NV_SOVER} ${GL_ROOT}
1429 - donvidia ${libdir}/libGL.so ${NV_SOVER} ${GL_ROOT}
1430 - donvidia ${libdir}/libGLESv1_CM.so ${NV_SOVER} ${GL_ROOT}
1431 - donvidia ${libdir}/libnvidia-eglcore.so ${NV_SOVER}
1432 - donvidia ${libdir}/libnvidia-glcore.so ${NV_SOVER}
1433 - donvidia ${libdir}/libnvidia-glsi.so ${NV_SOVER}
1434 - donvidia ${libdir}/libnvidia-ifr.so ${NV_SOVER}
1435 - if use kernel_FreeBSD; then
1436 - donvidia ${libdir}/libnvidia-tls.so ${NV_SOVER}
1437 - else
1438 - donvidia ${libdir}/tls/libnvidia-tls.so ${NV_SOVER}
1439 - fi
1440 -
1441 - # VDPAU
1442 - donvidia ${libdir}/libvdpau_nvidia.so ${NV_SOVER}
1443 -
1444 - # GLES v2 libraries
1445 - insinto ${GL_ROOT}
1446 - doexe ${libdir}/libGLESv2.so.${PV}
1447 - dosym libGLESv2.so.${PV} ${GL_ROOT}/libGLESv2.so.2
1448 - dosym libGLESv2.so.2 ${GL_ROOT}/libGLESv2.so
1449 - fi
1450 -
1451 - # NVIDIA monitoring library
1452 - if use kernel_linux ; then
1453 - donvidia ${libdir}/libnvidia-ml.so ${NV_SOVER}
1454 - fi
1455 -
1456 - # CUDA & OpenCL
1457 - if use kernel_linux; then
1458 - donvidia ${libdir}/libcuda.so ${NV_SOVER}
1459 - donvidia ${libdir}/libnvidia-compiler.so ${NV_SOVER}
1460 - donvidia ${libdir}/libOpenCL.so 1.0.0 ${CL_ROOT}
1461 - donvidia ${libdir}/libnvidia-opencl.so ${NV_SOVER}
1462 - fi
1463 -}
1464 -
1465 -pkg_preinst() {
1466 - if use kernel_linux; then
1467 - linux-mod_pkg_preinst
1468 -
1469 - local videogroup="$(egetent group video | cut -d ':' -f 3)"
1470 - if [ -z "${videogroup}" ]; then
1471 - eerror "Failed to determine the video group gid"
1472 - die "Failed to determine the video group gid"
1473 - else
1474 - sed -i \
1475 - -e "s:PACKAGE:${PF}:g" \
1476 - -e "s:VIDEOGID:${videogroup}:" \
1477 - "${D}"/etc/modprobe.d/nvidia.conf || die
1478 - fi
1479 - fi
1480 -
1481 - # Clean the dynamic libGL stuff's home to ensure
1482 - # we dont have stale libs floating around
1483 - if [ -d "${ROOT}"/usr/lib/opengl/nvidia ] ; then
1484 - rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
1485 - fi
1486 - # Make sure we nuke the old nvidia-glx's env.d file
1487 - if [ -e "${ROOT}"/etc/env.d/09nvidia ] ; then
1488 - rm -f "${ROOT}"/etc/env.d/09nvidia
1489 - fi
1490 -}
1491 -
1492 -pkg_postinst() {
1493 - use kernel_linux && linux-mod_pkg_postinst
1494 -
1495 - # Switch to the nvidia implementation
1496 - use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
1497 - "${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
1498 -
1499 - readme.gentoo_print_elog
1500 -
1501 - if ! use X; then
1502 - elog "You have elected to not install the X.org driver. Along with"
1503 - elog "this the OpenGL libraries and VDPAU libraries were not"
1504 - elog "installed. Additionally, once the driver is loaded your card"
1505 - elog "and fan will run at max speed which may not be desirable."
1506 - elog "Use the 'nvidia-smi' init script to have your card and fan"
1507 - elog "speed scale appropriately."
1508 - elog
1509 - fi
1510 - if ! use tools; then
1511 - elog "USE=tools controls whether the nvidia-settings application"
1512 - elog "is installed. If you would like to use it, enable that"
1513 - elog "flag and re-emerge this ebuild. Optionally you can install"
1514 - elog "media-video/nvidia-settings"
1515 - elog
1516 - fi
1517 -}
1518 -
1519 -pkg_prerm() {
1520 - use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
1521 -}
1522 -
1523 -pkg_postrm() {
1524 - use kernel_linux && linux-mod_pkg_postrm
1525 - use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
1526 -}
1527
1528 diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-346.96-r3.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-346.96-r3.ebuild
1529 deleted file mode 100644
1530 index e661328..0000000
1531 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-346.96-r3.ebuild
1532 +++ /dev/null
1533 @@ -1,528 +0,0 @@
1534 -# Copyright 1999-2015 Gentoo Foundation
1535 -# Distributed under the terms of the GNU General Public License v2
1536 -# $Id$
1537 -
1538 -EAPI=5
1539 -
1540 -inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \
1541 - portability toolchain-funcs unpacker user udev
1542 -
1543 -NV_URI="http://us.download.nvidia.com/XFree86/"
1544 -X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
1545 -AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
1546 -X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
1547 -AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
1548 -
1549 -DESCRIPTION="NVIDIA Accelerated Graphics Driver"
1550 -HOMEPAGE="http://www.nvidia.com/"
1551 -SRC_URI="
1552 - amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
1553 - amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
1554 - x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
1555 - x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
1556 - tools? ( ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2 )
1557 -"
1558 -
1559 -LICENSE="GPL-2 NVIDIA-r2"
1560 -SLOT="0/${PV%.*}"
1561 -KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
1562 -RESTRICT="bindist mirror strip"
1563 -EMULTILIB_PKG="true"
1564 -
1565 -IUSE="acpi gtk3 kernel_FreeBSD kernel_linux multilib pax_kernel static-libs +tools uvm +X"
1566 -REQUIRED_USE="
1567 - tools? ( X )
1568 - static-libs? ( tools )
1569 -"
1570 -
1571 -COMMON="
1572 - app-eselect/eselect-opencl
1573 - kernel_linux? ( >=sys-libs/glibc-2.6.1 )
1574 - tools? (
1575 - dev-libs/atk
1576 - dev-libs/glib:2
1577 - dev-libs/jansson
1578 - gtk3? ( x11-libs/gtk+:3 )
1579 - x11-libs/cairo
1580 - x11-libs/gdk-pixbuf[X]
1581 - x11-libs/gtk+:2
1582 - x11-libs/libX11
1583 - x11-libs/libXext
1584 - x11-libs/libXrandr
1585 - x11-libs/libXv
1586 - x11-libs/libXxf86vm
1587 - x11-libs/pango[X]
1588 - )
1589 - X? (
1590 - >=app-eselect/eselect-opengl-1.0.9
1591 - )
1592 -"
1593 -DEPEND="
1594 - ${COMMON}
1595 - app-arch/xz-utils
1596 - kernel_linux? ( virtual/linux-sources )
1597 -"
1598 -RDEPEND="
1599 - ${COMMON}
1600 - acpi? ( sys-power/acpid )
1601 - tools? ( !media-video/nvidia-settings )
1602 - X? (
1603 - <x11-base/xorg-server-1.18.99:=
1604 - >=x11-libs/libvdpau-0.3-r1
1605 - multilib? (
1606 - >=x11-libs/libX11-1.6.2[abi_x86_32]
1607 - >=x11-libs/libXext-1.3.2[abi_x86_32]
1608 - )
1609 - )
1610 -"
1611 -
1612 -QA_PREBUILT="opt/* usr/lib*"
1613 -
1614 -S=${WORKDIR}/
1615 -
1616 -pkg_pretend() {
1617 - if use amd64 && has_multilib_profile && \
1618 - [ "${DEFAULT_ABI}" != "amd64" ]; then
1619 - eerror "This ebuild doesn't currently support changing your default ABI"
1620 - die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
1621 - fi
1622 -
1623 - if use kernel_linux && kernel_is ge 4 3; then
1624 - ewarn "Gentoo supports kernels which are supported by NVIDIA"
1625 - ewarn "which are limited to the following kernels:"
1626 - ewarn "<sys-kernel/gentoo-sources-4.3"
1627 - ewarn "<sys-kernel/vanilla-sources-4.3"
1628 - ewarn ""
1629 - ewarn "You are free to utilize epatch_user to provide whatever"
1630 - ewarn "support you feel is appropriate, but will not receive"
1631 - ewarn "support as a result of those changes."
1632 - ewarn ""
1633 - ewarn "Do not file a bug report about this."
1634 - fi
1635 -
1636 - # Since Nvidia ships many different series of drivers, we need to give the user
1637 - # some kind of guidance as to what version they should install. This tries
1638 - # to point the user in the right direction but can't be perfect. check
1639 - # nvidia-driver.eclass
1640 - nvidia-driver-check-warning
1641 -
1642 - # Kernel features/options to check for
1643 - CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
1644 - use x86 && CONFIG_CHECK+=" ~HIGHMEM"
1645 -
1646 - # Now do the above checks
1647 - use kernel_linux && check_extra_config
1648 -}
1649 -
1650 -pkg_setup() {
1651 - # try to turn off distcc and ccache for people that have a problem with it
1652 - export DISTCC_DISABLE=1
1653 - export CCACHE_DISABLE=1
1654 -
1655 - if use kernel_linux; then
1656 - MODULE_NAMES="nvidia(video:${S}/kernel)"
1657 - use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel/uvm)"
1658 -
1659 - # This needs to run after MODULE_NAMES (so that the eclass checks
1660 - # whether the kernel supports loadable modules) but before BUILD_PARAMS
1661 - # is set (so that KV_DIR is populated).
1662 - linux-mod_pkg_setup
1663 -
1664 - BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
1665 - SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC)"
1666 -
1667 - # linux-mod_src_compile calls set_arch_to_kernel, which
1668 - # sets the ARCH to x86 but NVIDIA's wrapping Makefile
1669 - # expects x86_64 or i386 and then converts it to x86
1670 - # later on in the build process
1671 - BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
1672 - fi
1673 -
1674 - # set variables to where files are in the package structure
1675 - if use kernel_FreeBSD; then
1676 - use x86-fbsd && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
1677 - use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
1678 - NV_DOC="${S}/doc"
1679 - NV_OBJ="${S}/obj"
1680 - NV_SRC="${S}/src"
1681 - NV_MAN="${S}/x11/man"
1682 - NV_X11="${S}/obj"
1683 - NV_SOVER=1
1684 - elif use kernel_linux; then
1685 - NV_DOC="${S}"
1686 - NV_OBJ="${S}"
1687 - NV_SRC="${S}/kernel"
1688 - NV_MAN="${S}"
1689 - NV_X11="${S}"
1690 - NV_SOVER=${PV}
1691 - else
1692 - die "Could not determine proper NVIDIA package"
1693 - fi
1694 -}
1695 -
1696 -src_prepare() {
1697 - # Please add a brief description for every added patch
1698 -
1699 - if use kernel_linux; then
1700 - if kernel_is lt 2 6 9 ; then
1701 - eerror "You must build this against 2.6.9 or higher kernels."
1702 - fi
1703 -
1704 - # If greater than 2.6.5 use M= instead of SUBDIR=
1705 -# convert_to_m "${NV_SRC}"/Makefile.kbuild
1706 - fi
1707 -
1708 - if use pax_kernel; then
1709 - ewarn "Using PAX patches is not supported. You will be asked to"
1710 - ewarn "use a standard kernel should you have issues. Should you"
1711 - ewarn "need support with these patches, contact the PaX team."
1712 - epatch "${FILESDIR}"/${PN}-346.16-pax-usercopy.patch
1713 - epatch "${FILESDIR}"/${PN}-346.16-pax-constify.patch
1714 - fi
1715 -
1716 - # Allow user patches so they can support RC kernels and whatever else
1717 - epatch_user
1718 -}
1719 -
1720 -src_compile() {
1721 - # This is already the default on Linux, as there's no toplevel Makefile, but
1722 - # on FreeBSD there's one and triggers the kernel module build, as we install
1723 - # it by itself, pass this.
1724 -
1725 - cd "${NV_SRC}"
1726 - if use kernel_FreeBSD; then
1727 - MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
1728 - LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
1729 - elif use kernel_linux; then
1730 - MAKEOPTS=-j1
1731 - linux-mod_src_compile
1732 - fi
1733 -
1734 - if use tools; then
1735 - emake -C "${S}"/nvidia-settings-${PV}/src \
1736 - AR="$(tc-getAR)" \
1737 - CC="$(tc-getCC)" \
1738 - LIBDIR="$(get_libdir)" \
1739 - RANLIB="$(tc-getRANLIB)" \
1740 - build-xnvctrl
1741 -
1742 - emake -C "${S}"/nvidia-settings-${PV}/src \
1743 - CC="$(tc-getCC)" \
1744 - GTK3_AVAILABLE=$(usex gtk3 1 0) \
1745 - LD="$(tc-getCC)" \
1746 - LIBDIR="$(get_libdir)" \
1747 - NVML_ENABLED=0 \
1748 - NV_USE_BUNDLED_LIBJANSSON=0 \
1749 - NV_VERBOSE=1 \
1750 - STRIP_CMD=true
1751 - fi
1752 -}
1753 -
1754 -# Install nvidia library:
1755 -# the first parameter is the library to install
1756 -# the second parameter is the provided soversion
1757 -# the third parameter is the target directory if its not /usr/lib
1758 -donvidia() {
1759 - # Full path to library minus SOVER
1760 - MY_LIB="$1"
1761 -
1762 - # SOVER to use
1763 - MY_SOVER="$2"
1764 -
1765 - # Where to install
1766 - MY_DEST="$3"
1767 -
1768 - if [[ -z "${MY_DEST}" ]]; then
1769 - MY_DEST="/usr/$(get_libdir)"
1770 - action="dolib.so"
1771 - else
1772 - exeinto ${MY_DEST}
1773 - action="doexe"
1774 - fi
1775 -
1776 - # Get just the library name
1777 - libname=$(basename $1)
1778 -
1779 - # Install the library with the correct SOVER
1780 - ${action} ${MY_LIB}.${MY_SOVER} || \
1781 - die "failed to install ${libname}"
1782 -
1783 - # If SOVER wasn't 1, then we need to create a .1 symlink
1784 - if [[ "${MY_SOVER}" != "1" ]]; then
1785 - dosym ${libname}.${MY_SOVER} \
1786 - ${MY_DEST}/${libname}.1 || \
1787 - die "failed to create ${libname} symlink"
1788 - fi
1789 -
1790 - # Always create the symlink from the raw lib to the .1
1791 - dosym ${libname}.1 \
1792 - ${MY_DEST}/${libname} || \
1793 - die "failed to create ${libname} symlink"
1794 -}
1795 -
1796 -src_install() {
1797 - if use kernel_linux; then
1798 - linux-mod_src_install
1799 -
1800 - # Add the aliases
1801 - # This file is tweaked with the appropriate video group in
1802 - # pkg_preinst, see bug #491414
1803 - insinto /etc/modprobe.d
1804 - newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
1805 - use uvm && doins "${FILESDIR}"/nvidia-uvm.conf
1806 -
1807 - # Ensures that our device nodes are created when not using X
1808 - exeinto "$(get_udevdir)"
1809 - newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
1810 - udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
1811 - elif use kernel_FreeBSD; then
1812 - if use x86-fbsd; then
1813 - insinto /boot/modules
1814 - doins "${S}/src/nvidia.kld"
1815 - fi
1816 -
1817 - exeinto /boot/modules
1818 - doexe "${S}/src/nvidia.ko"
1819 - fi
1820 -
1821 - # NVIDIA kernel <-> userspace driver config lib
1822 - donvidia ${NV_OBJ}/libnvidia-cfg.so ${NV_SOVER}
1823 -
1824 - # NVIDIA framebuffer capture library
1825 - donvidia ${NV_OBJ}/libnvidia-fbc.so ${NV_SOVER}
1826 -
1827 - # NVIDIA video encode/decode <-> CUDA
1828 - if use kernel_linux; then
1829 - donvidia ${NV_OBJ}/libnvcuvid.so ${NV_SOVER}
1830 - donvidia ${NV_OBJ}/libnvidia-encode.so ${NV_SOVER}
1831 - fi
1832 -
1833 - if use X; then
1834 - # Xorg DDX driver
1835 - insinto /usr/$(get_libdir)/xorg/modules/drivers
1836 - doins ${NV_X11}/nvidia_drv.so
1837 -
1838 - # Xorg GLX driver
1839 - donvidia ${NV_X11}/libglx.so ${NV_SOVER} \
1840 - /usr/$(get_libdir)/opengl/nvidia/extensions
1841 -
1842 - # Xorg nvidia.conf
1843 - if has_version '>=x11-base/xorg-server-1.16'; then
1844 - insinto /usr/share/X11/xorg.conf.d
1845 - newins {,50-}nvidia-drm-outputclass.conf
1846 - fi
1847 - fi
1848 -
1849 - # OpenCL ICD for NVIDIA
1850 - if use kernel_linux; then
1851 - insinto /etc/OpenCL/vendors
1852 - doins ${NV_OBJ}/nvidia.icd
1853 - fi
1854 -
1855 - # Documentation
1856 - dohtml ${NV_DOC}/html/*
1857 - if use kernel_FreeBSD; then
1858 - dodoc "${NV_DOC}/README"
1859 - use X && doman "${NV_MAN}/nvidia-xconfig.1"
1860 - use tools && doman "${NV_MAN}/nvidia-settings.1"
1861 - else
1862 - # Docs
1863 - newdoc "${NV_DOC}/README.txt" README
1864 - dodoc "${NV_DOC}/NVIDIA_Changelog"
1865 - doman "${NV_MAN}/nvidia-smi.1.gz"
1866 - use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
1867 - use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
1868 - doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
1869 - fi
1870 -
1871 - # Helper Apps
1872 - exeinto /opt/bin/
1873 -
1874 - if use X; then
1875 - doexe ${NV_OBJ}/nvidia-xconfig
1876 - fi
1877 -
1878 - if use kernel_linux ; then
1879 - doexe ${NV_OBJ}/nvidia-cuda-mps-control
1880 - doexe ${NV_OBJ}/nvidia-cuda-mps-server
1881 - doexe ${NV_OBJ}/nvidia-debugdump
1882 - doexe ${NV_OBJ}/nvidia-persistenced
1883 - doexe ${NV_OBJ}/nvidia-smi
1884 -
1885 - # install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
1886 - doexe ${NV_OBJ}/nvidia-modprobe
1887 - fowners root:video /opt/bin/nvidia-modprobe
1888 - fperms 4710 /opt/bin/nvidia-modprobe
1889 - dosym /{opt,usr}/bin/nvidia-modprobe
1890 -
1891 - doman nvidia-cuda-mps-control.1.gz
1892 - doman nvidia-modprobe.1.gz
1893 - doman nvidia-persistenced.1.gz
1894 - newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
1895 - newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
1896 - newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
1897 - fi
1898 -
1899 - if use tools; then
1900 - emake -C "${S}"/nvidia-settings-${PV}/src/ \
1901 - DESTDIR="${D}" \
1902 - GTK3_AVAILABLE=$(usex gtk3 1 0) \
1903 - LIBDIR="${D}/usr/$(get_libdir)" \
1904 - PREFIX=/usr \
1905 - NV_USE_BUNDLED_LIBJANSSON=0 \
1906 - install
1907 -
1908 - if use static-libs; then
1909 - dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
1910 -
1911 - insinto /usr/include/NVCtrl
1912 - doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
1913 - fi
1914 -
1915 - insinto /usr/share/nvidia/
1916 - doins nvidia-application-profiles-${PV}-key-documentation
1917 -
1918 - insinto /etc/nvidia
1919 - newins \
1920 - nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
1921 -
1922 - # There is no icon in the FreeBSD tarball.
1923 - use kernel_FreeBSD || \
1924 - newicon ${NV_OBJ}/nvidia-settings.png ${PN}-settings.png
1925 -
1926 - domenu "${FILESDIR}"/${PN}-settings.desktop
1927 -
1928 - exeinto /etc/X11/xinit/xinitrc.d
1929 - doexe "${FILESDIR}"/95-nvidia-settings
1930 - fi
1931 -
1932 - dobin ${NV_OBJ}/nvidia-bug-report.sh
1933 -
1934 - if has_multilib_profile && use multilib ; then
1935 - local OABI=${ABI}
1936 - for ABI in $(get_install_abis) ; do
1937 - src_install-libs
1938 - done
1939 - ABI=${OABI}
1940 - unset OABI
1941 - else
1942 - src_install-libs
1943 - fi
1944 -
1945 - is_final_abi || die "failed to iterate through all ABIs"
1946 -
1947 - readme.gentoo_create_doc
1948 -}
1949 -
1950 -src_install-libs() {
1951 - local inslibdir=$(get_libdir)
1952 - local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
1953 - local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
1954 - local libdir=${NV_OBJ}
1955 -
1956 - if use kernel_linux && has_multilib_profile && \
1957 - [[ ${ABI} == "x86" ]] ; then
1958 - libdir=${NV_OBJ}/32
1959 - fi
1960 -
1961 - if use X; then
1962 - # The GLX libraries
1963 - donvidia ${libdir}/libEGL.so ${NV_SOVER} ${GL_ROOT}
1964 - donvidia ${libdir}/libGL.so ${NV_SOVER} ${GL_ROOT}
1965 - donvidia ${libdir}/libGLESv1_CM.so ${NV_SOVER} ${GL_ROOT}
1966 - donvidia ${libdir}/libnvidia-eglcore.so ${NV_SOVER}
1967 - donvidia ${libdir}/libnvidia-glcore.so ${NV_SOVER}
1968 - donvidia ${libdir}/libnvidia-glsi.so ${NV_SOVER}
1969 - donvidia ${libdir}/libnvidia-ifr.so ${NV_SOVER}
1970 - if use kernel_FreeBSD; then
1971 - donvidia ${libdir}/libnvidia-tls.so ${NV_SOVER}
1972 - else
1973 - donvidia ${libdir}/tls/libnvidia-tls.so ${NV_SOVER}
1974 - fi
1975 -
1976 - # VDPAU
1977 - donvidia ${libdir}/libvdpau_nvidia.so ${NV_SOVER}
1978 -
1979 - # GLES v2 libraries
1980 - insinto ${GL_ROOT}
1981 - doexe ${libdir}/libGLESv2.so.${PV}
1982 - dosym libGLESv2.so.${PV} ${GL_ROOT}/libGLESv2.so.2
1983 - dosym libGLESv2.so.2 ${GL_ROOT}/libGLESv2.so
1984 - fi
1985 -
1986 - # NVIDIA monitoring library
1987 - if use kernel_linux ; then
1988 - donvidia ${libdir}/libnvidia-ml.so ${NV_SOVER}
1989 - fi
1990 -
1991 - # CUDA & OpenCL
1992 - if use kernel_linux; then
1993 - donvidia ${libdir}/libcuda.so ${NV_SOVER}
1994 - donvidia ${libdir}/libnvidia-compiler.so ${NV_SOVER}
1995 - donvidia ${libdir}/libOpenCL.so 1.0.0 ${CL_ROOT}
1996 - donvidia ${libdir}/libnvidia-opencl.so ${NV_SOVER}
1997 - fi
1998 -}
1999 -
2000 -pkg_preinst() {
2001 - if use kernel_linux; then
2002 - linux-mod_pkg_preinst
2003 -
2004 - local videogroup="$(egetent group video | cut -d ':' -f 3)"
2005 - if [ -z "${videogroup}" ]; then
2006 - eerror "Failed to determine the video group gid"
2007 - die "Failed to determine the video group gid"
2008 - else
2009 - sed -i \
2010 - -e "s:PACKAGE:${PF}:g" \
2011 - -e "s:VIDEOGID:${videogroup}:" \
2012 - "${D}"/etc/modprobe.d/nvidia.conf || die
2013 - fi
2014 - fi
2015 -
2016 - # Clean the dynamic libGL stuff's home to ensure
2017 - # we dont have stale libs floating around
2018 - if [ -d "${ROOT}"/usr/lib/opengl/nvidia ] ; then
2019 - rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
2020 - fi
2021 - # Make sure we nuke the old nvidia-glx's env.d file
2022 - if [ -e "${ROOT}"/etc/env.d/09nvidia ] ; then
2023 - rm -f "${ROOT}"/etc/env.d/09nvidia
2024 - fi
2025 -}
2026 -
2027 -pkg_postinst() {
2028 - use kernel_linux && linux-mod_pkg_postinst
2029 -
2030 - # Switch to the nvidia implementation
2031 - use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
2032 - "${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
2033 -
2034 - readme.gentoo_print_elog
2035 -
2036 - if ! use X; then
2037 - elog "You have elected to not install the X.org driver. Along with"
2038 - elog "this the OpenGL libraries and VDPAU libraries were not"
2039 - elog "installed. Additionally, once the driver is loaded your card"
2040 - elog "and fan will run at max speed which may not be desirable."
2041 - elog "Use the 'nvidia-smi' init script to have your card and fan"
2042 - elog "speed scale appropriately."
2043 - elog
2044 - fi
2045 - if ! use tools; then
2046 - elog "USE=tools controls whether the nvidia-settings application"
2047 - elog "is installed. If you would like to use it, enable that"
2048 - elog "flag and re-emerge this ebuild. Optionally you can install"
2049 - elog "media-video/nvidia-settings"
2050 - elog
2051 - fi
2052 -}
2053 -
2054 -pkg_prerm() {
2055 - use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
2056 -}
2057 -
2058 -pkg_postrm() {
2059 - use kernel_linux && linux-mod_pkg_postrm
2060 - use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
2061 -}
2062
2063 diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-352.79-r1.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-352.79-r1.ebuild
2064 deleted file mode 100644
2065 index 4bb98c2..0000000
2066 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-352.79-r1.ebuild
2067 +++ /dev/null
2068 @@ -1,527 +0,0 @@
2069 -# Copyright 1999-2015 Gentoo Foundation
2070 -# Distributed under the terms of the GNU General Public License v2
2071 -# $Id$
2072 -
2073 -EAPI=5
2074 -
2075 -inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \
2076 - portability toolchain-funcs unpacker user udev
2077 -
2078 -NV_URI="http://us.download.nvidia.com/XFree86/"
2079 -X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
2080 -AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
2081 -X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
2082 -AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
2083 -
2084 -DESCRIPTION="NVIDIA Accelerated Graphics Driver"
2085 -HOMEPAGE="http://www.nvidia.com/"
2086 -SRC_URI="
2087 - amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
2088 - amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
2089 - x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
2090 - x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
2091 - tools? ( ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2 )
2092 -"
2093 -
2094 -LICENSE="GPL-2 NVIDIA-r2"
2095 -SLOT="0/${PV%.*}"
2096 -KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
2097 -RESTRICT="bindist mirror strip"
2098 -EMULTILIB_PKG="true"
2099 -
2100 -IUSE="acpi gtk3 multilib kernel_FreeBSD kernel_linux pax_kernel static-libs +tools +X uvm"
2101 -REQUIRED_USE="
2102 - tools? ( X )
2103 - static-libs? ( tools )
2104 -"
2105 -
2106 -COMMON="
2107 - app-eselect/eselect-opencl
2108 - kernel_linux? ( >=sys-libs/glibc-2.6.1 )
2109 - tools? (
2110 - dev-libs/atk
2111 - dev-libs/glib:2
2112 - dev-libs/jansson
2113 - gtk3? (
2114 - x11-libs/gtk+:3
2115 - )
2116 - x11-libs/cairo
2117 - x11-libs/gdk-pixbuf[X]
2118 - x11-libs/gtk+:2
2119 - x11-libs/libX11
2120 - x11-libs/libXext
2121 - x11-libs/libXrandr
2122 - x11-libs/libXv
2123 - x11-libs/libXxf86vm
2124 - x11-libs/pango[X]
2125 - )
2126 - X? (
2127 - >=app-eselect/eselect-opengl-1.0.9
2128 - )
2129 -"
2130 -DEPEND="
2131 - ${COMMON}
2132 - kernel_linux? ( virtual/linux-sources )
2133 -"
2134 -RDEPEND="
2135 - ${COMMON}
2136 - acpi? ( sys-power/acpid )
2137 - tools? ( !media-video/nvidia-settings )
2138 - X? (
2139 - <x11-base/xorg-server-1.18.99:=
2140 - >=x11-libs/libvdpau-0.3-r1
2141 - multilib? (
2142 - >=x11-libs/libX11-1.6.2[abi_x86_32]
2143 - >=x11-libs/libXext-1.3.2[abi_x86_32]
2144 - )
2145 - )
2146 -"
2147 -
2148 -QA_PREBUILT="opt/* usr/lib*"
2149 -
2150 -S=${WORKDIR}/
2151 -
2152 -pkg_pretend() {
2153 - if use amd64 && has_multilib_profile && \
2154 - [ "${DEFAULT_ABI}" != "amd64" ]; then
2155 - eerror "This ebuild doesn't currently support changing your default ABI"
2156 - die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
2157 - fi
2158 -
2159 - if use kernel_linux && kernel_is ge 4 4; then
2160 - ewarn "Gentoo supports kernels which are supported by NVIDIA"
2161 - ewarn "which are limited to the following kernels:"
2162 - ewarn "<sys-kernel/gentoo-sources-4.4"
2163 - ewarn "<sys-kernel/vanilla-sources-4.4"
2164 - ewarn ""
2165 - ewarn "You are free to utilize epatch_user to provide whatever"
2166 - ewarn "support you feel is appropriate, but will not receive"
2167 - ewarn "support as a result of those changes."
2168 - ewarn ""
2169 - ewarn "Do not file a bug report about this."
2170 - ewarn ""
2171 - fi
2172 -
2173 - # Since Nvidia ships many different series of drivers, we need to give the user
2174 - # some kind of guidance as to what version they should install. This tries
2175 - # to point the user in the right direction but can't be perfect. check
2176 - # nvidia-driver.eclass
2177 - nvidia-driver-check-warning
2178 -
2179 - # Kernel features/options to check for
2180 - CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
2181 - use x86 && CONFIG_CHECK+=" ~HIGHMEM"
2182 -
2183 - # Now do the above checks
2184 - use kernel_linux && check_extra_config
2185 -}
2186 -
2187 -pkg_setup() {
2188 - # try to turn off distcc and ccache for people that have a problem with it
2189 - export DISTCC_DISABLE=1
2190 - export CCACHE_DISABLE=1
2191 -
2192 - if use kernel_linux; then
2193 - MODULE_NAMES="nvidia(video:${S}/kernel)"
2194 - use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel/uvm)"
2195 -
2196 - # This needs to run after MODULE_NAMES (so that the eclass checks
2197 - # whether the kernel supports loadable modules) but before BUILD_PARAMS
2198 - # is set (so that KV_DIR is populated).
2199 - linux-mod_pkg_setup
2200 -
2201 - BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
2202 - SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC)"
2203 -
2204 - # linux-mod_src_compile calls set_arch_to_kernel, which
2205 - # sets the ARCH to x86 but NVIDIA's wrapping Makefile
2206 - # expects x86_64 or i386 and then converts it to x86
2207 - # later on in the build process
2208 - BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
2209 - fi
2210 -
2211 - # set variables to where files are in the package structure
2212 - if use kernel_FreeBSD; then
2213 - use x86-fbsd && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
2214 - use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
2215 - NV_DOC="${S}/doc"
2216 - NV_OBJ="${S}/obj"
2217 - NV_SRC="${S}/src"
2218 - NV_MAN="${S}/x11/man"
2219 - NV_X11="${S}/obj"
2220 - NV_SOVER=1
2221 - elif use kernel_linux; then
2222 - NV_DOC="${S}"
2223 - NV_OBJ="${S}"
2224 - NV_SRC="${S}/kernel"
2225 - NV_MAN="${S}"
2226 - NV_X11="${S}"
2227 - NV_SOVER=${PV}
2228 - else
2229 - die "Could not determine proper NVIDIA package"
2230 - fi
2231 -}
2232 -
2233 -src_prepare() {
2234 - # Please add a brief description for every added patch
2235 -
2236 - if use kernel_linux; then
2237 - if kernel_is lt 2 6 9 ; then
2238 - eerror "You must build this against 2.6.9 or higher kernels."
2239 - fi
2240 -
2241 - # If greater than 2.6.5 use M= instead of SUBDIR=
2242 -# convert_to_m "${NV_SRC}"/Makefile.kbuild
2243 - fi
2244 -
2245 - if use pax_kernel; then
2246 - ewarn "Using PAX patches is not supported. You will be asked to"
2247 - ewarn "use a standard kernel should you have issues. Should you"
2248 - ewarn "need support with these patches, contact the PaX team."
2249 - epatch "${FILESDIR}"/${PN}-346.16-pax-usercopy.patch
2250 - epatch "${FILESDIR}"/${PN}-346.16-pax-constify.patch
2251 - fi
2252 -
2253 - # Allow user patches so they can support RC kernels and whatever else
2254 - epatch_user
2255 -}
2256 -
2257 -src_compile() {
2258 - # This is already the default on Linux, as there's no toplevel Makefile, but
2259 - # on FreeBSD there's one and triggers the kernel module build, as we install
2260 - # it by itself, pass this.
2261 -
2262 - cd "${NV_SRC}"
2263 - if use kernel_FreeBSD; then
2264 - MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
2265 - LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
2266 - elif use kernel_linux; then
2267 - MAKEOPTS=-j1
2268 - linux-mod_src_compile
2269 - fi
2270 -
2271 - if use tools; then
2272 - emake -C "${S}"/nvidia-settings-${PV}/src \
2273 - AR="$(tc-getAR)" \
2274 - CC="$(tc-getCC)" \
2275 - LIBDIR="$(get_libdir)" \
2276 - RANLIB="$(tc-getRANLIB)" \
2277 - build-xnvctrl
2278 -
2279 - emake -C "${S}"/nvidia-settings-${PV}/src \
2280 - CC="$(tc-getCC)" \
2281 - GTK3_AVAILABLE=$(usex gtk3 1 0) \
2282 - LD="$(tc-getCC)" \
2283 - LIBDIR="$(get_libdir)" \
2284 - NVML_ENABLED=0 \
2285 - NV_USE_BUNDLED_LIBJANSSON=0 \
2286 - NV_VERBOSE=1 \
2287 - STRIP_CMD=true
2288 - fi
2289 -}
2290 -
2291 -# Install nvidia library:
2292 -# the first parameter is the library to install
2293 -# the second parameter is the provided soversion
2294 -# the third parameter is the target directory if its not /usr/lib
2295 -donvidia() {
2296 - # Full path to library minus SOVER
2297 - MY_LIB="$1"
2298 -
2299 - # SOVER to use
2300 - MY_SOVER="$2"
2301 -
2302 - # Where to install
2303 - MY_DEST="$3"
2304 -
2305 - if [[ -z "${MY_DEST}" ]]; then
2306 - MY_DEST="/usr/$(get_libdir)"
2307 - action="dolib.so"
2308 - else
2309 - exeinto ${MY_DEST}
2310 - action="doexe"
2311 - fi
2312 -
2313 - # Get just the library name
2314 - libname=$(basename $1)
2315 -
2316 - # Install the library with the correct SOVER
2317 - ${action} ${MY_LIB}.${MY_SOVER} || \
2318 - die "failed to install ${libname}"
2319 -
2320 - # If SOVER wasn't 1, then we need to create a .1 symlink
2321 - if [[ "${MY_SOVER}" != "1" ]]; then
2322 - dosym ${libname}.${MY_SOVER} \
2323 - ${MY_DEST}/${libname}.1 || \
2324 - die "failed to create ${libname} symlink"
2325 - fi
2326 -
2327 - # Always create the symlink from the raw lib to the .1
2328 - dosym ${libname}.1 \
2329 - ${MY_DEST}/${libname} || \
2330 - die "failed to create ${libname} symlink"
2331 -}
2332 -
2333 -src_install() {
2334 - if use kernel_linux; then
2335 - linux-mod_src_install
2336 -
2337 - # Add the aliases
2338 - # This file is tweaked with the appropriate video group in
2339 - # pkg_preinst, see bug #491414
2340 - insinto /etc/modprobe.d
2341 - newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
2342 - use uvm && doins "${FILESDIR}"/nvidia-uvm.conf
2343 -
2344 - # Ensures that our device nodes are created when not using X
2345 - exeinto "$(get_udevdir)"
2346 - newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
2347 - udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
2348 - elif use kernel_FreeBSD; then
2349 - if use x86-fbsd; then
2350 - insinto /boot/modules
2351 - doins "${S}/src/nvidia.kld"
2352 - fi
2353 -
2354 - exeinto /boot/modules
2355 - doexe "${S}/src/nvidia.ko"
2356 - fi
2357 -
2358 - # NVIDIA kernel <-> userspace driver config lib
2359 - donvidia ${NV_OBJ}/libnvidia-cfg.so ${NV_SOVER}
2360 -
2361 - # NVIDIA framebuffer capture library
2362 - donvidia ${NV_OBJ}/libnvidia-fbc.so ${NV_SOVER}
2363 -
2364 - # NVIDIA video encode/decode <-> CUDA
2365 - if use kernel_linux; then
2366 - donvidia ${NV_OBJ}/libnvcuvid.so ${NV_SOVER}
2367 - donvidia ${NV_OBJ}/libnvidia-encode.so ${NV_SOVER}
2368 - fi
2369 -
2370 - if use X; then
2371 - # Xorg DDX driver
2372 - insinto /usr/$(get_libdir)/xorg/modules/drivers
2373 - doins ${NV_X11}/nvidia_drv.so
2374 -
2375 - # Xorg GLX driver
2376 - donvidia ${NV_X11}/libglx.so ${NV_SOVER} \
2377 - /usr/$(get_libdir)/opengl/nvidia/extensions
2378 -
2379 - # Xorg nvidia.conf
2380 - if has_version '>=x11-base/xorg-server-1.16'; then
2381 - insinto /usr/share/X11/xorg.conf.d
2382 - newins {,50-}nvidia-drm-outputclass.conf
2383 - fi
2384 - fi
2385 -
2386 - # OpenCL ICD for NVIDIA
2387 - if use kernel_linux; then
2388 - insinto /etc/OpenCL/vendors
2389 - doins ${NV_OBJ}/nvidia.icd
2390 - fi
2391 -
2392 - # Documentation
2393 - dohtml ${NV_DOC}/html/*
2394 - if use kernel_FreeBSD; then
2395 - dodoc "${NV_DOC}/README"
2396 - use X && doman "${NV_MAN}/nvidia-xconfig.1"
2397 - use tools && doman "${NV_MAN}/nvidia-settings.1"
2398 - else
2399 - # Docs
2400 - newdoc "${NV_DOC}/README.txt" README
2401 - dodoc "${NV_DOC}/NVIDIA_Changelog"
2402 - doman "${NV_MAN}/nvidia-smi.1.gz"
2403 - use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
2404 - use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
2405 - doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
2406 - fi
2407 -
2408 - # Helper Apps
2409 - exeinto /opt/bin/
2410 -
2411 - if use X; then
2412 - doexe ${NV_OBJ}/nvidia-xconfig
2413 - fi
2414 -
2415 - if use kernel_linux ; then
2416 - doexe ${NV_OBJ}/nvidia-cuda-mps-control
2417 - doexe ${NV_OBJ}/nvidia-cuda-mps-server
2418 - doexe ${NV_OBJ}/nvidia-debugdump
2419 - doexe ${NV_OBJ}/nvidia-persistenced
2420 - doexe ${NV_OBJ}/nvidia-smi
2421 -
2422 - # install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
2423 - doexe ${NV_OBJ}/nvidia-modprobe
2424 - fowners root:video /opt/bin/nvidia-modprobe
2425 - fperms 4710 /opt/bin/nvidia-modprobe
2426 - dosym /{opt,usr}/bin/nvidia-modprobe
2427 -
2428 - doman nvidia-cuda-mps-control.1.gz
2429 - doman nvidia-modprobe.1.gz
2430 - doman nvidia-persistenced.1.gz
2431 - newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
2432 - newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
2433 - newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
2434 - fi
2435 -
2436 - if use tools; then
2437 - emake -C "${S}"/nvidia-settings-${PV}/src/ \
2438 - DESTDIR="${D}" \
2439 - GTK3_AVAILABLE=$(usex gtk3 1 0) \
2440 - LIBDIR="${D}/usr/$(get_libdir)" \
2441 - PREFIX=/usr \
2442 - NV_USE_BUNDLED_LIBJANSSON=0 \
2443 - install
2444 -
2445 - if use static-libs; then
2446 - dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
2447 -
2448 - insinto /usr/share/nvidia/
2449 - doins nvidia-application-profiles-${PV}-key-documentation
2450 - fi
2451 -
2452 - insinto /etc/nvidia
2453 - newins \
2454 - nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
2455 -
2456 - # There is no icon in the FreeBSD tarball.
2457 - use kernel_FreeBSD || \
2458 - newicon ${NV_OBJ}/nvidia-settings.png ${PN}-settings.png
2459 -
2460 - domenu "${FILESDIR}"/${PN}-settings.desktop
2461 -
2462 - exeinto /etc/X11/xinit/xinitrc.d
2463 - doexe "${FILESDIR}"/95-nvidia-settings
2464 - fi
2465 -
2466 - dobin ${NV_OBJ}/nvidia-bug-report.sh
2467 -
2468 - if has_multilib_profile && use multilib ; then
2469 - local OABI=${ABI}
2470 - for ABI in $(get_install_abis) ; do
2471 - src_install-libs
2472 - done
2473 - ABI=${OABI}
2474 - unset OABI
2475 - else
2476 - src_install-libs
2477 - fi
2478 -
2479 - is_final_abi || die "failed to iterate through all ABIs"
2480 -
2481 - readme.gentoo_create_doc
2482 -}
2483 -
2484 -src_install-libs() {
2485 - local inslibdir=$(get_libdir)
2486 - local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
2487 - local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
2488 - local libdir=${NV_OBJ}
2489 -
2490 - if use kernel_linux && has_multilib_profile && \
2491 - [[ ${ABI} == "x86" ]] ; then
2492 - libdir=${NV_OBJ}/32
2493 - fi
2494 -
2495 - if use X; then
2496 - # The GLX libraries
2497 - donvidia ${libdir}/libEGL.so ${NV_SOVER} ${GL_ROOT}
2498 - donvidia ${libdir}/libGL.so ${NV_SOVER} ${GL_ROOT}
2499 - donvidia ${libdir}/libGLESv1_CM.so ${NV_SOVER} ${GL_ROOT}
2500 - donvidia ${libdir}/libnvidia-eglcore.so ${NV_SOVER}
2501 - donvidia ${libdir}/libnvidia-glcore.so ${NV_SOVER}
2502 - donvidia ${libdir}/libnvidia-glsi.so ${NV_SOVER}
2503 - donvidia ${libdir}/libnvidia-ifr.so ${NV_SOVER}
2504 - if use kernel_FreeBSD; then
2505 - donvidia ${libdir}/libnvidia-tls.so ${NV_SOVER}
2506 - else
2507 - donvidia ${libdir}/tls/libnvidia-tls.so ${NV_SOVER}
2508 - fi
2509 -
2510 - # VDPAU
2511 - donvidia ${libdir}/libvdpau_nvidia.so ${NV_SOVER}
2512 -
2513 - # GLES v2 libraries
2514 - insinto ${GL_ROOT}
2515 - doexe ${libdir}/libGLESv2.so.${PV}
2516 - dosym libGLESv2.so.${PV} ${GL_ROOT}/libGLESv2.so.2
2517 - dosym libGLESv2.so.2 ${GL_ROOT}/libGLESv2.so
2518 - fi
2519 -
2520 - # NVIDIA monitoring library
2521 - if use kernel_linux ; then
2522 - donvidia ${libdir}/libnvidia-ml.so ${NV_SOVER}
2523 - fi
2524 -
2525 - # CUDA & OpenCL
2526 - if use kernel_linux; then
2527 - donvidia ${libdir}/libcuda.so ${NV_SOVER}
2528 - donvidia ${libdir}/libnvidia-compiler.so ${NV_SOVER}
2529 - donvidia ${libdir}/libOpenCL.so 1.0.0 ${CL_ROOT}
2530 - donvidia ${libdir}/libnvidia-opencl.so ${NV_SOVER}
2531 - fi
2532 -}
2533 -
2534 -pkg_preinst() {
2535 - if use kernel_linux; then
2536 - linux-mod_pkg_preinst
2537 -
2538 - local videogroup="$(egetent group video | cut -d ':' -f 3)"
2539 - if [ -z "${videogroup}" ]; then
2540 - eerror "Failed to determine the video group gid"
2541 - die "Failed to determine the video group gid"
2542 - else
2543 - sed -i \
2544 - -e "s:PACKAGE:${PF}:g" \
2545 - -e "s:VIDEOGID:${videogroup}:" \
2546 - "${D}"/etc/modprobe.d/nvidia.conf || die
2547 - fi
2548 - fi
2549 -
2550 - # Clean the dynamic libGL stuff's home to ensure
2551 - # we dont have stale libs floating around
2552 - if [ -d "${ROOT}"/usr/lib/opengl/nvidia ] ; then
2553 - rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
2554 - fi
2555 - # Make sure we nuke the old nvidia-glx's env.d file
2556 - if [ -e "${ROOT}"/etc/env.d/09nvidia ] ; then
2557 - rm -f "${ROOT}"/etc/env.d/09nvidia
2558 - fi
2559 -}
2560 -
2561 -pkg_postinst() {
2562 - use kernel_linux && linux-mod_pkg_postinst
2563 -
2564 - # Switch to the nvidia implementation
2565 - use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
2566 - "${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
2567 -
2568 - readme.gentoo_print_elog
2569 -
2570 - if ! use X; then
2571 - elog "You have elected to not install the X.org driver. Along with"
2572 - elog "this the OpenGL libraries and VDPAU libraries were not"
2573 - elog "installed. Additionally, once the driver is loaded your card"
2574 - elog "and fan will run at max speed which may not be desirable."
2575 - elog "Use the 'nvidia-smi' init script to have your card and fan"
2576 - elog "speed scale appropriately."
2577 - elog
2578 - fi
2579 - if ! use tools; then
2580 - elog "USE=tools controls whether the nvidia-settings application"
2581 - elog "is installed. If you would like to use it, enable that"
2582 - elog "flag and re-emerge this ebuild. Optionally you can install"
2583 - elog "media-video/nvidia-settings"
2584 - elog
2585 - fi
2586 -}
2587 -
2588 -pkg_prerm() {
2589 - use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
2590 -}
2591 -
2592 -pkg_postrm() {
2593 - use kernel_linux && linux-mod_pkg_postrm
2594 - use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
2595 -}
2596
2597 diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-358.16-r2.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-358.16-r2.ebuild
2598 deleted file mode 100644
2599 index 145dea6..0000000
2600 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-358.16-r2.ebuild
2601 +++ /dev/null
2602 @@ -1,539 +0,0 @@
2603 -# Copyright 1999-2015 Gentoo Foundation
2604 -# Distributed under the terms of the GNU General Public License v2
2605 -# $Id$
2606 -
2607 -EAPI=5
2608 -
2609 -inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \
2610 - portability toolchain-funcs unpacker user udev
2611 -
2612 -NV_URI="http://us.download.nvidia.com/XFree86/"
2613 -X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
2614 -AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
2615 -X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
2616 -AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
2617 -
2618 -DESCRIPTION="NVIDIA Accelerated Graphics Driver"
2619 -HOMEPAGE="http://www.nvidia.com/"
2620 -SRC_URI="
2621 - amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
2622 - amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
2623 - x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
2624 - x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
2625 - tools? ( ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2 )
2626 -"
2627 -
2628 -LICENSE="GPL-2 NVIDIA-r2"
2629 -SLOT="0/${PV%.*}"
2630 -KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
2631 -RESTRICT="bindist mirror strip"
2632 -EMULTILIB_PKG="true"
2633 -
2634 -IUSE="acpi multilib kernel_FreeBSD kernel_linux +kms pax_kernel static-libs +tools gtk3 +X uvm"
2635 -REQUIRED_USE="
2636 - tools? ( X )
2637 - static-libs? ( tools )
2638 -"
2639 -
2640 -COMMON="
2641 - app-eselect/eselect-opencl
2642 - kernel_linux? ( >=sys-libs/glibc-2.6.1 )
2643 - tools? (
2644 - dev-libs/atk
2645 - dev-libs/glib:2
2646 - dev-libs/jansson
2647 - gtk3? ( x11-libs/gtk+:3 )
2648 - x11-libs/cairo
2649 - x11-libs/gdk-pixbuf[X]
2650 - x11-libs/gtk+:2
2651 - x11-libs/libX11
2652 - x11-libs/libXext
2653 - x11-libs/libXrandr
2654 - x11-libs/libXv
2655 - x11-libs/libXxf86vm
2656 - x11-libs/pango[X]
2657 - )
2658 - X? (
2659 - >=app-eselect/eselect-opengl-1.0.9
2660 - )
2661 -"
2662 -DEPEND="
2663 - ${COMMON}
2664 - kernel_linux? ( virtual/linux-sources )
2665 -"
2666 -RDEPEND="
2667 - ${COMMON}
2668 - acpi? ( sys-power/acpid )
2669 - tools? ( !media-video/nvidia-settings )
2670 - X? (
2671 - <x11-base/xorg-server-1.18.99:=
2672 - >=x11-libs/libvdpau-0.3-r1
2673 - multilib? (
2674 - >=x11-libs/libX11-1.6.2[abi_x86_32]
2675 - >=x11-libs/libXext-1.3.2[abi_x86_32]
2676 - )
2677 - )
2678 -"
2679 -
2680 -QA_PREBUILT="opt/* usr/lib*"
2681 -
2682 -S=${WORKDIR}/
2683 -
2684 -pkg_pretend() {
2685 - if use amd64 && has_multilib_profile && \
2686 - [ "${DEFAULT_ABI}" != "amd64" ]; then
2687 - eerror "This ebuild doesn't currently support changing your default ABI"
2688 - die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
2689 - fi
2690 -
2691 - if use kernel_linux && kernel_is ge 4 4; then
2692 - ewarn "Gentoo supports kernels which are supported by NVIDIA"
2693 - ewarn "which are limited to the following kernels:"
2694 - ewarn "<sys-kernel/gentoo-sources-4.4"
2695 - ewarn "<sys-kernel/vanilla-sources-4.4"
2696 - ewarn ""
2697 - ewarn "You are free to utilize epatch_user to provide whatever"
2698 - ewarn "support you feel is appropriate, but will not receive"
2699 - ewarn "support as a result of those changes."
2700 - ewarn ""
2701 - ewarn "Do not file a bug report about this."
2702 - ewarn ""
2703 - fi
2704 -
2705 - # Since Nvidia ships many different series of drivers, we need to give the user
2706 - # some kind of guidance as to what version they should install. This tries
2707 - # to point the user in the right direction but can't be perfect. check
2708 - # nvidia-driver.eclass
2709 - nvidia-driver-check-warning
2710 -
2711 - # Kernel features/options to check for
2712 - CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
2713 - use x86 && CONFIG_CHECK+=" ~HIGHMEM"
2714 -
2715 - # Now do the above checks
2716 - use kernel_linux && check_extra_config
2717 -}
2718 -
2719 -pkg_setup() {
2720 - # try to turn off distcc and ccache for people that have a problem with it
2721 - export DISTCC_DISABLE=1
2722 - export CCACHE_DISABLE=1
2723 -
2724 - if use kernel_linux; then
2725 - MODULE_NAMES="nvidia(video:${S}/kernel)"
2726 - use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
2727 - use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel)"
2728 -
2729 - # This needs to run after MODULE_NAMES (so that the eclass checks
2730 - # whether the kernel supports loadable modules) but before BUILD_PARAMS
2731 - # is set (so that KV_DIR is populated).
2732 - linux-mod_pkg_setup
2733 -
2734 - BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
2735 - SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
2736 -
2737 - # linux-mod_src_compile calls set_arch_to_kernel, which
2738 - # sets the ARCH to x86 but NVIDIA's wrapping Makefile
2739 - # expects x86_64 or i386 and then converts it to x86
2740 - # later on in the build process
2741 - BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
2742 - fi
2743 -
2744 - # set variables to where files are in the package structure
2745 - if use kernel_FreeBSD; then
2746 - use x86-fbsd && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
2747 - use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
2748 - NV_DOC="${S}/doc"
2749 - NV_OBJ="${S}/obj"
2750 - NV_SRC="${S}/src"
2751 - NV_MAN="${S}/x11/man"
2752 - NV_X11="${S}/obj"
2753 - NV_SOVER=1
2754 - elif use kernel_linux; then
2755 - NV_DOC="${S}"
2756 - NV_OBJ="${S}"
2757 - NV_SRC="${S}/kernel"
2758 - NV_MAN="${S}"
2759 - NV_X11="${S}"
2760 - NV_SOVER=${PV}
2761 - else
2762 - die "Could not determine proper NVIDIA package"
2763 - fi
2764 -}
2765 -
2766 -src_prepare() {
2767 - # Please add a brief description for every added patch
2768 -
2769 - if use kernel_linux; then
2770 - if kernel_is lt 2 6 9; then
2771 - eerror "You must build this against 2.6.9 or higher kernels."
2772 - fi
2773 -
2774 - # If greater than 2.6.5 use M= instead of SUBDIR=
2775 -# convert_to_m "${NV_SRC}"/Makefile.kbuild
2776 - fi
2777 -
2778 - if use pax_kernel; then
2779 - ewarn "Using PAX patches is not supported. You will be asked to"
2780 - ewarn "use a standard kernel should you have issues. Should you"
2781 - ewarn "need support with these patches, contact the PaX team."
2782 - epatch "${FILESDIR}"/${PN}-355.06-pax.patch
2783 - fi
2784 -
2785 - # Allow user patches so they can support RC kernels and whatever else
2786 - epatch_user
2787 -}
2788 -
2789 -src_compile() {
2790 - # This is already the default on Linux, as there's no toplevel Makefile, but
2791 - # on FreeBSD there's one and triggers the kernel module build, as we install
2792 - # it by itself, pass this.
2793 -
2794 - cd "${NV_SRC}"
2795 - if use kernel_FreeBSD; then
2796 - MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
2797 - LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
2798 - elif use kernel_linux; then
2799 - MAKEOPTS=-j1
2800 - linux-mod_src_compile
2801 - fi
2802 -
2803 - if use tools; then
2804 - emake -C "${S}"/nvidia-settings-${PV}/src \
2805 - AR="$(tc-getAR)" \
2806 - CC="$(tc-getCC)" \
2807 - LIBDIR="$(get_libdir)" \
2808 - RANLIB="$(tc-getRANLIB)" \
2809 - build-xnvctrl
2810 -
2811 - emake -C "${S}"/nvidia-settings-${PV}/src \
2812 - CC="$(tc-getCC)" \
2813 - GTK3_AVAILABLE=$(usex gtk3 1 0) \
2814 - LD="$(tc-getCC)" \
2815 - LIBDIR="$(get_libdir)" \
2816 - NVML_ENABLED=0 \
2817 - NV_USE_BUNDLED_LIBJANSSON=0 \
2818 - NV_VERBOSE=1 \
2819 - STRIP_CMD=true
2820 - fi
2821 -}
2822 -
2823 -# Install nvidia library:
2824 -# the first parameter is the library to install
2825 -# the second parameter is the provided soversion
2826 -# the third parameter is the target directory if it is not /usr/lib
2827 -donvidia() {
2828 - # Full path to library minus SOVER
2829 - MY_LIB="$1"
2830 -
2831 - # SOVER to use
2832 - MY_SOVER="$2"
2833 -
2834 - # Where to install
2835 - MY_DEST="$3"
2836 -
2837 - if [[ -z "${MY_DEST}" ]]; then
2838 - MY_DEST="/usr/$(get_libdir)"
2839 - action="dolib.so"
2840 - else
2841 - exeinto ${MY_DEST}
2842 - action="doexe"
2843 - fi
2844 -
2845 - # Get just the library name
2846 - libname=$(basename $1)
2847 -
2848 - # Install the library with the correct SOVER
2849 - ${action} ${MY_LIB}.${MY_SOVER} || \
2850 - die "failed to install ${libname}"
2851 -
2852 - # If SOVER wasn't 1, then we need to create a .1 symlink
2853 - if [[ "${MY_SOVER}" != "1" ]]; then
2854 - dosym ${libname}.${MY_SOVER} \
2855 - ${MY_DEST}/${libname}.1 || \
2856 - die "failed to create ${libname} symlink"
2857 - fi
2858 -
2859 - # Always create the symlink from the raw lib to the .1
2860 - dosym ${libname}.1 \
2861 - ${MY_DEST}/${libname} || \
2862 - die "failed to create ${libname} symlink"
2863 -}
2864 -
2865 -src_install() {
2866 - if use kernel_linux; then
2867 - linux-mod_src_install
2868 -
2869 - # Add the aliases
2870 - # This file is tweaked with the appropriate video group in
2871 - # pkg_preinst, see bug #491414
2872 - insinto /etc/modprobe.d
2873 - newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
2874 - doins "${FILESDIR}"/nvidia-rmmod.conf
2875 -
2876 - # Ensures that our device nodes are created when not using X
2877 - exeinto "$(get_udevdir)"
2878 - newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
2879 - udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
2880 - elif use kernel_FreeBSD; then
2881 - if use x86-fbsd; then
2882 - insinto /boot/modules
2883 - doins "${S}/src/nvidia.kld"
2884 - fi
2885 -
2886 - exeinto /boot/modules
2887 - doexe "${S}/src/nvidia.ko"
2888 - fi
2889 -
2890 - # NVIDIA kernel <-> userspace driver config lib
2891 - donvidia ${NV_OBJ}/libnvidia-cfg.so ${NV_SOVER}
2892 -
2893 - # NVIDIA framebuffer capture library
2894 - donvidia ${NV_OBJ}/libnvidia-fbc.so ${NV_SOVER}
2895 -
2896 - # NVIDIA video encode/decode <-> CUDA
2897 - if use kernel_linux; then
2898 - donvidia ${NV_OBJ}/libnvcuvid.so ${NV_SOVER}
2899 - donvidia ${NV_OBJ}/libnvidia-encode.so ${NV_SOVER}
2900 - fi
2901 -
2902 - if use X; then
2903 - # Xorg DDX driver
2904 - insinto /usr/$(get_libdir)/xorg/modules/drivers
2905 - doins ${NV_X11}/nvidia_drv.so
2906 -
2907 - # Xorg GLX driver
2908 - donvidia ${NV_X11}/libglx.so ${NV_SOVER} \
2909 - /usr/$(get_libdir)/opengl/nvidia/extensions
2910 -
2911 - # Xorg nvidia.conf
2912 - if has_version '>=x11-base/xorg-server-1.16'; then
2913 - insinto /usr/share/X11/xorg.conf.d
2914 - newins {,50-}nvidia-drm-outputclass.conf
2915 - fi
2916 - fi
2917 -
2918 - # OpenCL ICD for NVIDIA
2919 - if use kernel_linux; then
2920 - insinto /etc/OpenCL/vendors
2921 - doins ${NV_OBJ}/nvidia.icd
2922 - fi
2923 -
2924 - # Documentation
2925 - dohtml ${NV_DOC}/html/*
2926 - if use kernel_FreeBSD; then
2927 - dodoc "${NV_DOC}/README"
2928 - use X && doman "${NV_MAN}/nvidia-xconfig.1"
2929 - use tools && doman "${NV_MAN}/nvidia-settings.1"
2930 - else
2931 - # Docs
2932 - newdoc "${NV_DOC}/README.txt" README
2933 - dodoc "${NV_DOC}/NVIDIA_Changelog"
2934 - doman "${NV_MAN}/nvidia-smi.1.gz"
2935 - use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
2936 - use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
2937 - doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
2938 - fi
2939 -
2940 - # Helper Apps
2941 - exeinto /opt/bin/
2942 -
2943 - if use X; then
2944 - doexe ${NV_OBJ}/nvidia-xconfig
2945 - fi
2946 -
2947 - if use kernel_linux; then
2948 - doexe ${NV_OBJ}/nvidia-cuda-mps-control
2949 - doexe ${NV_OBJ}/nvidia-cuda-mps-server
2950 - doexe ${NV_OBJ}/nvidia-debugdump
2951 - doexe ${NV_OBJ}/nvidia-persistenced
2952 - doexe ${NV_OBJ}/nvidia-smi
2953 -
2954 - # install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
2955 - doexe ${NV_OBJ}/nvidia-modprobe
2956 - fowners root:video /opt/bin/nvidia-modprobe
2957 - fperms 4710 /opt/bin/nvidia-modprobe
2958 - dosym /{opt,usr}/bin/nvidia-modprobe
2959 -
2960 - doman nvidia-cuda-mps-control.1.gz
2961 - doman nvidia-modprobe.1.gz
2962 - doman nvidia-persistenced.1.gz
2963 - newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
2964 - newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
2965 - newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
2966 - fi
2967 -
2968 - if use tools; then
2969 - emake -C "${S}"/nvidia-settings-${PV}/src/ \
2970 - DESTDIR="${D}" \
2971 - GTK3_AVAILABLE=$(usex gtk3 1 0) \
2972 - LIBDIR="${D}/usr/$(get_libdir)" \
2973 - PREFIX=/usr \
2974 - NV_USE_BUNDLED_LIBJANSSON=0 \
2975 - install
2976 -
2977 - if use static-libs; then
2978 - dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
2979 -
2980 - insinto /usr/include/NVCtrl
2981 - doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
2982 - fi
2983 -
2984 - insinto /usr/share/nvidia/
2985 - doins nvidia-application-profiles-${PV}-key-documentation
2986 -
2987 - insinto /etc/nvidia
2988 - newins \
2989 - nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
2990 -
2991 - # There is no icon in the FreeBSD tarball.
2992 - use kernel_FreeBSD || \
2993 - newicon ${NV_OBJ}/nvidia-settings.png ${PN}-settings.png
2994 -
2995 - domenu "${FILESDIR}"/${PN}-settings.desktop
2996 -
2997 - exeinto /etc/X11/xinit/xinitrc.d
2998 - doexe "${FILESDIR}"/95-nvidia-settings
2999 - fi
3000 -
3001 - dobin ${NV_OBJ}/nvidia-bug-report.sh
3002 -
3003 - if has_multilib_profile && use multilib; then
3004 - local OABI=${ABI}
3005 - for ABI in $(get_install_abis); do
3006 - src_install-libs
3007 - done
3008 - ABI=${OABI}
3009 - unset OABI
3010 - else
3011 - src_install-libs
3012 - fi
3013 -
3014 - is_final_abi || die "failed to iterate through all ABIs"
3015 -
3016 - readme.gentoo_create_doc
3017 -}
3018 -
3019 -src_install-libs() {
3020 - local inslibdir=$(get_libdir)
3021 - local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
3022 - local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
3023 - local libdir=${NV_OBJ}
3024 -
3025 - if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
3026 - libdir=${NV_OBJ}/32
3027 - fi
3028 -
3029 - if use X; then
3030 - NV_GLX_LIBRARIES=(
3031 - "libEGL.so 1 ${GL_ROOT}"
3032 - "libEGL_nvidia.so 0 ${GL_ROOT}"
3033 - "libGL.so ${NV_SOVER} ${GL_ROOT}"
3034 - "libGLESv1_CM.so ${NV_SOVER} ${GL_ROOT}"
3035 - "libGLdispatch.so 0 ${GL_ROOT}"
3036 - "libOpenCL.so 1.0.0 ${CL_ROOT}"
3037 - "libOpenGL.so 0 ${GL_ROOT}"
3038 - "libcuda.so ${NV_SOVER}"
3039 - "libnvcuvid.so ${NV_SOVER}"
3040 - "libnvidia-compiler.so ${NV_SOVER}"
3041 - "libnvidia-eglcore.so ${NV_SOVER}"
3042 - "libnvidia-encode.so ${NV_SOVER}"
3043 - "libnvidia-fbc.so ${NV_SOVER}"
3044 - "libnvidia-glcore.so ${NV_SOVER}"
3045 - "libnvidia-glsi.so ${NV_SOVER}"
3046 - "libnvidia-ifr.so ${NV_SOVER}"
3047 - "libnvidia-opencl.so ${NV_SOVER}"
3048 - "libvdpau.so ${NV_SOVER} ${GL_ROOT}"
3049 - "libvdpau_nvidia.so ${NV_SOVER}"
3050 - "libvdpau_trace.so ${NV_SOVER} ${GL_ROOT}"
3051 - )
3052 - if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
3053 - then
3054 - NV_GLX_LIBRARIES+=( "libnvidia-wfb.so ${NV_SOVER}" )
3055 - fi
3056 -
3057 - if use kernel_FreeBSD; then
3058 - NV_GLX_LIBRARIES+=( "libnvidia-tls.so ${NV_SOVER}" )
3059 - fi
3060 -
3061 - if use kernel_linux; then
3062 - NV_GLX_LIBRARIES+=(
3063 - "libnvidia-ml.so ${NV_SOVER}"
3064 - "tls/libnvidia-tls.so ${NV_SOVER}"
3065 - )
3066 - fi
3067 -
3068 - for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
3069 - donvidia ${libdir}/${NV_LIB}
3070 - done
3071 -
3072 - # GLES v2 library is special
3073 - insinto ${GL_ROOT}
3074 - doexe ${libdir}/libGLESv2.so.${PV}
3075 - dosym libGLESv2.so.${PV} ${GL_ROOT}/libGLESv2.so.2
3076 - dosym libGLESv2.so.2 ${GL_ROOT}/libGLESv2.so
3077 - fi
3078 -}
3079 -
3080 -pkg_preinst() {
3081 - if use kernel_linux; then
3082 - linux-mod_pkg_preinst
3083 -
3084 - local videogroup="$(egetent group video | cut -d ':' -f 3)"
3085 - if [ -z "${videogroup}" ]; then
3086 - eerror "Failed to determine the video group gid"
3087 - die "Failed to determine the video group gid"
3088 - else
3089 - sed -i \
3090 - -e "s:PACKAGE:${PF}:g" \
3091 - -e "s:VIDEOGID:${videogroup}:" \
3092 - "${D}"/etc/modprobe.d/nvidia.conf || die
3093 - fi
3094 - fi
3095 -
3096 - # Clean the dynamic libGL stuff's home to ensure
3097 - # we dont have stale libs floating around
3098 - if [ -d "${ROOT}"/usr/lib/opengl/nvidia ]; then
3099 - rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
3100 - fi
3101 - # Make sure we nuke the old nvidia-glx's env.d file
3102 - if [ -e "${ROOT}"/etc/env.d/09nvidia ]; then
3103 - rm -f "${ROOT}"/etc/env.d/09nvidia
3104 - fi
3105 -}
3106 -
3107 -pkg_postinst() {
3108 - use kernel_linux && linux-mod_pkg_postinst
3109 -
3110 - # Switch to the nvidia implementation
3111 - use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
3112 - "${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
3113 -
3114 - readme.gentoo_print_elog
3115 -
3116 - if ! use X; then
3117 - elog "You have elected to not install the X.org driver. Along with"
3118 - elog "this the OpenGL libraries and VDPAU libraries were not"
3119 - elog "installed. Additionally, once the driver is loaded your card"
3120 - elog "and fan will run at max speed which may not be desirable."
3121 - elog "Use the 'nvidia-smi' init script to have your card and fan"
3122 - elog "speed scale appropriately."
3123 - elog
3124 - fi
3125 - if ! use tools; then
3126 - elog "USE=tools controls whether the nvidia-settings application"
3127 - elog "is installed. If you would like to use it, enable that"
3128 - elog "flag and re-emerge this ebuild. Optionally you can install"
3129 - elog "media-video/nvidia-settings"
3130 - elog
3131 - fi
3132 -}
3133 -
3134 -pkg_prerm() {
3135 - use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
3136 -}
3137 -
3138 -pkg_postrm() {
3139 - use kernel_linux && linux-mod_pkg_postrm
3140 - use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
3141 -}
3142
3143 diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-361.18-r2.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-361.18-r2.ebuild
3144 deleted file mode 100644
3145 index cfcaa9b..0000000
3146 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-361.18-r2.ebuild
3147 +++ /dev/null
3148 @@ -1,530 +0,0 @@
3149 -# Copyright 1999-2015 Gentoo Foundation
3150 -# Distributed under the terms of the GNU General Public License v2
3151 -# $Id$
3152 -
3153 -EAPI=5
3154 -
3155 -inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \
3156 - portability toolchain-funcs unpacker user udev
3157 -
3158 -NV_URI="http://us.download.nvidia.com/XFree86/"
3159 -X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
3160 -AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
3161 -X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
3162 -AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
3163 -
3164 -DESCRIPTION="NVIDIA Accelerated Graphics Driver"
3165 -HOMEPAGE="http://www.nvidia.com/"
3166 -SRC_URI="
3167 - amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
3168 - amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
3169 - x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
3170 - x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
3171 - tools? ( ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2 )
3172 -"
3173 -
3174 -LICENSE="GPL-2 NVIDIA-r2"
3175 -SLOT="0/${PV%.*}"
3176 -KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
3177 -RESTRICT="bindist mirror strip"
3178 -EMULTILIB_PKG="true"
3179 -
3180 -IUSE="acpi +driver gtk3 kernel_FreeBSD kernel_linux +kms multilib pax_kernel static-libs +tools uvm +X"
3181 -REQUIRED_USE="
3182 - tools? ( X )
3183 - static-libs? ( tools )
3184 -"
3185 -
3186 -COMMON="
3187 - app-eselect/eselect-opencl
3188 - kernel_linux? ( >=sys-libs/glibc-2.6.1 )
3189 - tools? (
3190 - dev-libs/atk
3191 - dev-libs/glib:2
3192 - dev-libs/jansson
3193 - gtk3? ( x11-libs/gtk+:3 )
3194 - x11-libs/cairo
3195 - x11-libs/gdk-pixbuf[X]
3196 - x11-libs/gtk+:2
3197 - x11-libs/libX11
3198 - x11-libs/libXext
3199 - x11-libs/libXrandr
3200 - x11-libs/libXv
3201 - x11-libs/libXxf86vm
3202 - x11-libs/pango[X]
3203 - )
3204 - X? (
3205 - >=app-eselect/eselect-opengl-1.0.9
3206 - app-misc/pax-utils
3207 - )
3208 -"
3209 -DEPEND="
3210 - ${COMMON}
3211 - kernel_linux? ( virtual/linux-sources )
3212 -"
3213 -RDEPEND="
3214 - ${COMMON}
3215 - acpi? ( sys-power/acpid )
3216 - tools? ( !media-video/nvidia-settings )
3217 - X? (
3218 - <x11-base/xorg-server-1.18.99:=
3219 - >=x11-libs/libvdpau-0.3-r1
3220 - multilib? (
3221 - >=x11-libs/libX11-1.6.2[abi_x86_32]
3222 - >=x11-libs/libXext-1.3.2[abi_x86_32]
3223 - )
3224 - )
3225 -"
3226 -
3227 -QA_PREBUILT="opt/* usr/lib*"
3228 -
3229 -S=${WORKDIR}/
3230 -
3231 -pkg_pretend() {
3232 - if use amd64 && has_multilib_profile && \
3233 - [ "${DEFAULT_ABI}" != "amd64" ]; then
3234 - eerror "This ebuild doesn't currently support changing your default ABI"
3235 - die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
3236 - fi
3237 -
3238 - if use kernel_linux && kernel_is ge 4 5; then
3239 - ewarn "Gentoo supports kernels which are supported by NVIDIA"
3240 - ewarn "which are limited to the following kernels:"
3241 - ewarn "<sys-kernel/gentoo-sources-4.5"
3242 - ewarn "<sys-kernel/vanilla-sources-4.5"
3243 - ewarn ""
3244 - ewarn "You are free to utilize epatch_user to provide whatever"
3245 - ewarn "support you feel is appropriate, but will not receive"
3246 - ewarn "support as a result of those changes."
3247 - ewarn ""
3248 - ewarn "Do not file a bug report about this."
3249 - ewarn ""
3250 - fi
3251 -
3252 - # Since Nvidia ships many different series of drivers, we need to give the user
3253 - # some kind of guidance as to what version they should install. This tries
3254 - # to point the user in the right direction but can't be perfect. check
3255 - # nvidia-driver.eclass
3256 - nvidia-driver-check-warning
3257 -
3258 - # Kernel features/options to check for
3259 - CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
3260 - use x86 && CONFIG_CHECK+=" ~HIGHMEM"
3261 -
3262 - # Now do the above checks
3263 - use kernel_linux && check_extra_config
3264 -}
3265 -
3266 -pkg_setup() {
3267 - # try to turn off distcc and ccache for people that have a problem with it
3268 - export DISTCC_DISABLE=1
3269 - export CCACHE_DISABLE=1
3270 -
3271 - if use driver && use kernel_linux; then
3272 - MODULE_NAMES="nvidia(video:${S}/kernel)"
3273 - use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
3274 - use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel)"
3275 -
3276 - # This needs to run after MODULE_NAMES (so that the eclass checks
3277 - # whether the kernel supports loadable modules) but before BUILD_PARAMS
3278 - # is set (so that KV_DIR is populated).
3279 - linux-mod_pkg_setup
3280 -
3281 - BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
3282 - SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
3283 -
3284 - # linux-mod_src_compile calls set_arch_to_kernel, which
3285 - # sets the ARCH to x86 but NVIDIA's wrapping Makefile
3286 - # expects x86_64 or i386 and then converts it to x86
3287 - # later on in the build process
3288 - BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
3289 - fi
3290 -
3291 - if use kernel_linux && kernel_is lt 2 6 9; then
3292 - eerror "You must build this against 2.6.9 or higher kernels."
3293 - fi
3294 -
3295 - # set variables to where files are in the package structure
3296 - if use kernel_FreeBSD; then
3297 - use x86-fbsd && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
3298 - use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
3299 - NV_DOC="${S}/doc"
3300 - NV_OBJ="${S}/obj"
3301 - NV_SRC="${S}/src"
3302 - NV_MAN="${S}/x11/man"
3303 - NV_X11="${S}/obj"
3304 - NV_SOVER=1
3305 - elif use kernel_linux; then
3306 - NV_DOC="${S}"
3307 - NV_OBJ="${S}"
3308 - NV_SRC="${S}/kernel"
3309 - NV_MAN="${S}"
3310 - NV_X11="${S}"
3311 - NV_SOVER=${PV}
3312 - else
3313 - die "Could not determine proper NVIDIA package"
3314 - fi
3315 -}
3316 -
3317 -src_prepare() {
3318 - if use pax_kernel; then
3319 - ewarn "Using PAX patches is not supported. You will be asked to"
3320 - ewarn "use a standard kernel should you have issues. Should you"
3321 - ewarn "need support with these patches, contact the PaX team."
3322 - epatch "${FILESDIR}"/${PN}-355.06-pax.patch
3323 - fi
3324 -
3325 - # Allow user patches so they can support RC kernels and whatever else
3326 - epatch_user
3327 -}
3328 -
3329 -src_compile() {
3330 - # This is already the default on Linux, as there's no toplevel Makefile, but
3331 - # on FreeBSD there's one and triggers the kernel module build, as we install
3332 - # it by itself, pass this.
3333 -
3334 - cd "${NV_SRC}"
3335 - if use kernel_FreeBSD; then
3336 - MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
3337 - LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
3338 - elif use driver && use kernel_linux; then
3339 - MAKEOPTS=-j1
3340 - linux-mod_src_compile
3341 - fi
3342 -
3343 - if use tools; then
3344 - emake -C "${S}"/nvidia-settings-${PV}/src \
3345 - AR="$(tc-getAR)" \
3346 - CC="$(tc-getCC)" \
3347 - LIBDIR="$(get_libdir)" \
3348 - RANLIB="$(tc-getRANLIB)" \
3349 - build-xnvctrl
3350 -
3351 - emake -C "${S}"/nvidia-settings-${PV}/src \
3352 - CC="$(tc-getCC)" \
3353 - GTK3_AVAILABLE=$(usex gtk3 1 0) \
3354 - LD="$(tc-getCC)" \
3355 - LIBDIR="$(get_libdir)" \
3356 - NVML_ENABLED=0 \
3357 - NV_USE_BUNDLED_LIBJANSSON=0 \
3358 - NV_VERBOSE=1 \
3359 - STRIP_CMD=true
3360 - fi
3361 -}
3362 -
3363 -# Install nvidia library:
3364 -# the first parameter is the library to install
3365 -# the second parameter is the provided soversion
3366 -# the third parameter is the target directory if it is not /usr/lib
3367 -donvidia() {
3368 - # Full path to library
3369 - nv_LIB="${1}"
3370 -
3371 - # SOVER to use
3372 - nv_SOVER="$(scanelf -qF'%S#F' ${nv_LIB})"
3373 -
3374 - # Where to install
3375 - nv_DEST="${2}"
3376 -
3377 - # Get just the library name
3378 - nv_LIBNAME=$(basename "${nv_LIB}")
3379 -
3380 - if [[ "${nv_DEST}" ]]; then
3381 - exeinto ${nv_DEST}
3382 - action="doexe"
3383 - else
3384 - nv_DEST="/usr/$(get_libdir)"
3385 - action="dolib.so"
3386 - fi
3387 -
3388 - # Install the library
3389 - ${action} ${nv_LIB} || die "failed to install ${nv_LIBNAME}"
3390 -
3391 - # If the library has a SONAME and SONAME does not match the library name,
3392 - # then we need to create a symlink
3393 - if [[ ${nv_SOVER} ]] && ! [[ "${nv_SOVER}" = "${nv_LIBNAME}" ]]; then
3394 - dosym ${nv_LIBNAME} ${nv_DEST}/${nv_SOVER} \
3395 - || die "failed to create ${nv_DEST}/${nv_SOVER} symlink"
3396 - fi
3397 -
3398 - dosym ${nv_LIBNAME} ${nv_DEST}/${nv_LIBNAME/.so*/.so} \
3399 - || die "failed to create ${nv_LIBNAME/.so*/.so} symlink"
3400 -}
3401 -
3402 -src_install() {
3403 - if use driver && use kernel_linux; then
3404 - linux-mod_src_install
3405 -
3406 - # Add the aliases
3407 - # This file is tweaked with the appropriate video group in
3408 - # pkg_preinst, see bug #491414
3409 - insinto /etc/modprobe.d
3410 - newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
3411 - doins "${FILESDIR}"/nvidia-rmmod.conf
3412 -
3413 - # Ensures that our device nodes are created when not using X
3414 - exeinto "$(get_udevdir)"
3415 - newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
3416 - udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
3417 - elif use kernel_FreeBSD; then
3418 - if use x86-fbsd; then
3419 - insinto /boot/modules
3420 - doins "${S}/src/nvidia.kld"
3421 - fi
3422 -
3423 - exeinto /boot/modules
3424 - doexe "${S}/src/nvidia.ko"
3425 - fi
3426 -
3427 - # NVIDIA kernel <-> userspace driver config lib
3428 - donvidia ${NV_OBJ}/libnvidia-cfg.so.${NV_SOVER}
3429 -
3430 - # NVIDIA framebuffer capture library
3431 - donvidia ${NV_OBJ}/libnvidia-fbc.so.${NV_SOVER}
3432 -
3433 - # NVIDIA video encode/decode <-> CUDA
3434 - if use kernel_linux; then
3435 - donvidia ${NV_OBJ}/libnvcuvid.so.${NV_SOVER}
3436 - donvidia ${NV_OBJ}/libnvidia-encode.so.${NV_SOVER}
3437 - fi
3438 -
3439 - if use X; then
3440 - # Xorg DDX driver
3441 - insinto /usr/$(get_libdir)/xorg/modules/drivers
3442 - doins ${NV_X11}/nvidia_drv.so
3443 -
3444 - # Xorg GLX driver
3445 - donvidia ${NV_X11}/libglx.so.${NV_SOVER} \
3446 - /usr/$(get_libdir)/opengl/nvidia/extensions
3447 -
3448 - # Xorg nvidia.conf
3449 - if has_version '>=x11-base/xorg-server-1.16'; then
3450 - insinto /usr/share/X11/xorg.conf.d
3451 - newins {,50-}nvidia-drm-outputclass.conf
3452 - fi
3453 - fi
3454 -
3455 - # OpenCL ICD for NVIDIA
3456 - if use kernel_linux; then
3457 - insinto /etc/OpenCL/vendors
3458 - doins ${NV_OBJ}/nvidia.icd
3459 - fi
3460 -
3461 - # Documentation
3462 - dohtml ${NV_DOC}/html/*
3463 - if use kernel_FreeBSD; then
3464 - dodoc "${NV_DOC}/README"
3465 - use X && doman "${NV_MAN}/nvidia-xconfig.1"
3466 - use tools && doman "${NV_MAN}/nvidia-settings.1"
3467 - else
3468 - # Docs
3469 - newdoc "${NV_DOC}/README.txt" README
3470 - dodoc "${NV_DOC}/NVIDIA_Changelog"
3471 - doman "${NV_MAN}/nvidia-smi.1.gz"
3472 - use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
3473 - use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
3474 - doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
3475 - fi
3476 -
3477 - # Helper Apps
3478 - exeinto /opt/bin/
3479 -
3480 - if use X; then
3481 - doexe ${NV_OBJ}/nvidia-xconfig
3482 - fi
3483 -
3484 - if use kernel_linux; then
3485 - doexe ${NV_OBJ}/nvidia-cuda-mps-control
3486 - doexe ${NV_OBJ}/nvidia-cuda-mps-server
3487 - doexe ${NV_OBJ}/nvidia-debugdump
3488 - doexe ${NV_OBJ}/nvidia-persistenced
3489 - doexe ${NV_OBJ}/nvidia-smi
3490 -
3491 - # install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
3492 - doexe ${NV_OBJ}/nvidia-modprobe
3493 - fowners root:video /opt/bin/nvidia-modprobe
3494 - fperms 4710 /opt/bin/nvidia-modprobe
3495 - dosym /{opt,usr}/bin/nvidia-modprobe
3496 -
3497 - doman nvidia-cuda-mps-control.1.gz
3498 - doman nvidia-modprobe.1.gz
3499 - doman nvidia-persistenced.1.gz
3500 - newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
3501 - newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
3502 - newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
3503 - fi
3504 -
3505 - if use tools; then
3506 - emake -C "${S}"/nvidia-settings-${PV}/src/ \
3507 - DESTDIR="${D}" \
3508 - GTK3_AVAILABLE=$(usex gtk3 1 0) \
3509 - LIBDIR="${D}/usr/$(get_libdir)" \
3510 - PREFIX=/usr \
3511 - NV_USE_BUNDLED_LIBJANSSON=0 \
3512 - install
3513 -
3514 - if use static-libs; then
3515 - dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
3516 -
3517 - insinto /usr/include/NVCtrl
3518 - doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
3519 - fi
3520 -
3521 - insinto /usr/share/nvidia/
3522 - doins nvidia-application-profiles-${PV}-key-documentation
3523 -
3524 - insinto /etc/nvidia
3525 - newins \
3526 - nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
3527 -
3528 - # There is no icon in the FreeBSD tarball.
3529 - use kernel_FreeBSD || \
3530 - newicon ${NV_OBJ}/nvidia-settings.png ${PN}-settings.png
3531 -
3532 - domenu "${FILESDIR}"/${PN}-settings.desktop
3533 -
3534 - exeinto /etc/X11/xinit/xinitrc.d
3535 - doexe "${FILESDIR}"/95-nvidia-settings
3536 - fi
3537 -
3538 - dobin ${NV_OBJ}/nvidia-bug-report.sh
3539 -
3540 - if has_multilib_profile && use multilib; then
3541 - local OABI=${ABI}
3542 - for ABI in $(get_install_abis); do
3543 - src_install-libs
3544 - done
3545 - ABI=${OABI}
3546 - unset OABI
3547 - else
3548 - src_install-libs
3549 - fi
3550 -
3551 - is_final_abi || die "failed to iterate through all ABIs"
3552 -
3553 - readme.gentoo_create_doc
3554 -}
3555 -
3556 -src_install-libs() {
3557 - local inslibdir=$(get_libdir)
3558 - local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
3559 - local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
3560 - local libdir=${NV_OBJ}
3561 -
3562 - if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
3563 - libdir=${NV_OBJ}/32
3564 - fi
3565 -
3566 - if use X; then
3567 - NV_GLX_LIBRARIES=(
3568 - "libEGL.so.1 ${GL_ROOT}"
3569 - "libEGL_nvidia.so.${NV_SOVER} ${GL_ROOT}"
3570 - "libGL.so.1 ${GL_ROOT}"
3571 - "libGLESv1_CM.so.1 ${GL_ROOT}"
3572 - "libGLESv1_CM_nvidia.so.${NV_SOVER} ${GL_ROOT}"
3573 - "libGLESv2.so.2 ${GL_ROOT}"
3574 - "libGLESv2_nvidia.so.${NV_SOVER} ${GL_ROOT}"
3575 - "libGLX.so.0 ${GL_ROOT}"
3576 - "libGLX_nvidia.so.${NV_SOVER} ${GL_ROOT}"
3577 - "libGLdispatch.so.0 ${GL_ROOT}"
3578 - "libOpenCL.so.1.0.0 ${CL_ROOT}"
3579 - "libOpenGL.so.0 ${GL_ROOT}"
3580 - "libcuda.so.${NV_SOVER}"
3581 - "libnvcuvid.so.${NV_SOVER}"
3582 - "libnvidia-compiler.so.${NV_SOVER}"
3583 - "libnvidia-eglcore.so.${NV_SOVER}"
3584 - "libnvidia-encode.so.${NV_SOVER}"
3585 - "libnvidia-fatbinaryloader.so.${NV_SOVER}"
3586 - "libnvidia-fbc.so.${NV_SOVER}"
3587 - "libnvidia-glcore.so.${NV_SOVER}"
3588 - "libnvidia-glsi.so.${NV_SOVER}"
3589 - "libnvidia-ifr.so.${NV_SOVER}"
3590 - "libnvidia-opencl.so.${NV_SOVER}"
3591 - "libnvidia-ptxjitcompiler.so.${NV_SOVER}"
3592 - "libvdpau_nvidia.so.${NV_SOVER}"
3593 - )
3594 -
3595 - if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
3596 - then
3597 - NV_GLX_LIBRARIES+=( "libnvidia-wfb.so.${NV_SOVER}" )
3598 - fi
3599 -
3600 - if use kernel_FreeBSD; then
3601 - NV_GLX_LIBRARIES+=( "libnvidia-tls.so.${NV_SOVER}" )
3602 - fi
3603 -
3604 - if use kernel_linux; then
3605 - NV_GLX_LIBRARIES+=(
3606 - "libnvidia-ml.so.${NV_SOVER}"
3607 - "tls/libnvidia-tls.so.${NV_SOVER}"
3608 - )
3609 - fi
3610 -
3611 - for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
3612 - donvidia ${libdir}/${NV_LIB}
3613 - done
3614 - fi
3615 -}
3616 -
3617 -pkg_preinst() {
3618 - if use driver && use kernel_linux; then
3619 - linux-mod_pkg_preinst
3620 -
3621 - local videogroup="$(egetent group video | cut -d ':' -f 3)"
3622 - if [ -z "${videogroup}" ]; then
3623 - eerror "Failed to determine the video group gid"
3624 - die "Failed to determine the video group gid"
3625 - else
3626 - sed -i \
3627 - -e "s:PACKAGE:${PF}:g" \
3628 - -e "s:VIDEOGID:${videogroup}:" \
3629 - "${D}"/etc/modprobe.d/nvidia.conf || die
3630 - fi
3631 - fi
3632 -
3633 - # Clean the dynamic libGL stuff's home to ensure
3634 - # we dont have stale libs floating around
3635 - if [ -d "${ROOT}"/usr/lib/opengl/nvidia ]; then
3636 - rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
3637 - fi
3638 - # Make sure we nuke the old nvidia-glx's env.d file
3639 - if [ -e "${ROOT}"/etc/env.d/09nvidia ]; then
3640 - rm -f "${ROOT}"/etc/env.d/09nvidia
3641 - fi
3642 -}
3643 -
3644 -pkg_postinst() {
3645 - use driver && use kernel_linux && linux-mod_pkg_postinst
3646 -
3647 - # Switch to the nvidia implementation
3648 - use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
3649 - "${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
3650 -
3651 - readme.gentoo_print_elog
3652 -
3653 - if ! use X; then
3654 - elog "You have elected to not install the X.org driver. Along with"
3655 - elog "this the OpenGL libraries and VDPAU libraries were not"
3656 - elog "installed. Additionally, once the driver is loaded your card"
3657 - elog "and fan will run at max speed which may not be desirable."
3658 - elog "Use the 'nvidia-smi' init script to have your card and fan"
3659 - elog "speed scale appropriately."
3660 - elog
3661 - fi
3662 - if ! use tools; then
3663 - elog "USE=tools controls whether the nvidia-settings application"
3664 - elog "is installed. If you would like to use it, enable that"
3665 - elog "flag and re-emerge this ebuild. Optionally you can install"
3666 - elog "media-video/nvidia-settings"
3667 - elog
3668 - fi
3669 -}
3670 -
3671 -pkg_prerm() {
3672 - use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
3673 -}
3674 -
3675 -pkg_postrm() {
3676 - use driver && use kernel_linux && linux-mod_pkg_postrm
3677 - use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
3678 -}