Gentoo Archives: gentoo-commits

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