Gentoo Archives: gentoo-commits

From: "Ricardo Mendoza (ricmm)" <ricmm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in x11-drivers/nvidia-drivers: nvidia-drivers-173.14.18.ebuild nvidia-drivers-71.86.09.ebuild ChangeLog
Date: Mon, 23 Mar 2009 14:35:16
Message-Id: E1LllFC-0007Yg-CS@stork.gentoo.org
1 ricmm 09/03/23 14:35:14
2
3 Modified: ChangeLog
4 Added: nvidia-drivers-173.14.18.ebuild
5 nvidia-drivers-71.86.09.ebuild
6 Log:
7 Version bumps.
8 (Portage version: 2.2_rc23/cvs/Linux x86_64)
9
10 Revision Changes Path
11 1.142 x11-drivers/nvidia-drivers/ChangeLog
12
13 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog?rev=1.142&view=markup
14 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog?rev=1.142&content-type=text/plain
15 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog?r1=1.141&r2=1.142
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog,v
20 retrieving revision 1.141
21 retrieving revision 1.142
22 diff -u -r1.141 -r1.142
23 --- ChangeLog 23 Mar 2009 14:15:51 -0000 1.141
24 +++ ChangeLog 23 Mar 2009 14:35:14 -0000 1.142
25 @@ -1,6 +1,13 @@
26 # ChangeLog for x11-drivers/nvidia-drivers
27 # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog,v 1.141 2009/03/23 14:15:51 ricmm Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog,v 1.142 2009/03/23 14:35:14 ricmm Exp $
30 +
31 +*nvidia-drivers-173.14.18 (23 Mar 2009)
32 +*nvidia-drivers-71.86.09 (23 Mar 2009)
33 +
34 + 23 Mar 2009; <ricmm@g.o> +nvidia-drivers-71.86.09.ebuild,
35 + +nvidia-drivers-173.14.18.ebuild:
36 + Version bumps.
37
38 *nvidia-drivers-180.41 (23 Mar 2009)
39
40
41
42
43 1.1 x11-drivers/nvidia-drivers/nvidia-drivers-173.14.18.ebuild
44
45 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-173.14.18.ebuild?rev=1.1&view=markup
46 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-173.14.18.ebuild?rev=1.1&content-type=text/plain
47
48 Index: nvidia-drivers-173.14.18.ebuild
49 ===================================================================
50 # Copyright 1999-2009 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-173.14.18.ebuild,v 1.1 2009/03/23 14:35:14 ricmm Exp $
53
54 inherit eutils multilib versionator linux-mod flag-o-matic nvidia-driver
55
56 X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
57 AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
58 X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
59
60 DESCRIPTION="NVIDIA X11 driver and GLX libraries"
61 HOMEPAGE="http://www.nvidia.com/"
62 SRC_URI="x86? ( http://us.download.nvidia.com/XFree86/Linux-x86/${PV}/${X86_NV_PACKAGE}-pkg0.run )
63 amd64? ( http://us.download.nvidia.com/XFree86/Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}-pkg2.run )
64 x86-fbsd? ( http://us.download.nvidia.com/freebsd/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )"
65
66 LICENSE="NVIDIA"
67 SLOT="0"
68 KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
69 IUSE="acpi custom-cflags gtk multilib kernel_linux"
70 RESTRICT="strip"
71 EMULTILIB_PKG="true"
72
73 COMMON="<x11-base/xorg-server-1.5.99
74 multilib? ( app-emulation/emul-linux-x86-xlibs )
75 kernel_FreeBSD? ( !media-video/nvidia-freebsd )
76 !app-emulation/emul-linux-x86-nvidia
77 !x11-drivers/nvidia-legacy-drivers"
78 DEPEND="${COMMON}
79 kernel_linux? ( virtual/linux-sources )
80 app-admin/eselect-opengl"
81 RDEPEND="${COMMON}
82 kernel_linux? ( virtual/modutils )
83 media-libs/mesa
84 acpi? ( sys-power/acpid )"
85 PDEPEND="gtk? ( media-video/nvidia-settings )"
86
87 QA_TEXTRELS_x86="usr/lib/libXvMCNVIDIA.so.${PV}
88 usr/lib/opengl/nvidia/no-tls/libnvidia-tls.so.${PV}
89 usr/lib/opengl/nvidia/tls/libnvidia-tls.so.${PV}
90 usr/lib/opengl/nvidia/lib/libGL.so.${PV}
91 usr/lib/opengl/nvidia/lib/libnvidia-cfg.so.${PV}
92 usr/lib/opengl/nvidia/lib/libGLcore.so.${PV}
93 usr/lib/opengl/nvidia/extensions/libglx.so
94 usr/lib/xorg/modules/drivers/nvidia_drv.so
95 usr/lib/libcuda.so.${PV}"
96
97 QA_TEXTRELS_x86_fbsd="boot/modules/nvidia.ko
98 usr/lib/opengl/nvidia/lib/libGL.so.1
99 usr/lib/opengl/nvidia/lib/libGLcore.so.1
100 usr/lib/opengl/nvidia/lib/libnvidia-cfg.so.1
101 usr/lib/opengl/nvidia/no-tls/libnvidia-tls.so.1
102 usr/lib/opengl/nvidia/extensions/libglx.so
103 usr/lib/xorg/modules/drivers/nvidia_drv.so"
104
105 QA_TEXTRELS_amd64="usr/lib32/opengl/nvidia/tls/libnvidia-tls.so.${PV}
106 usr/lib32/opengl/nvidia/no-tls/libnvidia-tls.so.${PV}
107 usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV}
108 usr/lib32/opengl/nvidia/lib/libGL.so.${PV}
109 usr/lib32/opengl/nvidia/lib/libnvidia-cfg.so.${PV}
110 usr/lib32/libcuda.so.${PV}"
111
112 QA_EXECSTACK_x86="usr/lib/opengl/nvidia/lib/libGL.so.${PV}
113 usr/lib/opengl/nvidia/lib/libGLcore.so.${PV}
114 usr/lib/opengl/nvidia/extensions/libglx.so"
115
116 QA_EXECSTACK_amd64="usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV}
117 usr/lib32/opengl/nvidia/lib/libGL.so.${PV}
118 usr/lib64/xorg/modules/drivers/nvidia_drv.so
119 usr/lib64/libXvMCNVIDIA.so.${PV}
120 usr/lib64/opengl/nvidia/tls/libnvidia-tls.so.${PV}
121 usr/lib64/opengl/nvidia/no-tls/libnvidia-tls.so.${PV}
122 usr/lib64/opengl/nvidia/lib/libGLcore.so.${PV}
123 usr/lib64/opengl/nvidia/lib/libGL.so.${PV}
124 usr/lib64/opengl/nvidia/lib/libnvidia-cfg.so.${PV}
125 usr/lib64/opengl/nvidia/extensions/libglx.so
126 usr/bin/nvidia-xconfig"
127
128 QA_WX_LOAD_x86="usr/lib/opengl/nvidia/lib/libGLcore.so.${PV}
129 usr/lib/opengl/nvidia/lib/libGL.so.${PV}
130 usr/lib/opengl/nvidia/extensions/libglx.so"
131
132 QA_WX_LOAD_amd64="usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV}
133 usr/lib32/opengl/nvidia/lib/libGL.so.${PV}
134 usr/lib64/opengl/nvidia/lib/libGLcore.so.${PV}
135 usr/lib64/opengl/nvidia/lib/libGL.so.${PV}
136 usr/lib64/opengl/nvidia/extensions/libglx.so"
137
138 if use x86; then
139 PKG_V="-pkg0"
140 NV_PACKAGE="${X86_NV_PACKAGE}"
141 elif use amd64; then
142 PKG_V="-pkg2"
143 NV_PACKAGE="${AMD64_NV_PACKAGE}"
144 elif use x86-fbsd; then
145 PKG_V=""
146 NV_PACKAGE="${X86_FBSD_NV_PACKAGE}"
147 fi
148
149 S="${WORKDIR}/${NV_PACKAGE}${PKG_V}"
150
151 mtrr_check() {
152 ebegin "Checking for MTRR support"
153 linux_chkconfig_present MTRR
154 eend $?
155
156 if [[ $? -ne 0 ]] ; then
157 eerror "Please enable MTRR support in your kernel config, found at:"
158 eerror
159 eerror " Processor type and features"
160 eerror " [*] MTRR (Memory Type Range Register) support"
161 eerror
162 eerror "and recompile your kernel ..."
163 die "MTRR support not detected!"
164 fi
165 }
166
167 sysvipc_check() {
168 ebegin "Checking for SYSVIPC support"
169 linux_chkconfig_present SYSVIPC
170 eend $?
171
172 if [[ $? -ne 0 ]] ; then
173 eerror "Please enable SYSVIPC support in your kernel config, found at:"
174 eerror
175 eerror " General setup"
176 eerror " [*] System V IPC"
177 eerror
178 eerror "and recompile your kernel ..."
179 die "SYSVIPC support not detected!"
180 fi
181 }
182
183 pkg_setup() {
184 # try to turn off distcc and ccache for people that have a problem with it
185 export DISTCC_DISABLE=1
186 export CCACHE_DISABLE=1
187
188 if use amd64 && has_multilib_profile && [ "${DEFAULT_ABI}" != "amd64" ]; then
189 eerror "This ebuild doesn't currently support changing your default abi."
190 die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
191 fi
192
193 if use kernel_linux; then
194 linux-mod_pkg_setup
195 MODULE_NAMES="nvidia(video:${S}/usr/src/nv)"
196 BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
197 SYSOUT=${KV_OUT_DIR} HOST_CC=$(tc-getBUILD_CC)"
198 mtrr_check
199 sysvipc_check
200 fi
201
202 # On BSD userland it wants real make command
203 use userland_BSD && MAKE="$(get_bmake)"
204
205 export _POSIX2_VERSION="199209"
206
207 # Since Nvidia ships 3 different series of drivers, we need to give the user
208 # some kind of guidance as to what version they should install. This tries
209 # to point the user in the right direction but can't be perfect. check
210 # nvidia-driver.eclass
211 nvidia-driver-check-warning
212
213 # set variables to where files are in the package structure
214 if use kernel_FreeBSD; then
215 NV_DOC="${S}/doc"
216 NV_EXEC="${S}/obj"
217 NV_SRC="${S}/src"
218 elif use kernel_linux; then
219 NV_DOC="${S}/usr/share/doc"
220 NV_EXEC="${S}/usr/bin"
221 NV_SRC="${S}/usr/src/nv"
222 else
223 die "Could not determine proper NVIDIA package"
224 fi
225 }
226
227 src_unpack() {
228 if use kernel_linux && kernel_is lt 2 6 7; then
229 echo
230 ewarn "Your kernel version is ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}"
231 ewarn "This is not officially supported for ${P}. It is likely you"
232 ewarn "will not be able to compile or use the kernel module."
233 ewarn "It is recommended that you upgrade your kernel to a version >= 2.6.7"
234 echo
235 ewarn "DO NOT file bug reports for kernel versions less than 2.6.7 as they will be ignored."
236 fi
237
238 if ! use x86-fbsd; then
239 cd "${WORKDIR}"
240 bash "${DISTDIR}"/${NV_PACKAGE}${PKG_V}.run --extract-only
241 else
242 unpack ${A}
243 fi
244
245 # Patches go below here, add brief description
246 cd "${S}"
247 use x86-fbsd && cd doc
248
249 # Use the correct defines to make gtkglext build work
250 epatch "${FILESDIR}"/NVIDIA_glx-defines.patch
251 # Use some more sensible gl headers and make way for new glext.h
252 epatch "${FILESDIR}"/NVIDIA_glx-glheader.patch
253
254 # allow on board sensors to work with lm_sensors
255 if use kernel_linux; then
256 epatch "${FILESDIR}"/NVIDIA_i2c-hwmon.patch
257 fi
258
259 if use kernel_linux; then
260 # Quiet down warnings the user does not need to see
261 sed -i \
262 -e 's:-Wpointer-arith::g' \
263 -e 's:-Wsign-compare::g' \
264 "${NV_SRC}"/Makefile.kbuild
265
266 # If you set this then it's your own fault when stuff breaks :)
267 use custom-cflags \
268 && einfo "Patching ${NV_SRC}/Makefile* to respect custom cflags" \
269 && sed -i "s:-O:${CFLAGS}:" "${NV_SRC}"/Makefile.*
270
271 # If greater than 2.6.5 use M= instead of SUBDIR=
272 convert_to_m "${NV_SRC}"/Makefile.kbuild
273 fi
274 }
275
276 src_compile() {
277 # This is already the default on Linux, as there's no toplevel Makefile, but
278 # on FreeBSD there's one and triggers the kernel module build, as we install
279 # it by itself, pass this.
280
281 cd "${NV_SRC}"
282 if use x86-fbsd; then
283 MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
284 LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
285 elif use kernel_linux; then
286 linux-mod_src_compile
287 fi
288 }
289
290 src_install() {
291 local MLTEST=$(type dyn_unpack)
292
293 cd "${S}"
294
295 if use kernel_linux; then
296 linux-mod_src_install
297
298 VIDEOGROUP="$(egetent group video | cut -d ':' -f 3)"
299 if [ -z "$VIDEOGROUP" ]; then
300 eerror "Failed to determine the video group gid."
301 die "Failed to determine the video group gid."
302 fi
303
304 # Add the aliases
305 [ -f "${FILESDIR}/nvidia" ] || die "nvidia missing in FILESDIR"
306 sed -e 's:PACKAGE:'${PF}':g' \
307 -e 's:VIDEOGID:'${VIDEOGROUP}':' "${FILESDIR}"/nvidia-169.07 > \
308 "${WORKDIR}"/nvidia
309 insinto /etc/modprobe.d
310 doins "${WORKDIR}"/nvidia || die
311 elif use x86-fbsd; then
312 insinto /boot/modules
313 doins "${WORKDIR}/${NV_PACKAGE}/src/nvidia.kld" || die
314
315 exeinto /boot/modules
316 doexe "${WORKDIR}/${NV_PACKAGE}/src/nvidia.ko" || die
317 fi
318
319 if has_multilib_profile ; then
320 local OABI=${ABI}
321 for ABI in $(get_install_abis) ; do
322 src_install-libs
323 done
324 ABI=${OABI}
325 unset OABI
326 elif use amd64 ; then
327 src_install-libs lib32 $(get_multilibdir)
328 src_install-libs lib $(get_libdir)
329
330 rm -rf "${D}"/usr/$(get_multilibdir)/opengl/nvidia/include
331 rm -rf "${D}"/usr/$(get_multilibdir)/opengl/nvidia/extensions
332 else
333 src_install-libs
334 fi
335
336 is_final_abi || return 0
337
338 # Documentation
339 dodoc "${NV_DOC}"/{XF86Config.sample,Copyrights}
340 dohtml "${NV_DOC}"/html/*
341 if use x86-fbsd; then
342 dodoc "${NV_DOC}/README"
343 else
344 # Docs
345 newdoc "${NV_DOC}/README.txt" README
346 dodoc "${NV_DOC}/NVIDIA_Changelog"
347 fi
348
349 # Helper Apps
350 dobin ${NV_EXEC}/nvidia-xconfig || die
351 dobin ${NV_EXEC}/nvidia-bug-report.sh || die
352 }
353
354 # Install nvidia library:
355 # the first parameter is the place where to install it
356 # the second parameter is the base name of the library
357 # the third parameter is the provided soversion
358 donvidia() {
359 dodir $1
360 exeinto $1
361
362 libname=$(basename $2)
363
364 # libnvidia-cfg.so is no longer supplied in lib32; step over it gracefully
365 if [ -e $2.$3 ] ; then
366 doexe $2.$3
367 dosym ${libname}.$3 $1/${libname}
368 [[ $3 != "1" ]] && dosym ${libname}.$3 $1/${libname}.1
369 fi
370 }
371
372 src_install-libs() {
373 local pkglibdir=lib
374 local inslibdir=$(get_libdir)
375
376 if [[ ${#} -eq 2 ]] ; then
377 pkglibdir=${1}
378 inslibdir=${2}
379 elif has_multilib_profile && [[ ${ABI} == "x86" ]] ; then
380 pkglibdir=lib32
381 fi
382
383 local usrpkglibdir=usr/${pkglibdir}
384 local libdir=usr/X11R6/${pkglibdir}
385 local drvdir=${libdir}/modules/drivers
386 local extdir=${libdir}/modules/extensions
387 local incdir=usr/include/GL
388 local sover=${PV}
389 local NV_ROOT="/usr/${inslibdir}/opengl/nvidia"
390 local NO_TLS_ROOT="${NV_ROOT}/no-tls"
391 local TLS_ROOT="${NV_ROOT}/tls"
392 local X11_LIB_DIR="/usr/${inslibdir}/xorg"
393
394 if use x86-fbsd; then
395 # on FreeBSD everything is on obj/
396 pkglibdir=obj
397 usrpkglibdir=obj
398 x11pkglibdir=obj
399 drvdir=obj
400 extdir=obj
401
402 # don't ask me why the headers are there.. glxext.h is missing
403 incdir=doc
404
405 # on FreeBSD it has just .1 suffix
406 sover=1
407 fi
408
409 # The GLX libraries
410 donvidia ${NV_ROOT}/lib ${usrpkglibdir}/libGL.so ${sover}
411 donvidia ${NV_ROOT}/lib ${usrpkglibdir}/libGLcore.so ${sover}
412
413 donvidia ${NV_ROOT}/lib ${usrpkglibdir}/libnvidia-cfg.so ${sover}
414
415 dodir ${NO_TLS_ROOT}
416 donvidia ${NO_TLS_ROOT} ${usrpkglibdir}/libnvidia-tls.so ${sover}
417
418 if ! use x86-fbsd; then
419 donvidia ${TLS_ROOT} ${usrpkglibdir}/tls/libnvidia-tls.so ${sover}
420 fi
421
422 if want_tls ; then
423 dosym ../tls/libnvidia-tls.so ${NV_ROOT}/lib
424 dosym ../tls/libnvidia-tls.so.1 ${NV_ROOT}/lib
425 dosym ../tls/libnvidia-tls.so.${sover} ${NV_ROOT}/lib
426 else
427 dosym ../no-tls/libnvidia-tls.so ${NV_ROOT}/lib
428 dosym ../no-tls/libnvidia-tls.so.1 ${NV_ROOT}/lib
429 dosym ../no-tls/libnvidia-tls.so.${sover} ${NV_ROOT}/lib
430 fi
431
432 if ! use x86-fbsd; then
433 # Install the .la file for libtool, to prevent e.g. bug #176423
434 [ -f "${FILESDIR}/libGL.la-r2" ] || die "libGL.la-r2 missing in FILESDIR"
435 local ver1=$(get_version_component_range 1)
436 local ver2=$(get_version_component_range 2)
437 local ver3=$(get_version_component_range 3)
438 sed -e "s:\${PV}:${PV}:" \
439 -e "s:\${ver1}:${ver1}:" \
440 -e "s:\${ver2}:${ver2}:" \
441 -e "s:\${ver3}:${ver3}:" \
442 -e "s:\${libdir}:${inslibdir}:" \
443 "${FILESDIR}"/libGL.la-r2 > "${D}"/${NV_ROOT}/lib/libGL.la
444 fi
445
446 exeinto ${X11_LIB_DIR}/modules/drivers
447
448 [[ -f ${drvdir}/nvidia_drv.so ]] && \
449 doexe ${drvdir}/nvidia_drv.so
450
451 insinto /usr/${inslibdir}
452 [[ -f ${libdir}/libXvMCNVIDIA.a ]] && \
453 doins ${libdir}/libXvMCNVIDIA.a
454 exeinto /usr/${inslibdir}
455 # fix Bug 131315
456 [[ -f ${libdir}/libXvMCNVIDIA.so.${PV} ]] && \
457 doexe ${libdir}/libXvMCNVIDIA.so.${PV} && \
458 dosym libXvMCNVIDIA.so.${PV} \
459 /usr/${inslibdir}/libXvMCNVIDIA.so
460
461 exeinto ${NV_ROOT}/extensions
462 [[ -f ${libdir}/modules/libnvidia-wfb.so.${sover} ]] && \
463 newexe ${libdir}/modules/libnvidia-wfb.so.${sover} libwfb.so
464 [[ -f ${extdir}/libglx.so.${sover} ]] && \
465 newexe ${extdir}/libglx.so.${sover} libglx.so
466
467 # Includes
468 insinto ${NV_ROOT}/include
469 doins ${incdir}/*.h
470
471 #cuda
472 if [[ -f usr/include/cuda/cuda.h ]]; then
473 dodir /usr/include/cuda
474 insinto /usr/include/cuda
475 doins usr/include/cuda/*.h
476
477 if [[ -f usr/${pkglibdir}/libcuda.so.${PV} ]]; then
478 dolib.so usr/${pkglibdir}/libcuda.so.${PV}
479 dosym libcuda.so.${PV} /usr/${inslibdir}/libcuda.so.1
480 dosym libcuda.so.1 /usr/${inslibdir}/libcuda.so
481 fi
482 fi
483 }
484
485 pkg_preinst() {
486
487 # Clean the dynamic libGL stuff's home to ensure
488 # we dont have stale libs floating around
489 if [ -d "${ROOT}"/usr/lib/opengl/nvidia ] ; then
490 rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
491 fi
492 # Make sure we nuke the old nvidia-glx's env.d file
493 if [ -e "${ROOT}"/etc/env.d/09nvidia ] ; then
494 rm -f "${ROOT}"/etc/env.d/09nvidia
495 fi
496 }
497
498 pkg_postinst() {
499 if use kernel_linux; then
500 linux-mod_pkg_postinst
501 fi
502
503 # Switch to the nvidia implementation
504 eselect opengl set --use-old nvidia
505
506 echo
507 elog "You must be in the video group to use the NVIDIA device"
508 elog "For more info, read the docs at"
509 elog "http://www.gentoo.org/doc/en/nvidia-guide.xml#doc_chap3_sect6"
510 elog
511
512 elog "This ebuild installs a kernel module and X driver. Both must"
513 elog "match explicitly in their version. This means, if you restart"
514 elog "X, you most modprobe -r nvidia before starting it back up"
515 elog
516
517 elog "To use the NVIDIA GLX, run \"eselect opengl set nvidia\""
518 elog
519 elog "nVidia has requested that any bug reports submitted have the"
520 elog "output of /usr/bin/nvidia-bug-report.sh included."
521 elog
522 elog "To work with compiz, you must enable the AddARGBGLXVisuals option."
523 elog
524 elog "If you are having resolution problems, try disabling DynamicTwinView."
525 echo
526 }
527
528 want_tls() {
529 # For uclibc or anything non glibc, return false
530 has_version sys-libs/glibc || return 1
531
532 # Old versions of glibc were lt/no-tls only
533 has_version '<sys-libs/glibc-2.3.2' && return 1
534
535 if use x86 ; then
536 case ${CHOST/-*} in
537 i486|i586|i686) ;;
538 *) return 1 ;;
539 esac
540 fi
541
542 # If we've got nptl, we've got tls
543 built_with_use --missing true sys-libs/glibc nptl && return 0
544
545 # 2.3.5 turned off tls for linuxthreads glibc on i486 and i586
546 if use x86 && has_version '>=sys-libs/glibc-2.3.5' ; then
547 case ${CHOST/-*} in
548 i486|i586) return 1 ;;
549 esac
550 fi
551
552 # These versions built linuxthreads version to support tls, too
553 has_version '>=sys-libs/glibc-2.3.4.20040619-r2' && return 0
554
555 return 1
556 }
557
558 pkg_postrm() {
559 if use kernel_linux; then
560 linux-mod_pkg_postrm
561 fi
562 eselect opengl set --use-old xorg-x11
563 }
564
565
566
567 1.1 x11-drivers/nvidia-drivers/nvidia-drivers-71.86.09.ebuild
568
569 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-71.86.09.ebuild?rev=1.1&view=markup
570 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-71.86.09.ebuild?rev=1.1&content-type=text/plain
571
572 Index: nvidia-drivers-71.86.09.ebuild
573 ===================================================================
574 # Copyright 1999-2009 Gentoo Foundation
575 # Distributed under the terms of the GNU General Public License v2
576 # $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-71.86.09.ebuild,v 1.1 2009/03/23 14:35:14 ricmm Exp $
577
578 inherit eutils multilib versionator linux-mod flag-o-matic nvidia-driver
579
580 X86_NV="Linux-x86"
581 AMD64_NV="Linux-x86_64"
582 X86_FBSD_NV="FreeBSD-x86"
583 X86_NV_PACKAGE="NVIDIA-${X86_NV}-${PV}-pkg0"
584 AMD64_NV_PACKAGE="NVIDIA-${AMD64_NV}-${PV}-pkg2"
585 X86_FBSD_NV_PACKAGE="NVIDIA-${X86_FBSD_NV}-${PV}"
586
587 DESCRIPTION="NVIDIA X11 driver and GLX libraries"
588 HOMEPAGE="http://www.nvidia.com/"
589 SRC_URI="x86? ( ftp://download.nvidia.com/XFree86/${X86_NV}/${PV}/${X86_NV_PACKAGE}.run )
590 amd64? ( ftp://download.nvidia.com/XFree86/${AMD64_NV}/${PV}/${AMD64_NV_PACKAGE}.run )"
591
592 LICENSE="NVIDIA"
593 SLOT="0"
594 KEYWORDS="-* ~amd64 ~x86"
595 IUSE="acpi custom-cflags gtk multilib kernel_FreeBSD kernel_linux userland_BSD"
596 RESTRICT="strip"
597 EMULTILIB_PKG="true"
598
599 COMMON="<x11-base/xorg-server-1.4.99
600 multilib? ( app-emulation/emul-linux-x86-xlibs )
601 kernel_FreeBSD? ( !media-video/nvidia-freebsd )
602 !app-emulation/emul-linux-x86-nvidia
603 !x11-drivers/nvidia-legacy-drivers"
604 DEPEND="${COMMON}
605 kernel_linux? ( virtual/linux-sources )
606 app-admin/eselect-opengl"
607 RDEPEND="${COMMON}
608 kernel_linux? ( virtual/modutils )
609 media-libs/mesa
610 acpi? ( sys-power/acpid )"
611 PDEPEND="gtk? ( media-video/nvidia-settings )"
612
613 QA_TEXTRELS_x86="usr/lib/xorg/libXvMCNVIDIA.so.${PV}
614 usr/lib/opengl/nvidia/lib/libGL.so.${PV}
615 usr/lib/opengl/nvidia/lib/libGLcore.so.${PV}
616 usr/lib/opengl/nvidia/lib/libnvidia-cfg.so.${PV}
617 usr/lib/opengl/nvidia/tls/libnvidia-tls.so.${PV}
618 usr/lib/opengl/nvidia/no-tls/libnvidia-tls.so.${PV}
619 usr/lib/libXvMCNVIDIA.so.${PV}
620 usr/lib/xorg/modules/drivers/nvidia_drv.so
621 usr/lib/opengl/nvidia/extensions/libglx.so"
622
623 QA_TEXTRELS_x86_fbsd="boot/modules/nvidia.ko
624 usr/lib/opengl/nvidia/lib/libGL.so.1
625 usr/lib/opengl/nvidia/lib/libGLcore.so.1
626 usr/lib/opengl/nvidia/lib/libnvidia-cfg.so.${PV}
627 usr/lib/opengl/nvidia/no-tls/libnvidia-tls.so.1
628 usr/lib/opengl/nvidia/extensions/libglx.so
629 usr/lib/xorg/modules/drivers/nvidia_drv.so"
630
631 QA_WX_LOAD_x86="usr/lib/opengl/nvidia/lib/libGL.so.${PV}
632 usr/lib/opengl/nvidia/lib/libGLcore.so.${PV}
633 usr/lib/opengl/nvidia/extensions/libglx.so"
634
635 QA_TEXTRELS_amd64="usr/lib64/xorg/libXvMCNVIDIA.so.${PV}
636 usr/lib64/opengl/nvidia/lib/libGL.so.${PV}
637 usr/lib64/opengl/nvidia/lib/libGLcore.so.${PV}
638 usr/lib64/opengl/nvidia/lib/libnvidia-cfg.so.${PV}
639 usr/lib64/opengl/nvidia/tls/libnvidia-tls.so.${PV}
640 usr/lib64/opengl/nvidia/no-tls/libnvidia-tls.so.${PV}
641 usr/lib64/libXvMCNVIDIA.so.${PV}
642 usr/lib64/xorg/modules/drivers/nvidia_drv.so
643 usr/lib64/opengl/nvidia/extensions/libglx.so
644 usr/lib32/xorg/libXvMCNVIDIA.so.${PV}
645 usr/lib32/opengl/nvidia/lib/libGL.so.${PV}
646 usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV}
647 usr/lib32/opengl/nvidia/lib/libnvidia-cfg.so.${PV}
648 usr/lib32/opengl/nvidia/tls/libnvidia-tls.so.${PV}
649 usr/lib32/opengl/nvidia/no-tls/libnvidia-tls.so.${PV}
650 usr/lib32/libXvMCNVIDIA.so.${PV}
651 usr/lib32/xorg/modules/drivers/nvidia_drv.so
652 usr/lib32/opengl/nvidia/extensions/libglx.so"
653
654 QA_WX_LOAD_amd64="usr/lib64/opengl/nvidia/lib/libGL.so.${PV}
655 usr/lib64/opengl/nvidia/lib/libGLcore.so.${PV}
656 usr/lib64/opengl/nvidia/extensions/libglx.so
657 usr/lib32/opengl/nvidia/lib/libGL.so.${PV}
658 usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV}
659 usr/lib32/opengl/nvidia/extensions/libglx.so"
660
661 QA_EXECSTACK_amd64="usr/lib64/xorg/modules/drivers/nvidia_drv.so
662 usr/lib64/opengl/nvidia/lib/libGL.so.${PV}
663 usr/lib64/opengl/nvidia/lib/libnvidia-cfg.so.${PV}
664 usr/lib64/opengl/nvidia/extensions/libglx.so
665 usr/lib64/libXvMCNVIDIA.so.${PV}
666 usr/bin/nvidia-xconfig"
667
668 QA_EXECSTACK_x86="usr/lib/xorg/modules/drivers/nvidia_drv.so
669 usr/lib/opengl/nvidia/lib/libGL.so.${PV}
670 usr/lib/opengl/nvidia/lib/libnvidia-cfg.so.${PV}
671 usr/lib/opengl/nvidia/extensions/libglx.so
672 usr/lib/libXvMCNVIDIA.so.${PV}
673 usr/bin/nvidia-xconfig"
674
675 mtrr_check() {
676 ebegin "Checking for MTRR support"
677 linux_chkconfig_present MTRR
678 eend $?
679
680 if [[ $? -ne 0 ]] ; then
681 eerror "This version needs MTRR support for most chipsets!"
682 eerror "Please enable MTRR support in your kernel config, found at:"
683 eerror
684 eerror " Processor type and features"
685 eerror " [*] MTRR (Memory Type Range Register) support"
686 eerror
687 eerror "and recompile your kernel ..."
688 die "MTRR support not detected!"
689 fi
690 }
691
692 pkg_setup() {
693 # try to turn off distcc and ccache for people that have a problem with it
694 export DISTCC_DISABLE=1
695 export CCACHE_DISABLE=1
696
697 # use the right package
698 if use x86; then
699 NV_PACKAGE="${X86_NV_PACKAGE}"
700 elif use amd64; then
701 NV_PACKAGE="${AMD64_NV_PACKAGE}"
702 elif use x86-fbsd; then
703 NV_PACKAGE="${X86_FBSD_NV_PACKAGE}"
704 else
705 die "Could not determine proper NVIDIA package"
706 fi
707
708 # set variables to where files are in the package structure
709 if use kernel_FreeBSD; then
710 NV_DOC="${WORKDIR}/${NV_PACKAGE}/doc"
711 NV_EXEC="${WORKDIR}/${NV_PACKAGE}/obj"
712 NV_SRC="${WORKDIR}/${NV_PACKAGE}/src"
713 elif use kernel_linux; then
714 NV_DOC="${WORKDIR}/${NV_PACKAGE}/usr/share/doc"
715 NV_EXEC="${WORKDIR}/${NV_PACKAGE}/usr/bin"
716 NV_SRC="${WORKDIR}/${NV_PACKAGE}/usr/src/nv"
717 fi
718
719 if use amd64 && has_multilib_profile && [ "${DEFAULT_ABI}" != "amd64" ]; then
720 eerror "This ebuild doesn't currently support changing your default abi."
721 die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
722 fi
723
724 if use kernel_linux; then
725 linux-mod_pkg_setup
726 MODULE_NAMES="nvidia(video:${NV_SRC})"
727 BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
728 SYSOUT=${KV_OUT_DIR} HOST_CC=$(tc-getBUILD_CC)"
729 mtrr_check
730 fi
731
732 # On BSD userland it wants real make command
733 use userland_BSD && MAKE="$(get_bmake)"
734
735 # Unknown why this needs to be set
736 export _POSIX2_VERSION="199209"
737
738 # Since Nvidia ships 3 different series of drivers, we need to give the user
739 # some kind of guidance as to what version they should install. This tries
740 # to point the user in the right direction but can't be perfect. check
741 # nvidia-driver.eclass
742 nvidia-driver-check-warning
743 }
744
745 src_unpack() {
746 if use kernel_linux && kernel_is lt 2 6 7; then
747 echo
748 ewarn "Your kernel version is ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}"
749 ewarn "This is not officially supported for ${P}. It is likely you"
750 ewarn "will not be able to compile or use the kernel module."
751 ewarn "It is recommended that you upgrade your kernel to a version >= 2.6.7"
752 echo
753 ewarn "DO NOT file bug reports for kernel versions less than 2.6.7 as they will be ignored."
754 fi
755
756 if ! use x86-fbsd; then
757 mkdir "${WORKDIR}/${NV_PACKAGE}"
758 cd "${WORKDIR}/${NV_PACKAGE}"
759 unpack_makeself
760 else
761 unpack ${A}
762 fi
763
764 # Patches go below here, add brief description
765 use x86-fbsd \
766 && cd "${NV_DOC}" \
767 || cd "${WORKDIR}/${NV_PACKAGE}"
768 # Use the correct defines to make gtkglext build work
769 epatch "${FILESDIR}"/NVIDIA_glx-defines.patch
770 # Use some more sensible gl headers and make way for new glext.h
771 epatch "${FILESDIR}"/NVIDIA_glx-glheader.patch
772
773 if use kernel_linux; then
774 # Quiet down warnings the user does not need to see
775 sed -i \
776 -e 's:-Wpointer-arith::g' \
777 -e 's:-Wsign-compare::g' \
778 "${WORKDIR}/${NV_PACKAGE}"/Makefile.kbuild
779
780 # If you set this then it's your own fault when stuff breaks :)
781 [[ -n ${USE_CRAZY_OPTS} ]] && sed -i "s:-O:${CFLAGS}:" "${NV_SRC}"/Makefile.*
782
783 # If greater than 2.6.5 use M= instead of SUBDIR=
784 convert_to_m "${NV_SRC}"/Makefile.kbuild
785 fi
786 }
787
788 src_compile() {
789 # This is already the default on Linux, as there's no toplevel Makefile, but
790 # on FreeBSD there's one and triggers the kernel module build, as we install
791 # it by itself, pass this.
792
793 cd "${NV_SRC}"
794 if use x86-fbsd; then
795 emake CC="$(tc-getCC)" LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" \
796 CFLAGS="-Wno-sign-compare" || die "Failed to compile"
797 else
798 linux-mod_src_compile
799 fi
800 }
801
802 src_install() {
803 cd "${WORKDIR}"/${NV_PACKAGE}
804
805 if ! use x86-fbsd; then
806 linux-mod_src_install
807
808 VIDEOGROUP="$(egetent group video | cut -d ':' -f 3)"
809 if [ -z "$VIDEOGROUP" ]; then
810 eerror "Failed to determine the video group gid."
811 die "Failed to determine the video group gid."
812 fi
813
814 # Add the aliases
815 [ -f "${FILESDIR}/nvidia" ] || die "nvidia missing in FILESDIR"
816 sed -e 's:PACKAGE:'${PF}':g' \
817 -e 's:VIDEOGID:'${VIDEOGROUP}':' "${FILESDIR}"/nvidia > \
818 "${WORKDIR}"/nvidia
819 insinto /etc/modprobe.d
820 doins "${WORKDIR}"/nvidia || die
821 else
822 insinto /boot/modules
823 doins "${WORKDIR}/${NV_PACKAGE}/src/nvidia.kld" || die
824
825 exeinto /boot/modules
826 doexe "${WORKDIR}/${NV_PACKAGE}/src/nvidia.ko" || die
827 fi
828
829 if has_multilib_profile ; then
830 local OABI=${ABI}
831 for ABI in $(get_install_abis) ; do
832 src_install-libs
833 done
834 ABI=${OABI}
835 unset OABI
836 elif use amd64 ; then
837 src_install-libs lib32 $(get_multilibdir)
838 src_install-libs lib $(get_libdir)
839
840 rm -rf "${D}"/usr/$(get_multilibdir)/opengl/nvidia/include
841 rm -rf "${D}"/usr/$(get_multilibdir)/opengl/nvidia/extensions
842 else
843 src_install-libs
844 fi
845
846 is_final_abi || return 0
847
848 # Documentation
849 dodoc "${NV_DOC}"/{XF86Config.sample,README}
850 dohtml "${NV_DOC}"/html/*
851 if ! use x86-fbsd; then
852 dodoc "${NV_DOC}"/NVIDIA_Changelog
853 fi
854
855 # Helper Apps
856 dobin "${NV_EXEC}"/nvidia-bug-report.sh || die
857 }
858
859 # Install nvidia library:
860 # the first parameter is the place where to install it
861 # the second parameter is the base name of the library
862 # the third parameter is the provided soversion
863 donvidia() {
864 dodir $1
865 exeinto $1
866
867 libname=$(basename $2)
868
869 doexe $2.$3
870 dosym ${libname}.$3 $1/${libname}
871
872 [[ $3 != "1" ]] && dosym ${libname}.$3 $1/${libname}.1
873 }
874
875 src_install-libs() {
876 local pkglibdir=lib
877 local inslibdir=$(get_libdir)
878
879 if [[ ${#} -eq 2 ]] ; then
880 pkglibdir=${1}
881 inslibdir=${2}
882 elif has_multilib_profile && [[ ${ABI} == "x86" ]] ; then
883 pkglibdir=lib32
884 fi
885
886 local usrpkglibdir=usr/${pkglibdir}
887 local libdir=usr/X11R6/${pkglibdir}
888 local drvdir=${libdir}/modules/drivers
889 local extdir=${libdir}/modules/extensions
890 local incdir=usr/include/GL
891 local sover=${PV}
892 local NV_ROOT="/usr/${inslibdir}/opengl/nvidia"
893 local NO_TLS_ROOT="${NV_ROOT}/no-tls"
894 local TLS_ROOT="${NV_ROOT}/tls"
895 local X11_LIB_DIR="/usr/${inslibdir}/xorg"
896
897 if ! has_version x11-base/xorg-server ; then
898 X11_LIB_DIR="/usr/${inslibdir}"
899 fi
900
901 if use x86-fbsd; then
902 # on FreeBSD everything is on obj/
903 pkglibdir=obj
904 usrpkglibdir=obj
905 x11pkglibdir=obj
906 drvdir=obj
907 extdir=obj
908
909 # don't ask me why the headers are there.. glxext.h is missing
910 incdir=doc
911
912 # on FreeBSD it has just .1 suffix
913 sover=1
914 fi
915
916 # The GLX libraries
917 donvidia ${NV_ROOT}/lib ${usrpkglibdir}/libGL.so ${sover}
918 donvidia ${NV_ROOT}/lib ${usrpkglibdir}/libGLcore.so ${sover}
919
920 dodir ${NO_TLS_ROOT}
921 donvidia ${NO_TLS_ROOT} ${usrpkglibdir}/libnvidia-tls.so ${sover}
922
923 if ! use x86-fbsd; then
924 donvidia ${TLS_ROOT} ${usrpkglibdir}/tls/libnvidia-tls.so ${sover}
925 fi
926
927 if want_tls ; then
928 dosym ../tls/libnvidia-tls.so ${NV_ROOT}/lib
929 dosym ../tls/libnvidia-tls.so.1 ${NV_ROOT}/lib
930 dosym ../tls/libnvidia-tls.so.${sover} ${NV_ROOT}/lib
931 else
932 dosym ../no-tls/libnvidia-tls.so ${NV_ROOT}/lib
933 dosym ../no-tls/libnvidia-tls.so.1 ${NV_ROOT}/lib
934 dosym ../no-tls/libnvidia-tls.so.${sover} ${NV_ROOT}/lib
935 fi
936
937 if ! use x86-fbsd; then
938 # Install the .la file for libtool, to prevent e.g. bug #176423
939 [ -f "${FILESDIR}/libGL.la-r2" ] || die "libGL.la-r2 missing in FILESDIR"
940 local ver1=$(get_version_component_range 1)
941 local ver2=$(get_version_component_range 2)
942 local ver3=$(get_version_component_range 3)
943 sed -e "s:\${PV}:${PV}:" \
944 -e "s:\${ver1}:${ver1}:" \
945 -e "s:\${ver2}:${ver2}:" \
946 -e "s:\${ver3}:${ver3}:" \
947 -e "s:\${libdir}:${inslibdir}:" \
948 "${FILESDIR}"/libGL.la-r2 > "${D}"/${NV_ROOT}/lib/libGL.la
949 fi
950
951 exeinto ${X11_LIB_DIR}/modules/drivers
952
953 [[ -f ${drvdir}/nvidia_drv.so ]] && \
954 doexe ${drvdir}/nvidia_drv.so
955
956 insinto /usr/${inslibdir}
957 [[ -f ${libdir}/libXvMCNVIDIA.a ]] && \
958 doins ${libdir}/libXvMCNVIDIA.a
959 exeinto /usr/${inslibdir}
960 # fix Bug 131315
961 [[ -f ${libdir}/libXvMCNVIDIA.so.${PV} ]] && \
962 doexe ${libdir}/libXvMCNVIDIA.so.${PV} && \
963 dosym libXvMCNVIDIA.so.${PV} \
964 /usr/${inslibdir}/libXvMCNVIDIA.so
965
966 exeinto ${NV_ROOT}/extensions
967 [[ -f ${libdir}/modules/libnvidia-wfb.so.${sover} ]] && \
968 newexe ${libdir}/modules/libnvidia-wfb.so.${sover} libwfb.so
969 [[ -f ${extdir}/libglx.so.${sover} ]] && \
970 newexe ${extdir}/libglx.so.${sover} libglx.so
971
972 # Includes
973 insinto ${NV_ROOT}/include
974 doins ${incdir}/*.h
975 }
976
977 pkg_preinst() {
978 # Clean the dynamic libGL stuff's home to ensure
979 # we dont have stale libs floating around
980 if [[ -d ${ROOT}/usr/lib/opengl/nvidia ]] ; then
981 rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
982 fi
983 # Make sure we nuke the old nvidia-glx's env.d file
984 if [[ -e ${ROOT}/etc/env.d/09nvidia ]] ; then
985 rm -f "${ROOT}"/etc/env.d/09nvidia
986 fi
987 }
988
989 pkg_postinst() {
990 if use kernel_linux; then
991 linux-mod_pkg_postinst
992 fi
993
994 # Switch to the nvidia implementation
995 eselect opengl set --use-old nvidia
996
997 echo
998 elog "To use the Nvidia GLX, run \"eselect opengl set nvidia\""
999 elog
1000 elog "nVidia has requested that any bug reports submitted have the"
1001 elog "output of /usr/bin/nvidia-bug-report.sh included."
1002 elog
1003 elog "To work with compiz, you must enable the AddARGBGLXVisuals option."
1004 elog
1005 elog "If you are having resolution problems, try disabling DynamicTwinView."
1006 echo
1007 }
1008
1009 want_tls() {
1010 # For uclibc or anything non glibc, return false
1011 has_version sys-libs/glibc || return 1
1012
1013 # Old versions of glibc were lt/no-tls only
1014 has_version '<sys-libs/glibc-2.3.2' && return 1
1015
1016 if use x86 ; then
1017 case ${CHOST/-*} in
1018 i486|i586|i686) ;;
1019 *) return 1 ;;
1020 esac
1021 fi
1022
1023 # If we've got nptl, we've got tls
1024 built_with_use --missing true sys-libs/glibc nptl && return 0
1025
1026 # 2.3.5 turned off tls for linuxthreads glibc on i486 and i586
1027 if use x86 && has_version '>=sys-libs/glibc-2.3.5' ; then
1028 case ${CHOST/-*} in
1029 i486|i586) return 1 ;;
1030 esac
1031 fi
1032
1033 # These versions built linuxthreads version to support tls, too
1034 has_version '>=sys-libs/glibc-2.3.4.20040619-r2' && return 0
1035
1036 return 1
1037 }
1038
1039 pkg_postrm() {
1040 if use kernel_linux; then
1041 linux-mod_pkg_postrm
1042 fi
1043 eselect opengl set --use-old xorg-x11
1044 }