Contents of /branches/magellan-next/core/mesa/mesa-7.8.2-r2.smage2
Parent Directory | Revision Log
Revision 6397 -
(show annotations)
(download)
Mon Aug 23 10:59:49 2010 UTC (13 years, 8 months ago) by niro
File size: 5909 byte(s)
Mon Aug 23 10:59:49 2010 UTC (13 years, 8 months ago) by niro
File size: 5909 byte(s)
-split-package; mesa-progs now included
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="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 | PROGS_SRCFILE="MesaDemos-${PVER/_/-}.tar.gz" |
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 | |
96 | # no debug code in the drives (gentoo) |
97 | 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/" ;' |
98 | |
99 | # get rid of glut includes |
100 | all-abis rm -f include/GL/glut*h || die |
101 | } |
102 | |
103 | src_compile() |
104 | { |
105 | # gallium is highly experimental, disabled atm! |
106 | mconfigure \ |
107 | --with-driver=dri \ |
108 | --with-dri-driverdir=/usr/'$(mlibdir)'/dri \ |
109 | --disable-debug \ |
110 | --disable-glut \ |
111 | --disable-ttm-api \ |
112 | --without-demos \ |
113 | --enable-glx-tls \ |
114 | --enable-asm \ |
115 | --enable-xcb \ |
116 | --enable-glw \ |
117 | --disable-gallium \ |
118 | || die |
119 | |
120 | # only build software renderer on multilib arches |
121 | if [[ ${ARCH} = x86_64 ]] |
122 | then |
123 | only-m32 "echo 'DRI_DIRS =' >> configs/autoconf" || die |
124 | fi |
125 | |
126 | mmake || die |
127 | |
128 | cd ${SRCDIR}/progs/xdemos |
129 | mmake glxinfo || die |
130 | mmake glxgears || die |
131 | } |
132 | |
133 | src_install_mesa() |
134 | { |
135 | # needed directories |
136 | minstalldir /etc/env.d || die |
137 | |
138 | mmake DESTDIR=${BINDIR} install || die |
139 | |
140 | # missing gl headers |
141 | minstallfile src/glw/GLwDrawA.h /usr/include/GL || die |
142 | |
143 | # remove private headers |
144 | rm -f ${BINDIR}/usr/include/GL/GLw*P.h || die |
145 | |
146 | for abi in ${MULTILIB_ABIS} |
147 | do |
148 | [[ ${abi} = m32 ]] && ABI_LIBDIR="lib" |
149 | [[ ${abi} = m64 ]] && ABI_LIBDIR="lib64" |
150 | cd ${SRCDIR}-${abi} |
151 | |
152 | # fix opengl-symlinks |
153 | # first remove invalid symlinks |
154 | find ${BINDIR}/usr/$(mlibdir) -name libGL\.* -type l | xargs rm -f |
155 | # now create required opengl-symlinks |
156 | mlink libGL.so.1.2 /usr/$(mlibdir)/libGL.so || die |
157 | mlink libGL.so.1.2 /usr/$(mlibdir)/libGL.so.1 || die |
158 | |
159 | # now setup dynamic opengl |
160 | minstalldir /usr/$(mlibdir)/opengl/xorg/lib || die |
161 | minstalldir /usr/$(mlibdir)/opengl/xorg/extensions || die |
162 | minstalldir /usr/$(mlibdir)/opengl/xorg/include || die |
163 | |
164 | local x |
165 | for x in ${BINDIR}/usr/$(mlibdir)/libGL.so* \ |
166 | ${BINDIR}/usr/$(mlibdir)/libGL.la \ |
167 | ${BINDIR}/usr/$(mlibdir)/libGL.a |
168 | do |
169 | if [ -f ${x} -o -L ${x} ] |
170 | then |
171 | # libGL.a cause problems with tuxracer, etc |
172 | mv -f ${x} ${BINDIR}/usr/$(mlibdir)/opengl/xorg/lib || die "${x}" |
173 | fi |
174 | done |
175 | for x in ${BINDIR}/usr/include/GL/{gl.h,glx.h,glext.h,glxext.h} |
176 | do |
177 | if [ -f ${x} -o -L ${x} ] |
178 | then |
179 | mv -f ${x} ${BINDIR}/usr/$(mlibdir)/opengl/xorg/include || die "${x}" |
180 | fi |
181 | done |
182 | |
183 | # satisfy libtool |
184 | minstallfile -s libGLU.la /usr/$(mlibdir) || die |
185 | minstallfile -s libGL.la /usr/$(mlibdir)/opengl/xorg/lib || die |
186 | |
187 | # fix libdir on 64bit arches |
188 | if [[ $(mlibdir) != lib ]] |
189 | then |
190 | sed -i "s:/usr/lib:/usr/$(mlibdir):g" ${BINDIR}/usr/$(mlibdir)/libGLU.la || die |
191 | sed -i "s:/usr/lib:/usr/$(mlibdir):g" ${BINDIR}/usr/$(mlibdir)/opengl/xorg/lib/libGL.la || die |
192 | fi |
193 | |
194 | # create the two-number versioned libs (.so.#.#), since only .so.# and |
195 | # .so.#.#.# were made |
196 | local x |
197 | for x in ${BINDIR}/usr/$(mlibdir)/libGLU.so.*.*.* \ |
198 | ${BINDIR}/usr/$(mlibdir)/libGLw.so.*.*.* |
199 | do |
200 | local lib_name_dot3="$(basename $(ls ${x}))" |
201 | local lib_name_dot2="${lib_name_dot3%.*}" |
202 | local lib_name_dot1="${lib_name_dot2%.*}" |
203 | local lib_name_dot0="${lib_name_dot1%.*}" |
204 | mlink ${lib_name_dot3} /usr/$(mlibdir)/${lib_name_dot2} || die "${x}" |
205 | mlink ${lib_name_dot3} /usr/$(mlibdir)/${lib_name_dot1} || die "${x}" |
206 | mlink ${lib_name_dot3} /usr/$(mlibdir)/${lib_name_dot0} || die "${x}" |
207 | done |
208 | |
209 | # export LIBGL_DRIVER_PATH location. |
210 | # we are using '/usr/lib/dri' as hardcoded location. |
211 | # but nvidia and ati are using '/usr/$(mlibdir)/xorg/modules/dri' |
212 | # LIBGL_DRIVER_PATH overwrites the hardcoded location and |
213 | # if nvidia or ati driver are installed |
214 | # the dri modules will never be found by libGL |
215 | # use "LIBGL_DEBUG=verbose glxinfo" to check this issue |
216 | echo "LIBGL_DRIVERS_PATH=/usr/$(mlibdir)/dri" > ${BINDIR}/etc/env.d/09mesa-${abi} || die |
217 | done |
218 | } |
219 | |
220 | src_install_mesa-progs() |
221 | { |
222 | cd ${SRCDIR}/progs/xdemos |
223 | |
224 | minstallexec glxgears || die |
225 | minstallexec glxinfo || die |
226 | } |