1 |
chainsaw 08/07/31 13:30:40 |
2 |
|
3 |
Modified: nvidia-drivers-173.14.09.ebuild ChangeLog |
4 |
Added: nvidia-drivers-173.14.12.ebuild |
5 |
Log: |
6 |
Version bump as requested by Wyatt Epp <epp.8@×××.edu> in bug #233418. Ensure SYSVIPC is enabled as per cucu ionut <cuciferus@×××××.com> in bug #213157. Patch to respect custom CFLAGS by boris64 <genzilla@×××××××.net> closes bug #230273. Paravirt exports now usable, delete unnecessary check as per Patrizio Bassi <hetfield666@×××××.com> in bug #232883. |
7 |
(Portage version: 2.2_rc4/cvs/Linux 2.6.26 x86_64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.4 x11-drivers/nvidia-drivers/nvidia-drivers-173.14.09.ebuild |
11 |
|
12 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-173.14.09.ebuild?rev=1.4&view=markup |
13 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-173.14.09.ebuild?rev=1.4&content-type=text/plain |
14 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-173.14.09.ebuild?r1=1.3&r2=1.4 |
15 |
|
16 |
Index: nvidia-drivers-173.14.09.ebuild |
17 |
=================================================================== |
18 |
RCS file: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-173.14.09.ebuild,v |
19 |
retrieving revision 1.3 |
20 |
retrieving revision 1.4 |
21 |
diff -u -r1.3 -r1.4 |
22 |
--- nvidia-drivers-173.14.09.ebuild 8 Jul 2008 05:54:13 -0000 1.3 |
23 |
+++ nvidia-drivers-173.14.09.ebuild 31 Jul 2008 13:30:39 -0000 1.4 |
24 |
@@ -1,6 +1,6 @@ |
25 |
# Copyright 1999-2008 Gentoo Foundation |
26 |
# Distributed under the terms of the GNU General Public License v2 |
27 |
-# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-173.14.09.ebuild,v 1.3 2008/07/08 05:54:13 opfer Exp $ |
28 |
+# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-173.14.09.ebuild,v 1.4 2008/07/31 13:30:39 chainsaw Exp $ |
29 |
|
30 |
inherit eutils multilib versionator linux-mod flag-o-matic nvidia-driver |
31 |
|
32 |
@@ -216,7 +216,9 @@ |
33 |
"${NV_SRC}"/Makefile.kbuild |
34 |
|
35 |
# If you set this then it's your own fault when stuff breaks :) |
36 |
- use custom-cflags && sed -i "s:-O:${CFLAGS}:" Makefile.* |
37 |
+ use custom-cflags \ |
38 |
+ && einfo "Patching ${NV_SRC}/Makefile* to respect custom cflags" \ |
39 |
+ && sed -i "s:-O:${CFLAGS}:" "${NV_SRC}"/Makefile.* |
40 |
|
41 |
# If greater than 2.6.5 use M= instead of SUBDIR= |
42 |
convert_to_m "${NV_SRC}"/Makefile.kbuild |
43 |
|
44 |
|
45 |
|
46 |
1.107 x11-drivers/nvidia-drivers/ChangeLog |
47 |
|
48 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog?rev=1.107&view=markup |
49 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog?rev=1.107&content-type=text/plain |
50 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog?r1=1.106&r2=1.107 |
51 |
|
52 |
Index: ChangeLog |
53 |
=================================================================== |
54 |
RCS file: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog,v |
55 |
retrieving revision 1.106 |
56 |
retrieving revision 1.107 |
57 |
diff -u -r1.106 -r1.107 |
58 |
--- ChangeLog 22 Jul 2008 15:27:39 -0000 1.106 |
59 |
+++ ChangeLog 31 Jul 2008 13:30:39 -0000 1.107 |
60 |
@@ -1,6 +1,16 @@ |
61 |
# ChangeLog for x11-drivers/nvidia-drivers |
62 |
# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 |
63 |
-# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog,v 1.106 2008/07/22 15:27:39 chainsaw Exp $ |
64 |
+# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog,v 1.107 2008/07/31 13:30:39 chainsaw Exp $ |
65 |
+ |
66 |
+*nvidia-drivers-173.14.12 (31 Jul 2008) |
67 |
+ |
68 |
+ 31 Jul 2008; <chainsaw@g.o> nvidia-drivers-173.14.09.ebuild, |
69 |
+ +nvidia-drivers-173.14.12.ebuild: |
70 |
+ Version bump as requested by Wyatt Epp <epp.8@×××.edu> in bug #233418. |
71 |
+ Ensure SYSVIPC is enabled as per cucu ionut <cuciferus@×××××.com> in bug |
72 |
+ #213157. Patch to respect custom CFLAGS by boris64 <genzilla@×××××××.net> |
73 |
+ closes bug #230273. Paravirt exports now usable, delete unnecessary check |
74 |
+ as per Patrizio Bassi <hetfield666@×××××.com> in bug #232883. |
75 |
|
76 |
22 Jul 2008; <chainsaw@g.o> |
77 |
-files/NVIDIA_kernel-71.86.04-2305230.diff, |
78 |
|
79 |
|
80 |
|
81 |
1.1 x11-drivers/nvidia-drivers/nvidia-drivers-173.14.12.ebuild |
82 |
|
83 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-173.14.12.ebuild?rev=1.1&view=markup |
84 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-173.14.12.ebuild?rev=1.1&content-type=text/plain |
85 |
|
86 |
Index: nvidia-drivers-173.14.12.ebuild |
87 |
=================================================================== |
88 |
# Copyright 1999-2008 Gentoo Foundation |
89 |
# Distributed under the terms of the GNU General Public License v2 |
90 |
# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-173.14.12.ebuild,v 1.1 2008/07/31 13:30:39 chainsaw Exp $ |
91 |
|
92 |
inherit eutils multilib versionator linux-mod flag-o-matic nvidia-driver |
93 |
|
94 |
X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}" |
95 |
AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}" |
96 |
X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}" |
97 |
|
98 |
DESCRIPTION="NVIDIA X11 driver and GLX libraries" |
99 |
HOMEPAGE="http://www.nvidia.com/" |
100 |
SRC_URI="x86? ( http://us.download.nvidia.com/XFree86/Linux-x86/${PV}/${X86_NV_PACKAGE}-pkg0.run ) |
101 |
amd64? ( http://us.download.nvidia.com/XFree86/Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}-pkg2.run ) |
102 |
x86-fbsd? ( http://us.download.nvidia.com/freebsd/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )" |
103 |
|
104 |
LICENSE="NVIDIA" |
105 |
SLOT="0" |
106 |
KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd" |
107 |
IUSE="acpi custom-cflags gtk multilib kernel_linux" |
108 |
RESTRICT="strip" |
109 |
EMULTILIB_PKG="true" |
110 |
|
111 |
COMMON="x11-base/xorg-server |
112 |
multilib? ( app-emulation/emul-linux-x86-xlibs ) |
113 |
kernel_FreeBSD? ( !media-video/nvidia-freebsd ) |
114 |
!app-emulation/emul-linux-x86-nvidia |
115 |
!x11-drivers/nvidia-legacy-drivers" |
116 |
DEPEND="${COMMON} |
117 |
kernel_linux? ( virtual/linux-sources ) |
118 |
app-admin/eselect-opengl" |
119 |
RDEPEND="${COMMON} |
120 |
kernel_linux? ( virtual/modutils ) |
121 |
media-libs/mesa |
122 |
acpi? ( sys-power/acpid )" |
123 |
PDEPEND="gtk? ( media-video/nvidia-settings )" |
124 |
|
125 |
QA_TEXTRELS_x86="usr/lib/libXvMCNVIDIA.so.${PV} |
126 |
usr/lib/opengl/nvidia/no-tls/libnvidia-tls.so.${PV} |
127 |
usr/lib/opengl/nvidia/tls/libnvidia-tls.so.${PV} |
128 |
usr/lib/opengl/nvidia/lib/libGL.so.${PV} |
129 |
usr/lib/opengl/nvidia/lib/libnvidia-cfg.so.${PV} |
130 |
usr/lib/opengl/nvidia/lib/libGLcore.so.${PV} |
131 |
usr/lib/opengl/nvidia/extensions/libglx.so |
132 |
usr/lib/xorg/modules/drivers/nvidia_drv.so |
133 |
usr/lib/libcuda.so.${PV}" |
134 |
|
135 |
QA_TEXTRELS_x86_fbsd="boot/modules/nvidia.ko |
136 |
usr/lib/opengl/nvidia/lib/libGL.so.1 |
137 |
usr/lib/opengl/nvidia/lib/libGLcore.so.1 |
138 |
usr/lib/opengl/nvidia/lib/libnvidia-cfg.so.1 |
139 |
usr/lib/opengl/nvidia/no-tls/libnvidia-tls.so.1 |
140 |
usr/lib/opengl/nvidia/extensions/libglx.so |
141 |
usr/lib/xorg/modules/drivers/nvidia_drv.so" |
142 |
|
143 |
QA_TEXTRELS_amd64="usr/lib32/opengl/nvidia/tls/libnvidia-tls.so.${PV} |
144 |
usr/lib32/opengl/nvidia/no-tls/libnvidia-tls.so.${PV} |
145 |
usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV} |
146 |
usr/lib32/opengl/nvidia/lib/libGL.so.${PV} |
147 |
usr/lib32/opengl/nvidia/lib/libnvidia-cfg.so.${PV} |
148 |
usr/lib32/libcuda.so.${PV}" |
149 |
|
150 |
QA_EXECSTACK_x86="usr/lib/opengl/nvidia/lib/libGL.so.${PV} |
151 |
usr/lib/opengl/nvidia/lib/libGLcore.so.${PV} |
152 |
usr/lib/opengl/nvidia/extensions/libglx.so" |
153 |
|
154 |
QA_EXECSTACK_amd64="usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV} |
155 |
usr/lib32/opengl/nvidia/lib/libGL.so.${PV} |
156 |
usr/lib64/xorg/modules/drivers/nvidia_drv.so |
157 |
usr/lib64/libXvMCNVIDIA.so.${PV} |
158 |
usr/lib64/opengl/nvidia/tls/libnvidia-tls.so.${PV} |
159 |
usr/lib64/opengl/nvidia/no-tls/libnvidia-tls.so.${PV} |
160 |
usr/lib64/opengl/nvidia/lib/libGLcore.so.${PV} |
161 |
usr/lib64/opengl/nvidia/lib/libGL.so.${PV} |
162 |
usr/lib64/opengl/nvidia/lib/libnvidia-cfg.so.${PV} |
163 |
usr/lib64/opengl/nvidia/extensions/libglx.so |
164 |
usr/bin/nvidia-xconfig" |
165 |
|
166 |
QA_WX_LOAD_x86="usr/lib/opengl/nvidia/lib/libGLcore.so.${PV} |
167 |
usr/lib/opengl/nvidia/lib/libGL.so.${PV} |
168 |
usr/lib/opengl/nvidia/extensions/libglx.so" |
169 |
|
170 |
QA_WX_LOAD_amd64="usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV} |
171 |
usr/lib32/opengl/nvidia/lib/libGL.so.${PV} |
172 |
usr/lib64/opengl/nvidia/lib/libGLcore.so.${PV} |
173 |
usr/lib64/opengl/nvidia/lib/libGL.so.${PV} |
174 |
usr/lib64/opengl/nvidia/extensions/libglx.so" |
175 |
|
176 |
if use x86; then |
177 |
PKG_V="-pkg0" |
178 |
NV_PACKAGE="${X86_NV_PACKAGE}" |
179 |
elif use amd64; then |
180 |
PKG_V="-pkg2" |
181 |
NV_PACKAGE="${AMD64_NV_PACKAGE}" |
182 |
elif use x86-fbsd; then |
183 |
PKG_V="" |
184 |
NV_PACKAGE="${X86_FBSD_NV_PACKAGE}" |
185 |
fi |
186 |
|
187 |
S="${WORKDIR}/${NV_PACKAGE}${PKG_V}" |
188 |
|
189 |
mtrr_check() { |
190 |
ebegin "Checking for MTRR support" |
191 |
linux_chkconfig_present MTRR |
192 |
eend $? |
193 |
|
194 |
if [[ $? -ne 0 ]] ; then |
195 |
eerror "Please enable MTRR support in your kernel config, found at:" |
196 |
eerror |
197 |
eerror " Processor type and features" |
198 |
eerror " [*] MTRR (Memory Type Range Register) support" |
199 |
eerror |
200 |
eerror "and recompile your kernel ..." |
201 |
die "MTRR support not detected!" |
202 |
fi |
203 |
} |
204 |
|
205 |
sysvipc_check() { |
206 |
ebegin "Checking for SYSVIPC support" |
207 |
linux_chkconfig_present SYSVIPC |
208 |
eend $? |
209 |
|
210 |
if [[ $? -ne 0 ]] ; then |
211 |
eerror "Please enable SYSVIPC support in your kernel config, found at:" |
212 |
eerror |
213 |
eerror " General setup" |
214 |
eerror " [*] System V IPC" |
215 |
eerror |
216 |
eerror "and recompile your kernel ..." |
217 |
die "SYSVIPC support not detected!" |
218 |
fi |
219 |
} |
220 |
|
221 |
pkg_setup() { |
222 |
# try to turn off distcc and ccache for people that have a problem with it |
223 |
export DISTCC_DISABLE=1 |
224 |
export CCACHE_DISABLE=1 |
225 |
|
226 |
if use amd64 && has_multilib_profile && [ "${DEFAULT_ABI}" != "amd64" ]; then |
227 |
eerror "This ebuild doesn't currently support changing your default abi." |
228 |
die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}" |
229 |
fi |
230 |
|
231 |
if use kernel_linux; then |
232 |
linux-mod_pkg_setup |
233 |
MODULE_NAMES="nvidia(video:${S}/usr/src/nv)" |
234 |
BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \ |
235 |
SYSOUT=${KV_OUT_DIR} HOST_CC=$(tc-getBUILD_CC)" |
236 |
mtrr_check |
237 |
sysvipc_check |
238 |
fi |
239 |
|
240 |
# On BSD userland it wants real make command |
241 |
use userland_BSD && MAKE="$(get_bmake)" |
242 |
|
243 |
export _POSIX2_VERSION="199209" |
244 |
|
245 |
# Since Nvidia ships 3 different series of drivers, we need to give the user |
246 |
# some kind of guidance as to what version they should install. This tries |
247 |
# to point the user in the right direction but can't be perfect. check |
248 |
# nvidia-driver.eclass |
249 |
nvidia-driver-check-warning |
250 |
|
251 |
# set variables to where files are in the package structure |
252 |
if use kernel_FreeBSD; then |
253 |
NV_DOC="${S}/doc" |
254 |
NV_EXEC="${S}/obj" |
255 |
NV_SRC="${S}/src" |
256 |
elif use kernel_linux; then |
257 |
NV_DOC="${S}/usr/share/doc" |
258 |
NV_EXEC="${S}/usr/bin" |
259 |
NV_SRC="${S}/usr/src/nv" |
260 |
else |
261 |
die "Could not determine proper NVIDIA package" |
262 |
fi |
263 |
} |
264 |
|
265 |
src_unpack() { |
266 |
if use kernel_linux && kernel_is lt 2 6 7; then |
267 |
echo |
268 |
ewarn "Your kernel version is ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}" |
269 |
ewarn "This is not officially supported for ${P}. It is likely you" |
270 |
ewarn "will not be able to compile or use the kernel module." |
271 |
ewarn "It is recommended that you upgrade your kernel to a version >= 2.6.7" |
272 |
echo |
273 |
ewarn "DO NOT file bug reports for kernel versions less than 2.6.7 as they will be ignored." |
274 |
fi |
275 |
|
276 |
if ! use x86-fbsd; then |
277 |
cd "${WORKDIR}" |
278 |
bash "${DISTDIR}"/${NV_PACKAGE}${PKG_V}.run --extract-only |
279 |
else |
280 |
unpack ${A} |
281 |
fi |
282 |
|
283 |
# Patches go below here, add brief description |
284 |
cd "${S}" |
285 |
use x86-fbsd && cd doc |
286 |
|
287 |
# Use the correct defines to make gtkglext build work |
288 |
epatch "${FILESDIR}"/NVIDIA_glx-defines.patch |
289 |
# Use some more sensible gl headers and make way for new glext.h |
290 |
epatch "${FILESDIR}"/NVIDIA_glx-glheader.patch |
291 |
|
292 |
# allow on board sensors to work with lm_sensors |
293 |
if use kernel_linux; then |
294 |
epatch "${FILESDIR}"/NVIDIA_i2c-hwmon.patch |
295 |
fi |
296 |
|
297 |
if use kernel_linux; then |
298 |
# Quiet down warnings the user does not need to see |
299 |
sed -i \ |
300 |
-e 's:-Wpointer-arith::g' \ |
301 |
-e 's:-Wsign-compare::g' \ |
302 |
"${NV_SRC}"/Makefile.kbuild |
303 |
|
304 |
# If you set this then it's your own fault when stuff breaks :) |
305 |
use custom-cflags \ |
306 |
&& einfo "Patching ${NV_SRC}/Makefile* to respect custom cflags" \ |
307 |
&& sed -i "s:-O:${CFLAGS}:" "${NV_SRC}"/Makefile.* |
308 |
|
309 |
# If greater than 2.6.5 use M= instead of SUBDIR= |
310 |
convert_to_m "${NV_SRC}"/Makefile.kbuild |
311 |
fi |
312 |
} |
313 |
|
314 |
src_compile() { |
315 |
# This is already the default on Linux, as there's no toplevel Makefile, but |
316 |
# on FreeBSD there's one and triggers the kernel module build, as we install |
317 |
# it by itself, pass this. |
318 |
|
319 |
cd "${NV_SRC}" |
320 |
if use x86-fbsd; then |
321 |
MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \ |
322 |
LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die |
323 |
elif use kernel_linux; then |
324 |
linux-mod_src_compile |
325 |
fi |
326 |
} |
327 |
|
328 |
src_install() { |
329 |
local MLTEST=$(type dyn_unpack) |
330 |
|
331 |
cd "${S}" |
332 |
|
333 |
if use kernel_linux; then |
334 |
linux-mod_src_install |
335 |
|
336 |
VIDEOGROUP="$(egetent group video | cut -d ':' -f 3)" |
337 |
if [ -z "$VIDEOGROUP" ]; then |
338 |
eerror "Failed to determine the video group gid." |
339 |
die "Failed to determine the video group gid." |
340 |
fi |
341 |
|
342 |
# Add the aliases |
343 |
[ -f "${FILESDIR}/nvidia" ] || die "nvidia missing in FILESDIR" |
344 |
sed -e 's:PACKAGE:'${PF}':g' \ |
345 |
-e 's:VIDEOGID:'${VIDEOGROUP}':' "${FILESDIR}"/nvidia-169.07 > \ |
346 |
"${WORKDIR}"/nvidia |
347 |
insinto /etc/modprobe.d |
348 |
doins "${WORKDIR}"/nvidia || die |
349 |
elif use x86-fbsd; then |
350 |
insinto /boot/modules |
351 |
doins "${WORKDIR}/${NV_PACKAGE}/src/nvidia.kld" || die |
352 |
|
353 |
exeinto /boot/modules |
354 |
doexe "${WORKDIR}/${NV_PACKAGE}/src/nvidia.ko" || die |
355 |
fi |
356 |
|
357 |
if has_multilib_profile ; then |
358 |
local OABI=${ABI} |
359 |
for ABI in $(get_install_abis) ; do |
360 |
src_install-libs |
361 |
done |
362 |
ABI=${OABI} |
363 |
unset OABI |
364 |
elif use amd64 ; then |
365 |
src_install-libs lib32 $(get_multilibdir) |
366 |
src_install-libs lib $(get_libdir) |
367 |
|
368 |
rm -rf "${D}"/usr/$(get_multilibdir)/opengl/nvidia/include |
369 |
rm -rf "${D}"/usr/$(get_multilibdir)/opengl/nvidia/extensions |
370 |
else |
371 |
src_install-libs |
372 |
fi |
373 |
|
374 |
is_final_abi || return 0 |
375 |
|
376 |
# Documentation |
377 |
dodoc "${NV_DOC}"/{XF86Config.sample,Copyrights} |
378 |
dohtml "${NV_DOC}"/html/* |
379 |
if use x86-fbsd; then |
380 |
dodoc "${NV_DOC}/README" |
381 |
else |
382 |
# Docs |
383 |
newdoc "${NV_DOC}/README.txt" README |
384 |
dodoc "${NV_DOC}/NVIDIA_Changelog" |
385 |
fi |
386 |
|
387 |
# Helper Apps |
388 |
dobin ${NV_EXEC}/nvidia-xconfig || die |
389 |
dobin ${NV_EXEC}/nvidia-bug-report.sh || die |
390 |
} |
391 |
|
392 |
# Install nvidia library: |
393 |
# the first parameter is the place where to install it |
394 |
# the second parameter is the base name of the library |
395 |
# the third parameter is the provided soversion |
396 |
donvidia() { |
397 |
dodir $1 |
398 |
exeinto $1 |
399 |
|
400 |
libname=$(basename $2) |
401 |
|
402 |
# libnvidia-cfg.so is no longer supplied in lib32; step over it gracefully |
403 |
if [ -e $2.$3 ] ; then |
404 |
doexe $2.$3 |
405 |
dosym ${libname}.$3 $1/${libname} |
406 |
[[ $3 != "1" ]] && dosym ${libname}.$3 $1/${libname}.1 |
407 |
fi |
408 |
} |
409 |
|
410 |
src_install-libs() { |
411 |
local pkglibdir=lib |
412 |
local inslibdir=$(get_libdir) |
413 |
|
414 |
if [[ ${#} -eq 2 ]] ; then |
415 |
pkglibdir=${1} |
416 |
inslibdir=${2} |
417 |
elif has_multilib_profile && [[ ${ABI} == "x86" ]] ; then |
418 |
pkglibdir=lib32 |
419 |
fi |
420 |
|
421 |
local usrpkglibdir=usr/${pkglibdir} |
422 |
local libdir=usr/X11R6/${pkglibdir} |
423 |
local drvdir=${libdir}/modules/drivers |
424 |
local extdir=${libdir}/modules/extensions |
425 |
local incdir=usr/include/GL |
426 |
local sover=${PV} |
427 |
local NV_ROOT="/usr/${inslibdir}/opengl/nvidia" |
428 |
local NO_TLS_ROOT="${NV_ROOT}/no-tls" |
429 |
local TLS_ROOT="${NV_ROOT}/tls" |
430 |
local X11_LIB_DIR="/usr/${inslibdir}/xorg" |
431 |
|
432 |
if use x86-fbsd; then |
433 |
# on FreeBSD everything is on obj/ |
434 |
pkglibdir=obj |
435 |
usrpkglibdir=obj |
436 |
x11pkglibdir=obj |
437 |
drvdir=obj |
438 |
extdir=obj |
439 |
|
440 |
# don't ask me why the headers are there.. glxext.h is missing |
441 |
incdir=doc |
442 |
|
443 |
# on FreeBSD it has just .1 suffix |
444 |
sover=1 |
445 |
fi |
446 |
|
447 |
# The GLX libraries |
448 |
donvidia ${NV_ROOT}/lib ${usrpkglibdir}/libGL.so ${sover} |
449 |
donvidia ${NV_ROOT}/lib ${usrpkglibdir}/libGLcore.so ${sover} |
450 |
|
451 |
donvidia ${NV_ROOT}/lib ${usrpkglibdir}/libnvidia-cfg.so ${sover} |
452 |
|
453 |
dodir ${NO_TLS_ROOT} |
454 |
donvidia ${NO_TLS_ROOT} ${usrpkglibdir}/libnvidia-tls.so ${sover} |
455 |
|
456 |
if ! use x86-fbsd; then |
457 |
donvidia ${TLS_ROOT} ${usrpkglibdir}/tls/libnvidia-tls.so ${sover} |
458 |
fi |
459 |
|
460 |
if want_tls ; then |
461 |
dosym ../tls/libnvidia-tls.so ${NV_ROOT}/lib |
462 |
dosym ../tls/libnvidia-tls.so.1 ${NV_ROOT}/lib |
463 |
dosym ../tls/libnvidia-tls.so.${sover} ${NV_ROOT}/lib |
464 |
else |
465 |
dosym ../no-tls/libnvidia-tls.so ${NV_ROOT}/lib |
466 |
dosym ../no-tls/libnvidia-tls.so.1 ${NV_ROOT}/lib |
467 |
dosym ../no-tls/libnvidia-tls.so.${sover} ${NV_ROOT}/lib |
468 |
fi |
469 |
|
470 |
if ! use x86-fbsd; then |
471 |
# Install the .la file for libtool, to prevent e.g. bug #176423 |
472 |
[ -f "${FILESDIR}/libGL.la-r2" ] || die "libGL.la-r2 missing in FILESDIR" |
473 |
local ver1=$(get_version_component_range 1) |
474 |
local ver2=$(get_version_component_range 2) |
475 |
local ver3=$(get_version_component_range 3) |
476 |
sed -e "s:\${PV}:${PV}:" \ |
477 |
-e "s:\${ver1}:${ver1}:" \ |
478 |
-e "s:\${ver2}:${ver2}:" \ |
479 |
-e "s:\${ver3}:${ver3}:" \ |
480 |
-e "s:\${libdir}:${inslibdir}:" \ |
481 |
"${FILESDIR}"/libGL.la-r2 > "${D}"/${NV_ROOT}/lib/libGL.la |
482 |
fi |
483 |
|
484 |
exeinto ${X11_LIB_DIR}/modules/drivers |
485 |
|
486 |
[[ -f ${drvdir}/nvidia_drv.so ]] && \ |
487 |
doexe ${drvdir}/nvidia_drv.so |
488 |
|
489 |
insinto /usr/${inslibdir} |
490 |
[[ -f ${libdir}/libXvMCNVIDIA.a ]] && \ |
491 |
doins ${libdir}/libXvMCNVIDIA.a |
492 |
exeinto /usr/${inslibdir} |
493 |
# fix Bug 131315 |
494 |
[[ -f ${libdir}/libXvMCNVIDIA.so.${PV} ]] && \ |
495 |
doexe ${libdir}/libXvMCNVIDIA.so.${PV} && \ |
496 |
dosym libXvMCNVIDIA.so.${PV} \ |
497 |
/usr/${inslibdir}/libXvMCNVIDIA.so |
498 |
|
499 |
exeinto ${NV_ROOT}/extensions |
500 |
[[ -f ${libdir}/modules/libnvidia-wfb.so.${sover} ]] && \ |
501 |
newexe ${libdir}/modules/libnvidia-wfb.so.${sover} libwfb.so |
502 |
[[ -f ${extdir}/libglx.so.${sover} ]] && \ |
503 |
newexe ${extdir}/libglx.so.${sover} libglx.so |
504 |
|
505 |
# Includes |
506 |
insinto ${NV_ROOT}/include |
507 |
doins ${incdir}/*.h |
508 |
|
509 |
#cuda |
510 |
if [[ -f usr/include/cuda/cuda.h ]]; then |
511 |
dodir /usr/include/cuda |
512 |
insinto /usr/include/cuda |
513 |
doins usr/include/cuda/*.h |
514 |
|
515 |
if [[ -f usr/${pkglibdir}/libcuda.so.${PV} ]]; then |
516 |
dolib.so usr/${pkglibdir}/libcuda.so.${PV} |
517 |
dosym libcuda.so.${PV} /usr/${inslibdir}/libcuda.so.1 |
518 |
dosym libcuda.so.1 /usr/${inslibdir}/libcuda.so |
519 |
fi |
520 |
fi |
521 |
} |
522 |
|
523 |
pkg_preinst() { |
524 |
|
525 |
# Clean the dynamic libGL stuff's home to ensure |
526 |
# we dont have stale libs floating around |
527 |
if [ -d "${ROOT}"/usr/lib/opengl/nvidia ] ; then |
528 |
rm -rf "${ROOT}"/usr/lib/opengl/nvidia/* |
529 |
fi |
530 |
# Make sure we nuke the old nvidia-glx's env.d file |
531 |
if [ -e "${ROOT}"/etc/env.d/09nvidia ] ; then |
532 |
rm -f "${ROOT}"/etc/env.d/09nvidia |
533 |
fi |
534 |
} |
535 |
|
536 |
pkg_postinst() { |
537 |
if use kernel_linux; then |
538 |
linux-mod_pkg_postinst |
539 |
fi |
540 |
|
541 |
# Switch to the nvidia implementation |
542 |
eselect opengl set --use-old nvidia |
543 |
|
544 |
echo |
545 |
elog "You must be in the video group to use the NVIDIA device" |
546 |
elog "For more info, read the docs at" |
547 |
elog "http://www.gentoo.org/doc/en/nvidia-guide.xml#doc_chap3_sect6" |
548 |
elog |
549 |
|
550 |
elog "This ebuild installs a kernel module and X driver. Both must" |
551 |
elog "match explicitly in their version. This means, if you restart" |
552 |
elog "X, you most modprobe -r nvidia before starting it back up" |
553 |
elog |
554 |
|
555 |
elog "To use the NVIDIA GLX, run \"eselect opengl set nvidia\"" |
556 |
elog |
557 |
elog "nVidia has requested that any bug reports submitted have the" |
558 |
elog "output of /usr/bin/nvidia-bug-report.sh included." |
559 |
elog |
560 |
elog "To work with compiz, you must enable the AddARGBGLXVisuals option." |
561 |
elog |
562 |
elog "If you are having resolution problems, try disabling DynamicTwinView." |
563 |
echo |
564 |
} |
565 |
|
566 |
want_tls() { |
567 |
# For uclibc or anything non glibc, return false |
568 |
has_version sys-libs/glibc || return 1 |
569 |
|
570 |
# Old versions of glibc were lt/no-tls only |
571 |
has_version '<sys-libs/glibc-2.3.2' && return 1 |
572 |
|
573 |
if use x86 ; then |
574 |
case ${CHOST/-*} in |
575 |
i486|i586|i686) ;; |
576 |
*) return 1 ;; |
577 |
esac |
578 |
fi |
579 |
|
580 |
# If we've got nptl, we've got tls |
581 |
built_with_use --missing true sys-libs/glibc nptl && return 0 |
582 |
|
583 |
# 2.3.5 turned off tls for linuxthreads glibc on i486 and i586 |
584 |
if use x86 && has_version '>=sys-libs/glibc-2.3.5' ; then |
585 |
case ${CHOST/-*} in |
586 |
i486|i586) return 1 ;; |
587 |
esac |
588 |
fi |
589 |
|
590 |
# These versions built linuxthreads version to support tls, too |
591 |
has_version '>=sys-libs/glibc-2.3.4.20040619-r2' && return 0 |
592 |
|
593 |
return 1 |
594 |
} |
595 |
|
596 |
pkg_postrm() { |
597 |
if use kernel_linux; then |
598 |
linux-mod_pkg_postrm |
599 |
fi |
600 |
eselect opengl set --use-old xorg-x11 |
601 |
} |