Contents of /trunk/extras/nvidia-legacy-drivers/nvidia-legacy-drivers-1.0.9639-r6.smage2
Parent Directory | Revision Log
Revision 2 -
(show annotations)
(download)
Fri Oct 10 13:29:42 2008 UTC (16 years ago) by niro
File size: 7518 byte(s)
Fri Oct 10 13:29:42 2008 UTC (16 years ago) by niro
File size: 7518 byte(s)
import repo
1 | # $Header: /magellan-cvs/smage/nvidia-legacy-drivers/nvidia-legacy-drivers-1.0.9639-r5.smage2,v 1.1 2008/02/16 11:59:09 niro Exp $ |
2 | |
3 | PNAME="nvidia-legacy-drivers" |
4 | PVER="1.0.9639" |
5 | PBUILD="r6" |
6 | |
7 | PCATEGORIE="x11-drivers" |
8 | STATE="unstable" |
9 | |
10 | DESCRIPTION="NVidia OpenGL legacy drivers for Xorg." |
11 | HOMEPAGE="http://www.nvidia.com/" |
12 | |
13 | # only for >= xorg-7.1.0 |
14 | sminclude xorg xorg71 mtools |
15 | |
16 | DEPEND=">= x11-base/xorg-server-1 |
17 | >= x11-base/opengl-update-magellan-2.2" |
18 | |
19 | SDEPEND=">= x11-proto/xf86miscproto-1 |
20 | >= x11-proto/xf86vidmodeproto-1" |
21 | |
22 | PROVIDE="virtual/opengl |
23 | virtual/nvidia-legacy-drivers" |
24 | |
25 | # both files must be fetch or our md5-logic breaks |
26 | SRCFILE_x86="NVIDIA-Linux-x86-${PVER/1.0./1.0-}-pkg0.run" |
27 | SRCFILE_x86_64="NVIDIA-Linux-x86_64-${PVER/1.0./1.0-}-pkg0.run" |
28 | # decide between x86 and x86_64 arch |
29 | SRCFILE="$(eval echo \$SRCFILE_${ARCH/i*86/x86})" |
30 | SRCDIR="${BUILDDIR}/NVIDIA-Linux-${ARCH/i*86/x86}-${PVER/1.0./1.0-}-pkg0" |
31 | |
32 | # nvidia-module-sh cvs revision |
33 | MODULESH_REV=1.2 |
34 | |
35 | SRC_URI=( |
36 | http://download.nvidia.com/XFree86/Linux-x86/${PVER/1.0./1.0-}/${SRCFILE_x86} |
37 | http://download.nvidia.com/XFree86/Linux-x86_64/${PVER/1.0./1.0-}/${SRCFILE_x86_64} |
38 | mirror://${PNAME}/${SRCFILE_x86} |
39 | mirror://${PNAME}/${SRCFILE_x86_64} |
40 | mirror://${PNAME/-legacy/}/libGL.la-r2 |
41 | mirror://${PNAME/-legacy/}/NVIDIA_glx-1.0.6629-defines.patch |
42 | mirror://${PNAME/-legacy/}/NVIDIA_glx-1.0.6629-glheader.patch |
43 | mirror://${PNAME}/NVIDIA_kernel-1.0-7167-disable-preempt-on-smp_processor_id.patch |
44 | mirror://${PNAME}/nvidia-legacy-module.sh-${MODULESH_REV} |
45 | ) |
46 | |
47 | # this thingy don't like stripping |
48 | export CFLAGS="${CFLAGS/-s/}" |
49 | export CXXFLAGS="${CFLAGS}" |
50 | export NOSTRIP=true |
51 | |
52 | export _POSIX2_VERSION="199209" |
53 | |
54 | src_prepare() |
55 | { |
56 | # unpacking the package |
57 | cd ${BUILDDIR} |
58 | bash ${SOURCEDIR}/${PNAME}/${SRCFILE} --extract-only || die |
59 | cd ${SRCDIR} |
60 | |
61 | # use the correct defines to make gtkglext build work |
62 | mpatch NVIDIA_glx-1.0.6629-defines.patch || die |
63 | |
64 | # use some more sensible gl headers and make way for new glext.h |
65 | mpatch NVIDIA_glx-1.0.6629-glheader.patch || die |
66 | |
67 | cd ${SRCDIR}/usr/src/nv |
68 | # fix calling of smp_processor_id() when preempt is enabled |
69 | mpatch NVIDIA_kernel-1.0-7167-disable-preempt-on-smp_processor_id.patch || die |
70 | |
71 | # use M= instead of SUBDIRS= |
72 | sed -i 's:SUBDIRS=:M=:g' Makefile.kbuild || die |
73 | } |
74 | |
75 | # fake (needed with the include of xorg) |
76 | src_compile() { return 0; } |
77 | |
78 | src_install() |
79 | { |
80 | cd ${SRCDIR} |
81 | |
82 | # use driver for xorg-6.9.0 with dll-loader libs |
83 | local DLL_EXT="so" |
84 | local NV_ROOT="/usr/$(mlibdir)/opengl/nvidia" || die |
85 | |
86 | # the glx libraries |
87 | minstalldir ${NV_ROOT}/lib || die |
88 | minstallexec usr/lib/libGL.so.${PVER} ${NV_ROOT}/lib || die |
89 | minstallexec usr/lib/libGLcore.so.${PVER} ${NV_ROOT}/lib || die |
90 | mlink libGL.so.${PVER} ${NV_ROOT}/lib/libGL.so || die |
91 | mlink libGL.so.${PVER} ${NV_ROOT}/lib/libGL.so.1 || die |
92 | mlink libGLcore.so.${PVER} ${NV_ROOT}/lib/libGLcore.so || die |
93 | mlink libGLcore.so.${PVER} ${NV_ROOT}/lib/libGLcore.so.1 || die |
94 | |
95 | local NO_TLS_ROOT="/usr/$(mlibdir)/opengl/nvidia/no-tls" |
96 | minstalldir ${NO_TLS_ROOT} || die |
97 | |
98 | minstallexec usr/lib/libnvidia-tls.so.${PVER} ${NO_TLS_ROOT} || die |
99 | mlink libnvidia-tls.so.${PVER} ${NO_TLS_ROOT}/libnvidia-tls.so || die |
100 | mlink libnvidia-tls.so.${PVER} ${NO_TLS_ROOT}/libnvidia-tls.so.1 || die |
101 | |
102 | local TLS_ROOT="/usr/$(mlibdir)/opengl/nvidia/tls" |
103 | minstalldir ${TLS_ROOT} || die |
104 | minstallexec usr/lib/tls/libnvidia-tls.so.${PVER} ${TLS_ROOT} || die |
105 | mlink libnvidia-tls.so.${PVER} ${TLS_ROOT}/libnvidia-tls.so || die |
106 | mlink libnvidia-tls.so.${PVER} ${TLS_ROOT}/libnvidia-tls.so.1 || die |
107 | |
108 | # we want tls support |
109 | mlink ../tls/libnvidia-tls.so ${NV_ROOT}/lib || die |
110 | mlink ../tls/libnvidia-tls.so.1 ${NV_ROOT}/lib || die |
111 | mlink ../tls/libnvidia-tls.so.${PVER} ${NV_ROOT}/lib || die |
112 | |
113 | # not sure whether installing the .la file is neccessary; |
114 | local ver1="$(echo ${PVER} |cut -d '.' -f 1)" |
115 | local ver2="$(echo ${PVER} |cut -d '.' -f 2)" |
116 | local ver3="$(echo ${PVER} |cut -d '.' -f 3)" |
117 | sed -e "s:\${PVER}:${PVER}:" \ |
118 | -e "s:\${ver1}:${ver1}:" \ |
119 | -e "s:\${ver2}:${ver2}:" \ |
120 | -e "s:\${ver3}:${ver3}:" \ |
121 | ${SOURCEDIR}/${PNAME}/libGL.la-r2 > ${BINDIR}/${NV_ROOT}/lib/libGL.la || die |
122 | |
123 | # the x module |
124 | # since we moved away from libs in /usr/X11R6 need to check this |
125 | local X11_LIB_DIR="/usr/$(mlibdir)" |
126 | |
127 | minstalldir ${X11_LIB_DIR}/xorg/modules/drivers || die |
128 | if [ -f usr/X11R6/lib/modules/drivers/nvidia_drv.${DLL_EXT} ] |
129 | then |
130 | minstallexec usr/X11R6/lib/modules/drivers/nvidia_drv.${DLL_EXT} \ |
131 | ${X11_LIB_DIR}/xorg/modules/drivers || die |
132 | fi |
133 | |
134 | if [ -f usr/X11R6/libs/libXvMCNVIDIA.a ] |
135 | then |
136 | minstallfile usr/X11R6/lib/libXvMCNVIDIA.a ${X11_LIB_DIR} || die |
137 | fi |
138 | |
139 | if [ -f usr/X11R6/lib/libXvMCNVIDIA.so.${PVER} ] |
140 | then |
141 | minstallexec usr/X11R6/lib/libXvMCNVIDIA.so.${PVER} ${X11_LIB_DIR} || die |
142 | fi |
143 | |
144 | minstalldir ${NV_ROOT}/extensions || die |
145 | if [ -f usr/X11R6/lib/modules/extensions/libglx.so.${PVER} ] |
146 | then |
147 | minstallexec usr/X11R6/lib/modules/extensions/libglx.so.${PVER} \ |
148 | ${NV_ROOT}/extensions/libglx.so || die |
149 | fi |
150 | |
151 | # includes |
152 | minstalldir ${NV_ROOT}/include || die |
153 | install -m 0644 usr/include/GL/*.h ${BINDIR}${NV_ROOT}/include || die |
154 | |
155 | # install tls_test |
156 | minstalldir /usr/libexec/misc || die |
157 | minstallexec usr/bin/tls_test /usr/libexec/misc || die |
158 | minstallexec usr/bin/tls_test_dso.so /usr/libexec/misc || die |
159 | |
160 | # docs, remove nvidia-settings as provided by media-video/nvidia-settings |
161 | rm -f usr/share/doc/nvidia-settings* || die |
162 | minstalldocs usr/share/doc/* || die |
163 | |
164 | # nvidia want bug reports using this script |
165 | minstalldir /usr/bin || die |
166 | minstallexec usr/bin/nvidia-bug-report.sh || die |
167 | |
168 | # create a driver tarball |
169 | cd ${SRCDIR}/usr/src |
170 | minstalldir /usr/src/nvidia-legacy-drivers || die |
171 | mv ${SRCDIR}/usr/src/{nv,nvidia-legacy-drivers} || die |
172 | tar cvjf ${BINDIR}/usr/src/nvidia-legacy-drivers/nvidia-legacy-drivers-${PVER}.tar.bz2 nvidia-legacy-drivers/ || die |
173 | # install module-build script |
174 | minstallexec -s nvidia-legacy-module.sh-${MODULESH_REV} /usr/src/nvidia-legacy-drivers/nvidia-legacy-module.sh || die |
175 | # fix pver in nvidia-module.sh |
176 | sed -i "s:@@PVER@@:${PVER}:" ${BINDIR}/usr/src/nvidia-legacy-drivers/nvidia-legacy-module.sh || die |
177 | } |
178 | |
179 | preinstall() |
180 | { |
181 | if [[ ! -z $(magequery -n nvidia-glx) ]] |
182 | then |
183 | echo -e ${COLRED} |
184 | echo -e "Error: media-video/nvidia-glx is installed!!" |
185 | echo -e "These legacy drivers and nvidia-glx cannot be installed at the same time." |
186 | echo -e "Please uninstall media-video/nvidia-glx first!" |
187 | echo -e ${COLDEFAULT} |
188 | die "nvidia-glx found!" |
189 | fi |
190 | |
191 | if [[ ! -z $(magequery -n nvidia-drivers) ]] |
192 | then |
193 | echo -e ${COLRED} |
194 | echo -e "Error: x11-drivers/nvidia-drivers is installed!!" |
195 | echo -e "These legacy drivers and nvidia-drivers cannot be installed at the same time." |
196 | echo -e "Please uninstall x11-drivers/nvidia-drivers first!" |
197 | echo -e ${COLDEFAULT} |
198 | die "nvidia-drivers found!" |
199 | fi |
200 | |
201 | # clean the dynamic libGL stuff's home to ensure |
202 | # we dont have stale libs floating around |
203 | if [[ -d ${MROOT}/usr/$(mlibdir)/opengl/nvidia ]] |
204 | then |
205 | rm -rf ${MROOT}/usr/$(mlibdir)/opengl/nvidia/* |
206 | fi |
207 | |
208 | # make sure we nuke the old nvidia-glx's env.d file |
209 | if [[ -e ${MROOT}/etc/env.d/09nvidia ]] |
210 | then |
211 | rm -f ${MROOT}/etc/env.d/09nvidia |
212 | fi |
213 | } |
214 | |
215 | postinstall() |
216 | { |
217 | # switch to the new installed nvidia implementation |
218 | ${MROOT}/usr/sbin/opengl-update nvidia |
219 | |
220 | echo |
221 | echo -e "1. Please switch your gl-extension with: " |
222 | echo -e "\t'opengl-update nvidia'" |
223 | echo |
224 | echo -e "2. Edit yout /etc/X11/xorg.conf," |
225 | echo -e " rename your VGA card driver to: 'nvidia'" |
226 | echo -e " and enable the glx-module 'Load \"glx\"." |
227 | echo |
228 | } |
Properties
Name | Value |
---|---|
svn:keywords | Id |