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