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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Wed Dec 19 16:52:01 2012 UTC (19 months, 1 week ago) by tetromino
Branch: MAIN
Changes since 1.4: +2 -1 lines
Depend on pangox-compat if using pango-1.32.

(Portage version: 2.2.0_alpha149/cvs/Linux x86_64, signed Manifest commit with key CF0ADD61)

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.75.ebuild,v 1.4 2012/12/11 15:20:56 ssuominen Exp $
4
5 EAPI="2"
6
7 inherit eutils flag-o-matic linux-mod multilib nvidia-driver portability \
8 unpacker user versionator udev
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 || ( x11-libs/pangox-compat <x11-libs/pango-1.31[X] )
48 )"
49 PDEPEND=">=x11-libs/libvdpau-0.3-r1"
50
51 QA_TEXTRELS_x86="
52 usr/lib/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0
53 usr/lib/libXvMCNVIDIA.so.${PV}
54 usr/lib/libcuda.so.${PV}
55 usr/lib/libnvcuvid.so.${PV}
56 usr/lib/libnvidia-cfg.so.${PV}
57 usr/lib/libnvidia-compiler.so.${PV}
58 usr/lib/libnvidia-glcore.so.${PV}
59 usr/lib/libnvidia-ml.so.${PV}
60 usr/lib/libvdpau_nvidia.so.${PV}
61 usr/lib/opengl/nvidia/extensions/libglx.so.${PV}
62 usr/lib/opengl/nvidia/lib/libGL.so.${PV}
63 usr/lib/opengl/nvidia/lib/libnvidia-tls.so.${PV}
64 usr/lib/xorg/modules/drivers/nvidia_drv.so"
65
66 QA_TEXTRELS_x86_fbsd="boot/modules/nvidia.ko
67 usr/lib/opengl/nvidia/lib/libGL.so.1
68 usr/lib/libnvidia-glcore.so.1
69 usr/lib/libvdpau_nvidia.so.1
70 usr/lib/libnvidia-cfg.so.1
71 usr/lib/opengl/nvidia/extensions/libglx.so.1
72 usr/lib/xorg/modules/drivers/nvidia_drv.so"
73
74 QA_TEXTRELS_amd64="usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV}
75 usr/lib32/libnvidia-glcore.so.${PV}
76 usr/lib32/libvdpau_nvidia.so.${PV}
77 usr/lib32/opengl/nvidia/lib/libGL.so.${PV}
78 usr/lib32/libcuda.so.${PV}
79 usr/lib32/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0
80 usr/lib32/libnvidia-compiler.so.${PV}"
81
82 QA_EXECSTACK_x86="usr/lib/opengl/nvidia/lib/libGL.so.${PV}
83 usr/lib/libnvidia-glcore.so.${PV}
84 usr/lib/opengl/nvidia/extensions/libglx.so.${PV}
85 usr/lib64/libXvMCNVIDIA.so.${PV}
86 usr/lib/libXvMCNVIDIA.a:NVXVMC.o
87 usr/lib/libvdpau_nvidia.so.${PV}
88 usr/lib/libnvidia-compiler.so.${PV}
89 usr/lib/libcuda.so.${PV}
90 usr/lib/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0"
91
92 QA_EXECSTACK_amd64="usr/lib32/libnvidia-glcore.so.${PV}
93 usr/lib32/opengl/nvidia/lib/libGL.so.${PV}
94 usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV}
95 usr/lib32/libvdpau_nvidia.so.${PV}
96 usr/lib32/libcuda.so.${PV}
97 usr/lib32/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0
98 usr/lib32/libnvidia-compiler.so.${PV}
99 usr/lib64/libXvMCNVIDIA.a:NVXVMC.o
100 usr/lib64/libnvidia-cfg.so.${PV}
101 usr/lib64/libnvidia-ml.so.${PV}
102 usr/lib64/libvdpau_nvidia.so.${PV}
103 usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.${PV}
104 usr/lib64/opengl/nvidia/lib/libGL.so.${PV}
105 usr/lib64/libnvidia-glcore.so.${PV}
106 usr/lib64/opengl/nvidia/extensions/libglx.so.${PV}
107 usr/lib64/libXvMCNVIDIA.so.${PV}
108 usr/lib64/libcuda.so.${PV}
109 usr/lib64/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0
110 usr/lib64/libnvidia-compiler.so.${PV}
111 usr/lib64/xorg/modules/drivers/nvidia_drv.so
112 opt/bin/nvidia-smi
113 opt/bin/nvidia-xconfig
114 opt/bin/nvidia-debugdump
115 opt/bin/nvidia-settings"
116
117 QA_WX_LOAD_x86="usr/lib/libnvidia-glcore.so.${PV}
118 usr/lib/opengl/nvidia/lib/libGL.so.${PV}
119 usr/lib/opengl/nvidia/extensions/libglx.so.${PV}
120 usr/lib/libXvMCNVIDIA.a
121 usr/lib64/libXvMCNVIDIA.so.${PV}"
122
123 QA_WX_LOAD_amd64="usr/lib32/opengl/nvidia/lib/libGL.so.${PV}
124 usr/lib32/libnvidia-glcore.so.${PV}
125 usr/lib64/opengl/nvidia/lib/libGL.so.${PV}
126 usr/lib64/libnvidia-glcore.so.${PV}
127 usr/lib64/opengl/nvidia/extensions/libglx.so.${PV}
128 usr/lib64/libXvMCNVIDIA.so.${PV}"
129
130 QA_SONAME_x86="usr/lib/libnvidia-compiler.so.${PV}"
131
132 QA_SONAME_amd64="usr/lib64/libnvidia-compiler.so.${PV}
133 usr/lib32/libnvidia-compiler.so.${PV}"
134
135 QA_DT_HASH_amd64="usr/lib32/libcuda.so.${PV}
136 usr/lib32/opengl/nvidia/lib/libGL.so.${PV}
137 usr/lib32/libnvidia-glcore.so.${PV}
138 usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV}
139 usr/lib32/libvdpau_nvidia.so.${PV}
140 usr/lib32/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0
141 usr/lib32/libnvidia-compiler.so.${PV}
142 usr/lib64/libXvMCNVIDIA.so.${PV}
143 usr/lib64/libcuda.so.${PV}
144 usr/lib64/libnvidia-cfg.so.${PV}
145 usr/lib64/libnvidia-glcore.so.${PV}
146 usr/lib64/libnvidia-ml.so.${PV}
147 usr/lib64/opengl/nvidia/lib/libGL.so.${PV}
148 usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.${PV}
149 usr/lib64/opengl/nvidia/extensions/libglx.so.${PV}
150 usr/lib64/xorg/modules/drivers/nvidia_drv.so
151 usr/lib64/libvdpau_nvidia.so.${PV}
152 usr/lib64/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0
153 usr/lib64/libnvidia-compiler.so.${PV}
154 usr/lib64/libnvcuvid.so.${PV}
155 opt/bin/nvidia-smi
156 opt/bin/nvidia-xconfig
157 opt/bin/nvidia-debugdump
158 opt/bin/nvidia-settings"
159
160 QA_DT_HASH_x86="usr/lib/libcuda.so.${PV}
161 usr/lib/libnvidia-cfg.so.${PV}
162 usr/lib/libnvidia-glcore.so.${PV}
163 usr/lib/libnvidia-ml.so.${PV}
164 usr/lib/opengl/nvidia/lib/libGL.so.${PV}
165 usr/lib/opengl/nvidia/lib/libnvidia-tls.so.${PV}
166 usr/lib/opengl/nvidia/extensions/libglx.so.${PV}
167 usr/lib/xorg/modules/drivers/nvidia_drv.so
168 usr/lib/libXvMCNVIDIA.so.${PV}
169 usr/lib/libvdpau_nvidia.so.${PV}
170 usr/lib/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0
171 usr/lib/libnvidia-compiler.so.${PV}
172 usr/lib/libnvcuvid.so.${PV}
173 opt/bin/nvidia-smi
174 opt/bin/nvidia-xconfig
175 opt/bin/nvidia-debugdump
176 opt/bin/nvidia-settings"
177
178 S=${WORKDIR}/
179
180 mtrr_check() {
181 ebegin "Checking for MTRR support"
182 linux_chkconfig_present MTRR
183 eend $?
184
185 if [[ $? -ne 0 ]] ; then
186 eerror "Please enable MTRR support in your kernel config, found at:"
187 eerror
188 eerror " Processor type and features"
189 eerror " [*] MTRR (Memory Type Range Register) support"
190 eerror
191 eerror "and recompile your kernel ..."
192 die "MTRR support not detected!"
193 fi
194 }
195
196 lockdep_check() {
197 if linux_chkconfig_present LOCKDEP; then
198 eerror "You've enabled LOCKDEP -- lock tracking -- in the kernel."
199 eerror "Unfortunately, this option exports the symbol "
200 eerror "'lockdep_init_map' as GPL-only which will prevent "
201 eerror "${P} from compiling."
202 eerror "Please make sure the following options have been unset:"
203 eerror
204 eerror " Kernel hacking --->"
205 eerror " [ ] Lock debugging: detect incorrect freeing of live locks"
206 eerror " [ ] Lock debugging: prove locking correctness"
207 eerror " [ ] Lock usage statistics"
208 eerror "in 'menuconfig'"
209 die "LOCKDEP enabled"
210 fi
211 }
212
213 pkg_setup() {
214 # try to turn off distcc and ccache for people that have a problem with it
215 export DISTCC_DISABLE=1
216 export CCACHE_DISABLE=1
217
218 if use amd64 && has_multilib_profile && [ "${DEFAULT_ABI}" != "amd64" ]; then
219 eerror "This ebuild doesn't currently support changing your default abi."
220 die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
221 fi
222
223 if use kernel_linux; then
224 linux-mod_pkg_setup
225 MODULE_NAMES="nvidia(video:${S}/kernel)"
226 BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
227 SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC)"
228 # linux-mod_src_compile calls set_arch_to_kernel, which
229 # sets the ARCH to x86 but NVIDIA's wrapping Makefile
230 # expects x86_64 or i386 and then converts it to x86
231 # later on in the build process
232 BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
233 mtrr_check
234 lockdep_check
235 fi
236
237 # On BSD userland it wants real make command
238 use userland_BSD && MAKE="$(get_bmake)"
239
240 export _POSIX2_VERSION="199209"
241
242 # Since Nvidia ships 3 different series of drivers, we need to give the user
243 # some kind of guidance as to what version they should install. This tries
244 # to point the user in the right direction but can't be perfect. check
245 # nvidia-driver.eclass
246 nvidia-driver-check-warning
247
248 # set variables to where files are in the package structure
249 if use kernel_FreeBSD; then
250 use x86-fbsd && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
251 use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
252 NV_DOC="${S}/doc"
253 NV_EXEC="${S}/obj"
254 NV_LIB="${S}/obj"
255 NV_SRC="${S}/src"
256 NV_MAN="${S}/x11/man"
257 NV_X11="${S}/obj"
258 NV_X11_DRV="${NV_X11}"
259 NV_X11_EXT="${NV_X11}"
260 NV_SOVER=1
261 elif use kernel_linux; then
262 NV_DOC="${S}"
263 NV_EXEC="${S}"
264 NV_LIB="${S}"
265 NV_SRC="${S}/kernel"
266 NV_MAN="${S}"
267 NV_X11="${S}"
268 NV_X11_DRV="${NV_X11}"
269 NV_X11_EXT="${NV_X11}"
270 NV_SOVER=${PV}
271 else
272 die "Could not determine proper NVIDIA package"
273 fi
274 }
275
276 src_unpack() {
277 if use kernel_linux && kernel_is lt 2 6 7; then
278 echo
279 ewarn "Your kernel version is ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}"
280 ewarn "This is not officially supported for ${P}. It is likely you"
281 ewarn "will not be able to compile or use the kernel module."
282 ewarn "It is recommended that you upgrade your kernel to a version >= 2.6.7"
283 echo
284 ewarn "DO NOT file bug reports for kernel versions less than 2.6.7 as they will be ignored."
285 fi
286
287 if ! use kernel_FreeBSD; then
288 cd "${S}"
289 unpack_makeself
290 else
291 unpack ${A}
292 fi
293 }
294
295 src_prepare() {
296 # Please add a brief description for every added patch
297 use kernel_FreeBSD && cd doc
298
299 if use kernel_linux; then
300 # Quiet down warnings the user does not need to see
301 sed -i \
302 -e 's:-Wsign-compare::g' \
303 "${NV_SRC}"/Makefile.kbuild
304
305 # If greater than 2.6.5 use M= instead of SUBDIR=
306 convert_to_m "${NV_SRC}"/Makefile.kbuild
307 fi
308 cat <<- EOF > "${S}"/nvidia.icd
309 /usr/$(get_libdir)/libcuda.so
310 EOF
311
312 # Allow user patches so they can support RC kernels and whatever else
313 epatch_user
314 }
315
316 src_compile() {
317 # This is already the default on Linux, as there's no toplevel Makefile, but
318 # on FreeBSD there's one and triggers the kernel module build, as we install
319 # it by itself, pass this.
320
321 cd "${NV_SRC}"
322 if use kernel_FreeBSD; then
323 MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
324 LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
325 elif use kernel_linux; then
326 linux-mod_src_compile
327 fi
328 }
329
330 src_install() {
331 if use kernel_linux; then
332 linux-mod_src_install
333
334 VIDEOGROUP="$(egetent group video | cut -d ':' -f 3)"
335 if [ -z "$VIDEOGROUP" ]; then
336 eerror "Failed to determine the video group gid."
337 die "Failed to determine the video group gid."
338 fi
339
340 # Add the aliases
341 [ -f "${FILESDIR}/nvidia-169.07" ] || die "nvidia missing in FILESDIR"
342 sed -e 's:PACKAGE:'${PF}':g' \
343 -e 's:VIDEOGID:'${VIDEOGROUP}':' "${FILESDIR}"/nvidia-169.07 > \
344 "${WORKDIR}"/nvidia
345 insinto /etc/modprobe.d
346 newins "${WORKDIR}"/nvidia nvidia.conf || die
347
348 # Ensures that our device nodes are created when not using X
349 exeinto "$(udev_get_udevdir)"
350 doexe "${FILESDIR}"/nvidia-udev.sh
351 udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
352
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