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.16-r5.ebuild ChangeLog nvidia-drivers-334.16-r4.ebuild
Date: Mon, 10 Feb 2014 16:22:44
Message-Id: 20140210162241.3A31A2004C@flycatcher.gentoo.org
1 jer 14/02/10 16:22:41
2
3 Modified: ChangeLog
4 Added: nvidia-drivers-334.16-r5.ebuild
5 Removed: nvidia-drivers-334.16-r4.ebuild
6 Log:
7 Install the correct libGLESv2.so in multilib cases (bug #500866 by Enrico Tagliavini).
8
9 (Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key A792A613)
10
11 Revision Changes Path
12 1.524 x11-drivers/nvidia-drivers/ChangeLog
13
14 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog?rev=1.524&view=markup
15 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog?rev=1.524&content-type=text/plain
16 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog?r1=1.523&r2=1.524
17
18 Index: ChangeLog
19 ===================================================================
20 RCS file: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog,v
21 retrieving revision 1.523
22 retrieving revision 1.524
23 diff -u -r1.523 -r1.524
24 --- ChangeLog 8 Feb 2014 21:42:26 -0000 1.523
25 +++ ChangeLog 10 Feb 2014 16:22:41 -0000 1.524
26 @@ -1,6 +1,13 @@
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.523 2014/02/08 21:42:26 jer Exp $
30 +# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog,v 1.524 2014/02/10 16:22:41 jer Exp $
31 +
32 +*nvidia-drivers-334.16-r5 (10 Feb 2014)
33 +
34 + 10 Feb 2014; Jeroen Roovers <jer@g.o> +nvidia-drivers-334.16-r5.ebuild,
35 + -nvidia-drivers-334.16-r4.ebuild:
36 + Install the correct libGLESv2.so in multilib cases (bug #500866 by Enrico
37 + Tagliavini).
38
39 *nvidia-drivers-334.16-r4 (08 Feb 2014)
40
41
42
43
44 1.1 x11-drivers/nvidia-drivers/nvidia-drivers-334.16-r5.ebuild
45
46 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-334.16-r5.ebuild?rev=1.1&view=markup
47 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-334.16-r5.ebuild?rev=1.1&content-type=text/plain
48
49 Index: nvidia-drivers-334.16-r5.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-334.16-r5.ebuild,v 1.1 2014/02/10 16:22:41 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 X11 driver and GLX libraries"
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-r1"
76 SLOT="0"
77 KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
78 IUSE="acpi multilib kernel_FreeBSD kernel_linux pax_kernel +tools +X"
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
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 13 ; 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.13"
139 ewarn "<sys-kernel/vanilla-sources-3.13"
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 linux-mod_pkg_setup
169 MODULE_NAMES="nvidia(video:${S}/kernel)"
170 BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
171 SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC)"
172 # linux-mod_src_compile calls set_arch_to_kernel, which
173 # sets the ARCH to x86 but NVIDIA's wrapping Makefile
174 # expects x86_64 or i386 and then converts it to x86
175 # later on in the build process
176 BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
177 fi
178
179 # set variables to where files are in the package structure
180 if use kernel_FreeBSD; then
181 use x86-fbsd && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
182 use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
183 NV_DOC="${S}/doc"
184 NV_OBJ="${S}/obj"
185 NV_SRC="${S}/src"
186 NV_MAN="${S}/x11/man"
187 NV_X11="${S}/obj"
188 NV_SOVER=1
189 elif use kernel_linux; then
190 NV_DOC="${S}"
191 NV_OBJ="${S}"
192 NV_SRC="${S}/kernel"
193 NV_MAN="${S}"
194 NV_X11="${S}"
195 NV_SOVER=${PV}
196 else
197 die "Could not determine proper NVIDIA package"
198 fi
199 }
200
201 src_unpack() {
202 if ! use kernel_FreeBSD; then
203 cd "${S}"
204 unpack_makeself
205 else
206 unpack ${A}
207 fi
208 }
209
210 src_prepare() {
211 # Please add a brief description for every added patch
212
213 if use kernel_linux; then
214 if kernel_is lt 2 6 9 ; then
215 eerror "You must build this against 2.6.9 or higher kernels."
216 fi
217
218 # If greater than 2.6.5 use M= instead of SUBDIR=
219 # convert_to_m "${NV_SRC}"/Makefile.kbuild
220 fi
221
222 if use pax_kernel; then
223 ewarn "Using PAX patches is not supported. You will be asked to"
224 ewarn "use a standard kernel should you have issues. Should you"
225 ewarn "need support with these patches, contact the PaX team."
226 epatch "${FILESDIR}"/${PN}-331.13-pax-usercopy.patch
227 fi
228
229 # Allow user patches so they can support RC kernels and whatever else
230 epatch_user
231 }
232
233 src_compile() {
234 # This is already the default on Linux, as there's no toplevel Makefile, but
235 # on FreeBSD there's one and triggers the kernel module build, as we install
236 # it by itself, pass this.
237
238 cd "${NV_SRC}"
239 if use kernel_FreeBSD; then
240 MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
241 LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
242 elif use kernel_linux; then
243 linux-mod_src_compile
244 fi
245 }
246
247 # Install nvidia library:
248 # the first parameter is the library to install
249 # the second parameter is the provided soversion
250 # the third parameter is the target directory if its not /usr/lib
251 donvidia() {
252 # Full path to library minus SOVER
253 MY_LIB="$1"
254
255 # SOVER to use
256 MY_SOVER="$2"
257
258 # Where to install
259 MY_DEST="$3"
260
261 if [[ -z "${MY_DEST}" ]]; then
262 MY_DEST="/usr/$(get_libdir)"
263 action="dolib.so"
264 else
265 exeinto ${MY_DEST}
266 action="doexe"
267 fi
268
269 # Get just the library name
270 libname=$(basename $1)
271
272 # Install the library with the correct SOVER
273 ${action} ${MY_LIB}.${MY_SOVER} || \
274 die "failed to install ${libname}"
275
276 # If SOVER wasn't 1, then we need to create a .1 symlink
277 if [[ "${MY_SOVER}" != "1" ]]; then
278 dosym ${libname}.${MY_SOVER} \
279 ${MY_DEST}/${libname}.1 || \
280 die "failed to create ${libname} symlink"
281 fi
282
283 # Always create the symlink from the raw lib to the .1
284 dosym ${libname}.1 \
285 ${MY_DEST}/${libname} || \
286 die "failed to create ${libname} symlink"
287 }
288
289 src_install() {
290 if use kernel_linux; then
291 linux-mod_src_install
292
293 # Add the aliases
294 # This file is tweaked with the appropriate video group in
295 # pkg_preinst, see bug #491414
296 insinto /etc/modprobe.d
297 newins "${FILESDIR}"/nvidia-169.07 nvidia.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-modprobe
369 doexe ${NV_OBJ}/nvidia-persistenced
370 doexe ${NV_OBJ}/nvidia-smi
371 doman nvidia-cuda-mps-control.1.gz
372 doman nvidia-modprobe.1.gz
373 doman nvidia-persistenced.1.gz
374 newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
375 fi
376
377 if use tools; then
378 doexe ${NV_OBJ}/nvidia-settings
379 fi
380
381 exeinto /usr/bin/
382 doexe ${NV_OBJ}/nvidia-bug-report.sh
383
384 # Desktop entries for nvidia-settings
385 if use tools ; then
386 # There is no icon in the FreeBSD tarball.
387 use kernel_FreeBSD || newicon ${NV_OBJ}/nvidia-settings.png ${PN}-settings.png
388 domenu "${FILESDIR}"/${PN}-settings.desktop
389 exeinto /etc/X11/xinit/xinitrc.d
390 doexe "${FILESDIR}"/95-nvidia-settings
391 fi
392
393 #doenvd "${FILESDIR}"/50nvidia-prelink-blacklist
394
395 if has_multilib_profile && use multilib ; then
396 local OABI=${ABI}
397 for ABI in $(get_install_abis) ; do
398 src_install-libs
399 done
400 ABI=${OABI}
401 unset OABI
402 else
403 src_install-libs
404 fi
405
406 is_final_abi || die "failed to iterate through all ABIs"
407
408 readme.gentoo_create_doc
409 }
410
411 src_install-libs() {
412 local inslibdir=$(get_libdir)
413 local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
414 local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
415 local libdir=${NV_OBJ}
416
417 if use kernel_linux && has_multilib_profile && \
418 [[ ${ABI} == "x86" ]] ; then
419 libdir=${NV_OBJ}/32
420 fi
421
422 if use X; then
423 # The GLX libraries
424 donvidia ${libdir}/libEGL.so ${NV_SOVER} ${GL_ROOT}
425 donvidia ${libdir}/libGL.so ${NV_SOVER} ${GL_ROOT}
426 donvidia ${libdir}/libGLESv1_CM.so ${NV_SOVER} ${GL_ROOT}
427 donvidia ${libdir}/libnvidia-eglcore.so ${NV_SOVER}
428 donvidia ${libdir}/libnvidia-glcore.so ${NV_SOVER}
429 donvidia ${libdir}/libnvidia-glsi.so ${NV_SOVER}
430 donvidia ${libdir}/libnvidia-ifr.so ${NV_SOVER}
431 if use kernel_FreeBSD; then
432 donvidia ${libdir}/libnvidia-tls.so ${NV_SOVER}
433 else
434 donvidia ${libdir}/tls/libnvidia-tls.so ${NV_SOVER}
435 fi
436
437 # VDPAU
438 donvidia ${libdir}/libvdpau_nvidia.so ${NV_SOVER}
439
440 insinto ${GL_ROOT}
441 doexe ${libdir}/libGLESv2.so.${PV}
442 dosym libGLESv2.so.${PV} ${GL_ROOT}/libGLESv2.so.2
443 dosym libGLESv2.so.2 ${GL_ROOT}/libGLESv2.so
444 fi
445
446 # NVIDIA monitoring library
447 if use kernel_linux ; then
448 donvidia ${libdir}/libnvidia-ml.so ${NV_SOVER}
449 fi
450
451 # CUDA & OpenCL
452 if use kernel_linux; then
453 donvidia ${libdir}/libcuda.so ${NV_SOVER}
454 donvidia ${libdir}/libnvidia-compiler.so ${NV_SOVER}
455 donvidia ${libdir}/libOpenCL.so 1.0.0 ${CL_ROOT}
456 donvidia ${libdir}/libnvidia-opencl.so ${NV_SOVER}
457 fi
458 }
459
460 pkg_preinst() {
461 if use kernel_linux; then
462 linux-mod_pkg_preinst
463
464 local videogroup="$(egetent group video | cut -d ':' -f 3)"
465 if [ -z "${videogroup}" ]; then
466 eerror "Failed to determine the video group gid"
467 die "Failed to determine the video group gid"
468 else
469 sed -i \
470 -e "s:PACKAGE:${PF}:g" \
471 -e "s:VIDEOGID:${videogroup}:" \
472 "${D}"/etc/modprobe.d/nvidia.conf || die
473 fi
474 fi
475
476 # Clean the dynamic libGL stuff's home to ensure
477 # we dont have stale libs floating around
478 if [ -d "${ROOT}"/usr/lib/opengl/nvidia ] ; then
479 rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
480 fi
481 # Make sure we nuke the old nvidia-glx's env.d file
482 if [ -e "${ROOT}"/etc/env.d/09nvidia ] ; then
483 rm -f "${ROOT}"/etc/env.d/09nvidia
484 fi
485 }
486
487 pkg_postinst() {
488 use kernel_linux && linux-mod_pkg_postinst
489
490 # Switch to the nvidia implementation
491 use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
492 "${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
493
494 readme.gentoo_print_elog
495
496 if ! use X; then
497 elog "You have elected to not install the X.org driver. Along with"
498 elog "this the OpenGL libraries and VDPAU libraries were not"
499 elog "installed. Additionally, once the driver is loaded your card"
500 elog "and fan will run at max speed which may not be desirable."
501 elog "Use the 'nvidia-smi' init script to have your card and fan"
502 elog "speed scale appropriately."
503 elog
504 fi
505 if ! use tools; then
506 elog "USE=tools controls whether the nvidia-settings application"
507 elog "is installed. If you would like to use it, enable that"
508 elog "flag and re-emerge this ebuild. Optionally you can install"
509 elog "media-video/nvidia-settings"
510 elog
511 fi
512 }
513
514 pkg_prerm() {
515 use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
516 }
517
518 pkg_postrm() {
519 use kernel_linux && linux-mod_pkg_postrm
520 use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
521 }