Annotation of /branches/magellan-next/core/mesa/mesa-7.8.2-r2.smage2
Parent Directory | Revision Log
Revision 6401 -
(hide annotations)
(download)
Mon Aug 23 11:14:20 2010 UTC (13 years, 9 months ago) by niro
File size: 5992 byte(s)
Mon Aug 23 11:14:20 2010 UTC (13 years, 9 months ago) by niro
File size: 5992 byte(s)
auto added: ver bump to 7.8.2-r2
1 | niro | 6397 | # $Id: mesa-7.8.1-r1.smage2 5292 2010-04-20 19:02:07Z niro $ |
2 | |||
3 | PNAME="mesa" | ||
4 | PVER="7.8.2" | ||
5 | PBUILD="r2" | ||
6 | |||
7 | STATE="unstable" | ||
8 | |||
9 | HOMEPAGE="http://mesa3d.sourceforge.net/" | ||
10 | |||
11 | MESA_DEPEND=">= dev-libs/expat-2 | ||
12 | >= x11-libs/libX11-1 | ||
13 | >= x11-libs/libXext-1 | ||
14 | >= x11-libs/libXxf86vm-1 | ||
15 | >= x11-libs/libXi-1 | ||
16 | >= x11-libs/libXmu-1 | ||
17 | >= x11-libs/libdrm-2.4.21 | ||
18 | >= x11-libs/libICE-1 | ||
19 | >= x11-base/opengl-update-magellan-2.2.12 | ||
20 | >= x11-libs/libxcb-1 | ||
21 | >= x11-libs/libXfixes-4 | ||
22 | >= x11-libs/libXdamage-1" | ||
23 | |||
24 | MESA_PROGS_DEPEND=">= virtual/glut" | ||
25 | |||
26 | SDEPEND="${MESA_DEPEND} | ||
27 | ${MESA_PROGS_DEPEND} | ||
28 | >= dev-util/pkgconfig-0.25 | ||
29 | >= x11-misc/makedepend-1 | ||
30 | >= x11-proto/xf86vidmodeproto-2.3 | ||
31 | >= x11-libs/libXxf86vm-1.1 | ||
32 | >= x11-proto/glproto-1.4.9 | ||
33 | >= x11-proto/inputproto-1 | ||
34 | >= x11-proto/xextproto-7 | ||
35 | >= x11-proto/xf86driproto-2 | ||
36 | >= x11-proto/dri2proto-2.0 | ||
37 | >= x11-proto/xcb-proto-1 | ||
38 | >= x11-proto/xproto-7 | ||
39 | >= x11-proto/fixesproto-4 | ||
40 | >= x11-proto/damageproto-1" | ||
41 | |||
42 | PROVIDE="virtual/opengl" | ||
43 | |||
44 | # must be set before the include of multilib! | ||
45 | EMUL_LINUX_32=true | ||
46 | sminclude xorg mtools multilib | ||
47 | |||
48 | # must be set *after* the include of xorg! | ||
49 | SRCFILE="MesaLib-${PVER/_/-}.tar.bz2" | ||
50 | niro | 6399 | PROGS_SRCFILE="MesaDemos-${PVER/_/-}.tar.bz2" |
51 | niro | 6397 | # libs + progs have the same SRCDIR |
52 | SRCDIR="${BUILDDIR}/Mesa-${PVER/_/-}" | ||
53 | |||
54 | SPLIT_PACKAGES="mesa mesa-progs" | ||
55 | |||
56 | SRC_URI=( | ||
57 | ftp://ftp.freedesktop.org/pub/mesa/${PVER}/${SRCFILE} | ||
58 | ftp://ftp.freedesktop.org/pub/mesa/${PVER}/${PROGS_SRCFILE} | ||
59 | sourceforge://mesa3d/${SRCFILE} | ||
60 | sourceforge://mesa3d/${PROGS_SRCFILE} | ||
61 | mirror://${PNAME}/${SRCFILE} | ||
62 | mirror://${PNAME}/${PROGS_SRCFILE} | ||
63 | mirror://${PNAME}/libGLU.la | ||
64 | mirror://${PNAME}/libGL.la | ||
65 | ) | ||
66 | |||
67 | UP2DATE="updatecmd ftp://ftp.freedesktop.org/pub/mesa/current | lasttarball" | ||
68 | |||
69 | split_info_mesa() | ||
70 | { | ||
71 | DESCRIPTION="Mesa3D OpenGL graphics library." | ||
72 | PCATEGORIE="media-libs" | ||
73 | |||
74 | DEPEND="${MESA_DEPEND}" | ||
75 | |||
76 | postinstall() | ||
77 | { | ||
78 | ${MROOT}/usr/sbin/opengl-update --use-old xorg | ||
79 | } | ||
80 | } | ||
81 | |||
82 | split_info_mesa-progs() | ||
83 | { | ||
84 | DESCRIPTION="Mesa3D OpenGL graphics applications." | ||
85 | PCATEGORIE="x11-apps" | ||
86 | |||
87 | DEPEND="${MESA_PROGS_DEPEND}" | ||
88 | |||
89 | unset postinstall | ||
90 | } | ||
91 | |||
92 | src_prepare() | ||
93 | { | ||
94 | munpack ${SRCFILE} || die | ||
95 | niro | 6401 | all-abis oldmunpack ${PROGS_SRCFILE} && mv ${SRCDIR}/* ${SRCDIR}-$(mabi)/ || die |
96 | niro | 6397 | |
97 | # no debug code in the drives (gentoo) | ||
98 | all-abis 'find src/mesa/drivers/dri -name *.[hc] -exec egrep -l "\#define\W+DO_DEBUG\W+1" {} \; | xargs sed -i -re "s/\#define\W+DO_DEBUG\W+1/\#define DO_DEBUG 0/" ;' | ||
99 | |||
100 | # get rid of glut includes | ||
101 | all-abis rm -f include/GL/glut*h || die | ||
102 | } | ||
103 | |||
104 | src_compile() | ||
105 | { | ||
106 | # gallium is highly experimental, disabled atm! | ||
107 | mconfigure \ | ||
108 | --with-driver=dri \ | ||
109 | --with-dri-driverdir=/usr/'$(mlibdir)'/dri \ | ||
110 | --disable-debug \ | ||
111 | --disable-glut \ | ||
112 | --disable-ttm-api \ | ||
113 | --without-demos \ | ||
114 | --enable-glx-tls \ | ||
115 | --enable-asm \ | ||
116 | --enable-xcb \ | ||
117 | --enable-glw \ | ||
118 | --disable-gallium \ | ||
119 | || die | ||
120 | |||
121 | # only build software renderer on multilib arches | ||
122 | if [[ ${ARCH} = x86_64 ]] | ||
123 | then | ||
124 | only-m32 "echo 'DRI_DIRS =' >> configs/autoconf" || die | ||
125 | fi | ||
126 | |||
127 | mmake || die | ||
128 | |||
129 | cd ${SRCDIR}/progs/xdemos | ||
130 | mmake glxinfo || die | ||
131 | mmake glxgears || die | ||
132 | } | ||
133 | |||
134 | src_install_mesa() | ||
135 | { | ||
136 | # needed directories | ||
137 | minstalldir /etc/env.d || die | ||
138 | |||
139 | mmake DESTDIR=${BINDIR} install || die | ||
140 | |||
141 | # missing gl headers | ||
142 | minstallfile src/glw/GLwDrawA.h /usr/include/GL || die | ||
143 | |||
144 | # remove private headers | ||
145 | rm -f ${BINDIR}/usr/include/GL/GLw*P.h || die | ||
146 | |||
147 | for abi in ${MULTILIB_ABIS} | ||
148 | do | ||
149 | [[ ${abi} = m32 ]] && ABI_LIBDIR="lib" | ||
150 | [[ ${abi} = m64 ]] && ABI_LIBDIR="lib64" | ||
151 | cd ${SRCDIR}-${abi} | ||
152 | |||
153 | # fix opengl-symlinks | ||
154 | # first remove invalid symlinks | ||
155 | find ${BINDIR}/usr/$(mlibdir) -name libGL\.* -type l | xargs rm -f | ||
156 | # now create required opengl-symlinks | ||
157 | mlink libGL.so.1.2 /usr/$(mlibdir)/libGL.so || die | ||
158 | mlink libGL.so.1.2 /usr/$(mlibdir)/libGL.so.1 || die | ||
159 | |||
160 | # now setup dynamic opengl | ||
161 | minstalldir /usr/$(mlibdir)/opengl/xorg/lib || die | ||
162 | minstalldir /usr/$(mlibdir)/opengl/xorg/extensions || die | ||
163 | minstalldir /usr/$(mlibdir)/opengl/xorg/include || die | ||
164 | |||
165 | local x | ||
166 | for x in ${BINDIR}/usr/$(mlibdir)/libGL.so* \ | ||
167 | ${BINDIR}/usr/$(mlibdir)/libGL.la \ | ||
168 | ${BINDIR}/usr/$(mlibdir)/libGL.a | ||
169 | do | ||
170 | if [ -f ${x} -o -L ${x} ] | ||
171 | then | ||
172 | # libGL.a cause problems with tuxracer, etc | ||
173 | mv -f ${x} ${BINDIR}/usr/$(mlibdir)/opengl/xorg/lib || die "${x}" | ||
174 | fi | ||
175 | done | ||
176 | for x in ${BINDIR}/usr/include/GL/{gl.h,glx.h,glext.h,glxext.h} | ||
177 | do | ||
178 | if [ -f ${x} -o -L ${x} ] | ||
179 | then | ||
180 | mv -f ${x} ${BINDIR}/usr/$(mlibdir)/opengl/xorg/include || die "${x}" | ||
181 | fi | ||
182 | done | ||
183 | |||
184 | # satisfy libtool | ||
185 | minstallfile -s libGLU.la /usr/$(mlibdir) || die | ||
186 | minstallfile -s libGL.la /usr/$(mlibdir)/opengl/xorg/lib || die | ||
187 | |||
188 | # fix libdir on 64bit arches | ||
189 | if [[ $(mlibdir) != lib ]] | ||
190 | then | ||
191 | sed -i "s:/usr/lib:/usr/$(mlibdir):g" ${BINDIR}/usr/$(mlibdir)/libGLU.la || die | ||
192 | sed -i "s:/usr/lib:/usr/$(mlibdir):g" ${BINDIR}/usr/$(mlibdir)/opengl/xorg/lib/libGL.la || die | ||
193 | fi | ||
194 | |||
195 | # create the two-number versioned libs (.so.#.#), since only .so.# and | ||
196 | # .so.#.#.# were made | ||
197 | local x | ||
198 | for x in ${BINDIR}/usr/$(mlibdir)/libGLU.so.*.*.* \ | ||
199 | ${BINDIR}/usr/$(mlibdir)/libGLw.so.*.*.* | ||
200 | do | ||
201 | local lib_name_dot3="$(basename $(ls ${x}))" | ||
202 | local lib_name_dot2="${lib_name_dot3%.*}" | ||
203 | local lib_name_dot1="${lib_name_dot2%.*}" | ||
204 | local lib_name_dot0="${lib_name_dot1%.*}" | ||
205 | mlink ${lib_name_dot3} /usr/$(mlibdir)/${lib_name_dot2} || die "${x}" | ||
206 | mlink ${lib_name_dot3} /usr/$(mlibdir)/${lib_name_dot1} || die "${x}" | ||
207 | mlink ${lib_name_dot3} /usr/$(mlibdir)/${lib_name_dot0} || die "${x}" | ||
208 | done | ||
209 | |||
210 | # export LIBGL_DRIVER_PATH location. | ||
211 | # we are using '/usr/lib/dri' as hardcoded location. | ||
212 | # but nvidia and ati are using '/usr/$(mlibdir)/xorg/modules/dri' | ||
213 | # LIBGL_DRIVER_PATH overwrites the hardcoded location and | ||
214 | # if nvidia or ati driver are installed | ||
215 | # the dri modules will never be found by libGL | ||
216 | # use "LIBGL_DEBUG=verbose glxinfo" to check this issue | ||
217 | echo "LIBGL_DRIVERS_PATH=/usr/$(mlibdir)/dri" > ${BINDIR}/etc/env.d/09mesa-${abi} || die | ||
218 | done | ||
219 | } | ||
220 | |||
221 | src_install_mesa-progs() | ||
222 | { | ||
223 | cd ${SRCDIR}/progs/xdemos | ||
224 | |||
225 | minstallexec glxgears || die | ||
226 | minstallexec glxinfo || die | ||
227 | } |