Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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