Magellan Linux

Contents of /branches/magellan-next/core/mesa/mesa-7.8.2-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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