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-r1.ebuild ChangeLog nvidia-drivers-334.16.ebuild
Date: Fri, 07 Feb 2014 16:07:41
Message-Id: 20140207160737.B39A52004C@flycatcher.gentoo.org
1 jer 14/02/07 16:07:37
2
3 Modified: ChangeLog
4 Added: nvidia-drivers-334.16-r1.ebuild
5 Removed: nvidia-drivers-334.16.ebuild
6 Log:
7 Install some missing libraries.
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.519 x11-drivers/nvidia-drivers/ChangeLog
13
14 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog?rev=1.519&view=markup
15 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog?rev=1.519&content-type=text/plain
16 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog?r1=1.518&r2=1.519
17
18 Index: ChangeLog
19 ===================================================================
20 RCS file: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog,v
21 retrieving revision 1.518
22 retrieving revision 1.519
23 diff -u -r1.518 -r1.519
24 --- ChangeLog 7 Feb 2014 14:43:29 -0000 1.518
25 +++ ChangeLog 7 Feb 2014 16:07:37 -0000 1.519
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.518 2014/02/07 14:43:29 jer Exp $
30 +# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog,v 1.519 2014/02/07 16:07:37 jer Exp $
31 +
32 +*nvidia-drivers-334.16-r1 (07 Feb 2014)
33 +
34 + 07 Feb 2014; Jeroen Roovers <jer@g.o> -nvidia-drivers-334.16.ebuild,
35 + +nvidia-drivers-334.16-r1.ebuild:
36 + Install some missing libraries.
37
38 *nvidia-drivers-334.16 (07 Feb 2014)
39
40
41
42
43 1.1 x11-drivers/nvidia-drivers/nvidia-drivers-334.16-r1.ebuild
44
45 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-334.16-r1.ebuild?rev=1.1&view=markup
46 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-334.16-r1.ebuild?rev=1.1&content-type=text/plain
47
48 Index: nvidia-drivers-334.16-r1.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-r1.ebuild,v 1.1 2014/02/07 16:07:37 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 video encode/decode <-> CUDA
316 if use kernel_linux; then
317 donvidia ${NV_OBJ}/libnvcuvid.so ${NV_SOVER}
318 donvidia ${NV_OBJ}/libnvidia-encode.so ${NV_SOVER}
319 fi
320
321 if use X; then
322 # Xorg DDX driver
323 insinto /usr/$(get_libdir)/xorg/modules/drivers
324 doins ${NV_X11}/nvidia_drv.so
325
326 # Xorg GLX driver
327 donvidia ${NV_X11}/libglx.so ${NV_SOVER} \
328 /usr/$(get_libdir)/opengl/nvidia/extensions
329 fi
330
331 # OpenCL ICD for NVIDIA
332 if use kernel_linux; then
333 insinto /etc/OpenCL/vendors
334 doins ${NV_OBJ}/nvidia.icd
335 fi
336
337 # Documentation
338 dohtml ${NV_DOC}/html/*
339 if use kernel_FreeBSD; then
340 dodoc "${NV_DOC}/README"
341 use X && doman "${NV_MAN}/nvidia-xconfig.1"
342 use tools && doman "${NV_MAN}/nvidia-settings.1"
343 else
344 # Docs
345 newdoc "${NV_DOC}/README.txt" README
346 dodoc "${NV_DOC}/NVIDIA_Changelog"
347 doman "${NV_MAN}/nvidia-smi.1.gz"
348 use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
349 use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
350 doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
351 fi
352
353 # Helper Apps
354 exeinto /opt/bin/
355
356 if use X; then
357 doexe ${NV_OBJ}/nvidia-xconfig
358 fi
359
360 if use kernel_linux ; then
361 doexe ${NV_OBJ}/nvidia-cuda-mps-control
362 doexe ${NV_OBJ}/nvidia-cuda-mps-server
363 doexe ${NV_OBJ}/nvidia-debugdump
364 doexe ${NV_OBJ}/nvidia-modprobe
365 doexe ${NV_OBJ}/nvidia-persistenced
366 doexe ${NV_OBJ}/nvidia-smi
367 doman nvidia-cuda-mps-control.1.gz
368 doman nvidia-modprobe.1.gz
369 doman nvidia-persistenced.1.gz
370 newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
371 fi
372
373 if use tools; then
374 doexe ${NV_OBJ}/nvidia-settings
375 fi
376
377 exeinto /usr/bin/
378 doexe ${NV_OBJ}/nvidia-bug-report.sh
379
380 # Desktop entries for nvidia-settings
381 if use tools ; then
382 # There is no icon in the FreeBSD tarball.
383 use kernel_FreeBSD || newicon ${NV_OBJ}/nvidia-settings.png ${PN}-settings.png
384 domenu "${FILESDIR}"/${PN}-settings.desktop
385 exeinto /etc/X11/xinit/xinitrc.d
386 doexe "${FILESDIR}"/95-nvidia-settings
387 fi
388
389 #doenvd "${FILESDIR}"/50nvidia-prelink-blacklist
390
391 if has_multilib_profile && use multilib ; then
392 local OABI=${ABI}
393 for ABI in $(get_install_abis) ; do
394 src_install-libs
395 done
396 ABI=${OABI}
397 unset OABI
398 else
399 src_install-libs
400 fi
401
402 is_final_abi || die "failed to iterate through all ABIs"
403
404 readme.gentoo_create_doc
405 }
406
407 src_install-libs() {
408 local inslibdir=$(get_libdir)
409 local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
410 local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
411 local libdir=${NV_OBJ}
412
413 if use kernel_linux && has_multilib_profile && \
414 [[ ${ABI} == "x86" ]] ; then
415 libdir=${NV_OBJ}/32
416 fi
417
418 if use X; then
419 # The GLX libraries
420 donvidia ${libdir}/libEGL.so ${NV_SOVER} ${GL_ROOT}
421 donvidia ${libdir}/libGL.so ${NV_SOVER} ${GL_ROOT}
422 donvidia ${libdir}/libGLESv1_CM.so ${NV_SOVER} ${GL_ROOT}
423 donvidia ${libdir}/libGLESv2.so ${NV_SOVER} ${GL_ROOT}
424 donvidia ${libdir}/libnvidia-fbc.so ${NV_SOVER}
425 donvidia ${libdir}/libnvidia-glcore.so ${NV_SOVER}
426 donvidia ${libdir}/libnvidia-glsi.so ${NV_SOVER}
427 donvidia ${libdir}/libnvidia-ifr.so ${NV_SOVER}
428 if use kernel_FreeBSD; then
429 donvidia ${libdir}/libnvidia-tls.so ${NV_SOVER}
430 else
431 donvidia ${libdir}/tls/libnvidia-tls.so ${NV_SOVER}
432 fi
433
434 # VDPAU
435 donvidia ${libdir}/libvdpau_nvidia.so ${NV_SOVER}
436 fi
437
438 # NVIDIA monitoring library
439 if use kernel_linux ; then
440 donvidia ${libdir}/libnvidia-ml.so ${NV_SOVER}
441 fi
442
443 # CUDA & OpenCL
444 if use kernel_linux; then
445 donvidia ${libdir}/libcuda.so ${NV_SOVER}
446 donvidia ${libdir}/libnvidia-compiler.so ${NV_SOVER}
447 donvidia ${libdir}/libOpenCL.so 1.0.0 ${CL_ROOT}
448 donvidia ${libdir}/libnvidia-opencl.so ${NV_SOVER}
449 fi
450 }
451
452 pkg_preinst() {
453 if use kernel_linux; then
454 linux-mod_pkg_preinst
455
456 local videogroup="$(egetent group video | cut -d ':' -f 3)"
457 if [ -z "${videogroup}" ]; then
458 eerror "Failed to determine the video group gid"
459 die "Failed to determine the video group gid"
460 else
461 sed -i \
462 -e "s:PACKAGE:${PF}:g" \
463 -e "s:VIDEOGID:${videogroup}:" \
464 "${D}"/etc/modprobe.d/nvidia.conf || die
465 fi
466 fi
467
468 # Clean the dynamic libGL stuff's home to ensure
469 # we dont have stale libs floating around
470 if [ -d "${ROOT}"/usr/lib/opengl/nvidia ] ; then
471 rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
472 fi
473 # Make sure we nuke the old nvidia-glx's env.d file
474 if [ -e "${ROOT}"/etc/env.d/09nvidia ] ; then
475 rm -f "${ROOT}"/etc/env.d/09nvidia
476 fi
477 }
478
479 pkg_postinst() {
480 use kernel_linux && linux-mod_pkg_postinst
481
482 # Switch to the nvidia implementation
483 use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
484 "${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
485
486 readme.gentoo_print_elog
487
488 if ! use X; then
489 elog "You have elected to not install the X.org driver. Along with"
490 elog "this the OpenGL libraries and VDPAU libraries were not"
491 elog "installed. Additionally, once the driver is loaded your card"
492 elog "and fan will run at max speed which may not be desirable."
493 elog "Use the 'nvidia-smi' init script to have your card and fan"
494 elog "speed scale appropriately."
495 elog
496 fi
497 if ! use tools; then
498 elog "USE=tools controls whether the nvidia-settings application"
499 elog "is installed. If you would like to use it, enable that"
500 elog "flag and re-emerge this ebuild. Optionally you can install"
501 elog "media-video/nvidia-settings"
502 elog
503 fi
504 }
505
506 pkg_prerm() {
507 use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
508 }
509
510 pkg_postrm() {
511 use kernel_linux && linux-mod_pkg_postrm
512 use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
513 }