Contents of /branches/magellan-0_10_0/core/mesa/mesa-7.4.2-r1.smage2
Parent Directory | Revision Log
Revision 3000 -
(show annotations)
(download)
Mon Oct 5 18:47:41 2009 UTC (14 years, 11 months ago) by niro
File size: 4927 byte(s)
Mon Oct 5 18:47:41 2009 UTC (14 years, 11 months ago) by niro
File size: 4927 byte(s)
created branch 'magellan-0_10_0'
1 | # $Id$ |
2 | |
3 | PNAME="mesa" |
4 | PVER="7.4.2" |
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-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/xcb-proto-1 |
35 | >= x11-proto/xproto-7 |
36 | >= x11-proto/fixesproto-4 |
37 | >= x11-proto/damageproto-1" |
38 | |
39 | PROVIDE="virtual/opengl" |
40 | |
41 | # must be set before the include of multilib! |
42 | EMUL_LINUX_32=true |
43 | sminclude xorg mtools multilib |
44 | |
45 | # must be set *after* the include of xorg! |
46 | SRCFILE="MesaLib-${PVER/_/-}.tar.gz" |
47 | SRCDIR="${BUILDDIR}/Mesa-${PVER/_/-}" |
48 | |
49 | SRC_URI=( |
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 | mconfigure \ |
72 | --with-driver=dri \ |
73 | --with-dri-driverdir=/usr/'$(mlibdir)'/dri \ |
74 | --disable-debug \ |
75 | --disable-glut \ |
76 | --disable-ttm-api \ |
77 | --without-demos \ |
78 | --enable-glx-tls \ |
79 | --enable-asm \ |
80 | --enable-xcb \ |
81 | --enable-glw \ |
82 | || die |
83 | |
84 | # only build software renderer on multilib arches |
85 | if [[ ${ARCH} = x86_64 ]] |
86 | then |
87 | only-m32 "echo 'DRI_DIRS =' >> configs/autoconf" || die |
88 | fi |
89 | |
90 | mmake || die |
91 | } |
92 | |
93 | src_install() |
94 | { |
95 | # needed directories |
96 | minstalldir /etc/env.d || die |
97 | |
98 | mmake DESTDIR=${BINDIR} install || die |
99 | |
100 | # missing gl headers |
101 | minstallfile src/glw/GLwDrawA.h /usr/include/GL || die |
102 | |
103 | # remove private headers |
104 | rm -f ${BINDIR}/usr/include/GL/GLw*P.h || die |
105 | |
106 | for abi in ${MULTILIB_ABIS} |
107 | do |
108 | [[ ${abi} = m32 ]] && ABI_LIBDIR="lib" |
109 | [[ ${abi} = m64 ]] && ABI_LIBDIR="lib64" |
110 | cd ${SRCDIR}-${abi} |
111 | |
112 | # fix opengl-symlinks |
113 | # first remove invalid symlinks |
114 | find ${BINDIR}/usr/$(mlibdir) -name libGL\.* -type l | xargs rm -f |
115 | # now create required opengl-symlinks |
116 | mlink libGL.so.1.2 /usr/$(mlibdir)/libGL.so || die |
117 | mlink libGL.so.1.2 /usr/$(mlibdir)/libGL.so.1 || die |
118 | |
119 | # now setup dynamic opengl |
120 | minstalldir /usr/$(mlibdir)/opengl/xorg/lib || die |
121 | minstalldir /usr/$(mlibdir)/opengl/xorg/extensions || die |
122 | minstalldir /usr/$(mlibdir)/opengl/xorg/include || die |
123 | |
124 | local x |
125 | for x in ${BINDIR}/usr/$(mlibdir)/libGL.so* \ |
126 | ${BINDIR}/usr/$(mlibdir)/libGL.la \ |
127 | ${BINDIR}/usr/$(mlibdir)/libGL.a |
128 | do |
129 | if [ -f ${x} -o -L ${x} ] |
130 | then |
131 | # libGL.a cause problems with tuxracer, etc |
132 | mv -f ${x} ${BINDIR}/usr/$(mlibdir)/opengl/xorg/lib || die "${x}" |
133 | fi |
134 | done |
135 | for x in ${BINDIR}/usr/include/GL/{gl.h,glx.h,glext.h,glxext.h} |
136 | do |
137 | if [ -f ${x} -o -L ${x} ] |
138 | then |
139 | mv -f ${x} ${BINDIR}/usr/$(mlibdir)/opengl/xorg/include || die "${x}" |
140 | fi |
141 | done |
142 | |
143 | # satisfy libtool |
144 | minstallfile -s libGLU.la /usr/$(mlibdir) || die |
145 | minstallfile -s libGL.la /usr/$(mlibdir)/opengl/xorg/lib || die |
146 | |
147 | # fix libdir on 64bit arches |
148 | if [[ $(mlibdir) != lib ]] |
149 | then |
150 | sed -i "s:/usr/lib:/usr/$(mlibdir):g" ${BINDIR}/usr/$(mlibdir)/libGLU.la || die |
151 | sed -i "s:/usr/lib:/usr/$(mlibdir):g" ${BINDIR}/usr/$(mlibdir)/opengl/xorg/lib/libGL.la || die |
152 | fi |
153 | |
154 | # create the two-number versioned libs (.so.#.#), since only .so.# and |
155 | # .so.#.#.# were made |
156 | local x |
157 | for x in ${BINDIR}/usr/$(mlibdir)/libGLU.so.*.*.* \ |
158 | ${BINDIR}/usr/$(mlibdir)/libGLw.so.*.*.* |
159 | do |
160 | local lib_name_dot3="$(basename $(ls ${x}))" |
161 | local lib_name_dot2="${lib_name_dot3%.*}" |
162 | local lib_name_dot1="${lib_name_dot2%.*}" |
163 | local lib_name_dot0="${lib_name_dot1%.*}" |
164 | mlink ${lib_name_dot3} /usr/$(mlibdir)/${lib_name_dot2} || die "${x}" |
165 | mlink ${lib_name_dot3} /usr/$(mlibdir)/${lib_name_dot1} || die "${x}" |
166 | mlink ${lib_name_dot3} /usr/$(mlibdir)/${lib_name_dot0} || die "${x}" |
167 | done |
168 | |
169 | # export LIBGL_DRIVER_PATH location. |
170 | # we are using '/usr/lib/dri' as hardcoded location. |
171 | # but nvidia and ati are using '/usr/$(mlibdir)/xorg/modules/dri' |
172 | # LIBGL_DRIVER_PATH overwrites the hardcoded location and |
173 | # if nvidia or ati driver are installed |
174 | # the dri modules will never be found by libGL |
175 | # use "LIBGL_DEBUG=verbose glxinfo" to check this issue |
176 | echo "LIBGL_DRIVERS_PATH=/usr/$(mlibdir)/dri" > ${BINDIR}/etc/env.d/09mesa-${abi} || die |
177 | done |
178 | } |
179 | |
180 | postinstall() |
181 | { |
182 | ${MROOT}/usr/sbin/opengl-update --use-old xorg |
183 | } |
Properties
Name | Value |
---|---|
svn:keywords | Id |