Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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