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