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.46.ebuild nvidia-drivers-343.22.ebuild nvidia-drivers-343.13-r1.ebuild
Date: Wed, 01 Oct 2014 09:40:02
Message-Id: 20141001093958.EFAF36A88@oystercatcher.gentoo.org
1 jer 14/10/01 09:39:58
2
3 Modified: ChangeLog
4 Added: nvidia-drivers-340.46.ebuild
5 Removed: nvidia-drivers-343.22.ebuild
6 nvidia-drivers-343.13-r1.ebuild
7 Log:
8 Version bump.
9
10 (Portage version: 2.2.14_rc1/cvs/Linux x86_64, signed Manifest commit with key A792A613)
11
12 Revision Changes Path
13 1.579 x11-drivers/nvidia-drivers/ChangeLog
14
15 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog?rev=1.579&view=markup
16 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog?rev=1.579&content-type=text/plain
17 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog?r1=1.578&r2=1.579
18
19 Index: ChangeLog
20 ===================================================================
21 RCS file: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog,v
22 retrieving revision 1.578
23 retrieving revision 1.579
24 diff -u -r1.578 -r1.579
25 --- ChangeLog 22 Sep 2014 07:44:07 -0000 1.578
26 +++ ChangeLog 1 Oct 2014 09:39:58 -0000 1.579
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.578 2014/09/22 07:44:07 jer Exp $
31 +# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog,v 1.579 2014/10/01 09:39:58 jer Exp $
32 +
33 +*nvidia-drivers-340.46 (01 Oct 2014)
34 +
35 + 01 Oct 2014; Jeroen Roovers <jer@g.o> +nvidia-drivers-340.46.ebuild,
36 + -nvidia-drivers-343.13-r1.ebuild, -nvidia-drivers-343.22.ebuild:
37 + Version bump.
38
39 *nvidia-drivers-340.32-r1 (22 Sep 2014)
40
41
42
43
44 1.1 x11-drivers/nvidia-drivers/nvidia-drivers-340.46.ebuild
45
46 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-340.46.ebuild?rev=1.1&view=markup
47 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-340.46.ebuild?rev=1.1&content-type=text/plain
48
49 Index: nvidia-drivers-340.46.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-340.46.ebuild,v 1.1 2014/10/01 09:39:58 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.16.99
108 >=x11-libs/libvdpau-0.3-r1
109 multilib? (
110 || (
111 (
112 >=x11-libs/libX11-1.6.2[abi_x86_32]
113 >=x11-libs/libXext-1.3.2[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 17 ; 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.17"
139 ewarn "<sys-kernel/vanilla-sources-3.17"
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 "$(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 newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
382 newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
383 fi
384
385 if use tools; then
386 doexe ${NV_OBJ}/nvidia-settings
387 insinto /usr/share/nvidia/
388 doins nvidia-application-profiles-${PV}-key-documentation
389 insinto /etc/nvidia
390 newins nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
391 fi
392
393 exeinto /usr/bin/
394 doexe ${NV_OBJ}/nvidia-bug-report.sh
395
396 # Desktop entries for nvidia-settings
397 if use tools ; then
398 # There is no icon in the FreeBSD tarball.
399 use kernel_FreeBSD || newicon ${NV_OBJ}/nvidia-settings.png ${PN}-settings.png
400 domenu "${FILESDIR}"/${PN}-settings.desktop
401 exeinto /etc/X11/xinit/xinitrc.d
402 doexe "${FILESDIR}"/95-nvidia-settings
403 fi
404
405 #doenvd "${FILESDIR}"/50nvidia-prelink-blacklist
406
407 if has_multilib_profile && use multilib ; then
408 local OABI=${ABI}
409 for ABI in $(get_install_abis) ; do
410 src_install-libs
411 done
412 ABI=${OABI}
413 unset OABI
414 else
415 src_install-libs
416 fi
417
418 is_final_abi || die "failed to iterate through all ABIs"
419
420 readme.gentoo_create_doc
421 }
422
423 src_install-libs() {
424 local inslibdir=$(get_libdir)
425 local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
426 local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
427 local libdir=${NV_OBJ}
428
429 if use kernel_linux && has_multilib_profile && \
430 [[ ${ABI} == "x86" ]] ; then
431 libdir=${NV_OBJ}/32
432 fi
433
434 if use X; then
435 # The GLX libraries
436 donvidia ${libdir}/libEGL.so ${NV_SOVER} ${GL_ROOT}
437 donvidia ${libdir}/libGL.so ${NV_SOVER} ${GL_ROOT}
438 donvidia ${libdir}/libGLESv1_CM.so ${NV_SOVER} ${GL_ROOT}
439 donvidia ${libdir}/libnvidia-eglcore.so ${NV_SOVER}
440 donvidia ${libdir}/libnvidia-glcore.so ${NV_SOVER}
441 donvidia ${libdir}/libnvidia-glsi.so ${NV_SOVER}
442 donvidia ${libdir}/libnvidia-ifr.so ${NV_SOVER}
443 if use kernel_FreeBSD; then
444 donvidia ${libdir}/libnvidia-tls.so ${NV_SOVER}
445 else
446 donvidia ${libdir}/tls/libnvidia-tls.so ${NV_SOVER}
447 fi
448
449 # VDPAU
450 donvidia ${libdir}/libvdpau_nvidia.so ${NV_SOVER}
451
452 # GLES v2 libraries
453 insinto ${GL_ROOT}
454 doexe ${libdir}/libGLESv2.so.${PV}
455 dosym libGLESv2.so.${PV} ${GL_ROOT}/libGLESv2.so.2
456 dosym libGLESv2.so.2 ${GL_ROOT}/libGLESv2.so
457 fi
458
459 # NVIDIA monitoring library
460 if use kernel_linux ; then
461 donvidia ${libdir}/libnvidia-ml.so ${NV_SOVER}
462 fi
463
464 # CUDA & OpenCL
465 if use kernel_linux; then
466 donvidia ${libdir}/libcuda.so ${NV_SOVER}
467 donvidia ${libdir}/libnvidia-compiler.so ${NV_SOVER}
468 donvidia ${libdir}/libOpenCL.so 1.0.0 ${CL_ROOT}
469 donvidia ${libdir}/libnvidia-opencl.so ${NV_SOVER}
470 fi
471 }
472
473 pkg_preinst() {
474 if use kernel_linux; then
475 linux-mod_pkg_preinst
476
477 local videogroup="$(egetent group video | cut -d ':' -f 3)"
478 if [ -z "${videogroup}" ]; then
479 eerror "Failed to determine the video group gid"
480 die "Failed to determine the video group gid"
481 else
482 sed -i \
483 -e "s:PACKAGE:${PF}:g" \
484 -e "s:VIDEOGID:${videogroup}:" \
485 "${D}"/etc/modprobe.d/nvidia.conf || die
486 fi
487 fi
488
489 # Clean the dynamic libGL stuff's home to ensure
490 # we dont have stale libs floating around
491 if [ -d "${ROOT}"/usr/lib/opengl/nvidia ] ; then
492 rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
493 fi
494 # Make sure we nuke the old nvidia-glx's env.d file
495 if [ -e "${ROOT}"/etc/env.d/09nvidia ] ; then
496 rm -f "${ROOT}"/etc/env.d/09nvidia
497 fi
498 }
499
500 pkg_postinst() {
501 use kernel_linux && linux-mod_pkg_postinst
502
503 # Switch to the nvidia implementation
504 use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
505 "${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
506
507 readme.gentoo_print_elog
508
509 if ! use X; then
510 elog "You have elected to not install the X.org driver. Along with"
511 elog "this the OpenGL libraries and VDPAU libraries were not"
512 elog "installed. Additionally, once the driver is loaded your card"
513 elog "and fan will run at max speed which may not be desirable."
514 elog "Use the 'nvidia-smi' init script to have your card and fan"
515 elog "speed scale appropriately."
516 elog
517 fi
518 if ! use tools; then
519 elog "USE=tools controls whether the nvidia-settings application"
520 elog "is installed. If you would like to use it, enable that"
521 elog "flag and re-emerge this ebuild. Optionally you can install"
522 elog "media-video/nvidia-settings"
523 elog
524 fi
525 }
526
527 pkg_prerm() {
528 use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
529 }
530
531 pkg_postrm() {
532 use kernel_linux && linux-mod_pkg_postrm
533 use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
534 }