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