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