Gentoo Archives: gentoo-commits

From: "Luca Barbato (lu_zero)" <lu_zero@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in media-libs/mesa: ChangeLog mesa-8.0.3-r1.ebuild
Date: Tue, 05 Jun 2012 20:47:41
Message-Id: 20120605204731.21D9F2004B@flycatcher.gentoo.org
1 lu_zero 12/06/05 20:47:31
2
3 Modified: ChangeLog
4 Added: mesa-8.0.3-r1.ebuild
5 Log:
6 New revision to support new opengl-eselect layout
7
8 (Portage version: 2.2.0_alpha110/cvs/Linux x86_64)
9
10 Revision Changes Path
11 1.399 media-libs/mesa/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/mesa/ChangeLog?rev=1.399&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/mesa/ChangeLog?rev=1.399&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/mesa/ChangeLog?r1=1.398&r2=1.399
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/media-libs/mesa/ChangeLog,v
20 retrieving revision 1.398
21 retrieving revision 1.399
22 diff -u -r1.398 -r1.399
23 --- ChangeLog 1 Jun 2012 09:05:49 -0000 1.398
24 +++ ChangeLog 5 Jun 2012 20:47:31 -0000 1.399
25 @@ -1,6 +1,11 @@
26 # ChangeLog for media-libs/mesa
27 # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/media-libs/mesa/ChangeLog,v 1.398 2012/06/01 09:05:49 scarabeus Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/media-libs/mesa/ChangeLog,v 1.399 2012/06/05 20:47:31 lu_zero Exp $
30 +
31 +*mesa-8.0.3-r1 (05 Jun 2012)
32 +
33 + 05 Jun 2012; Luca Barbato <lu_zero@g.o> +mesa-8.0.3-r1.ebuild:
34 + New revision to support new opengl-eselect layout
35
36 01 Jun 2012; Tomáš Chvátal <scarabeus@g.o>
37 -files/eselect-mesa.conf.7.9, -files/eselect-mesa.conf.8.0,
38
39
40
41 1.1 media-libs/mesa/mesa-8.0.3-r1.ebuild
42
43 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/mesa/mesa-8.0.3-r1.ebuild?rev=1.1&view=markup
44 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/mesa/mesa-8.0.3-r1.ebuild?rev=1.1&content-type=text/plain
45
46 Index: mesa-8.0.3-r1.ebuild
47 ===================================================================
48 # Copyright 1999-2012 Gentoo Foundation
49 # Distributed under the terms of the GNU General Public License v2
50 # $Header: /var/cvsroot/gentoo-x86/media-libs/mesa/mesa-8.0.3-r1.ebuild,v 1.1 2012/06/05 20:47:31 lu_zero Exp $
51
52 EAPI=4
53
54 EGIT_REPO_URI="git://anongit.freedesktop.org/mesa/mesa"
55
56 if [[ ${PV} = 9999* ]]; then
57 GIT_ECLASS="git-2"
58 EXPERIMENTAL="true"
59 fi
60
61 inherit base autotools multilib flag-o-matic python toolchain-funcs ${GIT_ECLASS}
62
63 OPENGL_DIR="xorg-x11"
64
65 MY_PN="${PN/m/M}"
66 MY_P="${MY_PN}-${PV/_/-}"
67 MY_SRC_P="${MY_PN}Lib-${PV/_/-}"
68
69 FOLDER="${PV/_rc*/}"
70
71 DESCRIPTION="OpenGL-like graphic library for Linux"
72 HOMEPAGE="http://mesa3d.sourceforge.net/"
73
74 SRC_PATCHES="mirror://gentoo/${P}-gentoo-patches-02.tar.bz2"
75 if [[ $PV = 9999* ]]; then
76 SRC_URI="${SRC_PATCHES}"
77 else
78 SRC_URI="ftp://ftp.freedesktop.org/pub/mesa/${FOLDER}/${MY_SRC_P}.tar.bz2
79 ${SRC_PATCHES}"
80 fi
81
82 # Most of the code is MIT/X11.
83 # ralloc is LGPL-3
84 # GLES[2]/gl[2]{,ext,platform}.h are SGI-B-2.0
85 LICENSE="MIT LGPL-3 SGI-B-2.0"
86 SLOT="0"
87 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~ia64-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris"
88
89 INTEL_CARDS="i915 i965 intel"
90 RADEON_CARDS="r100 r200 r300 r600 radeon"
91 VIDEO_CARDS="${INTEL_CARDS} ${RADEON_CARDS} nouveau vmware"
92 for card in ${VIDEO_CARDS}; do
93 IUSE_VIDEO_CARDS+=" video_cards_${card}"
94 done
95
96 IUSE="${IUSE_VIDEO_CARDS}
97 bindist +classic d3d debug +egl g3dvl +gallium gbm gles1 gles2 +llvm +nptl openvg osmesa pax_kernel pic selinux shared-dricore +shared-glapi vdpau wayland xa xvmc kernel_FreeBSD"
98
99 REQUIRED_USE="
100 d3d? ( gallium )
101 g3dvl? ( gallium )
102 llvm? ( gallium )
103 openvg? ( egl gallium )
104 gbm? ( shared-glapi )
105 g3dvl? ( || ( vdpau xvmc ) )
106 vdpau? ( g3dvl )
107 xa? ( gallium )
108 xvmc? ( g3dvl )
109 video_cards_intel? ( || ( classic gallium ) )
110 video_cards_i915? ( || ( classic gallium ) )
111 video_cards_i965? ( classic )
112 video_cards_nouveau? ( || ( classic gallium ) )
113 video_cards_radeon? ( || ( classic gallium ) )
114 video_cards_r100? ( classic )
115 video_cards_r200? ( classic )
116 video_cards_r300? ( gallium )
117 video_cards_r600? ( gallium )
118 video_cards_vmware? ( gallium )
119 "
120
121 LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.32"
122 # not a runtime dependency of this package, but dependency of packages which
123 # depend on this package, bug #342393
124 EXTERNAL_DEPEND="
125 >=x11-proto/dri2proto-2.6
126 >=x11-proto/glproto-1.4.15
127 "
128 # keep correct libdrm and dri2proto dep
129 # keep blocks in rdepend for binpkg
130 RDEPEND="${EXTERNAL_DEPEND}
131 !<x11-base/xorg-server-1.7
132 !<=x11-proto/xf86driproto-2.0.3
133 classic? ( app-admin/eselect-mesa )
134 gallium? ( app-admin/eselect-mesa )
135 >=app-admin/eselect-opengl-1.2.6
136 dev-libs/expat
137 gbm? ( sys-fs/udev )
138 >=x11-libs/libX11-1.3.99.901
139 x11-libs/libXdamage
140 x11-libs/libXext
141 x11-libs/libXxf86vm
142 >=x11-libs/libxcb-1.8
143 d3d? ( app-emulation/wine )
144 vdpau? ( >=x11-libs/libvdpau-0.4.1 )
145 wayland? ( dev-libs/wayland )
146 xvmc? ( >=x11-libs/libXvMC-1.0.6 )
147 ${LIBDRM_DEPSTRING}[video_cards_nouveau?,video_cards_vmware?]
148 video_cards_nouveau? ( <x11-libs/libdrm-2.4.34 )
149 "
150 for card in ${INTEL_CARDS}; do
151 RDEPEND="${RDEPEND}
152 video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
153 "
154 done
155
156 for card in ${RADEON_CARDS}; do
157 RDEPEND="${RDEPEND}
158 video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_radeon] )
159 "
160 done
161
162 DEPEND="${RDEPEND}
163 llvm? ( >=sys-devel/llvm-2.9 )
164 =dev-lang/python-2*
165 dev-libs/libxml2[python]
166 virtual/pkgconfig
167 sys-devel/bison
168 sys-devel/flex
169 x11-misc/makedepend
170 >=x11-proto/xextproto-7.0.99.1
171 x11-proto/xf86driproto
172 x11-proto/xf86vidmodeproto
173 "
174
175 S="${WORKDIR}/${MY_P}"
176
177 # It is slow without texrels, if someone wants slow
178 # mesa without texrels +pic use is worth the shot
179 QA_EXECSTACK="usr/lib*/opengl/xorg-x11/lib/libGL.so*"
180 QA_WX_LOAD="usr/lib*/opengl/xorg-x11/lib/libGL.so*"
181
182 # Think about: ggi, fbcon, no-X configs
183
184 pkg_setup() {
185 # workaround toc-issue wrt #386545
186 use ppc64 && append-flags -mminimal-toc
187 }
188
189 src_unpack() {
190 default
191 [[ $PV = 9999* ]] && git-2_src_unpack
192 }
193
194 src_prepare() {
195 # apply patches
196 if [[ ${PV} != 9999* && -n ${SRC_PATCHES} ]]; then
197 EPATCH_FORCE="yes" \
198 EPATCH_SOURCE="${WORKDIR}/patches" \
199 EPATCH_SUFFIX="patch" \
200 epatch
201 fi
202
203 # relax the requirement that r300 must have llvm, bug 380303
204 epatch "${FILESDIR}"/${PN}-8.0-dont-require-llvm-for-r300.patch
205
206 # fix for hardened pax_kernel, bug 240956
207 [[ ${PV} != 9999* ]] && epatch "${FILESDIR}"/glx_ro_text_segm.patch
208
209 # Solaris needs some recent POSIX stuff in our case
210 if [[ ${CHOST} == *-solaris* ]] ; then
211 sed -i -e "s/-DSVR4/-D_POSIX_C_SOURCE=200112L/" configure.ac || die
212 fi
213
214 # Tests fail against python-3, bug #407887
215 sed -i 's|/usr/bin/env python|/usr/bin/env python2|' src/glsl/tests/compare_ir || die
216
217 base_src_prepare
218
219 eautoreconf
220 }
221
222 src_configure() {
223 local myconf
224
225 if use classic; then
226 # Configurable DRI drivers
227 driver_enable swrast
228
229 # Intel code
230 driver_enable video_cards_i915 i915
231 driver_enable video_cards_i965 i965
232 if ! use video_cards_i915 && \
233 ! use video_cards_i965; then
234 driver_enable video_cards_intel i915 i965
235 fi
236
237 # Nouveau code
238 driver_enable video_cards_nouveau nouveau
239
240 # ATI code
241 driver_enable video_cards_r100 radeon
242 driver_enable video_cards_r200 r200
243 if ! use video_cards_r100 && \
244 ! use video_cards_r200; then
245 driver_enable video_cards_radeon radeon r200
246 fi
247 fi
248
249 if use egl; then
250 myconf+="
251 --with-egl-platforms=x11$(use wayland && echo ",wayland")$(use gbm && echo ",drm")
252 $(use_enable gallium gallium-egl)
253 "
254 fi
255
256 if use gallium; then
257 myconf+="
258 $(use_enable d3d d3d1x)
259 $(use_enable g3dvl gallium-g3dvl)
260 $(use_enable llvm gallium-llvm)
261 $(use_enable openvg)
262 $(use_enable vdpau)
263 $(use_enable xa)
264 $(use_enable xvmc)
265 "
266 gallium_enable swrast
267 gallium_enable video_cards_vmware svga
268 gallium_enable video_cards_nouveau nouveau
269 gallium_enable video_cards_i915 i915
270 if ! use video_cards_i915; then
271 gallium_enable video_cards_intel i915
272 fi
273
274 gallium_enable video_cards_r300 r300
275 gallium_enable video_cards_r600 r600
276 if ! use video_cards_r300 && \
277 ! use video_cards_r600; then
278 gallium_enable video_cards_radeon r300 r600
279 fi
280 fi
281
282 # x86 hardened pax_kernel needs glx-rts, bug 240956
283 if use pax_kernel; then
284 myconf+="
285 $(use_enable x86 glx-rts)
286 "
287 fi
288
289 econf \
290 --enable-dri \
291 --enable-glx \
292 $(use_enable !bindist texture-float) \
293 $(use_enable debug) \
294 $(use_enable egl) \
295 $(use_enable gbm) \
296 $(use_enable gles1) \
297 $(use_enable gles2) \
298 $(use_enable nptl glx-tls) \
299 $(use_enable osmesa) \
300 $(use_enable !pic asm) \
301 $(use_enable shared-dricore) \
302 $(use_enable shared-glapi) \
303 --with-dri-drivers=${DRI_DRIVERS} \
304 --with-gallium-drivers=${GALLIUM_DRIVERS} \
305 ${myconf}
306 }
307
308 src_install() {
309 base_src_install
310
311 if use !bindist; then
312 dodoc docs/patents.txt
313 fi
314
315 # Save the glsl-compiler for later use
316 if ! tc-is-cross-compiler; then
317 dobin "${S}"/src/glsl/glsl_compiler
318 fi
319
320 # Install config file for eselect mesa
321 insinto /usr/share/mesa
322 newins "${FILESDIR}/eselect-mesa.conf.8.0.1" eselect-mesa.conf
323
324 # Move libGL and others from /usr/lib to /usr/lib/opengl/blah/lib
325 # because user can eselect desired GL provider.
326 ebegin "Moving libGL and friends for dynamic switching"
327 local gl_dir="/usr/$(get_libdir)/opengl/${OPENGL_DIR}/"
328 local x
329 dodir ${gl_dir}/{lib,extensions,include/GL}
330 for x in "${ED}"/usr/$(get_libdir)/lib{EGL,GL*,OpenVG}.{la,a,so*}; do
331 if [ -f ${x} -o -L ${x} ]; then
332 mv -f "${x}" "${ED}"${gl_dir}/lib \
333 || die "Failed to move ${x}"
334 fi
335 done
336 for x in "${ED}"/usr/include/GL/{gl.h,glx.h,glext.h,glxext.h}; do
337 if [ -f ${x} -o -L ${x} ]; then
338 mv -f "${x}" "${ED}"${gl_dir}/include/GL/ \
339 || die "Failed to move ${x}"
340 fi
341 done
342 mv "${ED}"/usr/include/{EGL,GLES*,VG,KHR}/ "${ED}"/${gl_dir}/include \
343 || die "Failed to move headers"
344 eend $?
345
346 if use classic || use gallium; then
347 ebegin "Moving DRI/Gallium drivers for dynamic switching"
348 local gallium_drivers=( i915_dri.so i965_dri.so r300_dri.so r600_dri.so swrast_dri.so )
349 keepdir /usr/$(get_libdir)/dri
350 dodir /usr/$(get_libdir)/mesa
351 for x in ${gallium_drivers[@]}; do
352 if [ -f "${S}/$(get_libdir)/gallium/${x}" ]; then
353 mv -f "${ED}/usr/$(get_libdir)/dri/${x}" "${ED}/usr/$(get_libdir)/dri/${x/_dri.so/g_dri.so}" \
354 || die "Failed to move ${x}"
355 insinto "/usr/$(get_libdir)/dri/"
356 if [ -f "${S}/$(get_libdir)/${x}" ]; then
357 insopts -m0755
358 doins "${S}/$(get_libdir)/${x}"
359 fi
360 fi
361 done
362 for x in "${ED}"/usr/$(get_libdir)/dri/*.so; do
363 if [ -f ${x} -o -L ${x} ]; then
364 mv -f "${x}" "${x/dri/mesa}" \
365 || die "Failed to move ${x}"
366 fi
367 done
368 pushd "${ED}"/usr/$(get_libdir)/dri || die "pushd failed"
369 ln -s ../mesa/*.so . || die "Creating symlink failed"
370 # remove symlinks to drivers known to eselect
371 for x in ${gallium_drivers[@]}; do
372 if [ -f ${x} -o -L ${x} ]; then
373 rm "${x}" || die "Failed to remove ${x}"
374 fi
375 done
376 popd
377 eend $?
378 fi
379 }
380
381 pkg_postinst() {
382 # Switch to the xorg implementation.
383 echo
384 eselect opengl set --use-old ${OPENGL_DIR}
385
386 # switch to xorg-x11 and back if necessary, bug #374647 comment 11
387 OLD_IMPLEM="$(eselect opengl show)"
388 if [[ ${OPENGL_DIR}x != ${OLD_IMPLEM}x ]]; then
389 eselect opengl set ${OPENGL_DIR}
390 eselect opengl set ${OLD_IMPLEM}
391 fi
392
393 # Select classic/gallium drivers
394 if use classic || use gallium; then
395 eselect mesa set --auto
396 fi
397
398 # warn about patent encumbered texture-float
399 if use !bindist; then
400 elog "USE=\"bindist\" was not set. Potentially patent encumbered code was"
401 elog "enabled. Please see patents.txt for an explanation."
402 fi
403
404 local using_radeon r_flag
405 for r_flag in ${RADEON_CARDS}; do
406 if use video_cards_${r_flag}; then
407 using_radeon=1
408 break
409 fi
410 done
411
412 if [[ ${using_radeon} = 1 ]] && ! has_version media-libs/libtxc_dxtn; then
413 elog "Note that in order to have full S3TC support, it is necessary to install"
414 elog "media-libs/libtxc_dxtn as well. This may be necessary to get nice"
415 elog "textures in some apps, and some others even require this to run."
416 fi
417 }
418
419 # $1 - VIDEO_CARDS flag
420 # other args - names of DRI drivers to enable
421 # TODO: avoid code duplication for a more elegant implementation
422 driver_enable() {
423 case $# in
424 # for enabling unconditionally
425 1)
426 DRI_DRIVERS+=",$1"
427 ;;
428 *)
429 if use $1; then
430 shift
431 for i in $@; do
432 DRI_DRIVERS+=",${i}"
433 done
434 fi
435 ;;
436 esac
437 }
438
439 gallium_enable() {
440 case $# in
441 # for enabling unconditionally
442 1)
443 GALLIUM_DRIVERS+=",$1"
444 ;;
445 *)
446 if use $1; then
447 shift
448 for i in $@; do
449 GALLIUM_DRIVERS+=",${i}"
450 done
451 fi
452 ;;
453 esac
454 }