Gentoo Archives: gentoo-commits

From: Jeroen Roovers <jer@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: x11-drivers/nvidia-drivers/
Date: Sat, 30 Jan 2016 12:53:46
Message-Id: 1454158415.53887296f10c01c66ec010dc5745fc59b3994f20.jer@gentoo
1 commit: 53887296f10c01c66ec010dc5745fc59b3994f20
2 Author: Jeroen Roovers <jer <AT> gentoo <DOT> org>
3 AuthorDate: Sat Jan 30 12:53:21 2016 +0000
4 Commit: Jeroen Roovers <jer <AT> gentoo <DOT> org>
5 CommitDate: Sat Jan 30 12:53:35 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=53887296
7
8 x11-drivers/nvidia-drivers: Update 346 branch for bug #562910.
9
10 Package-Manager: portage-2.2.27
11
12 x11-drivers/nvidia-drivers/Manifest | 1 +
13 .../nvidia-drivers/nvidia-drivers-346.96-r3.ebuild | 528 +++++++++++++++++++++
14 2 files changed, 529 insertions(+)
15
16 diff --git a/x11-drivers/nvidia-drivers/Manifest b/x11-drivers/nvidia-drivers/Manifest
17 index 39d279a..8fcd750 100644
18 --- a/x11-drivers/nvidia-drivers/Manifest
19 +++ b/x11-drivers/nvidia-drivers/Manifest
20 @@ -42,6 +42,7 @@ DIST NVIDIA-Linux-x86_64-361.18.run 86447500 SHA256 94cccc3ff10ee9544f60bf1d32d0
21 DIST NVIDIA-Linux-x86_64-96.43.23-pkg2.run 15962375 SHA256 ce8d8253e7dab7da63fbdac449ebf190cd0c10cbfffea0f8d0165515f851bc64 SHA512 04bec1187a6024a2b9839f008ec829281f1f2602dae2e639030bc385943186506bcaa2b46a230b2ab87f9217190841abc62f9e2d6395ab5559623389c31c6563 WHIRLPOOL 0651c44a51a1a06fcff5bfddbf9c3e408977e03263c7fe806cb6c01f9fe92f716dfe4e5190ffe1048bde72fcffdc8bca8267e74dd43ba5c9dfb22b6201fcc2bb
22 DIST nvidia-settings-304.131.tar.bz2 1480447 SHA256 d36d2d1ae7c1bb72cd18e713470546d2aa7057624b1f61319daf559a94054d29 SHA512 9269f54f87581e29e6d7cabeaf989c70cb27aa55f6b8f5f1c71b8a14401326d06ea194710722b41283cca56f5808b90a9b1fb12158d48c6332cce15a701c5796 WHIRLPOOL be8e38a09a0bfa40267b9cdae2800a9ef00a89e28e618b743b7acb0cd9ece4b242b74ced32018d735989592300b49b2ee683caa11a1e161bcecf070a58952dfd
23 DIST nvidia-settings-340.96.tar.bz2 1551011 SHA256 af7303b070a4b41e388a7be6dfae17f020a5cc197170d4815b9a291a3a98aaff SHA512 fc6096338e48c347e4e854d06e8f63d8edb6527953996e63f3f70619be59d0436176547b5197ef30d18a82cf5b58dd775dcca4a2624107b63cce1ae589f2b154 WHIRLPOOL e7266ca0395aa1a5666a43bf6e54e258706d4e76bfd15079485e2379b332d2d6ba0c97b32e49f5b041340bb2d3c0e11dace702754ffc952c149557e0ab9d820a
24 +DIST nvidia-settings-346.96.tar.bz2 1558100 SHA256 b293f269aac01dfdf59e9dff46d774f7ca77d4628f377c01cabfbfccd28f3cd9 SHA512 9ead0fa5f0a55c1080d9b4da6cf96c2435c1a166297187f2c7d8b95a9e66c2e9cdd2e35739a4304b02ff1ccedb0421a7dc99a546df3a8f18804da133b93f50e3 WHIRLPOOL 4bddea94bb4c0dcde6b2b06507ffe890a1996471603de2d494f54b783cd36d44aa620fe03d16bc104ce99d6371a50666b0f029a309b78226810761cc13053f98
25 DIST nvidia-settings-352.79.tar.bz2 1570988 SHA256 1f103cbfe162281355c484a5c3ef9ac1bb0528acba2d229111da7e58cf18f217 SHA512 d56e20844bf71d55e51aebca38e922a2985fdbd4edab29a07f9a4a8a0b883ca469c3b949f048837ec77464da90e2d485e5efcd314afc2810c44ad7dc497b53fe WHIRLPOOL 51999a744f6b3e36c4d12f841c136a754533de09c1802f60392666392beeccbb0bf1489269cac33b12ccb061554609d3dc8d8ffbf45b4cb860108fd9f86e2139
26 DIST nvidia-settings-358.16.tar.bz2 1571104 SHA256 8cd78df738a824e282771755ae9a41d5b194b15f9df96b9fd23fcf3005967d35 SHA512 0438aa2599e98f68a04c9f663f4ef9b05092df512fbca40ad0fe17e25ca4d940d02cc55e9fd44a2551950a2a30782d1e48553c4bebd071bfff280869a6dde556 WHIRLPOOL 60b7e9abba3163ac877a3a9d944cf72352e28d2fd1a3af0996d3b7d40ef48be7f057c1063f9ca61c693cbf1bff57be61704f13d941220bf74a8049954f87154d
27 DIST nvidia-settings-361.18.tar.bz2 1570821 SHA256 5e821bf9c92931da7c4ac2cac4c61a83e7f74641902935232cad747511fab363 SHA512 1a19ebb6773b53564a7996c8f963c161df599ed8ca577f505fbed1181f144a5e53fa970e3fee7fceed16909bd012f74f9af74080314ae9de9356894df9b1be4d WHIRLPOOL 23ff413900fca81427d755ecb5889dbb69033e101cf7c2f3edea4971defd03aedee95f5488779f634c690c05bfabe0763baf3dbf6377de950cabe48ad9c72684
28
29 diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-346.96-r3.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-346.96-r3.ebuild
30 new file mode 100644
31 index 0000000..e661328
32 --- /dev/null
33 +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-346.96-r3.ebuild
34 @@ -0,0 +1,528 @@
35 +# Copyright 1999-2015 Gentoo Foundation
36 +# Distributed under the terms of the GNU General Public License v2
37 +# $Id$
38 +
39 +EAPI=5
40 +
41 +inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \
42 + portability toolchain-funcs unpacker user udev
43 +
44 +NV_URI="http://us.download.nvidia.com/XFree86/"
45 +X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
46 +AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
47 +X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
48 +AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
49 +
50 +DESCRIPTION="NVIDIA Accelerated Graphics Driver"
51 +HOMEPAGE="http://www.nvidia.com/"
52 +SRC_URI="
53 + amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
54 + amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
55 + x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
56 + x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
57 + tools? ( ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2 )
58 +"
59 +
60 +LICENSE="GPL-2 NVIDIA-r2"
61 +SLOT="0/${PV%.*}"
62 +KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
63 +RESTRICT="bindist mirror strip"
64 +EMULTILIB_PKG="true"
65 +
66 +IUSE="acpi gtk3 kernel_FreeBSD kernel_linux multilib pax_kernel static-libs +tools uvm +X"
67 +REQUIRED_USE="
68 + tools? ( X )
69 + static-libs? ( tools )
70 +"
71 +
72 +COMMON="
73 + app-eselect/eselect-opencl
74 + kernel_linux? ( >=sys-libs/glibc-2.6.1 )
75 + tools? (
76 + dev-libs/atk
77 + dev-libs/glib:2
78 + dev-libs/jansson
79 + gtk3? ( x11-libs/gtk+:3 )
80 + x11-libs/cairo
81 + x11-libs/gdk-pixbuf[X]
82 + x11-libs/gtk+:2
83 + x11-libs/libX11
84 + x11-libs/libXext
85 + x11-libs/libXrandr
86 + x11-libs/libXv
87 + x11-libs/libXxf86vm
88 + x11-libs/pango[X]
89 + )
90 + X? (
91 + >=app-eselect/eselect-opengl-1.0.9
92 + )
93 +"
94 +DEPEND="
95 + ${COMMON}
96 + app-arch/xz-utils
97 + kernel_linux? ( virtual/linux-sources )
98 +"
99 +RDEPEND="
100 + ${COMMON}
101 + acpi? ( sys-power/acpid )
102 + tools? ( !media-video/nvidia-settings )
103 + X? (
104 + <x11-base/xorg-server-1.18.99:=
105 + >=x11-libs/libvdpau-0.3-r1
106 + multilib? (
107 + >=x11-libs/libX11-1.6.2[abi_x86_32]
108 + >=x11-libs/libXext-1.3.2[abi_x86_32]
109 + )
110 + )
111 +"
112 +
113 +QA_PREBUILT="opt/* usr/lib*"
114 +
115 +S=${WORKDIR}/
116 +
117 +pkg_pretend() {
118 + if use amd64 && has_multilib_profile && \
119 + [ "${DEFAULT_ABI}" != "amd64" ]; then
120 + eerror "This ebuild doesn't currently support changing your default ABI"
121 + die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
122 + fi
123 +
124 + if use kernel_linux && kernel_is ge 4 3; then
125 + ewarn "Gentoo supports kernels which are supported by NVIDIA"
126 + ewarn "which are limited to the following kernels:"
127 + ewarn "<sys-kernel/gentoo-sources-4.3"
128 + ewarn "<sys-kernel/vanilla-sources-4.3"
129 + ewarn ""
130 + ewarn "You are free to utilize epatch_user to provide whatever"
131 + ewarn "support you feel is appropriate, but will not receive"
132 + ewarn "support as a result of those changes."
133 + ewarn ""
134 + ewarn "Do not file a bug report about this."
135 + fi
136 +
137 + # Since Nvidia ships many different series of drivers, we need to give the user
138 + # some kind of guidance as to what version they should install. This tries
139 + # to point the user in the right direction but can't be perfect. check
140 + # nvidia-driver.eclass
141 + nvidia-driver-check-warning
142 +
143 + # Kernel features/options to check for
144 + CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
145 + use x86 && CONFIG_CHECK+=" ~HIGHMEM"
146 +
147 + # Now do the above checks
148 + use kernel_linux && check_extra_config
149 +}
150 +
151 +pkg_setup() {
152 + # try to turn off distcc and ccache for people that have a problem with it
153 + export DISTCC_DISABLE=1
154 + export CCACHE_DISABLE=1
155 +
156 + if use kernel_linux; then
157 + MODULE_NAMES="nvidia(video:${S}/kernel)"
158 + use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel/uvm)"
159 +
160 + # This needs to run after MODULE_NAMES (so that the eclass checks
161 + # whether the kernel supports loadable modules) but before BUILD_PARAMS
162 + # is set (so that KV_DIR is populated).
163 + linux-mod_pkg_setup
164 +
165 + BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
166 + SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC)"
167 +
168 + # linux-mod_src_compile calls set_arch_to_kernel, which
169 + # sets the ARCH to x86 but NVIDIA's wrapping Makefile
170 + # expects x86_64 or i386 and then converts it to x86
171 + # later on in the build process
172 + BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
173 + fi
174 +
175 + # set variables to where files are in the package structure
176 + if use kernel_FreeBSD; then
177 + use x86-fbsd && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
178 + use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
179 + NV_DOC="${S}/doc"
180 + NV_OBJ="${S}/obj"
181 + NV_SRC="${S}/src"
182 + NV_MAN="${S}/x11/man"
183 + NV_X11="${S}/obj"
184 + NV_SOVER=1
185 + elif use kernel_linux; then
186 + NV_DOC="${S}"
187 + NV_OBJ="${S}"
188 + NV_SRC="${S}/kernel"
189 + NV_MAN="${S}"
190 + NV_X11="${S}"
191 + NV_SOVER=${PV}
192 + else
193 + die "Could not determine proper NVIDIA package"
194 + fi
195 +}
196 +
197 +src_prepare() {
198 + # Please add a brief description for every added patch
199 +
200 + if use kernel_linux; then
201 + if kernel_is lt 2 6 9 ; then
202 + eerror "You must build this against 2.6.9 or higher kernels."
203 + fi
204 +
205 + # If greater than 2.6.5 use M= instead of SUBDIR=
206 +# convert_to_m "${NV_SRC}"/Makefile.kbuild
207 + fi
208 +
209 + if use pax_kernel; then
210 + ewarn "Using PAX patches is not supported. You will be asked to"
211 + ewarn "use a standard kernel should you have issues. Should you"
212 + ewarn "need support with these patches, contact the PaX team."
213 + epatch "${FILESDIR}"/${PN}-346.16-pax-usercopy.patch
214 + epatch "${FILESDIR}"/${PN}-346.16-pax-constify.patch
215 + fi
216 +
217 + # Allow user patches so they can support RC kernels and whatever else
218 + epatch_user
219 +}
220 +
221 +src_compile() {
222 + # This is already the default on Linux, as there's no toplevel Makefile, but
223 + # on FreeBSD there's one and triggers the kernel module build, as we install
224 + # it by itself, pass this.
225 +
226 + cd "${NV_SRC}"
227 + if use kernel_FreeBSD; then
228 + MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
229 + LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
230 + elif use kernel_linux; then
231 + MAKEOPTS=-j1
232 + linux-mod_src_compile
233 + fi
234 +
235 + if use tools; then
236 + emake -C "${S}"/nvidia-settings-${PV}/src \
237 + AR="$(tc-getAR)" \
238 + CC="$(tc-getCC)" \
239 + LIBDIR="$(get_libdir)" \
240 + RANLIB="$(tc-getRANLIB)" \
241 + build-xnvctrl
242 +
243 + emake -C "${S}"/nvidia-settings-${PV}/src \
244 + CC="$(tc-getCC)" \
245 + GTK3_AVAILABLE=$(usex gtk3 1 0) \
246 + LD="$(tc-getCC)" \
247 + LIBDIR="$(get_libdir)" \
248 + NVML_ENABLED=0 \
249 + NV_USE_BUNDLED_LIBJANSSON=0 \
250 + NV_VERBOSE=1 \
251 + STRIP_CMD=true
252 + fi
253 +}
254 +
255 +# Install nvidia library:
256 +# the first parameter is the library to install
257 +# the second parameter is the provided soversion
258 +# the third parameter is the target directory if its not /usr/lib
259 +donvidia() {
260 + # Full path to library minus SOVER
261 + MY_LIB="$1"
262 +
263 + # SOVER to use
264 + MY_SOVER="$2"
265 +
266 + # Where to install
267 + MY_DEST="$3"
268 +
269 + if [[ -z "${MY_DEST}" ]]; then
270 + MY_DEST="/usr/$(get_libdir)"
271 + action="dolib.so"
272 + else
273 + exeinto ${MY_DEST}
274 + action="doexe"
275 + fi
276 +
277 + # Get just the library name
278 + libname=$(basename $1)
279 +
280 + # Install the library with the correct SOVER
281 + ${action} ${MY_LIB}.${MY_SOVER} || \
282 + die "failed to install ${libname}"
283 +
284 + # If SOVER wasn't 1, then we need to create a .1 symlink
285 + if [[ "${MY_SOVER}" != "1" ]]; then
286 + dosym ${libname}.${MY_SOVER} \
287 + ${MY_DEST}/${libname}.1 || \
288 + die "failed to create ${libname} symlink"
289 + fi
290 +
291 + # Always create the symlink from the raw lib to the .1
292 + dosym ${libname}.1 \
293 + ${MY_DEST}/${libname} || \
294 + die "failed to create ${libname} symlink"
295 +}
296 +
297 +src_install() {
298 + if use kernel_linux; then
299 + linux-mod_src_install
300 +
301 + # Add the aliases
302 + # This file is tweaked with the appropriate video group in
303 + # pkg_preinst, see bug #491414
304 + insinto /etc/modprobe.d
305 + newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
306 + use uvm && doins "${FILESDIR}"/nvidia-uvm.conf
307 +
308 + # Ensures that our device nodes are created when not using X
309 + exeinto "$(get_udevdir)"
310 + newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
311 + udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
312 + elif use kernel_FreeBSD; then
313 + if use x86-fbsd; then
314 + insinto /boot/modules
315 + doins "${S}/src/nvidia.kld"
316 + fi
317 +
318 + exeinto /boot/modules
319 + doexe "${S}/src/nvidia.ko"
320 + fi
321 +
322 + # NVIDIA kernel <-> userspace driver config lib
323 + donvidia ${NV_OBJ}/libnvidia-cfg.so ${NV_SOVER}
324 +
325 + # NVIDIA framebuffer capture library
326 + donvidia ${NV_OBJ}/libnvidia-fbc.so ${NV_SOVER}
327 +
328 + # NVIDIA video encode/decode <-> CUDA
329 + if use kernel_linux; then
330 + donvidia ${NV_OBJ}/libnvcuvid.so ${NV_SOVER}
331 + donvidia ${NV_OBJ}/libnvidia-encode.so ${NV_SOVER}
332 + fi
333 +
334 + if use X; then
335 + # Xorg DDX driver
336 + insinto /usr/$(get_libdir)/xorg/modules/drivers
337 + doins ${NV_X11}/nvidia_drv.so
338 +
339 + # Xorg GLX driver
340 + donvidia ${NV_X11}/libglx.so ${NV_SOVER} \
341 + /usr/$(get_libdir)/opengl/nvidia/extensions
342 +
343 + # Xorg nvidia.conf
344 + if has_version '>=x11-base/xorg-server-1.16'; then
345 + insinto /usr/share/X11/xorg.conf.d
346 + newins {,50-}nvidia-drm-outputclass.conf
347 + fi
348 + fi
349 +
350 + # OpenCL ICD for NVIDIA
351 + if use kernel_linux; then
352 + insinto /etc/OpenCL/vendors
353 + doins ${NV_OBJ}/nvidia.icd
354 + fi
355 +
356 + # Documentation
357 + dohtml ${NV_DOC}/html/*
358 + if use kernel_FreeBSD; then
359 + dodoc "${NV_DOC}/README"
360 + use X && doman "${NV_MAN}/nvidia-xconfig.1"
361 + use tools && doman "${NV_MAN}/nvidia-settings.1"
362 + else
363 + # Docs
364 + newdoc "${NV_DOC}/README.txt" README
365 + dodoc "${NV_DOC}/NVIDIA_Changelog"
366 + doman "${NV_MAN}/nvidia-smi.1.gz"
367 + use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
368 + use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
369 + doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
370 + fi
371 +
372 + # Helper Apps
373 + exeinto /opt/bin/
374 +
375 + if use X; then
376 + doexe ${NV_OBJ}/nvidia-xconfig
377 + fi
378 +
379 + if use kernel_linux ; then
380 + doexe ${NV_OBJ}/nvidia-cuda-mps-control
381 + doexe ${NV_OBJ}/nvidia-cuda-mps-server
382 + doexe ${NV_OBJ}/nvidia-debugdump
383 + doexe ${NV_OBJ}/nvidia-persistenced
384 + doexe ${NV_OBJ}/nvidia-smi
385 +
386 + # install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
387 + doexe ${NV_OBJ}/nvidia-modprobe
388 + fowners root:video /opt/bin/nvidia-modprobe
389 + fperms 4710 /opt/bin/nvidia-modprobe
390 + dosym /{opt,usr}/bin/nvidia-modprobe
391 +
392 + doman nvidia-cuda-mps-control.1.gz
393 + doman nvidia-modprobe.1.gz
394 + doman nvidia-persistenced.1.gz
395 + newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
396 + newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
397 + newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
398 + fi
399 +
400 + if use tools; then
401 + emake -C "${S}"/nvidia-settings-${PV}/src/ \
402 + DESTDIR="${D}" \
403 + GTK3_AVAILABLE=$(usex gtk3 1 0) \
404 + LIBDIR="${D}/usr/$(get_libdir)" \
405 + PREFIX=/usr \
406 + NV_USE_BUNDLED_LIBJANSSON=0 \
407 + install
408 +
409 + if use static-libs; then
410 + dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
411 +
412 + insinto /usr/include/NVCtrl
413 + doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
414 + fi
415 +
416 + insinto /usr/share/nvidia/
417 + doins nvidia-application-profiles-${PV}-key-documentation
418 +
419 + insinto /etc/nvidia
420 + newins \
421 + nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
422 +
423 + # There is no icon in the FreeBSD tarball.
424 + use kernel_FreeBSD || \
425 + newicon ${NV_OBJ}/nvidia-settings.png ${PN}-settings.png
426 +
427 + domenu "${FILESDIR}"/${PN}-settings.desktop
428 +
429 + exeinto /etc/X11/xinit/xinitrc.d
430 + doexe "${FILESDIR}"/95-nvidia-settings
431 + fi
432 +
433 + dobin ${NV_OBJ}/nvidia-bug-report.sh
434 +
435 + if has_multilib_profile && use multilib ; then
436 + local OABI=${ABI}
437 + for ABI in $(get_install_abis) ; do
438 + src_install-libs
439 + done
440 + ABI=${OABI}
441 + unset OABI
442 + else
443 + src_install-libs
444 + fi
445 +
446 + is_final_abi || die "failed to iterate through all ABIs"
447 +
448 + readme.gentoo_create_doc
449 +}
450 +
451 +src_install-libs() {
452 + local inslibdir=$(get_libdir)
453 + local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
454 + local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
455 + local libdir=${NV_OBJ}
456 +
457 + if use kernel_linux && has_multilib_profile && \
458 + [[ ${ABI} == "x86" ]] ; then
459 + libdir=${NV_OBJ}/32
460 + fi
461 +
462 + if use X; then
463 + # The GLX libraries
464 + donvidia ${libdir}/libEGL.so ${NV_SOVER} ${GL_ROOT}
465 + donvidia ${libdir}/libGL.so ${NV_SOVER} ${GL_ROOT}
466 + donvidia ${libdir}/libGLESv1_CM.so ${NV_SOVER} ${GL_ROOT}
467 + donvidia ${libdir}/libnvidia-eglcore.so ${NV_SOVER}
468 + donvidia ${libdir}/libnvidia-glcore.so ${NV_SOVER}
469 + donvidia ${libdir}/libnvidia-glsi.so ${NV_SOVER}
470 + donvidia ${libdir}/libnvidia-ifr.so ${NV_SOVER}
471 + if use kernel_FreeBSD; then
472 + donvidia ${libdir}/libnvidia-tls.so ${NV_SOVER}
473 + else
474 + donvidia ${libdir}/tls/libnvidia-tls.so ${NV_SOVER}
475 + fi
476 +
477 + # VDPAU
478 + donvidia ${libdir}/libvdpau_nvidia.so ${NV_SOVER}
479 +
480 + # GLES v2 libraries
481 + insinto ${GL_ROOT}
482 + doexe ${libdir}/libGLESv2.so.${PV}
483 + dosym libGLESv2.so.${PV} ${GL_ROOT}/libGLESv2.so.2
484 + dosym libGLESv2.so.2 ${GL_ROOT}/libGLESv2.so
485 + fi
486 +
487 + # NVIDIA monitoring library
488 + if use kernel_linux ; then
489 + donvidia ${libdir}/libnvidia-ml.so ${NV_SOVER}
490 + fi
491 +
492 + # CUDA & OpenCL
493 + if use kernel_linux; then
494 + donvidia ${libdir}/libcuda.so ${NV_SOVER}
495 + donvidia ${libdir}/libnvidia-compiler.so ${NV_SOVER}
496 + donvidia ${libdir}/libOpenCL.so 1.0.0 ${CL_ROOT}
497 + donvidia ${libdir}/libnvidia-opencl.so ${NV_SOVER}
498 + fi
499 +}
500 +
501 +pkg_preinst() {
502 + if use kernel_linux; then
503 + linux-mod_pkg_preinst
504 +
505 + local videogroup="$(egetent group video | cut -d ':' -f 3)"
506 + if [ -z "${videogroup}" ]; then
507 + eerror "Failed to determine the video group gid"
508 + die "Failed to determine the video group gid"
509 + else
510 + sed -i \
511 + -e "s:PACKAGE:${PF}:g" \
512 + -e "s:VIDEOGID:${videogroup}:" \
513 + "${D}"/etc/modprobe.d/nvidia.conf || die
514 + fi
515 + fi
516 +
517 + # Clean the dynamic libGL stuff's home to ensure
518 + # we dont have stale libs floating around
519 + if [ -d "${ROOT}"/usr/lib/opengl/nvidia ] ; then
520 + rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
521 + fi
522 + # Make sure we nuke the old nvidia-glx's env.d file
523 + if [ -e "${ROOT}"/etc/env.d/09nvidia ] ; then
524 + rm -f "${ROOT}"/etc/env.d/09nvidia
525 + fi
526 +}
527 +
528 +pkg_postinst() {
529 + use kernel_linux && linux-mod_pkg_postinst
530 +
531 + # Switch to the nvidia implementation
532 + use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
533 + "${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
534 +
535 + readme.gentoo_print_elog
536 +
537 + if ! use X; then
538 + elog "You have elected to not install the X.org driver. Along with"
539 + elog "this the OpenGL libraries and VDPAU libraries were not"
540 + elog "installed. Additionally, once the driver is loaded your card"
541 + elog "and fan will run at max speed which may not be desirable."
542 + elog "Use the 'nvidia-smi' init script to have your card and fan"
543 + elog "speed scale appropriately."
544 + elog
545 + fi
546 + if ! use tools; then
547 + elog "USE=tools controls whether the nvidia-settings application"
548 + elog "is installed. If you would like to use it, enable that"
549 + elog "flag and re-emerge this ebuild. Optionally you can install"
550 + elog "media-video/nvidia-settings"
551 + elog
552 + fi
553 +}
554 +
555 +pkg_prerm() {
556 + use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
557 +}
558 +
559 +pkg_postrm() {
560 + use kernel_linux && linux-mod_pkg_postrm
561 + use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
562 +}