Contents of /branches/magellan-next/core/mesa/mesa-7.8.2-r3.smage2
Parent Directory | Revision Log
Revision 7214 -
(show annotations)
(download)
Thu Oct 7 18:33:51 2010 UTC (13 years, 7 months ago) by niro
File size: 6092 byte(s)
Thu Oct 7 18:33:51 2010 UTC (13 years, 7 months ago) by niro
File size: 6092 byte(s)
-force egl-support off
1 | # $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="r3" |
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 | PROGS_SRCFILE="MesaDemos-${PVER/_/-}.tar.bz2" |
51 | # 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 | all-abis "oldmunpack ${PROGS_SRCFILE} && cp -R ${SRCDIR}/* ${SRCDIR}-$(mabi)/" || die |
96 | |
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 | --disable-egl \ |
120 | || die |
121 | |
122 | # only build software renderer on multilib arches |
123 | if [[ ${ARCH} = x86_64 ]] |
124 | then |
125 | only-m32 "echo 'DRI_DIRS =' >> configs/autoconf" || die |
126 | fi |
127 | |
128 | mmake || die |
129 | |
130 | # build mesa-progs |
131 | mmake -C progs/xdemos glxinfo || die |
132 | mmake -C progs/xdemos glxgears || die |
133 | } |
134 | |
135 | src_install_mesa() |
136 | { |
137 | # needed directories |
138 | minstalldir /etc/env.d || die |
139 | |
140 | mmake DESTDIR=${BINDIR} install || die |
141 | |
142 | # missing gl headers |
143 | minstallfile src/glw/GLwDrawA.h /usr/include/GL || die |
144 | |
145 | # remove private headers |
146 | rm -f ${BINDIR}/usr/include/GL/GLw*P.h || die |
147 | |
148 | for abi in ${MULTILIB_ABIS} |
149 | do |
150 | [[ ${abi} = m32 ]] && ABI_LIBDIR="lib" |
151 | [[ ${abi} = m64 ]] && ABI_LIBDIR="lib64" |
152 | cd ${SRCDIR}-${abi} |
153 | |
154 | # fix opengl-symlinks |
155 | # first remove invalid symlinks |
156 | find ${BINDIR}/usr/$(mlibdir) -name libGL\.* -type l | xargs rm -f |
157 | # now create required opengl-symlinks |
158 | mlink libGL.so.1.2 /usr/$(mlibdir)/libGL.so || die |
159 | mlink libGL.so.1.2 /usr/$(mlibdir)/libGL.so.1 || die |
160 | |
161 | # now setup dynamic opengl |
162 | minstalldir /usr/$(mlibdir)/opengl/xorg/lib || die |
163 | minstalldir /usr/$(mlibdir)/opengl/xorg/extensions || die |
164 | minstalldir /usr/$(mlibdir)/opengl/xorg/include || die |
165 | |
166 | local x |
167 | for x in ${BINDIR}/usr/$(mlibdir)/libGL.so* \ |
168 | ${BINDIR}/usr/$(mlibdir)/libGL.la \ |
169 | ${BINDIR}/usr/$(mlibdir)/libGL.a |
170 | do |
171 | if [ -f ${x} -o -L ${x} ] |
172 | then |
173 | # libGL.a cause problems with tuxracer, etc |
174 | mv -f ${x} ${BINDIR}/usr/$(mlibdir)/opengl/xorg/lib || die "${x}" |
175 | fi |
176 | done |
177 | for x in ${BINDIR}/usr/include/GL/{gl.h,glx.h,glext.h,glxext.h} |
178 | do |
179 | if [ -f ${x} -o -L ${x} ] |
180 | then |
181 | mv -f ${x} ${BINDIR}/usr/$(mlibdir)/opengl/xorg/include || die "${x}" |
182 | fi |
183 | done |
184 | |
185 | # satisfy libtool |
186 | minstallfile -s libGLU.la /usr/$(mlibdir) || die |
187 | minstallfile -s libGL.la /usr/$(mlibdir)/opengl/xorg/lib || die |
188 | |
189 | # fix libdir on 64bit arches |
190 | if [[ $(mlibdir) != lib ]] |
191 | then |
192 | sed -i "s:/usr/lib:/usr/$(mlibdir):g" ${BINDIR}/usr/$(mlibdir)/libGLU.la || die |
193 | sed -i "s:/usr/lib:/usr/$(mlibdir):g" ${BINDIR}/usr/$(mlibdir)/opengl/xorg/lib/libGL.la || die |
194 | fi |
195 | |
196 | # create the two-number versioned libs (.so.#.#), since only .so.# and |
197 | # .so.#.#.# were made |
198 | local x |
199 | for x in ${BINDIR}/usr/$(mlibdir)/libGLU.so.*.*.* \ |
200 | ${BINDIR}/usr/$(mlibdir)/libGLw.so.*.*.* |
201 | do |
202 | local lib_name_dot3="$(basename $(ls ${x}))" |
203 | local lib_name_dot2="${lib_name_dot3%.*}" |
204 | local lib_name_dot1="${lib_name_dot2%.*}" |
205 | local lib_name_dot0="${lib_name_dot1%.*}" |
206 | mlink ${lib_name_dot3} /usr/$(mlibdir)/${lib_name_dot2} || die "${x}" |
207 | mlink ${lib_name_dot3} /usr/$(mlibdir)/${lib_name_dot1} || die "${x}" |
208 | mlink ${lib_name_dot3} /usr/$(mlibdir)/${lib_name_dot0} || die "${x}" |
209 | done |
210 | |
211 | # export LIBGL_DRIVER_PATH location. |
212 | # we are using '/usr/lib/dri' as hardcoded location. |
213 | # but nvidia and ati are using '/usr/$(mlibdir)/xorg/modules/dri' |
214 | # LIBGL_DRIVER_PATH overwrites the hardcoded location and |
215 | # if nvidia or ati driver are installed |
216 | # the dri modules will never be found by libGL |
217 | # use "LIBGL_DEBUG=verbose glxinfo" to check this issue |
218 | echo "LIBGL_DRIVERS_PATH=/usr/$(mlibdir)/dri" > ${BINDIR}/etc/env.d/09mesa-${abi} || die |
219 | done |
220 | } |
221 | |
222 | src_install_mesa-progs() |
223 | { |
224 | all-abis minstallexec ${SRCDIR}-$(mabi)/progs/xdemos/glxgears || die |
225 | all-abis minstallexec ${SRCDIR}-$(mabi)/progs/xdemos/glxinfo || die |
226 | } |