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