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