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