Magellan Linux

Contents of /smage/trunk/extras/mesa/mesa-7.8.1-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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