Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 582 - (hide annotations) (download)
Wed Oct 13 20:38:29 2010 UTC (13 years, 7 months ago) by niro
File size: 5120 byte(s)
-disable-egl
1 niro 567 # $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 niro 581 sminclude xorg mtools multilib mcore-split
43 niro 567
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 niro 581 --disable-xcb \
82 niro 567 --enable-glw \
83     --disable-gallium \
84 niro 582 --disable-egl \
85 niro 567 || die
86    
87     # only build software renderer on multilib arches
88     if [[ ${ARCH} = x86_64 ]]
89     then
90     only-m32 "echo 'DRI_DIRS =' >> configs/autoconf" || die
91     fi
92    
93     mmake || die
94     }
95    
96     src_install()
97     {
98     # needed directories
99     minstalldir /etc/env.d || die
100    
101     mmake DESTDIR=${BINDIR} install || die
102    
103     # missing gl headers
104     minstallfile src/glw/GLwDrawA.h /usr/include/GL || die
105    
106     # remove private headers
107     rm -f ${BINDIR}/usr/include/GL/GLw*P.h || die
108    
109     for abi in ${MULTILIB_ABIS}
110     do
111     [[ ${abi} = m32 ]] && ABI_LIBDIR="lib"
112     [[ ${abi} = m64 ]] && ABI_LIBDIR="lib64"
113     cd ${SRCDIR}-${abi}
114    
115     # fix opengl-symlinks
116     # first remove invalid symlinks
117     find ${BINDIR}/usr/$(mlibdir) -name libGL\.* -type l | xargs rm -f
118     # now create required opengl-symlinks
119     mlink libGL.so.1.2 /usr/$(mlibdir)/libGL.so || die
120     mlink libGL.so.1.2 /usr/$(mlibdir)/libGL.so.1 || die
121    
122     # now setup dynamic opengl
123     minstalldir /usr/$(mlibdir)/opengl/xorg/lib || die
124     minstalldir /usr/$(mlibdir)/opengl/xorg/extensions || die
125     minstalldir /usr/$(mlibdir)/opengl/xorg/include || die
126    
127     local x
128     for x in ${BINDIR}/usr/$(mlibdir)/libGL.so* \
129     ${BINDIR}/usr/$(mlibdir)/libGL.la \
130     ${BINDIR}/usr/$(mlibdir)/libGL.a
131     do
132     if [ -f ${x} -o -L ${x} ]
133     then
134     # libGL.a cause problems with tuxracer, etc
135     mv -f ${x} ${BINDIR}/usr/$(mlibdir)/opengl/xorg/lib || die "${x}"
136     fi
137     done
138     for x in ${BINDIR}/usr/include/GL/{gl.h,glx.h,glext.h,glxext.h}
139     do
140     if [ -f ${x} -o -L ${x} ]
141     then
142     mv -f ${x} ${BINDIR}/usr/$(mlibdir)/opengl/xorg/include || die "${x}"
143     fi
144     done
145    
146     # satisfy libtool
147     minstallfile -s libGLU.la /usr/$(mlibdir) || die
148     minstallfile -s libGL.la /usr/$(mlibdir)/opengl/xorg/lib || die
149    
150     # fix libdir on 64bit arches
151     if [[ $(mlibdir) != lib ]]
152     then
153     sed -i "s:/usr/lib:/usr/$(mlibdir):g" ${BINDIR}/usr/$(mlibdir)/libGLU.la || die
154     sed -i "s:/usr/lib:/usr/$(mlibdir):g" ${BINDIR}/usr/$(mlibdir)/opengl/xorg/lib/libGL.la || die
155     fi
156    
157     # create the two-number versioned libs (.so.#.#), since only .so.# and
158     # .so.#.#.# were made
159     local x
160     for x in ${BINDIR}/usr/$(mlibdir)/libGLU.so.*.*.* \
161     ${BINDIR}/usr/$(mlibdir)/libGLw.so.*.*.*
162     do
163     local lib_name_dot3="$(basename $(ls ${x}))"
164     local lib_name_dot2="${lib_name_dot3%.*}"
165     local lib_name_dot1="${lib_name_dot2%.*}"
166     local lib_name_dot0="${lib_name_dot1%.*}"
167     mlink ${lib_name_dot3} /usr/$(mlibdir)/${lib_name_dot2} || die "${x}"
168     mlink ${lib_name_dot3} /usr/$(mlibdir)/${lib_name_dot1} || die "${x}"
169     mlink ${lib_name_dot3} /usr/$(mlibdir)/${lib_name_dot0} || die "${x}"
170     done
171    
172     # export LIBGL_DRIVER_PATH location.
173     # we are using '/usr/lib/dri' as hardcoded location.
174     # but nvidia and ati are using '/usr/$(mlibdir)/xorg/modules/dri'
175     # LIBGL_DRIVER_PATH overwrites the hardcoded location and
176     # if nvidia or ati driver are installed
177     # the dri modules will never be found by libGL
178     # use "LIBGL_DEBUG=verbose glxinfo" to check this issue
179     echo "LIBGL_DRIVERS_PATH=/usr/$(mlibdir)/dri" > ${BINDIR}/etc/env.d/09mesa-${abi} || die
180     done
181     }
182    
183     postinstall()
184     {
185     ${MROOT}/usr/sbin/opengl-update --use-old xorg
186     }