/[gentoo-alt]/trunk/overlay/media-video/nvidia-glx/nvidia-glx-1.0.7667.ebuild
Gentoo

Contents of /trunk/overlay/media-video/nvidia-glx/nvidia-glx-1.0.7667.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 780 - (show annotations) (download)
Tue Sep 27 21:39:34 2005 UTC (8 years, 10 months ago) by pylon
File size: 8737 byte(s)
Moving stuff into the overlay
1 # Copyright 1999-2005 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header$
4
5 inherit eutils multilib versionator
6
7 X86_PKG_V="pkg0"
8 AMD64_PKG_V="pkg2"
9 NV_V="${PV/1.0./1.0-}"
10 X86_NV_PACKAGE="NVIDIA-Linux-x86-${NV_V}"
11 AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${NV_V}"
12 X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${NV_V}"
13
14 DESCRIPTION="NVIDIA X11 driver and GLX libraries"
15 HOMEPAGE="http://www.nvidia.com/"
16 SRC_URI="x86? ( ftp://download.nvidia.com/XFree86/Linux-x86/${NV_V}/${X86_NV_PACKAGE}-${X86_PKG_V}.run )
17 amd64? ( http://download.nvidia.com/XFree86/Linux-x86_64/${NV_V}/${AMD64_NV_PACKAGE}-${AMD64_PKG_V}.run )
18 x86-fbsd? ( http://download.nvidia.com/freebsd/${NV_V}/${X86_FBSD_NV_PACKAGE}.tar.gz )"
19
20 LICENSE="NVIDIA"
21 SLOT="0"
22
23 KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
24
25 RESTRICT="nostrip multilib-pkg-force"
26 IUSE="dlloader"
27
28 RDEPEND="virtual/libc
29 virtual/x11
30 >=x11-base/opengl-update-2.2.0
31 kernel_linux? ( ~media-video/nvidia-kernel-${PV} )
32 kernel_FreeBSD? ( ~media-video/nvidia-freebsd-${PV} )
33 !app-emulation/emul-linux-x86-nvidia"
34
35 # !<sys-libs/glibc-2.3.4.20040619-r2"
36 # The !<sys-libs/glibc-2.3.4.20040619-r2 is to ensure our glibc has tls
37 # support if we are atleast CHOST=i486.
38
39 PROVIDE="virtual/opengl"
40 export _POSIX2_VERSION="199209"
41
42 if use x86; then
43 PKG_V="-${X86_PKG_V}"
44 NV_PACKAGE="${X86_NV_PACKAGE}"
45 elif use amd64; then
46 PKG_V="-${AMD64_PKG_V}"
47 NV_PACKAGE="${AMD64_NV_PACKAGE}"
48 elif use x86-fbsd; then
49 PKG_V=""
50 NV_PACKAGE="${X86_FBSD_NV_PACKAGE}"
51 fi
52
53 S="${WORKDIR}/${NV_PACKAGE}${PKG_V}"
54
55 # On BSD userland it wants real make command
56 MAKE="make"
57
58 check_xfree() {
59 # This isn't necessary, true. But its about time people got the idea.
60 if has_version "x11-base/xfree"; then
61 eerror "Support for x11-base/xfree is deprecated. Upgrade to x11-base/xorg-x11."
62 fi
63 }
64
65 pkg_setup() {
66 check_xfree
67
68 if use amd64 && has_multilib_profile && [ "${DEFAULT_ABI}" != "amd64" ]; then
69 eerror "This ebuild doesn't currently support changing your defualt abi."
70 die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
71 fi
72 }
73
74 src_unpack() {
75 local NV_PATCH_PREFIX="${FILESDIR}/${PV}/NVIDIA_glx-${PV}"
76
77 if ! use x86-fbsd; then
78 cd ${WORKDIR}
79 bash ${DISTDIR}/${NV_PACKAGE}-${PKG_V}.run --extract-only
80 else
81 unpack ${A}
82 fi
83
84 # Patchs go below here, add breif description
85 cd ${S}
86 if ! use x86-fbsd; then
87 # nVidia wants us to use nvidia-installer, removing warning.
88 epatch ${NV_PATCH_PREFIX//$(get_version_component_range 3)/6629}-makefile.patch
89 else
90 cd ${S}/doc
91 fi
92 # Use the correct defines to make gtkglext build work
93 epatch ${NV_PATCH_PREFIX//$(get_version_component_range 3)/6629}-defines.patch
94 # Use some more sensible gl headers and make way for new glext.h
95 epatch ${NV_PATCH_PREFIX//$(get_version_component_range 3)/6629}-glheader.patch
96
97 # Closing bug #37517 by letting virtual/x11 provide system wide glext.h
98 # 16 July 2004, opengl-update is now supplying glext.h for system wide
99 # compatibility, so we still need to remove this.
100 # 7 November 2004, Keeping this around for 6629 to see what happens.
101 #rm -f usr/include/GL/glext.h
102 }
103
104 src_install() {
105 local MLTEST=$(type dyn_unpack)
106
107 if [[ "${MLTEST/set_abi}" == "${MLTEST}" ]] && has_multilib_profile ; then
108 local OABI=${ABI}
109 for ABI in $(get_install_abis) ; do
110 src_install-libs
111 done
112 ABI=${OABI}
113 unset OABI
114 elif use amd64 ; then
115 src_install-libs lib32 $(get_multilibdir)
116 src_install-libs lib $(get_libdir)
117
118 rm -rf ${D}/usr/$(get_multilibdir)/opengl/nvidia/include
119 rm -rf ${D}/usr/$(get_multilibdir)/opengl/nvidia/extensions
120 else
121 src_install-libs
122 fi
123
124 is_final_abi || return 0
125
126 if ! use x86-fbsd; then
127 # Docs, remove nvidia-settings as provided by media-video/nvidia-settings
128 rm -f usr/share/doc/nvidia-settings*
129 dodoc usr/share/doc/*
130 else
131 dodoc doc/README doc/README.Linux doc/XF86Config.sample
132 fi
133
134 # nVidia want bug reports using this script
135 exeinto /usr/bin
136 doexe usr/bin/nvidia-bug-report.sh
137 }
138
139 # Install nvidia library:
140 # the first parameter is the place where to install it
141 # the second paramis the base name of the library
142 # the third parameter is the provided soversion
143 donvidia() {
144 dodir $1
145 exeinto $1
146
147 libname=$(basename $2)
148
149 doexe $2.$3
150 dosym ${libname}.$3 $1/${libname}
151
152 [[ $3 != "1" ]] && dosym ${libname}.$3 $1/${libname}.1
153 }
154
155 src_install-libs() {
156 local pkglibdir=lib
157 local inslibdir=$(get_libdir)
158
159 if [[ ${#} -eq 2 ]] ; then
160 pkglibdir=${1}
161 inslibdir=${2}
162 elif has_multilib_profile && [[ ${ABI} == "x86" ]] ; then
163 pkglibdir=lib32
164 fi
165
166 local usrpkglibdir=usr/${pkglibdir}
167 local drvdir=usr/X11R6/${pkglibdir}/modules/drivers
168 local extdir=usr/X11R6/${pkglibdir}/modules/extensions
169 local incdir=usr/include/GL
170 local sover=${PV}
171
172 if use x86-fbsd; then
173 # on FreeBSD everything is on obj/
174 pkglibdir=obj
175 usrpkglibdir=obj
176 x11pkglibdir=obj
177 drvdir=obj
178 extdir=obj
179
180 # don't ask me why the headers are there.. glxext.h is missing
181 incdir=doc
182
183 # on FreeBSD it has just .1 suffix
184 sover=1
185 fi
186
187 local NV_ROOT="/usr/${inslibdir}/opengl/nvidia"
188
189 # The GLX libraries
190 donvidia ${NV_ROOT}/lib ${usrpkglibdir}/libGL.so ${sover}
191 donvidia ${NV_ROOT}/lib ${usrpkglibdir}/libGLcore.so ${sover}
192
193 local NO_TLS_ROOT="/usr/${inslibdir}/opengl/nvidia/no-tls"
194 donvidia ${NO_TLS_ROOT} ${usrpkglibdir}/libnvidia-tls.so ${sover}
195
196 if ! use x86-fbsd; then
197 local TLS_ROOT="/usr/${inslibdir}/opengl/nvidia/tls"
198 donvidia ${TLS_ROOT} ${usrpkglibdir}/tls/libnvidia-tls.so ${sover}
199 fi
200
201 if want_tls ; then
202 dosym ../tls/libnvidia-tls.so ${NV_ROOT}/lib
203 dosym ../tls/libnvidia-tls.so.1 ${NV_ROOT}/lib
204 dosym ../tls/libnvidia-tls.so.${sover} ${NV_ROOT}/lib
205 else
206 dosym ../no-tls/libnvidia-tls.so ${NV_ROOT}/lib
207 dosym ../no-tls/libnvidia-tls.so.1 ${NV_ROOT}/lib
208 dosym ../no-tls/libnvidia-tls.so.${sover} ${NV_ROOT}/lib
209 fi
210
211 if ! use x86-fbsd; then
212 # Not sure whether installing the .la file is neccessary;
213 # this is adopted from the `nvidia' ebuild
214 local ver1=$(get_version_component_range 1)
215 local ver2=$(get_version_component_range 2)
216 local ver3=$(get_version_component_range 3)
217 sed -e "s:\${PV}:${PV}:" \
218 -e "s:\${ver1}:${ver1}:" \
219 -e "s:\${ver2}:${ver2}:" \
220 -e "s:\${ver3}:${ver3}:" \
221 -e "s:\${libdir}:${inslibdir}:" \
222 ${FILESDIR}/libGL.la-r2 > ${D}/${NV_ROOT}/lib/libGL.la
223 fi
224
225 # The X module
226 # Since we moved away from libs in /usr/X11R6 need to check this
227 if has_version ">=x11-base/xorg-x11-6.8.0-r4" ; then
228 local X11_LIB_DIR="/usr/$(get_libdir)"
229 else
230 local X11_LIB_DIR="/usr/X11R6/$(get_libdir)"
231 fi
232
233 exeinto ${X11_LIB_DIR}/modules/drivers
234
235 if use dlloader; then
236 [[ -f ${drvdir}/nvidia_drv.so ]] && \
237 doexe ${drvdir}/nvidia_drv.so
238 else
239 [[ -f ${drvdir}/nvidia_drv.o ]] && \
240 doexe ${drvdir}/nvidia_drv.o
241 fi
242
243 insinto ${X11_LIB_DIR}
244 [[ -f ${drvdir}/libXvMCNVIDIA.a ]] && \
245 doins ${drvdir}/libXvMCNVIDIA.a
246 exeinto ${X11_LIB_DIR}
247 [[ -f ${drvdir}/libXvMCNVIDIA.so.${PV} ]] && \
248 doexe ${drvdir}/libXvMCNVIDIA.so.${PV}
249
250 exeinto ${NV_ROOT}/extensions
251 [[ -f ${extdir}/libglx.so.${sover} ]] && \
252 newexe ${extdir}/libglx.so.${sover} libglx.so
253
254 # Includes
255 insinto ${NV_ROOT}/include
256 doins ${incdir}/*.h
257 }
258
259 pkg_preinst() {
260 # Clean the dinamic libGL stuff's home to ensure
261 # we dont have stale libs floating around
262 if [[ -d ${ROOT}/usr/lib/opengl/nvidia ]] ; then
263 rm -rf ${ROOT}/usr/lib/opengl/nvidia/*
264 fi
265 # Make sure we nuke the old nvidia-glx's env.d file
266 if [[ -e ${ROOT}/etc/env.d/09nvidia ]] ; then
267 rm -f ${ROOT}/etc/env.d/09nvidia
268 fi
269 }
270
271 pkg_postinst() {
272 #switch to the nvidia implementation
273 if [[ ${ROOT} == "/" ]] ; then
274 /usr/sbin/opengl-update nvidia
275 fi
276
277 echo
278 einfo "To use the Nvidia GLX, run \"opengl-update nvidia\""
279 echo
280 einfo "You may also be interested in media-video/nvidia-settings"
281 echo
282 einfo "nVidia have requested that any bug reports submitted have the"
283 einfo "output of /usr/bin/nvidia-bug-report.sh included."
284 }
285
286 want_tls() {
287 # For uclibc or anything non glibc, return false
288 has_version sys-libs/glibc || return 1
289
290 # Old versions of glibc were lt/no-tls only
291 has_version '<sys-libs/glibc-2.3.2' && return 1
292
293 local valid_chost="true"
294 if use x86 ; then
295 case ${CHOST/-*} in
296 i486|i586|i686) ;;
297 *) valid_chost="false"
298 esac
299 fi
300
301 [[ ${valid_chost} == "false" ]] && return 1
302
303 # If we've got nptl, we've got tls
304 built_with_use sys-libs/glibc nptl && return 0
305
306 # 2.3.5 turned off tls for linuxthreads glibc on i486 and i586
307 if use x86 && has_version '>=sys-libs/glibc-2.3.5' ; then
308 case ${CHOST/-*} in
309 i486|i586) return 1 ;;
310 esac
311 fi
312
313 # These versions built linuxthreads version to support tls, too
314 has_version '>=sys-libs/glibc-2.3.4.20040619-r2' && return 0
315
316 return 1
317 }
318
319 pkg_postrm() {
320 opengl-update --use-old xorg-x11
321 }

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.20