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