Gentoo Archives: gentoo-commits

From: "Chi-Thanh Christopher Nguyen (chithanh)" <chithanh@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in media-libs/mesa: mesa-8.0.4-r1.ebuild mesa-9_pre20120831.ebuild ChangeLog
Date: Sat, 01 Sep 2012 16:48:54
Message-Id: 20120901164844.5694C20EDE@flycatcher.gentoo.org
1 chithanh 12/09/01 16:48:44
2
3 Modified: ChangeLog
4 Added: mesa-8.0.4-r1.ebuild mesa-9_pre20120831.ebuild
5 Log:
6 Update patch tarball and snapshot for security bug #432400.
7
8 (Portage version: 2.2.0_alpha123/cvs/Linux x86_64)
9
10 Revision Changes Path
11 1.416 media-libs/mesa/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/mesa/ChangeLog?rev=1.416&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/mesa/ChangeLog?rev=1.416&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/mesa/ChangeLog?r1=1.415&r2=1.416
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/media-libs/mesa/ChangeLog,v
20 retrieving revision 1.415
21 retrieving revision 1.416
22 diff -u -r1.415 -r1.416
23 --- ChangeLog 26 Aug 2012 20:18:24 -0000 1.415
24 +++ ChangeLog 1 Sep 2012 16:48:44 -0000 1.416
25 @@ -1,6 +1,13 @@
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.415 2012/08/26 20:18:24 armin76 Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/media-libs/mesa/ChangeLog,v 1.416 2012/09/01 16:48:44 chithanh Exp $
30 +
31 +*mesa-8.0.4-r1 (01 Sep 2012)
32 +*mesa-9_pre20120831 (01 Sep 2012)
33 +
34 + 01 Sep 2012; Chí-Thanh Christopher Nguyễn <chithanh@g.o>
35 + +mesa-8.0.4-r1.ebuild, +mesa-9_pre20120831.ebuild:
36 + Update patch tarball and snapshot for security bug #432400.
37
38 26 Aug 2012; Raúl Porcel <armin76@g.o> mesa-8.0.3.ebuild:
39 alpha/ia64/sh/sparc stable wrt #419473
40
41
42
43 1.1 media-libs/mesa/mesa-8.0.4-r1.ebuild
44
45 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/mesa/mesa-8.0.4-r1.ebuild?rev=1.1&view=markup
46 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/mesa/mesa-8.0.4-r1.ebuild?rev=1.1&content-type=text/plain
47
48 Index: mesa-8.0.4-r1.ebuild
49 ===================================================================
50 # Copyright 1999-2012 Gentoo Foundation
51 # Distributed under the terms of the GNU General Public License v2
52 # $Header: /var/cvsroot/gentoo-x86/media-libs/mesa/mesa-8.0.4-r1.ebuild,v 1.1 2012/09/01 16:48:44 chithanh Exp $
53
54 EAPI=4
55
56 EGIT_REPO_URI="git://anongit.freedesktop.org/mesa/mesa"
57
58 if [[ ${PV} = 9999* ]]; then
59 GIT_ECLASS="git-2"
60 EXPERIMENTAL="true"
61 fi
62
63 inherit base autotools multilib flag-o-matic python toolchain-funcs ${GIT_ECLASS}
64
65 OPENGL_DIR="xorg-x11"
66
67 MY_PN="${PN/m/M}"
68 MY_P="${MY_PN}-${PV/_/-}"
69 MY_SRC_P="${MY_PN}Lib-${PV/_/-}"
70
71 FOLDER="${PV/_rc*/}"
72
73 DESCRIPTION="OpenGL-like graphic library for Linux"
74 HOMEPAGE="http://mesa3d.sourceforge.net/"
75
76 SRC_PATCHES="mirror://gentoo/${P}-gentoo-patches-01.tar.bz2"
77 if [[ $PV = 9999* ]]; then
78 SRC_URI="${SRC_PATCHES}"
79 else
80 SRC_URI="ftp://ftp.freedesktop.org/pub/mesa/${FOLDER}/${MY_SRC_P}.tar.bz2
81 ${SRC_PATCHES}"
82 fi
83
84 # Most of the code is MIT/X11.
85 # ralloc is LGPL-3
86 # GLES[2]/gl[2]{,ext,platform}.h are SGI-B-2.0
87 LICENSE="MIT LGPL-3 SGI-B-2.0"
88 SLOT="0"
89 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"
90
91 INTEL_CARDS="i915 i965 intel"
92 RADEON_CARDS="r100 r200 r300 r600 radeon"
93 VIDEO_CARDS="${INTEL_CARDS} ${RADEON_CARDS} nouveau vmware"
94 for card in ${VIDEO_CARDS}; do
95 IUSE_VIDEO_CARDS+=" video_cards_${card}"
96 done
97
98 IUSE="${IUSE_VIDEO_CARDS}
99 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"
100
101 REQUIRED_USE="
102 d3d? ( gallium )
103 g3dvl? ( gallium )
104 llvm? ( gallium )
105 openvg? ( egl gallium )
106 gbm? ( shared-glapi )
107 g3dvl? ( || ( vdpau xvmc ) )
108 vdpau? ( g3dvl )
109 xa? ( gallium )
110 xvmc? ( g3dvl )
111 video_cards_intel? ( || ( classic gallium ) )
112 video_cards_i915? ( || ( classic gallium ) )
113 video_cards_i965? ( classic )
114 video_cards_nouveau? ( || ( classic gallium ) )
115 video_cards_radeon? ( || ( classic gallium ) )
116 video_cards_r100? ( classic )
117 video_cards_r200? ( classic )
118 video_cards_r300? ( gallium )
119 video_cards_r600? ( gallium )
120 video_cards_vmware? ( gallium )
121 "
122
123 LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.32"
124 # not a runtime dependency of this package, but dependency of packages which
125 # depend on this package, bug #342393
126 EXTERNAL_DEPEND="
127 >=x11-proto/dri2proto-2.6
128 >=x11-proto/glproto-1.4.15-r1
129 "
130 # keep correct libdrm and dri2proto dep
131 # keep blocks in rdepend for binpkg
132 RDEPEND="${EXTERNAL_DEPEND}
133 !<x11-base/xorg-server-1.7
134 !<=x11-proto/xf86driproto-2.0.3
135 classic? ( app-admin/eselect-mesa )
136 gallium? ( app-admin/eselect-mesa )
137 >=app-admin/eselect-opengl-1.2.6
138 dev-libs/expat
139 gbm? ( sys-fs/udev )
140 >=x11-libs/libX11-1.3.99.901
141 x11-libs/libXdamage
142 x11-libs/libXext
143 x11-libs/libXxf86vm
144 >=x11-libs/libxcb-1.8
145 d3d? ( app-emulation/wine )
146 vdpau? ( >=x11-libs/libvdpau-0.4.1 )
147 wayland? ( dev-libs/wayland )
148 xvmc? ( >=x11-libs/libXvMC-1.0.6 )
149 ${LIBDRM_DEPSTRING}[video_cards_nouveau?,video_cards_vmware?]
150 video_cards_nouveau? ( <x11-libs/libdrm-2.4.34 )
151 "
152 for card in ${INTEL_CARDS}; do
153 RDEPEND="${RDEPEND}
154 video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
155 "
156 done
157
158 for card in ${RADEON_CARDS}; do
159 RDEPEND="${RDEPEND}
160 video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_radeon] )
161 "
162 done
163
164 DEPEND="${RDEPEND}
165 llvm? ( >=sys-devel/llvm-2.9 )
166 =dev-lang/python-2*
167 dev-libs/libxml2[python]
168 virtual/pkgconfig
169 sys-devel/bison
170 sys-devel/flex
171 x11-misc/makedepend
172 >=x11-proto/xextproto-7.0.99.1
173 x11-proto/xf86driproto
174 x11-proto/xf86vidmodeproto
175 "
176
177 S="${WORKDIR}/${MY_P}"
178
179 # It is slow without texrels, if someone wants slow
180 # mesa without texrels +pic use is worth the shot
181 QA_EXECSTACK="usr/lib*/opengl/xorg-x11/lib/libGL.so*"
182 QA_WX_LOAD="usr/lib*/opengl/xorg-x11/lib/libGL.so*"
183
184 # Think about: ggi, fbcon, no-X configs
185
186 pkg_setup() {
187 # workaround toc-issue wrt #386545
188 use ppc64 && append-flags -mminimal-toc
189 }
190
191 src_unpack() {
192 default
193 [[ $PV = 9999* ]] && git-2_src_unpack
194 }
195
196 src_prepare() {
197 # apply patches
198 if [[ ${PV} != 9999* && -n ${SRC_PATCHES} ]]; then
199 EPATCH_FORCE="yes" \
200 EPATCH_SOURCE="${WORKDIR}/patches" \
201 EPATCH_SUFFIX="patch" \
202 epatch
203 fi
204
205 # relax the requirement that r300 must have llvm, bug 380303
206 epatch "${FILESDIR}"/${PN}-8.0-dont-require-llvm-for-r300.patch
207
208 # fix for hardened pax_kernel, bug 240956
209 [[ ${PV} != 9999* ]] && epatch "${FILESDIR}"/glx_ro_text_segm.patch
210
211 # Solaris needs some recent POSIX stuff in our case
212 if [[ ${CHOST} == *-solaris* ]] ; then
213 sed -i -e "s/-DSVR4/-D_POSIX_C_SOURCE=200112L/" configure.ac || die
214 fi
215
216 # Tests fail against python-3, bug #407887
217 sed -i 's|/usr/bin/env python|/usr/bin/env python2|' src/glsl/tests/compare_ir || die
218
219 base_src_prepare
220
221 eautoreconf
222 }
223
224 src_configure() {
225 local myconf
226
227 if use classic; then
228 # Configurable DRI drivers
229 driver_enable swrast
230
231 # Intel code
232 driver_enable video_cards_i915 i915
233 driver_enable video_cards_i965 i965
234 if ! use video_cards_i915 && \
235 ! use video_cards_i965; then
236 driver_enable video_cards_intel i915 i965
237 fi
238
239 # Nouveau code
240 driver_enable video_cards_nouveau nouveau
241
242 # ATI code
243 driver_enable video_cards_r100 radeon
244 driver_enable video_cards_r200 r200
245 if ! use video_cards_r100 && \
246 ! use video_cards_r200; then
247 driver_enable video_cards_radeon radeon r200
248 fi
249 fi
250
251 if use egl; then
252 myconf+="
253 --with-egl-platforms=x11$(use wayland && echo ",wayland")$(use gbm && echo ",drm")
254 $(use_enable gallium gallium-egl)
255 "
256 fi
257
258 if use gallium; then
259 myconf+="
260 $(use_enable d3d d3d1x)
261 $(use_enable g3dvl gallium-g3dvl)
262 $(use_enable llvm gallium-llvm)
263 $(use_enable openvg)
264 $(use_enable vdpau)
265 $(use_enable xa)
266 $(use_enable xvmc)
267 "
268 gallium_enable swrast
269 gallium_enable video_cards_vmware svga
270 gallium_enable video_cards_nouveau nouveau
271 gallium_enable video_cards_i915 i915
272 if ! use video_cards_i915; then
273 gallium_enable video_cards_intel i915
274 fi
275
276 gallium_enable video_cards_r300 r300
277 gallium_enable video_cards_r600 r600
278 if ! use video_cards_r300 && \
279 ! use video_cards_r600; then
280 gallium_enable video_cards_radeon r300 r600
281 fi
282 fi
283
284 # x86 hardened pax_kernel needs glx-rts, bug 240956
285 if use pax_kernel; then
286 myconf+="
287 $(use_enable x86 glx-rts)
288 "
289 fi
290
291 econf \
292 --enable-dri \
293 --enable-glx \
294 $(use_enable !bindist texture-float) \
295 $(use_enable debug) \
296 $(use_enable egl) \
297 $(use_enable gbm) \
298 $(use_enable gles1) \
299 $(use_enable gles2) \
300 $(use_enable nptl glx-tls) \
301 $(use_enable osmesa) \
302 $(use_enable !pic asm) \
303 $(use_enable shared-dricore) \
304 $(use_enable shared-glapi) \
305 --with-dri-drivers=${DRI_DRIVERS} \
306 --with-gallium-drivers=${GALLIUM_DRIVERS} \
307 ${myconf}
308 }
309
310 src_install() {
311 base_src_install
312
313 if use !bindist; then
314 dodoc docs/patents.txt
315 fi
316
317 # Save the glsl-compiler for later use
318 if ! tc-is-cross-compiler; then
319 dobin "${S}"/src/glsl/glsl_compiler
320 fi
321
322 # Install config file for eselect mesa
323 insinto /usr/share/mesa
324 newins "${FILESDIR}/eselect-mesa.conf.8.0.1" eselect-mesa.conf
325
326 # Move libGL and others from /usr/lib to /usr/lib/opengl/blah/lib
327 # because user can eselect desired GL provider.
328 ebegin "Moving libGL and friends for dynamic switching"
329 local gl_dir="/usr/$(get_libdir)/opengl/${OPENGL_DIR}/"
330 local x
331 dodir ${gl_dir}/{lib,extensions,include/GL}
332 for x in "${ED}"/usr/$(get_libdir)/lib{EGL,GL*,OpenVG}.{la,a,so*}; do
333 if [ -f ${x} -o -L ${x} ]; then
334 mv -f "${x}" "${ED}"${gl_dir}/lib \
335 || die "Failed to move ${x}"
336 fi
337 done
338 for x in "${ED}"/usr/include/GL/{gl.h,glx.h,glext.h,glxext.h}; do
339 if [ -f ${x} -o -L ${x} ]; then
340 mv -f "${x}" "${ED}"${gl_dir}/include/GL/ \
341 || die "Failed to move ${x}"
342 fi
343 done
344 for x in "${ED}"/usr/include/{EGL,GLES*,VG,KHR}; do
345 if [ -d ${x} ]; then
346 mv -f "${x}" "${ED}"/${gl_dir}/include \
347 || die "Failed to move ${x}"
348 fi
349 done
350 eend $?
351
352 if use classic || use gallium; then
353 ebegin "Moving DRI/Gallium drivers for dynamic switching"
354 local gallium_drivers=( i915_dri.so i965_dri.so r300_dri.so r600_dri.so swrast_dri.so )
355 keepdir /usr/$(get_libdir)/dri
356 dodir /usr/$(get_libdir)/mesa
357 for x in ${gallium_drivers[@]}; do
358 if [ -f "${S}/$(get_libdir)/gallium/${x}" ]; then
359 mv -f "${ED}/usr/$(get_libdir)/dri/${x}" "${ED}/usr/$(get_libdir)/dri/${x/_dri.so/g_dri.so}" \
360 || die "Failed to move ${x}"
361 insinto "/usr/$(get_libdir)/dri/"
362 if [ -f "${S}/$(get_libdir)/${x}" ]; then
363 insopts -m0755
364 doins "${S}/$(get_libdir)/${x}"
365 fi
366 fi
367 done
368 for x in "${ED}"/usr/$(get_libdir)/dri/*.so; do
369 if [ -f ${x} -o -L ${x} ]; then
370 mv -f "${x}" "${x/dri/mesa}" \
371 || die "Failed to move ${x}"
372 fi
373 done
374 pushd "${ED}"/usr/$(get_libdir)/dri || die "pushd failed"
375 ln -s ../mesa/*.so . || die "Creating symlink failed"
376 # remove symlinks to drivers known to eselect
377 for x in ${gallium_drivers[@]}; do
378 if [ -f ${x} -o -L ${x} ]; then
379 rm "${x}" || die "Failed to remove ${x}"
380 fi
381 done
382 popd
383 eend $?
384 fi
385 }
386
387 pkg_postinst() {
388 # Switch to the xorg implementation.
389 echo
390 eselect opengl set --use-old ${OPENGL_DIR}
391
392 # switch to xorg-x11 and back if necessary, bug #374647 comment 11
393 OLD_IMPLEM="$(eselect opengl show)"
394 if [[ ${OPENGL_DIR}x != ${OLD_IMPLEM}x ]]; then
395 eselect opengl set ${OPENGL_DIR}
396 eselect opengl set ${OLD_IMPLEM}
397 fi
398
399 # Select classic/gallium drivers
400 if use classic || use gallium; then
401 eselect mesa set --auto
402 fi
403
404 # warn about patent encumbered texture-float
405 if use !bindist; then
406 elog "USE=\"bindist\" was not set. Potentially patent encumbered code was"
407 elog "enabled. Please see patents.txt for an explanation."
408 fi
409
410 local using_radeon r_flag
411 for r_flag in ${RADEON_CARDS}; do
412 if use video_cards_${r_flag}; then
413 using_radeon=1
414 break
415 fi
416 done
417
418 if [[ ${using_radeon} = 1 ]] && ! has_version media-libs/libtxc_dxtn; then
419 elog "Note that in order to have full S3TC support, it is necessary to install"
420 elog "media-libs/libtxc_dxtn as well. This may be necessary to get nice"
421 elog "textures in some apps, and some others even require this to run."
422 fi
423 }
424
425 # $1 - VIDEO_CARDS flag
426 # other args - names of DRI drivers to enable
427 # TODO: avoid code duplication for a more elegant implementation
428 driver_enable() {
429 case $# in
430 # for enabling unconditionally
431 1)
432 DRI_DRIVERS+=",$1"
433 ;;
434 *)
435 if use $1; then
436 shift
437 for i in $@; do
438 DRI_DRIVERS+=",${i}"
439 done
440 fi
441 ;;
442 esac
443 }
444
445 gallium_enable() {
446 case $# in
447 # for enabling unconditionally
448 1)
449 GALLIUM_DRIVERS+=",$1"
450 ;;
451 *)
452 if use $1; then
453 shift
454 for i in $@; do
455 GALLIUM_DRIVERS+=",${i}"
456 done
457 fi
458 ;;
459 esac
460 }
461
462
463
464 1.1 media-libs/mesa/mesa-9_pre20120831.ebuild
465
466 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/mesa/mesa-9_pre20120831.ebuild?rev=1.1&view=markup
467 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/mesa/mesa-9_pre20120831.ebuild?rev=1.1&content-type=text/plain
468
469 Index: mesa-9_pre20120831.ebuild
470 ===================================================================
471 # Copyright 1999-2012 Gentoo Foundation
472 # Distributed under the terms of the GNU General Public License v2
473 # $Header: /var/cvsroot/gentoo-x86/media-libs/mesa/mesa-9_pre20120831.ebuild,v 1.1 2012/09/01 16:48:44 chithanh Exp $
474
475 EAPI=4
476
477 EGIT_REPO_URI="git://anongit.freedesktop.org/mesa/mesa"
478
479 if [[ ${PV} = 9999* ]]; then
480 GIT_ECLASS="git-2"
481 EXPERIMENTAL="true"
482 fi
483
484 inherit base autotools multilib flag-o-matic toolchain-funcs ${GIT_ECLASS}
485
486 OPENGL_DIR="xorg-x11"
487
488 MY_PN="${PN/m/M}"
489 MY_P="${MY_PN}-${PV/_/-}"
490 MY_SRC_P="${MY_PN}Lib-${PV/_/-}"
491
492 FOLDER="${PV/_rc*/}"
493
494 DESCRIPTION="OpenGL-like graphic library for Linux"
495 HOMEPAGE="http://mesa3d.sourceforge.net/"
496
497 #SRC_PATCHES="mirror://gentoo/${P}-gentoo-patches-01.tar.bz2"
498 if [[ $PV = 9999* ]]; then
499 SRC_URI="${SRC_PATCHES}"
500 else
501 SRC_URI="mirror://gentoo/${P}.tar.xz
502 ${SRC_PATCHES}"
503 fi
504
505 # The code is MIT/X11.
506 # GLES[2]/gl[2]{,ext,platform}.h are SGI-B-2.0
507 LICENSE="MIT SGI-B-2.0"
508 SLOT="0"
509 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"
510
511 INTEL_CARDS="i915 i965 intel"
512 RADEON_CARDS="r100 r200 r300 r600 radeon radeonsi"
513 VIDEO_CARDS="${INTEL_CARDS} ${RADEON_CARDS} nouveau vmware"
514 for card in ${VIDEO_CARDS}; do
515 IUSE_VIDEO_CARDS+=" video_cards_${card}"
516 done
517
518 IUSE="${IUSE_VIDEO_CARDS}
519 bindist +classic d3d debug +egl g3dvl +gallium gbm gles1 gles2 +llvm +nptl
520 openvg osmesa pax_kernel pic r600-llvm-compiler selinux +shared-glapi vdpau
521 wayland xvmc xa xorg kernel_FreeBSD"
522
523 REQUIRED_USE="
524 d3d? ( gallium )
525 g3dvl? ( gallium )
526 llvm? ( gallium )
527 openvg? ( egl gallium )
528 gbm? ( shared-glapi )
529 g3dvl? ( || ( vdpau xvmc ) )
530 vdpau? ( g3dvl )
531 r600-llvm-compiler? ( gallium llvm || ( video_cards_r600 video_cards_radeon ) )
532 xa? ( gallium )
533 xorg? ( gallium )
534 xvmc? ( g3dvl )
535 video_cards_intel? ( || ( classic gallium ) )
536 video_cards_i915? ( || ( classic gallium ) )
537 video_cards_i965? ( classic )
538 video_cards_nouveau? ( || ( classic gallium ) )
539 video_cards_radeon? ( || ( classic gallium ) )
540 video_cards_r100? ( classic )
541 video_cards_r200? ( classic )
542 video_cards_r300? ( gallium )
543 video_cards_r600? ( gallium )
544 video_cards_radeonsi? ( gallium llvm )
545 video_cards_vmware? ( gallium )
546 "
547
548 LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.39"
549 # not a runtime dependency of this package, but dependency of packages which
550 # depend on this package, bug #342393
551 EXTERNAL_DEPEND="
552 >=x11-proto/dri2proto-2.6
553 >=x11-proto/glproto-1.4.15-r1
554 "
555 # keep correct libdrm and dri2proto dep
556 # keep blocks in rdepend for binpkg
557 # gtest file collision bug #411825
558 RDEPEND="${EXTERNAL_DEPEND}
559 !<x11-base/xorg-server-1.7
560 !<=x11-proto/xf86driproto-2.0.3
561 classic? ( app-admin/eselect-mesa )
562 gallium? ( app-admin/eselect-mesa )
563 >=app-admin/eselect-opengl-1.2.6
564 dev-libs/expat
565 gbm? (
566 sys-fs/udev
567 x11-libs/libdrm[libkms]
568 )
569 >=x11-libs/libX11-1.3.99.901
570 x11-libs/libXdamage
571 x11-libs/libXext
572 x11-libs/libXxf86vm
573 >=x11-libs/libxcb-1.8.1
574 d3d? ( app-emulation/wine )
575 vdpau? ( >=x11-libs/libvdpau-0.4.1 )
576 wayland? ( dev-libs/wayland )
577 xorg? (
578 x11-base/xorg-server
579 x11-libs/libdrm[libkms]
580 )
581 xvmc? ( >=x11-libs/libXvMC-1.0.6 )
582 ${LIBDRM_DEPSTRING}[video_cards_nouveau?,video_cards_vmware?]
583 "
584 for card in ${INTEL_CARDS}; do
585 RDEPEND="${RDEPEND}
586 video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
587 "
588 done
589
590 for card in ${RADEON_CARDS}; do
591 RDEPEND="${RDEPEND}
592 video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_radeon] )
593 "
594 done
595
596 DEPEND="${RDEPEND}
597 llvm? (
598 >=sys-devel/llvm-2.9
599 r600-llvm-compiler? ( >=sys-devel/llvm-3.1 )
600 video_cards_radeonsi? ( >=sys-devel/llvm-3.1 )
601 )
602 =dev-lang/python-2*
603 dev-libs/libxml2[python]
604 sys-devel/bison
605 sys-devel/flex
606 virtual/pkgconfig
607 x11-misc/makedepend
608 >=x11-proto/xextproto-7.0.99.1
609 x11-proto/xf86driproto
610 x11-proto/xf86vidmodeproto
611 "
612
613 S="${WORKDIR}/${MY_P}"
614
615 # It is slow without texrels, if someone wants slow
616 # mesa without texrels +pic use is worth the shot
617 QA_EXECSTACK="usr/lib*/opengl/xorg-x11/lib/libGL.so*"
618 QA_WX_LOAD="usr/lib*/opengl/xorg-x11/lib/libGL.so*"
619
620 # Think about: ggi, fbcon, no-X configs
621
622 pkg_setup() {
623 # workaround toc-issue wrt #386545
624 use ppc64 && append-flags -mminimal-toc
625 }
626
627 src_unpack() {
628 default
629 if [[ ${PV} = 9999* ]]; then
630 git-2_src_unpack
631 fi
632 mv "${WORKDIR}"/${PN}-*/ "${WORKDIR}"/${MY_P} || die
633 }
634
635 src_prepare() {
636 # apply patches
637 if [[ ${PV} != 9999* && -n ${SRC_PATCHES} ]]; then
638 EPATCH_FORCE="yes" \
639 EPATCH_SOURCE="${WORKDIR}/patches" \
640 EPATCH_SUFFIX="patch" \
641 epatch
642 fi
643
644 # relax the requirement that r300 must have llvm, bug 380303
645 epatch "${FILESDIR}"/${PN}-8.1-dont-require-llvm-for-r300.patch
646
647 # fix for hardened pax_kernel, bug 240956
648 [[ ${PV} != 9999* ]] && epatch "${FILESDIR}"/glx_ro_text_segm.patch
649
650 # Solaris needs some recent POSIX stuff in our case
651 if [[ ${CHOST} == *-solaris* ]] ; then
652 sed -i -e "s/-DSVR4/-D_POSIX_C_SOURCE=200112L/" configure.ac || die
653 fi
654
655 # Tests fail against python-3, bug #407887
656 sed -i 's|/usr/bin/env python|/usr/bin/env python2|' src/glsl/tests/compare_ir || die
657
658 base_src_prepare
659
660 eautoreconf
661 }
662
663 src_configure() {
664 local myconf
665
666 if use classic; then
667 # Configurable DRI drivers
668 driver_enable swrast
669
670 # Intel code
671 driver_enable video_cards_i915 i915
672 driver_enable video_cards_i965 i965
673 if ! use video_cards_i915 && \
674 ! use video_cards_i965; then
675 driver_enable video_cards_intel i915 i965
676 fi
677
678 # Nouveau code
679 driver_enable video_cards_nouveau nouveau
680
681 # ATI code
682 driver_enable video_cards_r100 radeon
683 driver_enable video_cards_r200 r200
684 if ! use video_cards_r100 && \
685 ! use video_cards_r200; then
686 driver_enable video_cards_radeon radeon r200
687 fi
688 fi
689
690 if use egl; then
691 myconf+="
692 --with-egl-platforms=x11$(use wayland && echo ",wayland")$(use gbm && echo ",drm")
693 $(use_enable gallium gallium-egl)
694 "
695 fi
696
697 if use gallium; then
698 myconf+="
699 $(use_enable d3d d3d1x)
700 $(use_enable g3dvl gallium-g3dvl)
701 $(use_enable llvm gallium-llvm)
702 $(use_enable openvg)
703 $(use_enable r600-llvm-compiler)
704 $(use_enable vdpau)
705 $(use_enable xvmc)
706 "
707 gallium_enable swrast
708 gallium_enable video_cards_vmware svga
709 gallium_enable video_cards_nouveau nouveau
710 gallium_enable video_cards_i915 i915
711 if ! use video_cards_i915; then
712 gallium_enable video_cards_intel i915
713 fi
714
715 gallium_enable video_cards_r300 r300
716 gallium_enable video_cards_r600 r600
717 gallium_enable video_cards_radeonsi radeonsi
718 if ! use video_cards_r300 && \
719 ! use video_cards_r600; then
720 gallium_enable video_cards_radeon r300 r600
721 fi
722 fi
723
724 # x86 hardened pax_kernel needs glx-rts, bug 240956
725 if use pax_kernel; then
726 myconf+="
727 $(use_enable x86 glx-rts)
728 "
729 fi
730
731 econf \
732 --enable-dri \
733 --enable-glx \
734 $(use_enable !bindist texture-float) \
735 $(use_enable debug) \
736 $(use_enable egl) \
737 $(use_enable gbm) \
738 $(use_enable gles1) \
739 $(use_enable gles2) \
740 $(use_enable nptl glx-tls) \
741 $(use_enable osmesa) \
742 $(use_enable !pic asm) \
743 $(use_enable shared-glapi) \
744 $(use_enable xa) \
745 $(use_enable xorg) \
746 --with-dri-drivers=${DRI_DRIVERS} \
747 --with-gallium-drivers=${GALLIUM_DRIVERS} \
748 ${myconf}
749 }
750
751 src_install() {
752 base_src_install
753
754 find "${ED}" -name '*.la' -exec rm -f {} + || die
755
756 if use !bindist; then
757 dodoc docs/patents.txt
758 fi
759
760 # Save the glsl-compiler for later use
761 if ! tc-is-cross-compiler; then
762 dobin "${S}"/src/glsl/glsl_compiler
763 fi
764
765 # Install config file for eselect mesa
766 insinto /usr/share/mesa
767 newins "${FILESDIR}/eselect-mesa.conf.8.1" eselect-mesa.conf
768
769 # Move libGL and others from /usr/lib to /usr/lib/opengl/blah/lib
770 # because user can eselect desired GL provider.
771 ebegin "Moving libGL and friends for dynamic switching"
772 local x
773 local gl_dir="/usr/$(get_libdir)/opengl/${OPENGL_DIR}/"
774 dodir ${gl_dir}/{lib,extensions,include/GL}
775 for x in "${ED}"/usr/$(get_libdir)/lib{EGL,GL*,OpenVG}.{la,a,so*}; do
776 if [ -f ${x} -o -L ${x} ]; then
777 mv -f "${x}" "${ED}${gl_dir}"/lib \
778 || die "Failed to move ${x}"
779 fi
780 done
781 for x in "${ED}"/usr/include/GL/{gl.h,glx.h,glext.h,glxext.h}; do
782 if [ -f ${x} -o -L ${x} ]; then
783 mv -f "${x}" "${ED}${gl_dir}"/include/GL \
784 || die "Failed to move ${x}"
785 fi
786 done
787 for x in "${ED}"/usr/include/{EGL,GLES*,VG,KHR}; do
788 if [ -d ${x} ]; then
789 mv -f "${x}" "${ED}${gl_dir}"/include \
790 || die "Failed to move ${x}"
791 fi
792 done
793 eend $?
794
795 if use classic || use gallium; then
796 ebegin "Moving DRI/Gallium drivers for dynamic switching"
797 local gallium_drivers=( i915_dri.so i965_dri.so r300_dri.so r600_dri.so swrast_dri.so )
798 keepdir /usr/$(get_libdir)/dri
799 dodir /usr/$(get_libdir)/mesa
800 for x in ${gallium_drivers[@]}; do
801 if [ -f "${S}/$(get_libdir)/gallium/${x}" ]; then
802 mv -f "${ED}/usr/$(get_libdir)/dri/${x}" "${ED}/usr/$(get_libdir)/dri/${x/_dri.so/g_dri.so}" \
803 || die "Failed to move ${x}"
804 insinto "/usr/$(get_libdir)/dri/"
805 if [ -f "${S}/$(get_libdir)/${x}" ]; then
806 insopts -m0755
807 doins "${S}/$(get_libdir)/${x}"
808 fi
809 fi
810 done
811 for x in "${ED}"/usr/$(get_libdir)/dri/*.so; do
812 if [ -f ${x} -o -L ${x} ]; then
813 mv -f "${x}" "${x/dri/mesa}" \
814 || die "Failed to move ${x}"
815 fi
816 done
817 pushd "${ED}"/usr/$(get_libdir)/dri || die "pushd failed"
818 ln -s ../mesa/*.so . || die "Creating symlink failed"
819 # remove symlinks to drivers known to eselect
820 for x in ${gallium_drivers[@]}; do
821 if [ -f ${x} -o -L ${x} ]; then
822 rm "${x}" || die "Failed to remove ${x}"
823 fi
824 done
825 popd
826 eend $?
827 fi
828 }
829
830 pkg_postinst() {
831 # Switch to the xorg implementation.
832 echo
833 eselect opengl set --use-old ${OPENGL_DIR}
834
835 # switch to xorg-x11 and back if necessary, bug #374647 comment 11
836 OLD_IMPLEM="$(eselect opengl show)"
837 if [[ ${OPENGL_DIR}x != ${OLD_IMPLEM}x ]]; then
838 eselect opengl set ${OPENGL_DIR}
839 eselect opengl set ${OLD_IMPLEM}
840 fi
841
842 # Select classic/gallium drivers
843 if use classic || use gallium; then
844 eselect mesa set --auto
845 fi
846
847 # warn about patent encumbered texture-float
848 if use !bindist; then
849 elog "USE=\"bindist\" was not set. Potentially patent encumbered code was"
850 elog "enabled. Please see patents.txt for an explanation."
851 fi
852
853 local using_radeon r_flag
854 for r_flag in ${RADEON_CARDS}; do
855 if use video_cards_${r_flag}; then
856 using_radeon=1
857 break
858 fi
859 done
860
861 if [[ ${using_radeon} = 1 ]] && ! has_version media-libs/libtxc_dxtn; then
862 elog "Note that in order to have full S3TC support, it is necessary to install"
863 elog "media-libs/libtxc_dxtn as well. This may be necessary to get nice"
864 elog "textures in some apps, and some others even require this to run."
865 fi
866 }
867
868 # $1 - VIDEO_CARDS flag
869 # other args - names of DRI drivers to enable
870 # TODO: avoid code duplication for a more elegant implementation
871 driver_enable() {
872 case $# in
873 # for enabling unconditionally
874 1)
875 DRI_DRIVERS+=",$1"
876 ;;
877 *)
878 if use $1; then
879 shift
880 for i in $@; do
881 DRI_DRIVERS+=",${i}"
882 done
883 fi
884 ;;
885 esac
886 }
887
888 gallium_enable() {
889 case $# in
890 # for enabling unconditionally
891 1)
892 GALLIUM_DRIVERS+=",$1"
893 ;;
894 *)
895 if use $1; then
896 shift
897 for i in $@; do
898 GALLIUM_DRIVERS+=",${i}"
899 done
900 fi
901 ;;
902 esac
903 }