/[gentoo-x86]/x11-drivers/nvidia-drivers/nvidia-drivers-295.71.ebuild
Gentoo

Contents of /x11-drivers/nvidia-drivers/nvidia-drivers-295.71.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations) (download)
Mon Sep 24 00:48:53 2012 UTC (21 months, 2 weeks ago) by vapier
Branch: MAIN
Changes since 1.5: +3 -3 lines
QA_DT_HASH (old/deprecated) -> QA_FLAGS_IGNORED (new hotness).

(Portage version: 2.2.0_alpha131/cvs/Linux x86_64)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-295.71.ebuild,v 1.5 2012/08/17 11:20:04 nativemad Exp $
4
5 EAPI="2"
6
7 inherit eutils flag-o-matic linux-mod multilib nvidia-driver portability \
8 unpacker user versionator
9
10 X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
11 AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
12 X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
13 AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
14
15 DESCRIPTION="NVIDIA X11 driver and GLX libraries"
16 HOMEPAGE="http://www.nvidia.com/"
17 SRC_URI="x86? ( http://us.download.nvidia.com/XFree86/Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
18 amd64? ( http://us.download.nvidia.com/XFree86/Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
19 amd64-fbsd? ( http://us.download.nvidia.com/XFree86/FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
20 x86-fbsd? ( http://us.download.nvidia.com/XFree86/FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )"
21
22 LICENSE="NVIDIA"
23 SLOT="0"
24 KEYWORDS="-* amd64 x86 ~amd64-fbsd ~x86-fbsd"
25 IUSE="acpi multilib kernel_FreeBSD kernel_linux +tools"
26 RESTRICT="strip"
27 EMULTILIB_PKG="true"
28
29 COMMON="<x11-base/xorg-server-1.12.99
30 kernel_linux? ( >=sys-libs/glibc-2.6.1 )
31 multilib? ( app-emulation/emul-linux-x86-xlibs )
32 >=app-admin/eselect-opengl-1.0.9
33 app-admin/eselect-opencl"
34 DEPEND="${COMMON}
35 kernel_linux? ( virtual/linux-sources )"
36 RDEPEND="${COMMON}
37 x11-libs/libXvMC
38 acpi? ( sys-power/acpid )
39 tools? (
40 dev-libs/atk
41 dev-libs/glib
42 x11-libs/gdk-pixbuf
43 x11-libs/gtk+:2
44 x11-libs/libX11
45 x11-libs/libXext
46 x11-libs/pango[X]
47 )"
48 PDEPEND=">=x11-libs/libvdpau-0.3-r1"
49
50 QA_TEXTRELS_x86="
51 usr/lib/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0
52 usr/lib/libXvMCNVIDIA.so.${PV}
53 usr/lib/libcuda.so.${PV}
54 usr/lib/libnvcuvid.so.${PV}
55 usr/lib/libnvidia-cfg.so.${PV}
56 usr/lib/libnvidia-compiler.so.${PV}
57 usr/lib/libnvidia-glcore.so.${PV}
58 usr/lib/libnvidia-ml.so.${PV}
59 usr/lib/libvdpau_nvidia.so.${PV}
60 usr/lib/opengl/nvidia/extensions/libglx.so.${PV}
61 usr/lib/opengl/nvidia/lib/libGL.so.${PV}
62 usr/lib/opengl/nvidia/lib/libnvidia-tls.so.${PV}
63 usr/lib/xorg/modules/drivers/nvidia_drv.so"
64
65 QA_TEXTRELS_x86_fbsd="boot/modules/nvidia.ko
66 usr/lib/opengl/nvidia/lib/libGL.so.1
67 usr/lib/libnvidia-glcore.so.1
68 usr/lib/libvdpau_nvidia.so.1
69 usr/lib/libnvidia-cfg.so.1
70 usr/lib/opengl/nvidia/extensions/libglx.so.1
71 usr/lib/xorg/modules/drivers/nvidia_drv.so"
72
73 QA_TEXTRELS_amd64="usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV}
74 usr/lib32/libnvidia-glcore.so.${PV}
75 usr/lib32/libvdpau_nvidia.so.${PV}
76 usr/lib32/opengl/nvidia/lib/libGL.so.${PV}
77 usr/lib32/libcuda.so.${PV}
78 usr/lib32/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0
79 usr/lib32/libnvidia-compiler.so.${PV}"
80
81 QA_EXECSTACK_x86="usr/lib/opengl/nvidia/lib/libGL.so.${PV}
82 usr/lib/libnvidia-glcore.so.${PV}
83 usr/lib/opengl/nvidia/extensions/libglx.so.${PV}
84 usr/lib64/libXvMCNVIDIA.so.${PV}
85 usr/lib/libXvMCNVIDIA.a:NVXVMC.o
86 usr/lib/libvdpau_nvidia.so.${PV}
87 usr/lib/libnvidia-compiler.so.${PV}
88 usr/lib/libcuda.so.${PV}
89 usr/lib/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0"
90
91 QA_EXECSTACK_amd64="usr/lib32/libnvidia-glcore.so.${PV}
92 usr/lib32/opengl/nvidia/lib/libGL.so.${PV}
93 usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV}
94 usr/lib32/libvdpau_nvidia.so.${PV}
95 usr/lib32/libcuda.so.${PV}
96 usr/lib32/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0
97 usr/lib32/libnvidia-compiler.so.${PV}
98 usr/lib64/libXvMCNVIDIA.a:NVXVMC.o
99 usr/lib64/libnvidia-cfg.so.${PV}
100 usr/lib64/libnvidia-ml.so.${PV}
101 usr/lib64/libvdpau_nvidia.so.${PV}
102 usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.${PV}
103 usr/lib64/opengl/nvidia/lib/libGL.so.${PV}
104 usr/lib64/libnvidia-glcore.so.${PV}
105 usr/lib64/opengl/nvidia/extensions/libglx.so.${PV}
106 usr/lib64/libXvMCNVIDIA.so.${PV}
107 usr/lib64/libcuda.so.${PV}
108 usr/lib64/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0
109 usr/lib64/libnvidia-compiler.so.${PV}
110 usr/lib64/xorg/modules/drivers/nvidia_drv.so
111 opt/bin/nvidia-smi
112 opt/bin/nvidia-xconfig
113 opt/bin/nvidia-debugdump
114 opt/bin/nvidia-settings"
115
116 QA_WX_LOAD_x86="usr/lib/libnvidia-glcore.so.${PV}
117 usr/lib/opengl/nvidia/lib/libGL.so.${PV}
118 usr/lib/opengl/nvidia/extensions/libglx.so.${PV}
119 usr/lib/libXvMCNVIDIA.a
120 usr/lib64/libXvMCNVIDIA.so.${PV}"
121
122 QA_WX_LOAD_amd64="usr/lib32/opengl/nvidia/lib/libGL.so.${PV}
123 usr/lib32/libnvidia-glcore.so.${PV}
124 usr/lib64/opengl/nvidia/lib/libGL.so.${PV}
125 usr/lib64/libnvidia-glcore.so.${PV}
126 usr/lib64/opengl/nvidia/extensions/libglx.so.${PV}
127 usr/lib64/libXvMCNVIDIA.so.${PV}"
128
129 QA_SONAME_x86="usr/lib/libnvidia-compiler.so.${PV}"
130
131 QA_SONAME_amd64="usr/lib64/libnvidia-compiler.so.${PV}
132 usr/lib32/libnvidia-compiler.so.${PV}"
133
134 QA_FLAGS_IGNORED_amd64="usr/lib32/libcuda.so.${PV}
135 usr/lib32/opengl/nvidia/lib/libGL.so.${PV}
136 usr/lib32/libnvidia-glcore.so.${PV}
137 usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV}
138 usr/lib32/libvdpau_nvidia.so.${PV}
139 usr/lib32/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0
140 usr/lib32/libnvidia-compiler.so.${PV}
141 usr/lib64/libXvMCNVIDIA.so.${PV}
142 usr/lib64/libcuda.so.${PV}
143 usr/lib64/libnvidia-cfg.so.${PV}
144 usr/lib64/libnvidia-glcore.so.${PV}
145 usr/lib64/libnvidia-ml.so.${PV}
146 usr/lib64/opengl/nvidia/lib/libGL.so.${PV}
147 usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.${PV}
148 usr/lib64/opengl/nvidia/extensions/libglx.so.${PV}
149 usr/lib64/xorg/modules/drivers/nvidia_drv.so
150 usr/lib64/libvdpau_nvidia.so.${PV}
151 usr/lib64/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0
152 usr/lib64/libnvidia-compiler.so.${PV}
153 usr/lib64/libnvcuvid.so.${PV}
154 opt/bin/nvidia-smi
155 opt/bin/nvidia-xconfig
156 opt/bin/nvidia-debugdump
157 opt/bin/nvidia-settings"
158
159 QA_FLAGS_IGNORED_x86="usr/lib/libcuda.so.${PV}
160 usr/lib/libnvidia-cfg.so.${PV}
161 usr/lib/libnvidia-glcore.so.${PV}
162 usr/lib/libnvidia-ml.so.${PV}
163 usr/lib/opengl/nvidia/lib/libGL.so.${PV}
164 usr/lib/opengl/nvidia/lib/libnvidia-tls.so.${PV}
165 usr/lib/opengl/nvidia/extensions/libglx.so.${PV}
166 usr/lib/xorg/modules/drivers/nvidia_drv.so
167 usr/lib/libXvMCNVIDIA.so.${PV}
168 usr/lib/libvdpau_nvidia.so.${PV}
169 usr/lib/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0
170 usr/lib/libnvidia-compiler.so.${PV}
171 usr/lib/libnvcuvid.so.${PV}
172 opt/bin/nvidia-smi
173 opt/bin/nvidia-xconfig
174 opt/bin/nvidia-debugdump
175 opt/bin/nvidia-settings"
176
177 S=${WORKDIR}/
178
179 mtrr_check() {
180 ebegin "Checking for MTRR support"
181 linux_chkconfig_present MTRR
182 eend $?
183
184 if [[ $? -ne 0 ]] ; then
185 eerror "Please enable MTRR support in your kernel config, found at:"
186 eerror
187 eerror " Processor type and features"
188 eerror " [*] MTRR (Memory Type Range Register) support"
189 eerror
190 eerror "and recompile your kernel ..."
191 die "MTRR support not detected!"
192 fi
193 }
194
195 lockdep_check() {
196 if linux_chkconfig_present LOCKDEP; then
197 eerror "You've enabled LOCKDEP -- lock tracking -- in the kernel."
198 eerror "Unfortunately, this option exports the symbol "
199 eerror "'lockdep_init_map' as GPL-only which will prevent "
200 eerror "${P} from compiling."
201 eerror "Please make sure the following options have been unset:"
202 eerror
203 eerror " Kernel hacking --->"
204 eerror " [ ] Lock debugging: detect incorrect freeing of live locks"
205 eerror " [ ] Lock debugging: prove locking correctness"
206 eerror " [ ] Lock usage statistics"
207 eerror "in 'menuconfig'"
208 die "LOCKDEP enabled"
209 fi
210 }
211
212 pkg_setup() {
213 # try to turn off distcc and ccache for people that have a problem with it
214 export DISTCC_DISABLE=1
215 export CCACHE_DISABLE=1
216
217 if use amd64 && has_multilib_profile && [ "${DEFAULT_ABI}" != "amd64" ]; then
218 eerror "This ebuild doesn't currently support changing your default abi."
219 die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
220 fi
221
222 if use kernel_linux; then
223 linux-mod_pkg_setup
224 MODULE_NAMES="nvidia(video:${S}/kernel)"
225 BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
226 SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC)"
227 # linux-mod_src_compile calls set_arch_to_kernel, which
228 # sets the ARCH to x86 but NVIDIA's wrapping Makefile
229 # expects x86_64 or i386 and then converts it to x86
230 # later on in the build process
231 BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
232 mtrr_check
233 lockdep_check
234 fi
235
236 # On BSD userland it wants real make command
237 use userland_BSD && MAKE="$(get_bmake)"
238
239 export _POSIX2_VERSION="199209"
240
241 # Since Nvidia ships 3 different series of drivers, we need to give the user
242 # some kind of guidance as to what version they should install. This tries
243 # to point the user in the right direction but can't be perfect. check
244 # nvidia-driver.eclass
245 nvidia-driver-check-warning
246
247 # set variables to where files are in the package structure
248 if use kernel_FreeBSD; then
249 use x86-fbsd && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
250 use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
251 NV_DOC="${S}/doc"
252 NV_EXEC="${S}/obj"
253 NV_LIB="${S}/obj"
254 NV_SRC="${S}/src"
255 NV_MAN="${S}/x11/man"
256 NV_X11="${S}/obj"
257 NV_X11_DRV="${NV_X11}"
258 NV_X11_EXT="${NV_X11}"
259 NV_SOVER=1
260 elif use kernel_linux; then
261 NV_DOC="${S}"
262 NV_EXEC="${S}"
263 NV_LIB="${S}"
264 NV_SRC="${S}/kernel"
265 NV_MAN="${S}"
266 NV_X11="${S}"
267 NV_X11_DRV="${NV_X11}"
268 NV_X11_EXT="${NV_X11}"
269 NV_SOVER=${PV}
270 else
271 die "Could not determine proper NVIDIA package"
272 fi
273 }
274
275 src_unpack() {
276 if use kernel_linux && kernel_is lt 2 6 7; then
277 echo
278 ewarn "Your kernel version is ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}"
279 ewarn "This is not officially supported for ${P}. It is likely you"
280 ewarn "will not be able to compile or use the kernel module."
281 ewarn "It is recommended that you upgrade your kernel to a version >= 2.6.7"
282 echo
283 ewarn "DO NOT file bug reports for kernel versions less than 2.6.7 as they will be ignored."
284 fi
285
286 if ! use kernel_FreeBSD; then
287 cd "${S}"
288 unpack_makeself
289 else
290 unpack ${A}
291 fi
292 }
293
294 src_prepare() {
295 # Please add a brief description for every added patch
296 use kernel_FreeBSD && cd doc
297
298 if use kernel_linux; then
299 # Quiet down warnings the user does not need to see
300 sed -i \
301 -e 's:-Wsign-compare::g' \
302 "${NV_SRC}"/Makefile.kbuild
303
304 # If greater than 2.6.5 use M= instead of SUBDIR=
305 convert_to_m "${NV_SRC}"/Makefile.kbuild
306 fi
307 cat <<- EOF > "${S}"/nvidia.icd
308 /usr/$(get_libdir)/libcuda.so
309 EOF
310
311 # Allow user patches so they can support RC kernels and whatever else
312 epatch_user
313 }
314
315 src_compile() {
316 # This is already the default on Linux, as there's no toplevel Makefile, but
317 # on FreeBSD there's one and triggers the kernel module build, as we install
318 # it by itself, pass this.
319
320 cd "${NV_SRC}"
321 if use kernel_FreeBSD; then
322 MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
323 LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
324 elif use kernel_linux; then
325 linux-mod_src_compile
326 fi
327 }
328
329 src_install() {
330 if use kernel_linux; then
331 linux-mod_src_install
332
333 VIDEOGROUP="$(egetent group video | cut -d ':' -f 3)"
334 if [ -z "$VIDEOGROUP" ]; then
335 eerror "Failed to determine the video group gid."
336 die "Failed to determine the video group gid."
337 fi
338
339 # Add the aliases
340 [ -f "${FILESDIR}/nvidia-169.07" ] || die "nvidia missing in FILESDIR"
341 sed -e 's:PACKAGE:'${PF}':g' \
342 -e 's:VIDEOGID:'${VIDEOGROUP}':' "${FILESDIR}"/nvidia-169.07 > \
343 "${WORKDIR}"/nvidia
344 insinto /etc/modprobe.d
345 newins "${WORKDIR}"/nvidia nvidia.conf || die
346
347 # Ensures that our device nodes are created when not using X
348 exeinto /lib/udev
349 doexe "${FILESDIR}"/nvidia-udev.sh
350
351 insinto /lib/udev/rules.d
352 newins "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
353 elif use kernel_FreeBSD; then
354 if use x86-fbsd; then
355 insinto /boot/modules
356 doins "${S}/src/nvidia.kld" || die
357 fi
358
359 exeinto /boot/modules
360 doexe "${S}/src/nvidia.ko" || die
361 fi
362
363 # NVIDIA kernel <-> userspace driver config lib
364 dolib.so ${NV_LIB}/libnvidia-cfg.so.${NV_SOVER} || \
365 die "failed to install libnvidia-cfg"
366 dosym libnvidia-cfg.so.${NV_SOVER} \
367 /usr/$(get_libdir)/libnvidia-cfg.so.1 || \
368 die "failed to create libnvidia-cfg.so symlink"
369 dosym libnvidia-cfg.so.1 \
370 /usr/$(get_libdir)/libnvidia-cfg.so || \
371 die "failed to create libnvidia-cfg.so symlink"
372
373 if use kernel_linux; then
374 # NVIDIA monitoring library
375 dolib.so ${NV_LIB}/libnvidia-ml.so.${NV_SOVER} || \
376 die "failed to install libnvidia-ml"
377 dosym libnvidia-ml.so.${NV_SOVER} \
378 /usr/$(get_libdir)/libnvidia-ml.so.1 || \
379 die "failed to create libnvidia-ml.so symlink"
380 dosym libnvidia-ml.so.1 \
381 /usr/$(get_libdir)/libnvidia-ml.so || \
382 die "failed to create libnvidia-ml.so symlink"
383
384 # NVIDIA video decode <-> CUDA
385 dolib.so ${NV_LIB}/libnvcuvid.so.${NV_SOVER} || \
386 die "failed to install libnvcuvid.so"
387 dosym libnvcuvid.so.${NV_SOVER} \
388 /usr/$(get_libdir)/libnvcuvid.so.1 || \
389 die "failed to create libnvcuvid.so symlink"
390 dosym libnvcuvid.so.1 \
391 /usr/$(get_libdir)/libnvcuvid.so || \
392 die "failed to create libnvcuvid.so symlink"
393 fi
394
395 # Xorg DDX driver
396 insinto /usr/$(get_libdir)/xorg/modules/drivers
397 doins ${NV_X11_DRV}/nvidia_drv.so || die "failed to install nvidia_drv.so"
398
399 # Xorg GLX driver
400 insinto /usr/$(get_libdir)/opengl/nvidia/extensions
401 doins ${NV_X11_EXT}/libglx.so.${NV_SOVER} || \
402 die "failed to install libglx.so"
403 dosym libglx.so.${NV_SOVER} \
404 /usr/$(get_libdir)/opengl/nvidia/extensions/libglx.so || \
405 die "failed to create libglx.so symlink"
406
407 # XvMC driver
408 dolib.a ${NV_X11}/libXvMCNVIDIA.a || \
409 die "failed to install libXvMCNVIDIA.so"
410 dolib.so ${NV_X11}/libXvMCNVIDIA.so.${NV_SOVER} || \
411 die "failed to install libXvMCNVIDIA.so"
412 dosym libXvMCNVIDIA.so.${NV_SOVER} \
413 /usr/$(get_libdir)/libXvMCNVIDIA.so.1 || \
414 die "failed to create libXvMCNVIDIA.so symlink"
415 dosym libXvMCNVIDIA.so.1 /usr/$(get_libdir)/libXvMCNVIDIA.so || \
416 die "failed to create libXvMCNVIDIA.so symlink"
417 dosym libXvMCNVIDIA.so.${NV_SOVER} \
418 /usr/$(get_libdir)/libXvMCNVIDIA_dynamic.so.1 || \
419 die "failed to create libXvMCNVIDIA_dynamic.so symlink"
420
421 # OpenCL ICD for NVIDIA
422 if use kernel_linux; then
423 insinto /etc/OpenCL/vendors
424 doins nvidia.icd
425 fi
426
427 # Documentation
428 dohtml ${NV_DOC}/html/*
429 if use kernel_FreeBSD; then
430 dodoc "${NV_DOC}/README"
431 doman "${NV_MAN}/nvidia-xconfig.1"
432 doman "${NV_MAN}/nvidia-settings.1"
433 else
434 # Docs
435 newdoc "${NV_DOC}/README.txt" README
436 dodoc "${NV_DOC}/NVIDIA_Changelog"
437 doman "${NV_MAN}/nvidia-smi.1.gz"
438 doman "${NV_MAN}/nvidia-xconfig.1.gz"
439 doman "${NV_MAN}/nvidia-settings.1.gz"
440 fi
441
442 # Helper Apps
443 exeinto /opt/bin/
444 doexe ${NV_EXEC}/nvidia-xconfig || die
445 use kernel_linux && { doexe ${NV_EXEC}/nvidia-debugdump || die ; }
446 if use tools; then
447 doexe ${NV_EXEC}/nvidia-settings || die
448 fi
449 doexe ${NV_EXEC}/nvidia-bug-report.sh || die
450 if use kernel_linux; then
451 doexe ${NV_EXEC}/nvidia-smi || die
452 fi
453
454 # Desktop entries for nvidia-settings
455 if use tools && use kernel_linux ; then
456 sed -e 's:__UTILS_PATH__:/opt/bin:' \
457 -e 's:__PIXMAP_PATH__:/usr/share/pixmaps:' \
458 -i "${NV_EXEC}/nvidia-settings.desktop"
459 newmenu ${NV_EXEC}/nvidia-settings.desktop nvidia-settings-opt.desktop
460 fi
461
462 doicon ${NV_EXEC}/nvidia-settings.png
463
464 if has_multilib_profile && use multilib ; then
465 local OABI=${ABI}
466 for ABI in $(get_install_abis) ; do
467 src_install-libs
468 done
469 ABI=${OABI}
470 unset OABI
471 else
472 src_install-libs
473 fi
474
475 is_final_abi || die "failed to iterate through all ABIs"
476 }
477
478 # Install nvidia library:
479 # the first parameter is the place where to install it
480 # the second parameter is the base name of the library
481 # the third parameter is the provided soversion
482 donvidia() {
483 dodir $1
484 exeinto $1
485
486 libname=$(basename $2)
487
488 doexe $2.$3 || die "failed to install $2"
489 dosym ${libname}.$3 $1/${libname} || die "failed to symlink $2"
490 [[ $3 != "1" ]] && dosym ${libname}.$3 $1/${libname}.1
491 }
492
493 src_install-libs() {
494 local inslibdir=$(get_libdir)
495 local NV_ROOT="/usr/${inslibdir}/opengl/nvidia"
496 local CL_ROOT=/usr/${inslibdir}/OpenCL/vendors/nvidia
497 local libdir= sover=
498
499 if use kernel_linux; then
500 if has_multilib_profile && [[ ${ABI} == "x86" ]] ; then
501 libdir=32
502 else
503 libdir=.
504 fi
505 sover=${PV}
506 else
507 libdir=obj
508 # on FreeBSD it has just .1 suffix
509 sover=1
510 fi
511
512 # The GLX libraries
513 donvidia ${NV_ROOT}/lib ${libdir}/libGL.so ${sover}
514 donvidia /usr/${inslibdir} ${libdir}/libnvidia-glcore.so ${sover}
515 if use kernel_FreeBSD; then
516 donvidia ${NV_ROOT}/lib ${libdir}/libnvidia-tls.so ${sover}
517 else
518 donvidia ${NV_ROOT}/lib ${libdir}/tls/libnvidia-tls.so ${sover}
519 fi
520
521 # VDPAU
522 donvidia /usr/${inslibdir} ${libdir}/libvdpau_nvidia.so ${sover}
523
524 # CUDA & OpenCL
525 if use kernel_linux; then
526 donvidia /usr/${inslibdir} ${libdir}/libcuda.so ${sover}
527 donvidia /usr/${inslibdir} ${libdir}/libnvidia-compiler.so ${sover}
528 donvidia ${CL_ROOT} ${libdir}/libOpenCL.so 1.0.0
529 #dosym libOpenCL.so.1 ${CL_ROOT}/libOpenCL.so
530 fi
531 }
532
533 pkg_preinst() {
534 use kernel_linux && linux-mod_pkg_preinst
535
536 # Clean the dynamic libGL stuff's home to ensure
537 # we dont have stale libs floating around
538 if [ -d "${ROOT}"/usr/lib/opengl/nvidia ] ; then
539 rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
540 fi
541 # Make sure we nuke the old nvidia-glx's env.d file
542 if [ -e "${ROOT}"/etc/env.d/09nvidia ] ; then
543 rm -f "${ROOT}"/etc/env.d/09nvidia
544 fi
545 }
546
547 pkg_postinst() {
548 use kernel_linux && linux-mod_pkg_postinst
549
550 # Switch to the nvidia implementation
551 "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
552 "${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
553
554 elog "You must be in the video group to use the NVIDIA device"
555 elog "For more info, read the docs at"
556 elog "http://www.gentoo.org/doc/en/nvidia-guide.xml#doc_chap3_sect6"
557 elog
558 elog "This ebuild installs a kernel module and X driver. Both must"
559 elog "match explicitly in their version. This means, if you restart"
560 elog "X, you must modprobe -r nvidia before starting it back up"
561 elog
562 elog "To use the NVIDIA GLX, run \"eselect opengl set nvidia\""
563 elog
564 elog "To use the NVIDIA CUDA/OpenCL, run \"eselect opencl set nvidia\""
565 elog
566 elog "NVIDIA has requested that any bug reports submitted have the"
567 elog "output of /opt/bin/nvidia-bug-report.sh included."
568 elog
569 if ! use tools; then
570 elog "USE=tools controls whether the nvidia-settings application"
571 elog "is installed. If you would like to use it, enable that"
572 elog "flag and re-emerge this ebuild. Optionally you can install"
573 elog "media-video/nvidia-settings"
574 fi
575 }
576
577 pkg_prerm() {
578 "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
579 }
580
581 pkg_postrm() {
582 use kernel_linux && linux-mod_pkg_postrm
583 "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
584 }

  ViewVC Help
Powered by ViewVC 1.1.20