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