Magellan Linux

Contents of /trunk/core/mesa/mesa-7.4.1-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

Name Value
svn:keywords Id