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