Annotation of /trunk/extras/mesa/mesa-7.1-r1.smage2
Parent Directory | Revision Log
Revision 532 -
(hide annotations)
(download)
Thu Dec 25 16:18:08 2008 UTC (15 years, 5 months ago) by niro
File size: 4875 byte(s)
Thu Dec 25 16:18:08 2008 UTC (15 years, 5 months ago) by niro
File size: 4875 byte(s)
-import from cvs
1 | niro | 532 | # $Header: /magellan-cvs/smage/mesa/mesa-7.1-r1.smage2,v 1.2 2008/09/09 15:44:36 niro Exp $ |
2 | |||
3 | PNAME="mesa" | ||
4 | PVER="7.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 | sminclude xorg mtools multilib | ||
14 | |||
15 | DEPEND=">= dev-libs/expat-2 | ||
16 | >= x11-libs/libX11-1 | ||
17 | >= x11-libs/libXext-1 | ||
18 | >= x11-libs/libXxf86vm-1 | ||
19 | >= x11-libs/libXi-1 | ||
20 | >= x11-libs/libXmu-1 | ||
21 | >= x11-libs/libdrm-2.3.99 | ||
22 | >= x11-libs/libICE-1 | ||
23 | >= x11-base/opengl-update-magellan-2 | ||
24 | >= x11-libs/libxcb-1 | ||
25 | >= x11-libs/libXfixes-4 | ||
26 | >= x11-libs/libXdamage-1" | ||
27 | |||
28 | SDEPEND=">= dev-util/pkgconfig-0.23 | ||
29 | >= x11-misc/makedepend-1 | ||
30 | >= x11-proto/xf86vidmodeproto-1 | ||
31 | >= x11-proto/glproto-1.4 | ||
32 | >= x11-proto/inputproto-1 | ||
33 | >= x11-proto/xextproto-7 | ||
34 | >= x11-proto/xf86driproto-2 | ||
35 | >= x11-proto/printproto-1 | ||
36 | >= x11-proto/xcb-proto-1 | ||
37 | >= x11-proto/xproto-7 | ||
38 | >= x11-proto/fixesproto-4 | ||
39 | >= x11-proto/damageproto-1" | ||
40 | |||
41 | PROVIDE="virtual/opengl" | ||
42 | |||
43 | SRCFILE="MesaLib-${PVER/_/-}.tar.gz" | ||
44 | SRCDIR="${BUILDDIR}/Mesa-${PVER/_/-}" | ||
45 | |||
46 | SRC_URI=( | ||
47 | sourceforge://mesa3d/${SRCFILE} | ||
48 | mirror://${PNAME}/${SRCFILE} | ||
49 | mirror://${PNAME}/libGLU.la | ||
50 | mirror://${PNAME}/libGL.la | ||
51 | ) | ||
52 | |||
53 | EMUL_LINUX_32=true | ||
54 | |||
55 | src_prepare() | ||
56 | { | ||
57 | munpack ${SRCFILE} || die | ||
58 | |||
59 | # no debug code in the drives (gentoo) | ||
60 | 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/" ;' | ||
61 | |||
62 | # get rid of glut includes | ||
63 | all-abis rm -f include/GL/glut*h || die | ||
64 | } | ||
65 | |||
66 | src_compile() | ||
67 | { | ||
68 | mconfigure \ | ||
69 | --with-driver=dri \ | ||
70 | --with-dri-driverdir=/usr/'$(mlibdir)'/dri \ | ||
71 | --disable-debug \ | ||
72 | --disable-glut \ | ||
73 | --disable-ttm-api \ | ||
74 | --without-demos \ | ||
75 | --enable-glx-tls \ | ||
76 | --enable-asm \ | ||
77 | --enable-xcb \ | ||
78 | --enable-glw \ | ||
79 | || die | ||
80 | |||
81 | # only build software renderer on multilib arches | ||
82 | if [[ ${ARCH} = x86_64 ]] | ||
83 | then | ||
84 | only-m32 "echo 'DRI_DIRS =' >> configs/autoconf" || die | ||
85 | fi | ||
86 | |||
87 | mmake || die | ||
88 | } | ||
89 | |||
90 | src_install() | ||
91 | { | ||
92 | # needed directories | ||
93 | minstalldir /etc/env.d || die | ||
94 | |||
95 | mmake DESTDIR=${BINDIR} install || die | ||
96 | |||
97 | # missing gl headers | ||
98 | minstallfile src/glw/GLwDrawA.h /usr/include/GL || die | ||
99 | |||
100 | # remove private headers | ||
101 | rm -f ${BINDIR}/usr/include/GL/GLw*P.h || die | ||
102 | |||
103 | for abi in ${MULTILIB_ABIS} | ||
104 | do | ||
105 | [[ ${abi} = m32 ]] && ABI_LIBDIR="lib" | ||
106 | [[ ${abi} = m64 ]] && ABI_LIBDIR="lib64" | ||
107 | cd ${SRCDIR}-${abi} | ||
108 | |||
109 | # fix opengl-symlinks | ||
110 | # first remove invalid symlinks | ||
111 | find ${BINDIR}/usr/$(mlibdir) -name libGL\.* -type l | xargs rm -f | ||
112 | # now create required opengl-symlinks | ||
113 | mlink libGL.so.1.2 /usr/$(mlibdir)/libGL.so || die | ||
114 | mlink libGL.so.1.2 /usr/$(mlibdir)/libGL.so.1 || die | ||
115 | |||
116 | # now setup dynamic opengl | ||
117 | minstalldir /usr/$(mlibdir)/opengl/xorg/lib || die | ||
118 | minstalldir /usr/$(mlibdir)/opengl/xorg/extensions || die | ||
119 | minstalldir /usr/$(mlibdir)/opengl/xorg/include || die | ||
120 | |||
121 | local x | ||
122 | for x in ${BINDIR}/usr/$(mlibdir)/libGL.so* \ | ||
123 | ${BINDIR}/usr/$(mlibdir)/libGL.la \ | ||
124 | ${BINDIR}/usr/$(mlibdir)/libGL.a | ||
125 | do | ||
126 | if [ -f ${x} -o -L ${x} ] | ||
127 | then | ||
128 | # libGL.a cause problems with tuxracer, etc | ||
129 | mv -f ${x} ${BINDIR}/usr/$(mlibdir)/opengl/xorg/lib || die "${x}" | ||
130 | fi | ||
131 | done | ||
132 | for x in ${BINDIR}/usr/include/GL/{gl.h,glx.h,glext.h,glxext.h} | ||
133 | do | ||
134 | if [ -f ${x} -o -L ${x} ] | ||
135 | then | ||
136 | mv -f ${x} ${BINDIR}/usr/$(mlibdir)/opengl/xorg/include || die "${x}" | ||
137 | fi | ||
138 | done | ||
139 | |||
140 | # satisfy libtool | ||
141 | minstallfile -s libGLU.la /usr/$(mlibdir) || die | ||
142 | minstallfile -s libGL.la /usr/$(mlibdir)/opengl/xorg/lib || die | ||
143 | |||
144 | # fix libdir on 64bit arches | ||
145 | if [[ $(mlibdir) != lib ]] | ||
146 | then | ||
147 | sed -i "s:/usr/lib:/usr/$(mlibdir):g" ${BINDIR}/usr/$(mlibdir)/libGLU.la || die | ||
148 | sed -i "s:/usr/lib:/usr/$(mlibdir):g" ${BINDIR}/usr/$(mlibdir)/opengl/xorg/lib/libGL.la || die | ||
149 | fi | ||
150 | |||
151 | # create the two-number versioned libs (.so.#.#), since only .so.# and | ||
152 | # .so.#.#.# were made | ||
153 | local x | ||
154 | for x in ${BINDIR}/usr/$(mlibdir)/libGLU.so.*.*.* \ | ||
155 | ${BINDIR}/usr/$(mlibdir)/libGLw.so.*.*.* | ||
156 | do | ||
157 | local lib_name_dot3="$(basename $(ls ${x}))" | ||
158 | local lib_name_dot2="${lib_name_dot3%.*}" | ||
159 | local lib_name_dot1="${lib_name_dot2%.*}" | ||
160 | local lib_name_dot0="${lib_name_dot1%.*}" | ||
161 | mlink ${lib_name_dot3} /usr/$(mlibdir)/${lib_name_dot2} || die "${x}" | ||
162 | mlink ${lib_name_dot3} /usr/$(mlibdir)/${lib_name_dot1} || die "${x}" | ||
163 | mlink ${lib_name_dot3} /usr/$(mlibdir)/${lib_name_dot0} || die "${x}" | ||
164 | done | ||
165 | |||
166 | # export LIBGL_DRIVER_PATH location. | ||
167 | # we are using '/usr/lib/dri' as hardcoded location. | ||
168 | # but nvidia and ati are using '/usr/$(mlibdir)/xorg/modules/dri' | ||
169 | # LIBGL_DRIVER_PATH overwrites the hardcoded location and | ||
170 | # if nvidia or ati driver are installed | ||
171 | # the dri modules will never be found by libGL | ||
172 | # use "LIBGL_DEBUG=verbose glxinfo" to check this issue | ||
173 | echo "LIBGL_DRIVERS_PATH=/usr/$(mlibdir)/dri" > ${BINDIR}/etc/env.d/09mesa-${abi} || die | ||
174 | done | ||
175 | } | ||
176 | |||
177 | postinstall() | ||
178 | { | ||
179 | ${MROOT}/usr/sbin/opengl-update --use-old xorg | ||
180 | } |
Properties
Name | Value |
---|---|
svn:keywords | Id |