Gentoo Archives: gentoo-commits

From: "Jeroen Roovers (jer)" <jer@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in x11-drivers/nvidia-drivers: nvidia-drivers-334.21-r3.ebuild ChangeLog nvidia-drivers-331.67.ebuild nvidia-drivers-337.12.ebuild nvidia-drivers-337.19.ebuild
Date: Mon, 05 May 2014 18:16:06
Message-Id: 20140505181601.C64422004C@flycatcher.gentoo.org
1 jer 14/05/05 18:16:01
2
3 Modified: nvidia-drivers-334.21-r3.ebuild ChangeLog
4 nvidia-drivers-331.67.ebuild
5 nvidia-drivers-337.12.ebuild
6 Added: nvidia-drivers-337.19.ebuild
7 Log:
8 Version bump. Work around parallel make failure on Module.symvers with USE=uvm.
9
10 (Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key A792A613)
11
12 Revision Changes Path
13 1.5 x11-drivers/nvidia-drivers/nvidia-drivers-334.21-r3.ebuild
14
15 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-334.21-r3.ebuild?rev=1.5&view=markup
16 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-334.21-r3.ebuild?rev=1.5&content-type=text/plain
17 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-334.21-r3.ebuild?r1=1.4&r2=1.5
18
19 Index: nvidia-drivers-334.21-r3.ebuild
20 ===================================================================
21 RCS file: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-334.21-r3.ebuild,v
22 retrieving revision 1.4
23 retrieving revision 1.5
24 diff -u -r1.4 -r1.5
25 --- nvidia-drivers-334.21-r3.ebuild 9 Apr 2014 16:05:24 -0000 1.4
26 +++ nvidia-drivers-334.21-r3.ebuild 5 May 2014 18:16:01 -0000 1.5
27 @@ -1,6 +1,6 @@
28 # Copyright 1999-2014 Gentoo Foundation
29 # Distributed under the terms of the GNU General Public License v2
30 -# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-334.21-r3.ebuild,v 1.4 2014/04/09 16:05:24 jer Exp $
31 +# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-334.21-r3.ebuild,v 1.5 2014/05/05 18:16:01 jer Exp $
32
33 EAPI=5
34
35 @@ -115,11 +115,8 @@
36 export CCACHE_DISABLE=1
37
38 if use kernel_linux; then
39 - # Because of awkward limitations of linux-mod.eclass, the order in
40 - # which the modules are listed somehow affects module dependencies,
41 - # so we list nvidia-uvm first and then nvidia.
42 - use uvm && MODULE_NAMES="nvidia-uvm(video:${S}/kernel/uvm)"
43 - MODULE_NAMES+=" nvidia(video:${S}/kernel)"
44 + MODULE_NAMES="nvidia(video:${S}/kernel)"
45 + use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel/uvm)"
46
47 # This needs to run after MODULE_NAMES (so that the eclass checks
48 # whether the kernel supports loadable modules) but before BUILD_PARAMS
49 @@ -191,6 +188,7 @@
50 MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
51 LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
52 elif use kernel_linux; then
53 + use uvm && MAKEOPTS=-j1
54 linux-mod_src_compile
55 fi
56 }
57
58
59
60 1.550 x11-drivers/nvidia-drivers/ChangeLog
61
62 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog?rev=1.550&view=markup
63 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog?rev=1.550&content-type=text/plain
64 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog?r1=1.549&r2=1.550
65
66 Index: ChangeLog
67 ===================================================================
68 RCS file: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog,v
69 retrieving revision 1.549
70 retrieving revision 1.550
71 diff -u -r1.549 -r1.550
72 --- ChangeLog 2 May 2014 12:38:09 -0000 1.549
73 +++ ChangeLog 5 May 2014 18:16:01 -0000 1.550
74 @@ -1,6 +1,14 @@
75 # ChangeLog for x11-drivers/nvidia-drivers
76 # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
77 -# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog,v 1.549 2014/05/02 12:38:09 jer Exp $
78 +# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog,v 1.550 2014/05/05 18:16:01 jer Exp $
79 +
80 +*nvidia-drivers-337.19 (05 May 2014)
81 +
82 + 05 May 2014; Jeroen Roovers <jer@g.o> nvidia-drivers-331.67.ebuild,
83 + nvidia-drivers-334.21-r3.ebuild, nvidia-drivers-337.12.ebuild,
84 + +nvidia-drivers-337.19.ebuild:
85 + Version bump. Work around parallel make failure on Module.symvers with
86 + USE=uvm.
87
88 02 May 2014; Jeroen Roovers <jer@g.o>
89 -nvidia-drivers-331.49-r3.ebuild, nvidia-drivers-331.67.ebuild:
90
91
92
93 1.3 x11-drivers/nvidia-drivers/nvidia-drivers-331.67.ebuild
94
95 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-331.67.ebuild?rev=1.3&view=markup
96 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-331.67.ebuild?rev=1.3&content-type=text/plain
97 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-331.67.ebuild?r1=1.2&r2=1.3
98
99 Index: nvidia-drivers-331.67.ebuild
100 ===================================================================
101 RCS file: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-331.67.ebuild,v
102 retrieving revision 1.2
103 retrieving revision 1.3
104 diff -u -r1.2 -r1.3
105 --- nvidia-drivers-331.67.ebuild 2 May 2014 12:38:09 -0000 1.2
106 +++ nvidia-drivers-331.67.ebuild 5 May 2014 18:16:01 -0000 1.3
107 @@ -1,6 +1,6 @@
108 # Copyright 1999-2014 Gentoo Foundation
109 # Distributed under the terms of the GNU General Public License v2
110 -# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-331.67.ebuild,v 1.2 2014/05/02 12:38:09 jer Exp $
111 +# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-331.67.ebuild,v 1.3 2014/05/05 18:16:01 jer Exp $
112
113 EAPI=5
114
115 @@ -197,6 +197,7 @@
116 MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
117 LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
118 elif use kernel_linux; then
119 + use uvm && MAKEOPTS=-j1
120 linux-mod_src_compile
121 fi
122 }
123
124
125
126 1.2 x11-drivers/nvidia-drivers/nvidia-drivers-337.12.ebuild
127
128 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-337.12.ebuild?rev=1.2&view=markup
129 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-337.12.ebuild?rev=1.2&content-type=text/plain
130 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-337.12.ebuild?r1=1.1&r2=1.2
131
132 Index: nvidia-drivers-337.12.ebuild
133 ===================================================================
134 RCS file: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-337.12.ebuild,v
135 retrieving revision 1.1
136 retrieving revision 1.2
137 diff -u -r1.1 -r1.2
138 --- nvidia-drivers-337.12.ebuild 9 Apr 2014 16:05:24 -0000 1.1
139 +++ nvidia-drivers-337.12.ebuild 5 May 2014 18:16:01 -0000 1.2
140 @@ -1,6 +1,6 @@
141 # Copyright 1999-2014 Gentoo Foundation
142 # Distributed under the terms of the GNU General Public License v2
143 -# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-337.12.ebuild,v 1.1 2014/04/09 16:05:24 jer Exp $
144 +# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-337.12.ebuild,v 1.2 2014/05/05 18:16:01 jer Exp $
145
146 EAPI=5
147
148 @@ -188,6 +188,7 @@
149 MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
150 LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
151 elif use kernel_linux; then
152 + use uvm && MAKEOPTS=-j1
153 linux-mod_src_compile
154 fi
155 }
156
157
158
159 1.1 x11-drivers/nvidia-drivers/nvidia-drivers-337.19.ebuild
160
161 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-337.19.ebuild?rev=1.1&view=markup
162 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-337.19.ebuild?rev=1.1&content-type=text/plain
163
164 Index: nvidia-drivers-337.19.ebuild
165 ===================================================================
166 # Copyright 1999-2014 Gentoo Foundation
167 # Distributed under the terms of the GNU General Public License v2
168 # $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-337.19.ebuild,v 1.1 2014/05/05 18:16:01 jer Exp $
169
170 EAPI=5
171
172 inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \
173 portability toolchain-funcs unpacker user udev
174
175 NV_URI="http://us.download.nvidia.com/XFree86/"
176 X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
177 AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
178 X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
179 AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
180
181 DESCRIPTION="NVIDIA Accelerated Graphics Driver"
182 HOMEPAGE="http://www.nvidia.com/"
183 SRC_URI="
184 amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
185 amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
186 x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
187 x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
188 "
189
190 LICENSE="GPL-2 NVIDIA-r2"
191 SLOT="0"
192 KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
193 IUSE="acpi multilib kernel_FreeBSD kernel_linux pax_kernel +tools +X uvm"
194 RESTRICT="bindist mirror strip"
195 EMULTILIB_PKG="true"
196
197 COMMON="
198 app-admin/eselect-opencl
199 kernel_linux? ( >=sys-libs/glibc-2.6.1 )
200 X? (
201 >=app-admin/eselect-opengl-1.0.9
202 )
203 "
204 DEPEND="
205 ${COMMON}
206 app-arch/xz-utils
207 kernel_linux? ( virtual/linux-sources )
208 "
209 RDEPEND="
210 ${COMMON}
211 acpi? ( sys-power/acpid )
212 tools? (
213 dev-libs/atk
214 dev-libs/glib
215 x11-libs/gdk-pixbuf
216 >=x11-libs/gtk+-2.4:2
217 x11-libs/libX11
218 x11-libs/libXext
219 x11-libs/pango[X]
220 )
221 X? (
222 <x11-base/xorg-server-1.15.99
223 >=x11-libs/libvdpau-0.3-r1
224 multilib? (
225 || (
226 (
227 x11-libs/libX11[abi_x86_32]
228 x11-libs/libXext[abi_x86_32]
229 )
230 app-emulation/emul-linux-x86-xlibs
231 )
232 )
233 )
234 "
235
236 REQUIRED_USE="tools? ( X )"
237
238 QA_PREBUILT="opt/* usr/lib*"
239
240 S=${WORKDIR}/
241
242 pkg_pretend() {
243
244 if use amd64 && has_multilib_profile && \
245 [ "${DEFAULT_ABI}" != "amd64" ]; then
246 eerror "This ebuild doesn't currently support changing your default ABI"
247 die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
248 fi
249
250 if use kernel_linux && kernel_is ge 3 15 ; then
251 ewarn "Gentoo supports kernels which are supported by NVIDIA"
252 ewarn "which are limited to the following kernels:"
253 ewarn "<sys-kernel/gentoo-sources-3.15"
254 ewarn "<sys-kernel/vanilla-sources-3.15"
255 ewarn ""
256 ewarn "You are free to utilize epatch_user to provide whatever"
257 ewarn "support you feel is appropriate, but will not receive"
258 ewarn "support as a result of those changes."
259 ewarn ""
260 ewarn "Do not file a bug report about this."
261 fi
262
263 # Since Nvidia ships 3 different series of drivers, we need to give the user
264 # some kind of guidance as to what version they should install. This tries
265 # to point the user in the right direction but can't be perfect. check
266 # nvidia-driver.eclass
267 nvidia-driver-check-warning
268
269 # Kernel features/options to check for
270 CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
271 use x86 && CONFIG_CHECK+=" ~HIGHMEM"
272
273 # Now do the above checks
274 use kernel_linux && check_extra_config
275 }
276
277 pkg_setup() {
278 # try to turn off distcc and ccache for people that have a problem with it
279 export DISTCC_DISABLE=1
280 export CCACHE_DISABLE=1
281
282 if use kernel_linux; then
283 MODULE_NAMES="nvidia(video:${S}/kernel)"
284 use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel/uvm)"
285
286 # This needs to run after MODULE_NAMES (so that the eclass checks
287 # whether the kernel supports loadable modules) but before BUILD_PARAMS
288 # is set (so that KV_DIR is populated).
289 linux-mod_pkg_setup
290
291 BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
292 SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC)"
293
294 # linux-mod_src_compile calls set_arch_to_kernel, which
295 # sets the ARCH to x86 but NVIDIA's wrapping Makefile
296 # expects x86_64 or i386 and then converts it to x86
297 # later on in the build process
298 BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
299 fi
300
301 # set variables to where files are in the package structure
302 if use kernel_FreeBSD; then
303 use x86-fbsd && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
304 use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
305 NV_DOC="${S}/doc"
306 NV_OBJ="${S}/obj"
307 NV_SRC="${S}/src"
308 NV_MAN="${S}/x11/man"
309 NV_X11="${S}/obj"
310 NV_SOVER=1
311 elif use kernel_linux; then
312 NV_DOC="${S}"
313 NV_OBJ="${S}"
314 NV_SRC="${S}/kernel"
315 NV_MAN="${S}"
316 NV_X11="${S}"
317 NV_SOVER=${PV}
318 else
319 die "Could not determine proper NVIDIA package"
320 fi
321 }
322
323 src_prepare() {
324 # Please add a brief description for every added patch
325
326 if use kernel_linux; then
327 if kernel_is lt 2 6 9 ; then
328 eerror "You must build this against 2.6.9 or higher kernels."
329 fi
330
331 # If greater than 2.6.5 use M= instead of SUBDIR=
332 # convert_to_m "${NV_SRC}"/Makefile.kbuild
333 fi
334
335 if use pax_kernel; then
336 ewarn "Using PAX patches is not supported. You will be asked to"
337 ewarn "use a standard kernel should you have issues. Should you"
338 ewarn "need support with these patches, contact the PaX team."
339 epatch "${FILESDIR}"/${PN}-331.13-pax-usercopy.patch
340 fi
341
342 # Allow user patches so they can support RC kernels and whatever else
343 epatch_user
344 }
345
346 src_compile() {
347 # This is already the default on Linux, as there's no toplevel Makefile, but
348 # on FreeBSD there's one and triggers the kernel module build, as we install
349 # it by itself, pass this.
350
351 cd "${NV_SRC}"
352 if use kernel_FreeBSD; then
353 MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
354 LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
355 elif use kernel_linux; then
356 use uvm && MAKEOPTS=-j1
357 linux-mod_src_compile
358 fi
359 }
360
361 # Install nvidia library:
362 # the first parameter is the library to install
363 # the second parameter is the provided soversion
364 # the third parameter is the target directory if its not /usr/lib
365 donvidia() {
366 # Full path to library minus SOVER
367 MY_LIB="$1"
368
369 # SOVER to use
370 MY_SOVER="$2"
371
372 # Where to install
373 MY_DEST="$3"
374
375 if [[ -z "${MY_DEST}" ]]; then
376 MY_DEST="/usr/$(get_libdir)"
377 action="dolib.so"
378 else
379 exeinto ${MY_DEST}
380 action="doexe"
381 fi
382
383 # Get just the library name
384 libname=$(basename $1)
385
386 # Install the library with the correct SOVER
387 ${action} ${MY_LIB}.${MY_SOVER} || \
388 die "failed to install ${libname}"
389
390 # If SOVER wasn't 1, then we need to create a .1 symlink
391 if [[ "${MY_SOVER}" != "1" ]]; then
392 dosym ${libname}.${MY_SOVER} \
393 ${MY_DEST}/${libname}.1 || \
394 die "failed to create ${libname} symlink"
395 fi
396
397 # Always create the symlink from the raw lib to the .1
398 dosym ${libname}.1 \
399 ${MY_DEST}/${libname} || \
400 die "failed to create ${libname} symlink"
401 }
402
403 src_install() {
404 if use kernel_linux; then
405 linux-mod_src_install
406
407 # Add the aliases
408 # This file is tweaked with the appropriate video group in
409 # pkg_preinst, see bug #491414
410 insinto /etc/modprobe.d
411 newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
412 use uvm && doins "${FILESDIR}"/nvidia-uvm.conf
413
414 # Ensures that our device nodes are created when not using X
415 exeinto "$(udev_get_udevdir)"
416 doexe "${FILESDIR}"/nvidia-udev.sh
417 udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
418 elif use kernel_FreeBSD; then
419 if use x86-fbsd; then
420 insinto /boot/modules
421 doins "${S}/src/nvidia.kld"
422 fi
423
424 exeinto /boot/modules
425 doexe "${S}/src/nvidia.ko"
426 fi
427
428 # NVIDIA kernel <-> userspace driver config lib
429 donvidia ${NV_OBJ}/libnvidia-cfg.so ${NV_SOVER}
430
431 # NVIDIA framebuffer capture library
432 donvidia ${NV_OBJ}/libnvidia-fbc.so ${NV_SOVER}
433
434 # NVIDIA video encode/decode <-> CUDA
435 if use kernel_linux; then
436 donvidia ${NV_OBJ}/libnvcuvid.so ${NV_SOVER}
437 donvidia ${NV_OBJ}/libnvidia-encode.so ${NV_SOVER}
438 fi
439
440 if use X; then
441 # Xorg DDX driver
442 insinto /usr/$(get_libdir)/xorg/modules/drivers
443 doins ${NV_X11}/nvidia_drv.so
444
445 # Xorg GLX driver
446 donvidia ${NV_X11}/libglx.so ${NV_SOVER} \
447 /usr/$(get_libdir)/opengl/nvidia/extensions
448 fi
449
450 # OpenCL ICD for NVIDIA
451 if use kernel_linux; then
452 insinto /etc/OpenCL/vendors
453 doins ${NV_OBJ}/nvidia.icd
454 fi
455
456 # Documentation
457 dohtml ${NV_DOC}/html/*
458 if use kernel_FreeBSD; then
459 dodoc "${NV_DOC}/README"
460 use X && doman "${NV_MAN}/nvidia-xconfig.1"
461 use tools && doman "${NV_MAN}/nvidia-settings.1"
462 else
463 # Docs
464 newdoc "${NV_DOC}/README.txt" README
465 dodoc "${NV_DOC}/NVIDIA_Changelog"
466 doman "${NV_MAN}/nvidia-smi.1.gz"
467 use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
468 use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
469 doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
470 fi
471
472 # Helper Apps
473 exeinto /opt/bin/
474
475 if use X; then
476 doexe ${NV_OBJ}/nvidia-xconfig
477 fi
478
479 if use kernel_linux ; then
480 doexe ${NV_OBJ}/nvidia-cuda-mps-control
481 doexe ${NV_OBJ}/nvidia-cuda-mps-server
482 doexe ${NV_OBJ}/nvidia-debugdump
483 doexe ${NV_OBJ}/nvidia-persistenced
484 doexe ${NV_OBJ}/nvidia-smi
485
486 # install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
487 doexe ${NV_OBJ}/nvidia-modprobe
488 fowners root:video /opt/bin/nvidia-modprobe
489 fperms 4710 /opt/bin/nvidia-modprobe
490 dosym /{opt,usr}/bin/nvidia-modprobe
491
492 doman nvidia-cuda-mps-control.1.gz
493 doman nvidia-modprobe.1.gz
494 doman nvidia-persistenced.1.gz
495 newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
496 fi
497
498 if use tools; then
499 doexe ${NV_OBJ}/nvidia-settings
500 fi
501
502 exeinto /usr/bin/
503 doexe ${NV_OBJ}/nvidia-bug-report.sh
504
505 # Desktop entries for nvidia-settings
506 if use tools ; then
507 # There is no icon in the FreeBSD tarball.
508 use kernel_FreeBSD || newicon ${NV_OBJ}/nvidia-settings.png ${PN}-settings.png
509 domenu "${FILESDIR}"/${PN}-settings.desktop
510 exeinto /etc/X11/xinit/xinitrc.d
511 doexe "${FILESDIR}"/95-nvidia-settings
512 fi
513
514 #doenvd "${FILESDIR}"/50nvidia-prelink-blacklist
515
516 if has_multilib_profile && use multilib ; then
517 local OABI=${ABI}
518 for ABI in $(get_install_abis) ; do
519 src_install-libs
520 done
521 ABI=${OABI}
522 unset OABI
523 else
524 src_install-libs
525 fi
526
527 is_final_abi || die "failed to iterate through all ABIs"
528
529 readme.gentoo_create_doc
530 }
531
532 src_install-libs() {
533 local inslibdir=$(get_libdir)
534 local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
535 local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
536 local libdir=${NV_OBJ}
537
538 if use kernel_linux && has_multilib_profile && \
539 [[ ${ABI} == "x86" ]] ; then
540 libdir=${NV_OBJ}/32
541 fi
542
543 if use X; then
544 # The GLX libraries
545 donvidia ${libdir}/libEGL.so ${NV_SOVER} ${GL_ROOT}
546 donvidia ${libdir}/libGL.so ${NV_SOVER} ${GL_ROOT}
547 donvidia ${libdir}/libGLESv1_CM.so ${NV_SOVER} ${GL_ROOT}
548 donvidia ${libdir}/libnvidia-eglcore.so ${NV_SOVER}
549 donvidia ${libdir}/libnvidia-glcore.so ${NV_SOVER}
550 donvidia ${libdir}/libnvidia-glsi.so ${NV_SOVER}
551 donvidia ${libdir}/libnvidia-ifr.so ${NV_SOVER}
552 if use kernel_FreeBSD; then
553 donvidia ${libdir}/libnvidia-tls.so ${NV_SOVER}
554 else
555 donvidia ${libdir}/tls/libnvidia-tls.so ${NV_SOVER}
556 fi
557
558 # VDPAU
559 donvidia ${libdir}/libvdpau_nvidia.so ${NV_SOVER}
560
561 # GLES v2 libraries
562 insinto ${GL_ROOT}
563 doexe ${libdir}/libGLESv2.so.${PV}
564 dosym libGLESv2.so.${PV} ${GL_ROOT}/libGLESv2.so.2
565 dosym libGLESv2.so.2 ${GL_ROOT}/libGLESv2.so
566 fi
567
568 # NVIDIA monitoring library
569 if use kernel_linux ; then
570 donvidia ${libdir}/libnvidia-ml.so ${NV_SOVER}
571 fi
572
573 # CUDA & OpenCL
574 if use kernel_linux; then
575 donvidia ${libdir}/libcuda.so ${NV_SOVER}
576 donvidia ${libdir}/libnvidia-compiler.so ${NV_SOVER}
577 donvidia ${libdir}/libOpenCL.so 1.0.0 ${CL_ROOT}
578 donvidia ${libdir}/libnvidia-opencl.so ${NV_SOVER}
579 fi
580 }
581
582 pkg_preinst() {
583 if use kernel_linux; then
584 linux-mod_pkg_preinst
585
586 local videogroup="$(egetent group video | cut -d ':' -f 3)"
587 if [ -z "${videogroup}" ]; then
588 eerror "Failed to determine the video group gid"
589 die "Failed to determine the video group gid"
590 else
591 sed -i \
592 -e "s:PACKAGE:${PF}:g" \
593 -e "s:VIDEOGID:${videogroup}:" \
594 "${D}"/etc/modprobe.d/nvidia.conf || die
595 fi
596 fi
597
598 # Clean the dynamic libGL stuff's home to ensure
599 # we dont have stale libs floating around
600 if [ -d "${ROOT}"/usr/lib/opengl/nvidia ] ; then
601 rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
602 fi
603 # Make sure we nuke the old nvidia-glx's env.d file
604 if [ -e "${ROOT}"/etc/env.d/09nvidia ] ; then
605 rm -f "${ROOT}"/etc/env.d/09nvidia
606 fi
607 }
608
609 pkg_postinst() {
610 use kernel_linux && linux-mod_pkg_postinst
611
612 # Switch to the nvidia implementation
613 use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
614 "${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
615
616 readme.gentoo_print_elog
617
618 if ! use X; then
619 elog "You have elected to not install the X.org driver. Along with"
620 elog "this the OpenGL libraries and VDPAU libraries were not"
621 elog "installed. Additionally, once the driver is loaded your card"
622 elog "and fan will run at max speed which may not be desirable."
623 elog "Use the 'nvidia-smi' init script to have your card and fan"
624 elog "speed scale appropriately."
625 elog
626 fi
627 if ! use tools; then
628 elog "USE=tools controls whether the nvidia-settings application"
629 elog "is installed. If you would like to use it, enable that"
630 elog "flag and re-emerge this ebuild. Optionally you can install"
631 elog "media-video/nvidia-settings"
632 elog
633 fi
634 }
635
636 pkg_prerm() {
637 use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
638 }
639
640 pkg_postrm() {
641 use kernel_linux && linux-mod_pkg_postrm
642 use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
643 }