1 |
cardoe 09/10/31 20:17:03 |
2 |
|
3 |
Modified: ChangeLog |
4 |
Added: nvidia-drivers-190.42-r2.ebuild |
5 |
Log: |
6 |
reworked the ebuild for an overall improvement. Should fix several obscure issues people have with different profiles. remove usage of non-TLS libraries since Gentoo has TLS glibc's. still a work in progress for other clean ups. |
7 |
(Portage version: 2.1.7.1/cvs/Linux x86_64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.193 x11-drivers/nvidia-drivers/ChangeLog |
11 |
|
12 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog?rev=1.193&view=markup |
13 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog?rev=1.193&content-type=text/plain |
14 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog?r1=1.192&r2=1.193 |
15 |
|
16 |
Index: ChangeLog |
17 |
=================================================================== |
18 |
RCS file: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog,v |
19 |
retrieving revision 1.192 |
20 |
retrieving revision 1.193 |
21 |
diff -u -r1.192 -r1.193 |
22 |
--- ChangeLog 29 Oct 2009 20:40:09 -0000 1.192 |
23 |
+++ ChangeLog 31 Oct 2009 20:17:02 -0000 1.193 |
24 |
@@ -1,6 +1,15 @@ |
25 |
# ChangeLog for x11-drivers/nvidia-drivers |
26 |
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 |
27 |
-# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog,v 1.192 2009/10/29 20:40:09 cardoe Exp $ |
28 |
+# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog,v 1.193 2009/10/31 20:17:02 cardoe Exp $ |
29 |
+ |
30 |
+*nvidia-drivers-190.42-r2 (31 Oct 2009) |
31 |
+ |
32 |
+ 31 Oct 2009; Doug Goldstein <cardoe@g.o> |
33 |
+ +nvidia-drivers-190.42-r2.ebuild: |
34 |
+ reworked the ebuild for an overall improvement. Should fix several obscure |
35 |
+ issues people have with different profiles. remove usage of non-TLS |
36 |
+ libraries since Gentoo has TLS glibc's. still a work in progress for other |
37 |
+ clean ups. |
38 |
|
39 |
29 Oct 2009; Doug Goldstein <cardoe@g.o> |
40 |
nvidia-drivers-185.18.36.ebuild, nvidia-drivers-185.18.36-r1.ebuild: |
41 |
|
42 |
|
43 |
|
44 |
1.1 x11-drivers/nvidia-drivers/nvidia-drivers-190.42-r2.ebuild |
45 |
|
46 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-190.42-r2.ebuild?rev=1.1&view=markup |
47 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-190.42-r2.ebuild?rev=1.1&content-type=text/plain |
48 |
|
49 |
Index: nvidia-drivers-190.42-r2.ebuild |
50 |
=================================================================== |
51 |
# Copyright 1999-2009 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-190.42-r2.ebuild,v 1.1 2009/10/31 20:17:03 cardoe Exp $ |
54 |
|
55 |
EAPI="2" |
56 |
|
57 |
inherit eutils multilib versionator linux-mod flag-o-matic nvidia-driver |
58 |
|
59 |
X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}" |
60 |
AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}" |
61 |
X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}" |
62 |
|
63 |
DESCRIPTION="NVIDIA X11 driver and GLX libraries" |
64 |
HOMEPAGE="http://www.nvidia.com/" |
65 |
SRC_URI="x86? ( ftp://download.nvidia.com/XFree86/Linux-x86/${PV}/${X86_NV_PACKAGE}-pkg0.run ) |
66 |
amd64? ( ftp://download.nvidia.com/XFree86/Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}-pkg2.run ) |
67 |
x86-fbsd? ( ftp://download.nvidia.com/freebsd/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )" |
68 |
|
69 |
LICENSE="NVIDIA" |
70 |
SLOT="0" |
71 |
KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd" |
72 |
IUSE="acpi custom-cflags gtk multilib kernel_linux" |
73 |
RESTRICT="strip" |
74 |
EMULTILIB_PKG="true" |
75 |
|
76 |
COMMON="<x11-base/xorg-server-1.7.99 |
77 |
kernel_linux? ( >=sys-libs/glibc-2.6.1 ) |
78 |
multilib? ( app-emulation/emul-linux-x86-xlibs )" |
79 |
DEPEND="${COMMON} |
80 |
kernel_linux? ( virtual/linux-sources ) |
81 |
app-admin/eselect-opengl" |
82 |
RDEPEND="${COMMON} |
83 |
kernel_linux? ( virtual/modutils ) |
84 |
!>=media-libs/mesa-7.6 |
85 |
acpi? ( sys-power/acpid )" |
86 |
PDEPEND="x11-libs/libvdpau |
87 |
gtk? ( media-video/nvidia-settings )" |
88 |
|
89 |
QA_TEXTRELS_x86="usr/lib/libXvMCNVIDIA.so.${PV} |
90 |
usr/lib/opengl/nvidia/lib/libnvidia-tls.so.${PV} |
91 |
usr/lib/opengl/nvidia/lib/libGL.so.${PV} |
92 |
usr/lib/opengl/nvidia/lib/libGLcore.so.${PV} |
93 |
usr/lib/opengl/nvidia/extensions/libglx.so.${PV} |
94 |
usr/lib/xorg/modules/drivers/nvidia_drv.so |
95 |
usr/lib/libcuda.so.${PV} |
96 |
usr/lib/libnvidia-cfg.so.${PV} |
97 |
usr/lib/libvdpau_nvidia.so.${PV}" |
98 |
|
99 |
QA_TEXTRELS_x86_fbsd="boot/modules/nvidia.ko |
100 |
usr/lib/opengl/nvidia/lib/libGL.so.1 |
101 |
usr/lib/opengl/nvidia/lib/libGLcore.so.1 |
102 |
usr/lib/libnvidia-cfg.so.1 |
103 |
usr/lib/opengl/nvidia/extensions/libglx.so.1 |
104 |
usr/lib/xorg/modules/drivers/nvidia_drv.so" |
105 |
|
106 |
QA_TEXTRELS_amd64="usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} |
107 |
usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV} |
108 |
usr/lib32/opengl/nvidia/lib/libGL.so.${PV} |
109 |
usr/lib32/libcuda.so.${PV} |
110 |
usr/lib32/libvdpau_nvidia.so.${PV}" |
111 |
|
112 |
QA_EXECSTACK_x86="usr/lib/opengl/nvidia/lib/libGL.so.${PV} |
113 |
usr/lib/opengl/nvidia/lib/libGLcore.so.${PV} |
114 |
usr/lib/opengl/nvidia/extensions/libglx.so.${PV} |
115 |
usr/lib/libXvMCNVIDIA.a:NVXVMC.o" |
116 |
|
117 |
QA_EXECSTACK_amd64="usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV} |
118 |
usr/lib32/opengl/nvidia/lib/libGL.so.${PV} |
119 |
usr/lib64/libnvcompiler.so.${PV} |
120 |
usr/lib64/libXvMCNVIDIA.so.${PV} |
121 |
usr/lib64/libXvMCNVIDIA.a:NVXVMC.o |
122 |
usr/lib64/libnvidia-cfg.so.${PV} |
123 |
usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.${PV} |
124 |
usr/lib64/opengl/nvidia/lib/libGL.so.${PV} |
125 |
usr/lib64/opengl/nvidia/lib/libGLcore.so.${PV} |
126 |
usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} |
127 |
usr/bin/nvidia-smi |
128 |
usr/bin/nvidia-xconfig" |
129 |
|
130 |
QA_WX_LOAD_x86="usr/lib/opengl/nvidia/lib/libGLcore.so.${PV} |
131 |
usr/lib/opengl/nvidia/lib/libGL.so.${PV} |
132 |
usr/lib/opengl/nvidia/extensions/libglx.so.${PV} |
133 |
usr/lib/libXvMCNVIDIA.a" |
134 |
|
135 |
QA_WX_LOAD_amd64="usr/lib32/opengl/nvidia/lib/libGL.so.${PV} |
136 |
usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV} |
137 |
usr/lib64/opengl/nvidia/lib/libGL.so.${PV} |
138 |
usr/lib64/opengl/nvidia/lib/libGLcore.so.${PV} |
139 |
usr/lib64/opengl/nvidia/extensions/libglx.so.${PV}" |
140 |
|
141 |
QA_SONAME_amd64="usr/lib64/libnvcompiler.so.${PV}" |
142 |
|
143 |
QA_DT_HASH_amd64="usr/lib32/libcuda.so.${PV} |
144 |
usr/lib32/opengl/nvidia/lib/libGL.so.${PV} |
145 |
usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV} |
146 |
usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} |
147 |
usr/lib32/libvdpau_nvidia.so.${PV} |
148 |
usr/lib64/libXvMCNVIDIA.so.${PV} |
149 |
usr/lib64/libcuda.so.${PV} |
150 |
usr/lib64/libnvidia-cfg.so.${PV} |
151 |
usr/lib64/opengl/nvidia/lib/libGLcore.so.${PV} |
152 |
usr/lib64/opengl/nvidia/lib/libGL.so.${PV} |
153 |
usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.${PV} |
154 |
usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} |
155 |
usr/lib64/xorg/modules/drivers/nvidia_drv.so |
156 |
usr/lib64/libvdpau_nvidia.so.${PV} |
157 |
usr/bin/nvidia-smi |
158 |
usr/bin/nvidia-xconfig" |
159 |
|
160 |
QA_DT_HASH_x86="usr/lib/libcuda.so.${PV} |
161 |
usr/lib/opengl/nvidia/lib/libnvidia-cfg.so.${PV} |
162 |
usr/lib/opengl/nvidia/lib/libGLcore.so.${PV} |
163 |
usr/lib/opengl/nvidia/lib/libGL.so.${PV} |
164 |
usr/lib/opengl/nvidia/lib/libnvidia-tls.so.${PV} |
165 |
usr/lib/opengl/nvidia/extensions/libwfb.so |
166 |
usr/lib/opengl/nvidia/extensions/libglx.so |
167 |
usr/lib/xorg/modules/drivers/nvidia_drv.so |
168 |
usr/lib/libXvMCNVIDIA.so.${PV} |
169 |
usr/lib/libvdpau_nvidia.so.${PV} |
170 |
usr/bin/nvidia-smi |
171 |
usr/bin/nvidia-xconfig" |
172 |
|
173 |
if use x86; then |
174 |
PKG_V="-pkg0" |
175 |
NV_PACKAGE="${X86_NV_PACKAGE}" |
176 |
elif use amd64; then |
177 |
PKG_V="-pkg2" |
178 |
NV_PACKAGE="${AMD64_NV_PACKAGE}" |
179 |
elif use x86-fbsd; then |
180 |
PKG_V="" |
181 |
NV_PACKAGE="${X86_FBSD_NV_PACKAGE}" |
182 |
fi |
183 |
|
184 |
S="${WORKDIR}/${NV_PACKAGE}${PKG_V}" |
185 |
|
186 |
mtrr_check() { |
187 |
ebegin "Checking for MTRR support" |
188 |
linux_chkconfig_present MTRR |
189 |
eend $? |
190 |
|
191 |
if [[ $? -ne 0 ]] ; then |
192 |
eerror "Please enable MTRR support in your kernel config, found at:" |
193 |
eerror |
194 |
eerror " Processor type and features" |
195 |
eerror " [*] MTRR (Memory Type Range Register) support" |
196 |
eerror |
197 |
eerror "and recompile your kernel ..." |
198 |
die "MTRR support not detected!" |
199 |
fi |
200 |
} |
201 |
|
202 |
lockdep_check() { |
203 |
if linux_chkconfig_present LOCKDEP; then |
204 |
eerror "You've enabled LOCKDEP -- lock tracking -- in the kernel." |
205 |
eerror "Unfortunately, this option exports the symbol 'lockdep_init_map' as GPL-only" |
206 |
eerror "which will prevent ${P} from compiling." |
207 |
eerror "Please make sure the following options have been unset:" |
208 |
eerror " Kernel hacking --->" |
209 |
eerror " [ ] Lock debugging: detect incorrect freeing of live locks" |
210 |
eerror " [ ] Lock debugging: prove locking correctness" |
211 |
eerror " [ ] Lock usage statistics" |
212 |
eerror "in 'menuconfig'" |
213 |
die "LOCKDEP enabled" |
214 |
fi |
215 |
} |
216 |
|
217 |
pkg_setup() { |
218 |
# try to turn off distcc and ccache for people that have a problem with it |
219 |
export DISTCC_DISABLE=1 |
220 |
export CCACHE_DISABLE=1 |
221 |
|
222 |
if use amd64 && has_multilib_profile && [ "${DEFAULT_ABI}" != "amd64" ]; then |
223 |
eerror "This ebuild doesn't currently support changing your default abi." |
224 |
die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}" |
225 |
fi |
226 |
|
227 |
if use kernel_linux; then |
228 |
linux-mod_pkg_setup |
229 |
MODULE_NAMES="nvidia(video:${S}/usr/src/nv)" |
230 |
BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \ |
231 |
SYSOUT=${KV_OUT_DIR} HOST_CC=$(tc-getBUILD_CC)" |
232 |
mtrr_check |
233 |
lockdep_check |
234 |
fi |
235 |
|
236 |
# On BSD userland it wants real make command |
237 |
use userland_BSD && MAKE="$(get_bmake)" |
238 |
|
239 |
export _POSIX2_VERSION="199209" |
240 |
|
241 |
# Since Nvidia ships 3 different series of drivers, we need to give the user |
242 |
# some kind of guidance as to what version they should install. This tries |
243 |
# to point the user in the right direction but can't be perfect. check |
244 |
# nvidia-driver.eclass |
245 |
nvidia-driver-check-warning |
246 |
|
247 |
# set variables to where files are in the package structure |
248 |
if use kernel_FreeBSD; then |
249 |
NV_DOC="${S}/doc" |
250 |
NV_EXEC="${S}/obj" |
251 |
NV_LIB="${S}/obj" |
252 |
NV_SRC="${S}/src" |
253 |
NV_MAN="${S}/x11/man" |
254 |
NV_X11="${S}/obj" |
255 |
NV_SOVER=1 |
256 |
elif use kernel_linux; then |
257 |
NV_DOC="${S}/usr/share/doc" |
258 |
NV_EXEC="${S}/usr/bin" |
259 |
NV_LIB="${S}/usr/lib" |
260 |
NV_SRC="${S}/usr/src/nv" |
261 |
NV_MAN="${S}/usr/share/man/man1" |
262 |
NV_X11="${S}/usr/X11R6/lib" |
263 |
NV_SOVER=${PV} |
264 |
else |
265 |
die "Could not determine proper NVIDIA package" |
266 |
fi |
267 |
} |
268 |
|
269 |
src_unpack() { |
270 |
if use kernel_linux && kernel_is lt 2 6 7; then |
271 |
echo |
272 |
ewarn "Your kernel version is ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}" |
273 |
ewarn "This is not officially supported for ${P}. It is likely you" |
274 |
ewarn "will not be able to compile or use the kernel module." |
275 |
ewarn "It is recommended that you upgrade your kernel to a version >= 2.6.7" |
276 |
echo |
277 |
ewarn "DO NOT file bug reports for kernel versions less than 2.6.7 as they will be ignored." |
278 |
fi |
279 |
|
280 |
if ! use x86-fbsd; then |
281 |
mkdir "${S}" |
282 |
cd "${S}" |
283 |
unpack_makeself |
284 |
else |
285 |
unpack ${A} |
286 |
fi |
287 |
} |
288 |
|
289 |
src_prepare() { |
290 |
# Please add a brief description for every added patch |
291 |
use x86-fbsd && cd doc |
292 |
|
293 |
# Use the correct defines to make gtkglext build work |
294 |
epatch "${FILESDIR}"/NVIDIA_glx-defines.patch |
295 |
# Use some more sensible gl headers and make way for new glext.h |
296 |
epatch "${FILESDIR}"/NVIDIA_glx-glheader.patch |
297 |
|
298 |
if use kernel_linux; then |
299 |
# Quiet down warnings the user does not need to see |
300 |
sed -i \ |
301 |
-e 's:-Wpointer-arith::g' \ |
302 |
-e 's:-Wsign-compare::g' \ |
303 |
"${NV_SRC}"/Makefile.kbuild |
304 |
|
305 |
# If you set this then it's your own fault when stuff breaks :) |
306 |
use custom-cflags && sed -i "s:-O:${CFLAGS}:" "${NV_SRC}"/Makefile.* |
307 |
|
308 |
# If greater than 2.6.5 use M= instead of SUBDIR= |
309 |
convert_to_m "${NV_SRC}"/Makefile.kbuild |
310 |
fi |
311 |
} |
312 |
|
313 |
src_compile() { |
314 |
# This is already the default on Linux, as there's no toplevel Makefile, but |
315 |
# on FreeBSD there's one and triggers the kernel module build, as we install |
316 |
# it by itself, pass this. |
317 |
|
318 |
cd "${NV_SRC}" |
319 |
if use x86-fbsd; then |
320 |
MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \ |
321 |
LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die |
322 |
elif use kernel_linux; then |
323 |
linux-mod_src_compile |
324 |
fi |
325 |
} |
326 |
|
327 |
src_install() { |
328 |
cd "${S}" |
329 |
|
330 |
if use kernel_linux; then |
331 |
linux-mod_src_install |
332 |
|
333 |
VIDEOGROUP="$(egetent group video | cut -d ':' -f 3)" |
334 |
if [ -z "$VIDEOGROUP" ]; then |
335 |
eerror "Failed to determine the video group gid." |
336 |
die "Failed to determine the video group gid." |
337 |
fi |
338 |
|
339 |
# Add the aliases |
340 |
[ -f "${FILESDIR}/nvidia-169.07" ] || die "nvidia missing in FILESDIR" |
341 |
sed -e 's:PACKAGE:'${PF}':g' \ |
342 |
-e 's:VIDEOGID:'${VIDEOGROUP}':' "${FILESDIR}"/nvidia-169.07 > \ |
343 |
"${WORKDIR}"/nvidia |
344 |
insinto /etc/modprobe.d |
345 |
newins "${WORKDIR}"/nvidia nvidia.conf || die |
346 |
elif use x86-fbsd; then |
347 |
insinto /boot/modules |
348 |
doins "${WORKDIR}/${NV_PACKAGE}/src/nvidia.kld" || die |
349 |
|
350 |
exeinto /boot/modules |
351 |
doexe "${WORKDIR}/${NV_PACKAGE}/src/nvidia.ko" || die |
352 |
fi |
353 |
|
354 |
# NVIDIA kernel <-> userspace driver config lib |
355 |
dolib.so ${NV_LIB}/libnvidia-cfg.so.${NV_SOVER} || \ |
356 |
die "failed to install libnvidia-cfg" |
357 |
|
358 |
# Xorg DDX driver |
359 |
insinto /usr/$(get_libdir)/xorg/modules/drivers |
360 |
doins ${NV_X11}/modules/drivers/nvidia_drv.so || die "failed to install nvidia_drv.so" |
361 |
|
362 |
# Xorg GLX driver |
363 |
insinto /usr/$(get_libdir)/opengl/nvidia/extensions |
364 |
doins ${NV_X11}/modules/extensions/libglx.so.${NV_SOVER} || \ |
365 |
die "failed to install libglx.so" |
366 |
dosym /usr/$(get_libdir)/opengl/nvidia/extensions/libglx.so.${NV_SOVER} \ |
367 |
/usr/$(get_libdir)/opengl/nvidia/extensions/libglx.so || \ |
368 |
die "failed to create libglx.so symlink" |
369 |
|
370 |
# XvMC driver |
371 |
dolib.a ${NV_X11}/libXvMCNVIDIA.a || \ |
372 |
die "failed to install libXvMCNVIDIA.so" |
373 |
dolib.so ${NV_X11}/libXvMCNVIDIA.so.${NV_SOVER} || \ |
374 |
die "failed to install libXvMCNVIDIA.so" |
375 |
dosym libXvMCNVIDIA.so.${NV_SOVER} /usr/$(get_libdir)/libXvMCNVIDIA.so || \ |
376 |
die "failed to create libXvMCNVIDIA.so symlink" |
377 |
|
378 |
# CUDA headers (driver to come) |
379 |
if use kernel_linux; then |
380 |
dodir /usr/include/cuda |
381 |
insinto /usr/include/cuda |
382 |
doins usr/include/cuda/*.h || die "failed to install cuda headers" |
383 |
fi |
384 |
|
385 |
# OpenCL headers (driver to come) |
386 |
if [[ -d ${S}/usr/include/CL ]]; then |
387 |
dodir /usr/include/CL |
388 |
insinto /usr/include/CL |
389 |
doins usr/include/CL/*.h || die "failed to install OpenCL headers" |
390 |
fi |
391 |
|
392 |
# Documentation |
393 |
dodoc ${NV_DOC}/XF86Config.sample |
394 |
dohtml ${NV_DOC}/html/* |
395 |
if use x86-fbsd; then |
396 |
dodoc "${NV_DOC}/README" |
397 |
doman "${NV_MAN}/nvidia-xconfig.1" |
398 |
else |
399 |
# Docs |
400 |
newdoc "${NV_DOC}/README.txt" README |
401 |
dodoc "${NV_DOC}/NVIDIA_Changelog" |
402 |
doman "${NV_MAN}/nvidia-smi.1.gz" |
403 |
doman "${NV_MAN}/nvidia-xconfig.1.gz" |
404 |
fi |
405 |
|
406 |
# Helper Apps |
407 |
dobin ${NV_EXEC}/nvidia-xconfig || die |
408 |
dobin ${NV_EXEC}/nvidia-bug-report.sh || die |
409 |
if use kernel_linux; then |
410 |
dobin ${NV_EXEC}/nvidia-smi || die |
411 |
fi |
412 |
|
413 |
if has_multilib_profile ; then |
414 |
local OABI=${ABI} |
415 |
for ABI in $(get_install_abis) ; do |
416 |
src_install-libs |
417 |
done |
418 |
ABI=${OABI} |
419 |
unset OABI |
420 |
else |
421 |
src_install-libs |
422 |
fi |
423 |
|
424 |
is_final_abi || die "failed to iterate through all ABIs" |
425 |
} |
426 |
|
427 |
# Install nvidia library: |
428 |
# the first parameter is the place where to install it |
429 |
# the second parameter is the base name of the library |
430 |
# the third parameter is the provided soversion |
431 |
donvidia() { |
432 |
dodir $1 |
433 |
exeinto $1 |
434 |
|
435 |
libname=$(basename $2) |
436 |
|
437 |
doexe $2.$3 || die "failed to install $2" |
438 |
dosym ${libname}.$3 $1/${libname} || die "failed to symlink $2" |
439 |
[[ $3 != "1" ]] && dosym ${libname}.$3 $1/${libname}.1 |
440 |
} |
441 |
|
442 |
src_install-libs() { |
443 |
local pkglibdir=lib |
444 |
local inslibdir=$(get_libdir) |
445 |
|
446 |
if has_multilib_profile && [[ ${ABI} == "x86" ]] ; then |
447 |
pkglibdir=lib32 |
448 |
fi |
449 |
|
450 |
local NV_ROOT="/usr/${inslibdir}/opengl/nvidia" |
451 |
|
452 |
local libdir= sover= |
453 |
|
454 |
if use kernel_linux; then |
455 |
libdir=usr/${pkglibdir} |
456 |
sover=${PV} |
457 |
else |
458 |
pkglibdir=obj |
459 |
# on FreeBSD it has just .1 suffix |
460 |
sover=1 |
461 |
fi |
462 |
|
463 |
# The GLX libraries |
464 |
donvidia ${NV_ROOT}/lib ${libdir}/libGL.so ${sover} |
465 |
donvidia ${NV_ROOT}/lib ${libdir}/libGLcore.so ${sover} |
466 |
donvidia ${NV_ROOT}/lib ${libdir}/tls/libnvidia-tls.so ${sover} |
467 |
|
468 |
if ! use x86-fbsd; then |
469 |
# Install the .la file for libtool, to prevent e.g. bug #176423 |
470 |
[ -f "${FILESDIR}/libGL.la-r2" ] || die "libGL.la-r2 missing in FILESDIR" |
471 |
local ver1=$(get_version_component_range 1) |
472 |
local ver2=$(get_version_component_range 2) |
473 |
local ver3=$(get_version_component_range 3) |
474 |
sed -e "s:\${PV}:${PV}:" \ |
475 |
-e "s:\${ver1}:${ver1}:" \ |
476 |
-e "s:\${ver2}:${ver2}:" \ |
477 |
-e "s:\${ver3}:${ver3}:" \ |
478 |
-e "s:\${libdir}:${inslibdir}:" \ |
479 |
"${FILESDIR}"/libGL.la-r2 > "${D}"/${NV_ROOT}/lib/libGL.la |
480 |
fi |
481 |
|
482 |
#cuda |
483 |
if [[ -f usr/${pkglibdir}/libcuda.so.${PV} ]]; then |
484 |
dolib.so usr/${pkglibdir}/libcuda.so.${PV} |
485 |
dosym libcuda.so.${PV} /usr/${inslibdir}/libcuda.so.1 |
486 |
dosym libcuda.so.1 /usr/${inslibdir}/libcuda.so |
487 |
fi |
488 |
|
489 |
#vdpau |
490 |
if [[ -f usr/${pkglibdir}/libvdpau_nvidia.so.${PV} ]]; then |
491 |
dolib.so usr/${pkglibdir}/libvdpau_nvidia.so.${PV} |
492 |
dosym libvdpau_nvidia.so.${PV} /usr/${inslibdir}/libvdpau_nvidia.so |
493 |
fi |
494 |
|
495 |
# OpenCL |
496 |
# NOTE: This isn't currently available in the publicly released drivers. |
497 |
if [[ -f usr/${pkglibdir}/libOpenCL.so.1.0.0 ]]; then |
498 |
|
499 |
dolib.so usr/${pkglibdir}/libnvcompiler.so.${PV} |
500 |
dosym libnvcompiler.so.${PV} /usr/${inslibdir}/libnvcompiler.so.1 |
501 |
dosym libnvcompiler.so.1 /usr/${inslibdir}/libnvcompiler.so |
502 |
|
503 |
dolib.so usr/${pkglibdir}/libOpenCL.so.1.0.0 |
504 |
dosym libOpenCL.so.1.0.0 /usr/${inslibdir}/libOpenCL.so.1 |
505 |
dosym libOpenCL.so.1 /usr/${inslibdir}/libOpenCL.so |
506 |
fi |
507 |
} |
508 |
|
509 |
pkg_preinst() { |
510 |
|
511 |
# Clean the dynamic libGL stuff's home to ensure |
512 |
# we dont have stale libs floating around |
513 |
if [ -d "${ROOT}"/usr/lib/opengl/nvidia ] ; then |
514 |
rm -rf "${ROOT}"/usr/lib/opengl/nvidia/* |
515 |
fi |
516 |
# Make sure we nuke the old nvidia-glx's env.d file |
517 |
if [ -e "${ROOT}"/etc/env.d/09nvidia ] ; then |
518 |
rm -f "${ROOT}"/etc/env.d/09nvidia |
519 |
fi |
520 |
} |
521 |
|
522 |
pkg_postinst() { |
523 |
if use kernel_linux; then |
524 |
linux-mod_pkg_postinst |
525 |
fi |
526 |
|
527 |
# Switch to the nvidia implementation |
528 |
eselect opengl set --use-old nvidia |
529 |
|
530 |
echo |
531 |
elog "You must be in the video group to use the NVIDIA device" |
532 |
elog "For more info, read the docs at" |
533 |
elog "http://www.gentoo.org/doc/en/nvidia-guide.xml#doc_chap3_sect6" |
534 |
elog |
535 |
|
536 |
elog "This ebuild installs a kernel module and X driver. Both must" |
537 |
elog "match explicitly in their version. This means, if you restart" |
538 |
elog "X, you most modprobe -r nvidia before starting it back up" |
539 |
elog |
540 |
|
541 |
elog "To use the NVIDIA GLX, run \"eselect opengl set nvidia\"" |
542 |
elog |
543 |
elog "NVIDIA has requested that any bug reports submitted have the" |
544 |
elog "output of /usr/bin/nvidia-bug-report.sh included." |
545 |
elog |
546 |
elog "To work with compiz, you must enable the AddARGBGLXVisuals option." |
547 |
elog |
548 |
elog "If you are having resolution problems, try disabling DynamicTwinView." |
549 |
echo |
550 |
} |
551 |
|
552 |
pkg_postrm() { |
553 |
if use kernel_linux; then |
554 |
linux-mod_pkg_postrm |
555 |
fi |
556 |
eselect opengl set --use-old xorg-x11 |
557 |
} |