Gentoo Archives: gentoo-commits

From: "Doug Goldstein (cardoe)" <cardoe@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in x11-drivers/nvidia-drivers: ChangeLog nvidia-drivers-304.43.ebuild
Date: Tue, 28 Aug 2012 23:05:53
Message-Id: 20120828230540.1D62820A99@flycatcher.gentoo.org
1 cardoe 12/08/28 23:05:40
2
3 Modified: ChangeLog
4 Added: nvidia-drivers-304.43.ebuild
5 Log:
6 Version bump. Supports xorg-server 1.13 now.
7
8 (Portage version: 2.2.0_alpha123/cvs/Linux x86_64)
9
10 Revision Changes Path
11 1.390 x11-drivers/nvidia-drivers/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog?rev=1.390&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog?rev=1.390&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog?r1=1.389&r2=1.390
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog,v
20 retrieving revision 1.389
21 retrieving revision 1.390
22 diff -u -r1.389 -r1.390
23 --- ChangeLog 22 Aug 2012 04:50:23 -0000 1.389
24 +++ ChangeLog 28 Aug 2012 23:05:39 -0000 1.390
25 @@ -1,6 +1,12 @@
26 # ChangeLog for x11-drivers/nvidia-drivers
27 # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog,v 1.389 2012/08/22 04:50:23 cardoe Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog,v 1.390 2012/08/28 23:05:39 cardoe Exp $
30 +
31 +*nvidia-drivers-304.43 (28 Aug 2012)
32 +
33 + 28 Aug 2012; Doug Goldstein <cardoe@g.o>
34 + +nvidia-drivers-304.43.ebuild:
35 + Version bump. Supports xorg-server 1.13 now.
36
37 22 Aug 2012; Doug Goldstein <cardoe@g.o>
38 nvidia-drivers-304.37-r1.ebuild:
39
40
41
42 1.1 x11-drivers/nvidia-drivers/nvidia-drivers-304.43.ebuild
43
44 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-304.43.ebuild?rev=1.1&view=markup
45 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-304.43.ebuild?rev=1.1&content-type=text/plain
46
47 Index: nvidia-drivers-304.43.ebuild
48 ===================================================================
49 # Copyright 1999-2012 Gentoo Foundation
50 # Distributed under the terms of the GNU General Public License v2
51 # $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-304.43.ebuild,v 1.1 2012/08/28 23:05:39 cardoe Exp $
52
53 EAPI=4
54
55 inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \
56 portability toolchain-funcs unpacker user versionator
57
58 X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
59 AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
60 X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
61 AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
62
63 DESCRIPTION="NVIDIA X11 driver and GLX libraries"
64 HOMEPAGE="http://www.nvidia.com/"
65 SRC_URI="x86? ( http://us.download.nvidia.com/XFree86/Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
66 amd64? ( http://us.download.nvidia.com/XFree86/Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
67 amd64-fbsd? ( http://us.download.nvidia.com/XFree86/FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
68 x86-fbsd? ( http://us.download.nvidia.com/XFree86/FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )"
69
70 LICENSE="NVIDIA"
71 SLOT="0"
72 KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
73 IUSE="acpi multilib kernel_FreeBSD kernel_linux +tools +X"
74 RESTRICT="strip"
75 EMULTILIB_PKG="true"
76
77 COMMON="app-admin/eselect-opencl
78 kernel_linux? ( >=sys-libs/glibc-2.6.1 )
79 multilib? ( app-emulation/emul-linux-x86-xlibs )
80 X? (
81 <x11-base/xorg-server-1.13.99
82 >=app-admin/eselect-opengl-1.0.9
83 )"
84 DEPEND="${COMMON}
85 kernel_linux? (
86 virtual/linux-sources
87 virtual/pkgconfig
88 )"
89 RDEPEND="${COMMON}
90 acpi? ( sys-power/acpid )
91 tools? (
92 dev-libs/atk
93 dev-libs/glib
94 x11-libs/gdk-pixbuf
95 x11-libs/gtk+:2
96 x11-libs/libX11
97 x11-libs/libXext
98 x11-libs/pango[X]
99 )
100 X? ( x11-libs/libXvMC )"
101 PDEPEND="X? ( >=x11-libs/libvdpau-0.3-r1 )"
102
103 REQUIRED_USE="tools? ( X )"
104
105 QA_PREBUILT=""
106
107 S=${WORKDIR}/
108
109 pkg_pretend() {
110
111 if use amd64 && has_multilib_profile && \
112 [ "${DEFAULT_ABI}" != "amd64" ]; then
113 eerror "This ebuild doesn't currently support changing your default ABI"
114 die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
115 fi
116
117 # Kernel features/options to check for
118 CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
119 use x86 && CONFIG_CHECK+=" ~HIGHMEM"
120
121 # Now do the above checks
122 use kernel_linux && check_extra_config
123 }
124
125 pkg_setup() {
126 # try to turn off distcc and ccache for people that have a problem with it
127 export DISTCC_DISABLE=1
128 export CCACHE_DISABLE=1
129
130 if use kernel_linux; then
131 linux-mod_pkg_setup
132 MODULE_NAMES="nvidia(video:${S}/kernel)"
133 BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
134 SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC)"
135 # linux-mod_src_compile calls set_arch_to_kernel, which
136 # sets the ARCH to x86 but NVIDIA's wrapping Makefile
137 # expects x86_64 or i386 and then converts it to x86
138 # later on in the build process
139 BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
140 fi
141
142 # Since Nvidia ships 3 different series of drivers, we need to give the user
143 # some kind of guidance as to what version they should install. This tries
144 # to point the user in the right direction but can't be perfect. check
145 # nvidia-driver.eclass
146 nvidia-driver-check-warning
147
148 # set variables to where files are in the package structure
149 if use kernel_FreeBSD; then
150 use x86-fbsd && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
151 use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
152 NV_DOC="${S}/doc"
153 NV_OBJ="${S}/obj"
154 NV_SRC="${S}/src"
155 NV_MAN="${S}/x11/man"
156 NV_X11="${S}/obj"
157 NV_SOVER=1
158 elif use kernel_linux; then
159 NV_DOC="${S}"
160 NV_OBJ="${S}"
161 NV_SRC="${S}/kernel"
162 NV_MAN="${S}"
163 NV_X11="${S}"
164 NV_SOVER=${PV}
165 else
166 die "Could not determine proper NVIDIA package"
167 fi
168 }
169
170 src_unpack() {
171 if ! use kernel_FreeBSD; then
172 cd "${S}"
173 unpack_makeself
174 else
175 unpack ${A}
176 fi
177 }
178
179 src_prepare() {
180 # Please add a brief description for every added patch
181
182 if use kernel_linux; then
183 if kernel_is lt 2 6 9 ; then
184 eerror "You must build this against 2.6.9 or higher kernels."
185 fi
186
187 # If greater than 2.6.5 use M= instead of SUBDIR=
188 convert_to_m "${NV_SRC}"/Makefile.kbuild
189 fi
190 cat <<- EOF > "${S}"/nvidia.icd
191 /usr/$(get_libdir)/libnvidia-opencl.so
192 EOF
193
194 # Allow user patches so they can support RC kernels and whatever else
195 epatch_user
196 }
197
198 src_compile() {
199 # This is already the default on Linux, as there's no toplevel Makefile, but
200 # on FreeBSD there's one and triggers the kernel module build, as we install
201 # it by itself, pass this.
202
203 cd "${NV_SRC}"
204 if use kernel_FreeBSD; then
205 MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
206 LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
207 elif use kernel_linux; then
208 linux-mod_src_compile
209 fi
210 }
211
212 # Install nvidia library:
213 # the first parameter is the library to install
214 # the second parameter is the provided soversion
215 # the third parameter is the target directory if its not /usr/lib
216 donvidia() {
217 # Full path to library minus SOVER
218 MY_LIB="$1"
219
220 # SOVER to use
221 MY_SOVER="$2"
222
223 # Where to install
224 MY_DEST="$3"
225
226 if [[ -z "${MY_DEST}" ]]; then
227 MY_DEST="/usr/$(get_libdir)"
228 action="dolib.so"
229 else
230 exeinto ${MY_DEST}
231 action="doexe"
232 fi
233
234 # Get just the library name
235 libname=$(basename $1)
236
237 # Add it to QA_PREBUILT
238 QA_PREBUILT+=" ${MY_DEST}/${libname}.${MY_SOVER}"
239
240 # Install the library with the correct SOVER
241 ${action} ${MY_LIB}.${MY_SOVER} || \
242 die "failed to install ${libname}"
243
244 # If SOVER wasn't 1, then we need to create a .1 symlink
245 if [[ "${MY_SOVER}" != "1" ]]; then
246 dosym ${libname}.${MY_SOVER} \
247 ${MY_DEST}/${libname}.1 || \
248 die "failed to create ${libname} symlink"
249 fi
250
251 # Always create the symlink from the raw lib to the .1
252 dosym ${libname}.1 \
253 ${MY_DEST}/${libname} || \
254 die "failed to create ${libname} symlink"
255 }
256
257 src_install() {
258 if use kernel_linux; then
259 linux-mod_src_install
260
261 VIDEOGROUP="$(egetent group video | cut -d ':' -f 3)"
262 if [ -z "$VIDEOGROUP" ]; then
263 eerror "Failed to determine the video group gid."
264 die "Failed to determine the video group gid."
265 fi
266
267 # Add the aliases
268 [ -f "${FILESDIR}/nvidia-169.07" ] || die "nvidia missing in FILESDIR"
269 sed -e 's:PACKAGE:'${PF}':g' \
270 -e 's:VIDEOGID:'${VIDEOGROUP}':' "${FILESDIR}"/nvidia-169.07 > \
271 "${WORKDIR}"/nvidia
272 insinto /etc/modprobe.d
273 newins "${WORKDIR}"/nvidia nvidia.conf || die
274
275 local udevdir=/lib/udev
276 has_version sys-fs/udev && udevdir="$($(tc-getPKG_CONFIG) --variable=udevdir udev)"
277
278 # Ensures that our device nodes are created when not using X
279 exeinto "${udevdir}"
280 doexe "${FILESDIR}"/nvidia-udev.sh
281
282 insinto "${udevdir}"/rules.d
283 newins "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
284 elif use kernel_FreeBSD; then
285 if use x86-fbsd; then
286 insinto /boot/modules
287 doins "${S}/src/nvidia.kld" || die
288 fi
289
290 exeinto /boot/modules
291 doexe "${S}/src/nvidia.ko" || die
292 fi
293
294 # NVIDIA kernel <-> userspace driver config lib
295 donvidia ${NV_OBJ}/libnvidia-cfg.so ${NV_SOVER}
296
297 if use kernel_linux; then
298 # NVIDIA video decode <-> CUDA
299 donvidia ${NV_OBJ}/libnvcuvid.so ${NV_SOVER}
300 fi
301
302 if use X; then
303 # Xorg DDX driver
304 insinto /usr/$(get_libdir)/xorg/modules/drivers
305 doins ${NV_X11}/nvidia_drv.so || die "failed to install nvidia_drv.so"
306
307 # Xorg GLX driver
308 donvidia ${NV_X11}/libglx.so ${NV_SOVER} \
309 /usr/$(get_libdir)/opengl/nvidia/extensions
310
311 # XvMC driver
312 dolib.a ${NV_X11}/libXvMCNVIDIA.a || \
313 die "failed to install libXvMCNVIDIA.so"
314 donvidia ${NV_X11}/libXvMCNVIDIA.so ${NV_SOVER}
315 dosym libXvMCNVIDIA.so.${NV_SOVER} \
316 /usr/$(get_libdir)/libXvMCNVIDIA_dynamic.so.1 || \
317 die "failed to create libXvMCNVIDIA_dynamic.so symlink"
318 fi
319
320 # OpenCL ICD for NVIDIA
321 if use kernel_linux; then
322 insinto /etc/OpenCL/vendors
323 doins nvidia.icd
324 donvidia ${NV_OBJ}/libnvidia-opencl.so ${NV_SOVER}
325 fi
326
327 # Documentation
328 dohtml ${NV_DOC}/html/*
329 if use kernel_FreeBSD; then
330 dodoc "${NV_DOC}/README"
331 use X && doman "${NV_MAN}/nvidia-xconfig.1"
332 use tools && doman "${NV_MAN}/nvidia-settings.1"
333 else
334 # Docs
335 newdoc "${NV_DOC}/README.txt" README
336 dodoc "${NV_DOC}/NVIDIA_Changelog"
337 doman "${NV_MAN}/nvidia-smi.1.gz"
338 use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
339 use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
340 doman "${NV_MAN}/nvidia-cuda-proxy-control.1.gz"
341 fi
342
343 # Helper Apps
344 exeinto /opt/bin/
345
346 if use X; then
347 doexe ${NV_OBJ}/nvidia-xconfig || die
348 fi
349
350 if use kernel_linux ; then
351 doexe ${NV_OBJ}/nvidia-debugdump || die
352 doexe ${NV_OBJ}/nvidia-cuda-proxy-control || die
353 doexe ${NV_OBJ}/nvidia-cuda-proxy-server || die
354 doexe ${NV_OBJ}/nvidia-smi || die
355 newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
356 fi
357
358 if use tools; then
359 doexe ${NV_OBJ}/nvidia-settings || die
360 fi
361
362 exeinto /usr/bin/
363 doexe ${NV_OBJ}/nvidia-bug-report.sh || die
364
365 # Desktop entries for nvidia-settings
366 if use tools ; then
367 newicon ${NV_OBJ}/nvidia-settings.png nvidia-drivers-settings.png
368 domenu "${FILESDIR}"/nvidia-drivers-settings.desktop
369 insinto /etc/xdg/autostart
370 doins "${FILESDIR}"/nvidia-autostart.desktop
371 fi
372
373 #doenvd "${FILESDIR}"/50nvidia-prelink-blacklist
374
375 if has_multilib_profile && use multilib ; then
376 local OABI=${ABI}
377 for ABI in $(get_install_abis) ; do
378 src_install-libs
379 done
380 ABI=${OABI}
381 unset OABI
382 else
383 src_install-libs
384 fi
385
386 is_final_abi || die "failed to iterate through all ABIs"
387 }
388
389 src_install-libs() {
390 local inslibdir=$(get_libdir)
391 local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
392 local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
393 local libdir=${NV_OBJ}
394
395 if use kernel_linux && has_multilib_profile && \
396 [[ ${ABI} == "x86" ]] ; then
397 libdir=${NV_OBJ}/32
398 fi
399
400 if use X; then
401 # The GLX libraries
402 donvidia ${libdir}/libGL.so ${NV_SOVER} ${GL_ROOT}
403 donvidia ${libdir}/libnvidia-glcore.so ${NV_SOVER}
404 if use kernel_FreeBSD; then
405 donvidia ${libdir}/libnvidia-tls.so ${NV_SOVER} ${GL_ROOT}
406 else
407 donvidia ${libdir}/tls/libnvidia-tls.so ${NV_SOVER} ${GL_ROOT}
408 fi
409
410 # VDPAU
411 donvidia ${libdir}/libvdpau_nvidia.so ${NV_SOVER}
412 fi
413
414 # NVIDIA monitoring library
415 if use kernel_linux ; then
416 donvidia ${libdir}/libnvidia-ml.so ${NV_SOVER}
417 fi
418
419 # CUDA & OpenCL
420 if use kernel_linux; then
421 donvidia ${libdir}/libcuda.so ${NV_SOVER}
422 donvidia ${libdir}/libnvidia-compiler.so ${NV_SOVER}
423 donvidia ${libdir}/libOpenCL.so 1.0.0 ${CL_ROOT}
424 fi
425 }
426
427 pkg_preinst() {
428 use kernel_linux && linux-mod_pkg_preinst
429
430 # Clean the dynamic libGL stuff's home to ensure
431 # we dont have stale libs floating around
432 if [ -d "${ROOT}"/usr/lib/opengl/nvidia ] ; then
433 rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
434 fi
435 # Make sure we nuke the old nvidia-glx's env.d file
436 if [ -e "${ROOT}"/etc/env.d/09nvidia ] ; then
437 rm -f "${ROOT}"/etc/env.d/09nvidia
438 fi
439 }
440
441 pkg_postinst() {
442 use kernel_linux && linux-mod_pkg_postinst
443
444 # Switch to the nvidia implementation
445 use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
446 "${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
447
448 elog "You must be in the video group to use the NVIDIA device"
449 elog "For more info, read the docs at"
450 elog "http://www.gentoo.org/doc/en/nvidia-guide.xml#doc_chap3_sect6"
451 elog
452 elog "This ebuild installs a kernel module and X driver. Both must"
453 elog "match explicitly in their version. This means, if you restart"
454 elog "X, you must modprobe -r nvidia before starting it back up"
455 elog
456 elog "To use the NVIDIA GLX, run \"eselect opengl set nvidia\""
457 elog
458 elog "To use the NVIDIA CUDA/OpenCL, run \"eselect opencl set nvidia\""
459 elog
460 elog "NVIDIA has requested that any bug reports submitted have the"
461 elog "output of /opt/bin/nvidia-bug-report.sh included."
462 elog
463 if ! use X; then
464 elog "You have elected to not install the X.org driver. Along with"
465 elog "this the OpenGL libraries, XvMC, and VDPAU libraries were not"
466 elog "installed. Additionally, once the driver is loaded your card"
467 elog "and fan will run at max speed which may not be desirable."
468 elog "Use the 'nvidia-smi' init script to have your card and fan"
469 elog "speed scale appropriately."
470 elog
471 fi
472 if ! use tools; then
473 elog "USE=tools controls whether the nvidia-settings application"
474 elog "is installed. If you would like to use it, enable that"
475 elog "flag and re-emerge this ebuild. Optionally you can install"
476 elog "media-video/nvidia-settings"
477 elog
478 fi
479 }
480
481 pkg_prerm() {
482 use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
483 }
484
485 pkg_postrm() {
486 use kernel_linux && linux-mod_pkg_postrm
487 use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
488 }