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