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