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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (hide annotations) (download)
Wed Apr 11 17:51:45 2012 UTC (2 years, 8 months ago) by cardoe
Branch: MAIN
Changes since 1.4: +6 -1 lines
Fix 295.33 for Linux 3.3.x. bug #408841

(Portage version: 2.1.10.56/cvs/Linux x86_64)

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

  ViewVC Help
Powered by ViewVC 1.1.20