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-10.1.6.ebuild mesa-10.2.2.ebuild ChangeLog
Date: Wed, 25 Jun 2014 10:45:46
Message-Id: 20140625104541.4F12A2004E@flycatcher.gentoo.org
1 chithanh 14/06/25 10:45:41
2
3 Modified: ChangeLog
4 Added: mesa-10.1.6.ebuild mesa-10.2.2.ebuild
5 Log:
6 Version bumps.
7
8 (Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key 0x2324E7B566DF2611!)
9
10 Revision Changes Path
11 1.566 media-libs/mesa/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/mesa/ChangeLog?rev=1.566&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/mesa/ChangeLog?rev=1.566&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/mesa/ChangeLog?r1=1.565&r2=1.566
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/media-libs/mesa/ChangeLog,v
20 retrieving revision 1.565
21 retrieving revision 1.566
22 diff -u -r1.565 -r1.566
23 --- ChangeLog 18 Jun 2014 19:55:05 -0000 1.565
24 +++ ChangeLog 25 Jun 2014 10:45:41 -0000 1.566
25 @@ -1,6 +1,13 @@
26 # ChangeLog for media-libs/mesa
27 # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/media-libs/mesa/ChangeLog,v 1.565 2014/06/18 19:55:05 mgorny Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/media-libs/mesa/ChangeLog,v 1.566 2014/06/25 10:45:41 chithanh Exp $
30 +
31 +*mesa-10.1.6 (25 Jun 2014)
32 +*mesa-10.2.2 (25 Jun 2014)
33 +
34 + 25 Jun 2014; Chí-Thanh Christopher Nguyễn <chithanh@g.o>
35 + +mesa-10.1.6.ebuild, +mesa-10.2.2.ebuild:
36 + Version bumps.
37
38 18 Jun 2014; Michał Górny <mgorny@g.o> mesa-10.0.4.ebuild,
39 mesa-10.1.0.ebuild, mesa-10.1.1.ebuild, mesa-10.1.3.ebuild,
40
41
42
43 1.1 media-libs/mesa/mesa-10.1.6.ebuild
44
45 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/mesa/mesa-10.1.6.ebuild?rev=1.1&view=markup
46 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/mesa/mesa-10.1.6.ebuild?rev=1.1&content-type=text/plain
47
48 Index: mesa-10.1.6.ebuild
49 ===================================================================
50 # Copyright 1999-2014 Gentoo Foundation
51 # Distributed under the terms of the GNU General Public License v2
52 # $Header: /var/cvsroot/gentoo-x86/media-libs/mesa/mesa-10.1.6.ebuild,v 1.1 2014/06/25 10:45:41 chithanh Exp $
53
54 EAPI=5
55
56 EGIT_REPO_URI="git://anongit.freedesktop.org/mesa/mesa"
57
58 if [[ ${PV} = 9999* ]]; then
59 GIT_ECLASS="git-r3"
60 EXPERIMENTAL="true"
61 fi
62
63 PYTHON_COMPAT=( python{2_6,2_7} )
64
65 inherit base autotools multilib multilib-minimal flag-o-matic \
66 python-any-r1 toolchain-funcs pax-utils ${GIT_ECLASS}
67
68 OPENGL_DIR="xorg-x11"
69
70 MY_PN="${PN/m/M}"
71 MY_P="${MY_PN}-${PV/_/-}"
72 MY_SRC_P="${MY_PN}Lib-${PV/_/-}"
73
74 FOLDER="${PV/.0/}"
75
76 DESCRIPTION="OpenGL-like graphic library for Linux"
77 HOMEPAGE="http://mesa3d.sourceforge.net/"
78
79 #SRC_PATCHES="mirror://gentoo/${P}-gentoo-patches-01.tar.bz2"
80 if [[ $PV = 9999* ]]; then
81 SRC_URI="${SRC_PATCHES}"
82 else
83 SRC_URI="ftp://ftp.freedesktop.org/pub/mesa/${FOLDER}/${MY_SRC_P}.tar.bz2
84 ${SRC_PATCHES}"
85 fi
86
87 # The code is MIT/X11.
88 # GLES[2]/gl[2]{,ext,platform}.h are SGI-B-2.0
89 LICENSE="MIT SGI-B-2.0"
90 SLOT="0"
91 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris"
92
93 INTEL_CARDS="i915 i965 ilo intel"
94 RADEON_CARDS="r100 r200 r300 r600 radeon radeonsi"
95 VIDEO_CARDS="${INTEL_CARDS} ${RADEON_CARDS} freedreno nouveau vmware"
96 for card in ${VIDEO_CARDS}; do
97 IUSE_VIDEO_CARDS+=" video_cards_${card}"
98 done
99
100 IUSE="${IUSE_VIDEO_CARDS}
101 bindist +classic debug +dri3 +egl +gallium gbm gles1 gles2 +llvm +nptl
102 opencl openvg osmesa pax_kernel pic r600-llvm-compiler selinux
103 vdpau wayland xvmc xa kernel_FreeBSD"
104
105 REQUIRED_USE="
106 llvm? ( gallium )
107 openvg? ( egl gallium )
108 opencl? (
109 gallium
110 video_cards_r600? ( r600-llvm-compiler )
111 video_cards_radeon? ( r600-llvm-compiler )
112 video_cards_radeonsi? ( r600-llvm-compiler )
113 )
114 gles1? ( egl )
115 gles2? ( egl )
116 r600-llvm-compiler? ( gallium llvm || ( video_cards_r600 video_cards_radeonsi video_cards_radeon ) )
117 wayland? ( egl gbm )
118 xa? ( gallium )
119 video_cards_freedreno? ( gallium )
120 video_cards_intel? ( || ( classic gallium ) )
121 video_cards_i915? ( || ( classic gallium ) )
122 video_cards_i965? ( classic )
123 video_cards_ilo? ( gallium )
124 video_cards_nouveau? ( || ( classic gallium ) )
125 video_cards_radeon? ( || ( classic gallium ) )
126 video_cards_r100? ( classic )
127 video_cards_r200? ( classic )
128 video_cards_r300? ( gallium )
129 video_cards_r600? ( gallium )
130 video_cards_radeonsi? ( gallium llvm )
131 video_cards_vmware? ( gallium )
132 ${PYTHON_REQUIRED_USE}
133 "
134
135 LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.52"
136 # keep correct libdrm and dri2proto dep
137 # keep blocks in rdepend for binpkg
138 RDEPEND="
139 !<x11-base/xorg-server-1.7
140 !<=x11-proto/xf86driproto-2.0.3
141 abi_x86_32? ( !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)] )
142 classic? ( app-admin/eselect-mesa )
143 gallium? ( app-admin/eselect-mesa )
144 >=app-admin/eselect-opengl-1.2.7
145 >=dev-libs/expat-2.1.0-r3[${MULTILIB_USEDEP}]
146 gbm? ( >=virtual/udev-208-r2[${MULTILIB_USEDEP}] )
147 dri3? ( >=virtual/udev-208-r2[${MULTILIB_USEDEP}] )
148 >=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
149 >=x11-libs/libxshmfence-1.1[${MULTILIB_USEDEP}]
150 >=x11-libs/libXdamage-1.1.4-r1[${MULTILIB_USEDEP}]
151 >=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
152 >=x11-libs/libXxf86vm-1.1.3[${MULTILIB_USEDEP}]
153 >=x11-libs/libxcb-1.9.3[${MULTILIB_USEDEP}]
154 llvm? (
155 video_cards_radeonsi? ( || (
156 >=dev-libs/elfutils-0.155-r1[${MULTILIB_USEDEP}]
157 >=dev-libs/libelf-0.8.13-r2[${MULTILIB_USEDEP}]
158 ) )
159 video_cards_r600? ( || (
160 >=dev-libs/elfutils-0.155-r1[${MULTILIB_USEDEP}]
161 >=dev-libs/libelf-0.8.13-r2[${MULTILIB_USEDEP}]
162 ) )
163 !video_cards_r600? (
164 video_cards_radeon? ( || (
165 >=dev-libs/elfutils-0.155-r1[${MULTILIB_USEDEP}]
166 >=dev-libs/libelf-0.8.13-r2[${MULTILIB_USEDEP}]
167 ) )
168 )
169 >=sys-devel/llvm-3.3-r3[${MULTILIB_USEDEP}]
170 )
171 opencl? (
172 app-admin/eselect-opencl
173 dev-libs/libclc
174 )
175 vdpau? ( >=x11-libs/libvdpau-0.7[${MULTILIB_USEDEP}] )
176 wayland? ( >=dev-libs/wayland-1.2.0[${MULTILIB_USEDEP}] )
177 xvmc? ( >=x11-libs/libXvMC-1.0.8[${MULTILIB_USEDEP}] )
178 ${LIBDRM_DEPSTRING}[video_cards_freedreno?,video_cards_nouveau?,video_cards_vmware?,${MULTILIB_USEDEP}]
179 "
180 for card in ${INTEL_CARDS}; do
181 RDEPEND="${RDEPEND}
182 video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
183 "
184 done
185
186 for card in ${RADEON_CARDS}; do
187 RDEPEND="${RDEPEND}
188 video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_radeon] )
189 "
190 done
191
192 DEPEND="${RDEPEND}
193 llvm? (
194 r600-llvm-compiler? ( sys-devel/llvm[video_cards_radeon] )
195 video_cards_radeonsi? ( sys-devel/llvm[video_cards_radeon] )
196 )
197 opencl? (
198 >=sys-devel/llvm-3.3-r3[video_cards_radeon,${MULTILIB_USEDEP}]
199 >=sys-devel/clang-3.3[${MULTILIB_USEDEP}]
200 >=sys-devel/gcc-4.6
201 )
202 sys-devel/bison
203 sys-devel/flex
204 sys-devel/gettext
205 virtual/pkgconfig
206 >=x11-proto/dri2proto-2.8-r1[${MULTILIB_USEDEP}]
207 dri3? (
208 >=x11-proto/dri3proto-1.0[${MULTILIB_USEDEP}]
209 >=x11-proto/presentproto-1.0[${MULTILIB_USEDEP}]
210 )
211 >=x11-proto/glproto-1.4.16-r1[${MULTILIB_USEDEP}]
212 >=x11-proto/xextproto-7.2.1-r1[${MULTILIB_USEDEP}]
213 >=x11-proto/xf86driproto-2.1.1-r1[${MULTILIB_USEDEP}]
214 >=x11-proto/xf86vidmodeproto-2.3.1-r1[${MULTILIB_USEDEP}]
215 $(python_gen_any_dep 'dev-libs/libxml2[python,${PYTHON_USEDEP}]')
216 "
217
218 python_check_deps() {
219 has_version --host-root "dev-libs/libxml2[python,${PYTHON_USEDEP}]"
220 }
221
222 S="${WORKDIR}/${MY_P}"
223 EGIT_CHECKOUT_DIR=${S}
224
225 # It is slow without texrels, if someone wants slow
226 # mesa without texrels +pic use is worth the shot
227 QA_EXECSTACK="usr/lib*/opengl/xorg-x11/lib/libGL.so*"
228 QA_WX_LOAD="usr/lib*/opengl/xorg-x11/lib/libGL.so*"
229
230 # Think about: ggi, fbcon, no-X configs
231
232 pkg_setup() {
233 # workaround toc-issue wrt #386545
234 use ppc64 && append-flags -mminimal-toc
235
236 # warning message for bug 459306
237 if use llvm && has_version sys-devel/llvm[!debug=]; then
238 ewarn "Mismatch between debug USE flags in media-libs/mesa and sys-devel/llvm"
239 ewarn "detected! This can cause problems. For details, see bug 459306."
240 fi
241
242 python-any-r1_pkg_setup
243 }
244
245 src_unpack() {
246 default
247 [[ $PV = 9999* ]] && git-r3_src_unpack
248 }
249
250 src_prepare() {
251 # apply patches
252 if [[ ${PV} != 9999* && -n ${SRC_PATCHES} ]]; then
253 EPATCH_FORCE="yes" \
254 EPATCH_SOURCE="${WORKDIR}/patches" \
255 EPATCH_SUFFIX="patch" \
256 epatch
257 fi
258
259 # relax the requirement that r300 must have llvm, bug 380303
260 epatch "${FILESDIR}"/${PN}-9.2-dont-require-llvm-for-r300.patch
261
262 # fix for hardened pax_kernel, bug 240956
263 [[ ${PV} != 9999* ]] && epatch "${FILESDIR}"/glx_ro_text_segm.patch
264
265 # Solaris needs some recent POSIX stuff in our case
266 if [[ ${CHOST} == *-solaris* ]] ; then
267 sed -i -e "s/-DSVR4/-D_POSIX_C_SOURCE=200112L/" configure.ac || die
268 fi
269
270 base_src_prepare
271
272 eautoreconf
273 multilib_copy_sources
274 }
275
276 multilib_src_configure() {
277 local myconf
278
279 if use classic; then
280 # Configurable DRI drivers
281 driver_enable swrast
282
283 # Intel code
284 driver_enable video_cards_i915 i915
285 driver_enable video_cards_i965 i965
286 if ! use video_cards_i915 && \
287 ! use video_cards_i965; then
288 driver_enable video_cards_intel i915 i965
289 fi
290
291 # Nouveau code
292 driver_enable video_cards_nouveau nouveau
293
294 # ATI code
295 driver_enable video_cards_r100 radeon
296 driver_enable video_cards_r200 r200
297 if ! use video_cards_r100 && \
298 ! use video_cards_r200; then
299 driver_enable video_cards_radeon radeon r200
300 fi
301 fi
302
303 if use egl; then
304 myconf+="--with-egl-platforms=x11$(use wayland && echo ",wayland")$(use gbm && echo ",drm") "
305 fi
306
307 if use gallium; then
308 myconf+="
309 $(use_enable llvm gallium-llvm)
310 $(use_enable openvg)
311 $(use_enable openvg gallium-egl)
312 $(use_enable r600-llvm-compiler)
313 $(use_enable vdpau)
314 $(use_enable xa)
315 $(use_enable xvmc)
316 "
317 gallium_enable swrast
318 gallium_enable video_cards_vmware svga
319 gallium_enable video_cards_nouveau nouveau
320 gallium_enable video_cards_i915 i915
321 gallium_enable video_cards_ilo ilo
322 if ! use video_cards_i915 && \
323 ! use video_cards_i965; then
324 gallium_enable video_cards_intel i915
325 fi
326
327 gallium_enable video_cards_r300 r300
328 gallium_enable video_cards_r600 r600
329 gallium_enable video_cards_radeonsi radeonsi
330 if ! use video_cards_r300 && \
331 ! use video_cards_r600; then
332 gallium_enable video_cards_radeon r300 r600
333 fi
334
335 gallium_enable video_cards_freedreno freedreno
336 # opencl stuff
337 if use opencl; then
338 myconf+="
339 $(use_enable opencl)
340 --with-opencl-libdir="${EPREFIX}/usr/$(get_libdir)/OpenCL/vendors/mesa"
341 --with-clang-libdir="${EPREFIX}/usr/lib"
342 "
343 fi
344 fi
345
346 # x86 hardened pax_kernel needs glx-rts, bug 240956
347 if use pax_kernel; then
348 myconf+="
349 $(use_enable x86 glx-rts)
350 "
351 fi
352
353 # build fails with BSD indent, bug #428112
354 use userland_GNU || export INDENT=cat
355
356 econf \
357 --enable-dri \
358 --enable-glx \
359 --enable-shared-glapi \
360 $(use_enable !bindist texture-float) \
361 $(use_enable debug) \
362 $(use_enable dri3) \
363 $(use_enable egl) \
364 $(use_enable gbm) \
365 $(use_enable gles1) \
366 $(use_enable gles2) \
367 $(use_enable nptl glx-tls) \
368 $(use_enable osmesa) \
369 $(use_enable !pic asm) \
370 --with-dri-drivers=${DRI_DRIVERS} \
371 --with-gallium-drivers=${GALLIUM_DRIVERS} \
372 PYTHON2="${PYTHON}" \
373 ${myconf}
374 }
375
376 multilib_src_install() {
377 emake install DESTDIR="${D}"
378
379 # Move libGL and others from /usr/lib to /usr/lib/opengl/blah/lib
380 # because user can eselect desired GL provider.
381 ebegin "Moving libGL and friends for dynamic switching"
382 local x
383 local gl_dir="/usr/$(get_libdir)/opengl/${OPENGL_DIR}/"
384 dodir ${gl_dir}/{lib,extensions,include/GL}
385 for x in "${ED}"/usr/$(get_libdir)/lib{EGL,GL*,OpenVG}.{la,a,so*}; do
386 if [ -f ${x} -o -L ${x} ]; then
387 mv -f "${x}" "${ED}${gl_dir}"/lib \
388 || die "Failed to move ${x}"
389 fi
390 done
391 for x in "${ED}"/usr/include/GL/{gl.h,glx.h,glext.h,glxext.h}; do
392 if [ -f ${x} -o -L ${x} ]; then
393 mv -f "${x}" "${ED}${gl_dir}"/include/GL \
394 || die "Failed to move ${x}"
395 fi
396 done
397 for x in "${ED}"/usr/include/{EGL,GLES*,VG,KHR}; do
398 if [ -d ${x} ]; then
399 mv -f "${x}" "${ED}${gl_dir}"/include \
400 || die "Failed to move ${x}"
401 fi
402 done
403 eend $?
404
405 if use classic || use gallium; then
406 ebegin "Moving DRI/Gallium drivers for dynamic switching"
407 local gallium_drivers=( i915_dri.so i965_dri.so r300_dri.so r600_dri.so swrast_dri.so )
408 keepdir /usr/$(get_libdir)/dri
409 dodir /usr/$(get_libdir)/mesa
410 for x in ${gallium_drivers[@]}; do
411 if [ -f "$(get_libdir)/gallium/${x}" ]; then
412 mv -f "${ED}/usr/$(get_libdir)/dri/${x}" "${ED}/usr/$(get_libdir)/dri/${x/_dri.so/g_dri.so}" \
413 || die "Failed to move ${x}"
414 fi
415 done
416 if use classic; then
417 emake -C "${BUILD_DIR}/src/mesa/drivers/dri" DESTDIR="${D}" install
418 fi
419 for x in "${ED}"/usr/$(get_libdir)/dri/*.so; do
420 if [ -f ${x} -o -L ${x} ]; then
421 mv -f "${x}" "${x/dri/mesa}" \
422 || die "Failed to move ${x}"
423 fi
424 done
425 pushd "${ED}"/usr/$(get_libdir)/dri || die "pushd failed"
426 ln -s ../mesa/*.so . || die "Creating symlink failed"
427 # remove symlinks to drivers known to eselect
428 for x in ${gallium_drivers[@]}; do
429 if [ -f ${x} -o -L ${x} ]; then
430 rm "${x}" || die "Failed to remove ${x}"
431 fi
432 done
433 popd
434 eend $?
435 fi
436 if use opencl; then
437 ebegin "Moving Gallium/Clover OpenCL implementation for dynamic switching"
438 local cl_dir="/usr/$(get_libdir)/OpenCL/vendors/mesa"
439 dodir ${cl_dir}/{lib,include}
440 if [ -f "${ED}/usr/$(get_libdir)/libOpenCL.so" ]; then
441 mv -f "${ED}"/usr/$(get_libdir)/libOpenCL.so* \
442 "${ED}"${cl_dir}
443 fi
444 if [ -f "${ED}/usr/include/CL/opencl.h" ]; then
445 mv -f "${ED}"/usr/include/CL \
446 "${ED}"${cl_dir}/include
447 fi
448 eend $?
449 fi
450 }
451
452 multilib_src_install_all() {
453 prune_libtool_files --all
454 einstalldocs
455
456 if use !bindist; then
457 dodoc docs/patents.txt
458 fi
459
460 # Install config file for eselect mesa
461 insinto /usr/share/mesa
462 newins "${FILESDIR}/eselect-mesa.conf.9.2" eselect-mesa.conf
463 }
464
465 multilib_src_test() {
466 if use llvm; then
467 local llvm_tests='lp_test_arit lp_test_arit lp_test_blend lp_test_blend lp_test_conv lp_test_conv lp_test_format lp_test_format lp_test_printf lp_test_printf'
468 pushd src/gallium/drivers/llvmpipe >/dev/null || die
469 emake ${llvm_tests}
470 pax-mark m ${llvm_tests}
471 popd >/dev/null || die
472 fi
473 emake check
474 }
475
476 pkg_postinst() {
477 # Switch to the xorg implementation.
478 echo
479 eselect opengl set --use-old ${OPENGL_DIR}
480
481 # switch to xorg-x11 and back if necessary, bug #374647 comment 11
482 OLD_IMPLEM="$(eselect opengl show)"
483 if [[ ${OPENGL_DIR}x != ${OLD_IMPLEM}x ]]; then
484 eselect opengl set ${OPENGL_DIR}
485 eselect opengl set ${OLD_IMPLEM}
486 fi
487
488 # Select classic/gallium drivers
489 if use classic || use gallium; then
490 eselect mesa set --auto
491 fi
492
493 # Switch to mesa opencl
494 if use opencl; then
495 eselect opencl set --use-old ${PN}
496 fi
497
498 # warn about patent encumbered texture-float
499 if use !bindist; then
500 elog "USE=\"bindist\" was not set. Potentially patent encumbered code was"
501 elog "enabled. Please see patents.txt for an explanation."
502 fi
503
504 local using_radeon r_flag
505 for r_flag in ${RADEON_CARDS}; do
506 if use video_cards_${r_flag}; then
507 using_radeon=1
508 break
509 fi
510 done
511
512 if [[ ${using_radeon} = 1 ]] && ! has_version media-libs/libtxc_dxtn; then
513 elog "Note that in order to have full S3TC support, it is necessary to install"
514 elog "media-libs/libtxc_dxtn as well. This may be necessary to get nice"
515 elog "textures in some apps, and some others even require this to run."
516 fi
517 }
518
519 # $1 - VIDEO_CARDS flag
520 # other args - names of DRI drivers to enable
521 # TODO: avoid code duplication for a more elegant implementation
522 driver_enable() {
523 case $# in
524 # for enabling unconditionally
525 1)
526 DRI_DRIVERS+=",$1"
527 ;;
528 *)
529 if use $1; then
530 shift
531 for i in $@; do
532 DRI_DRIVERS+=",${i}"
533 done
534 fi
535 ;;
536 esac
537 }
538
539 gallium_enable() {
540 case $# in
541 # for enabling unconditionally
542 1)
543 GALLIUM_DRIVERS+=",$1"
544 ;;
545 *)
546 if use $1; then
547 shift
548 for i in $@; do
549 GALLIUM_DRIVERS+=",${i}"
550 done
551 fi
552 ;;
553 esac
554 }
555
556
557
558 1.1 media-libs/mesa/mesa-10.2.2.ebuild
559
560 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/mesa/mesa-10.2.2.ebuild?rev=1.1&view=markup
561 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/mesa/mesa-10.2.2.ebuild?rev=1.1&content-type=text/plain
562
563 Index: mesa-10.2.2.ebuild
564 ===================================================================
565 # Copyright 1999-2014 Gentoo Foundation
566 # Distributed under the terms of the GNU General Public License v2
567 # $Header: /var/cvsroot/gentoo-x86/media-libs/mesa/mesa-10.2.2.ebuild,v 1.1 2014/06/25 10:45:41 chithanh Exp $
568
569 EAPI=5
570
571 EGIT_REPO_URI="git://anongit.freedesktop.org/mesa/mesa"
572
573 if [[ ${PV} = 9999* ]]; then
574 GIT_ECLASS="git-r3"
575 EXPERIMENTAL="true"
576 fi
577
578 PYTHON_COMPAT=( python{2_6,2_7} )
579
580 inherit base autotools multilib multilib-minimal flag-o-matic \
581 python-any-r1 toolchain-funcs pax-utils ${GIT_ECLASS}
582
583 OPENGL_DIR="xorg-x11"
584
585 MY_PN="${PN/m/M}"
586 MY_P="${MY_PN}-${PV/_/-}"
587 MY_SRC_P="${MY_PN}Lib-${PV/_/-}"
588
589 FOLDER="${PV/.0_rc*/}"
590
591 DESCRIPTION="OpenGL-like graphic library for Linux"
592 HOMEPAGE="http://mesa3d.sourceforge.net/"
593
594 #SRC_PATCHES="mirror://gentoo/${P}-gentoo-patches-01.tar.bz2"
595 if [[ $PV = 9999* ]]; then
596 SRC_URI="${SRC_PATCHES}"
597 else
598 SRC_URI="ftp://ftp.freedesktop.org/pub/mesa/${FOLDER}/${MY_SRC_P}.tar.bz2
599 ${SRC_PATCHES}"
600 fi
601
602 # The code is MIT/X11.
603 # GLES[2]/gl[2]{,ext,platform}.h are SGI-B-2.0
604 LICENSE="MIT SGI-B-2.0"
605 SLOT="0"
606 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris"
607
608 INTEL_CARDS="i915 i965 ilo intel"
609 RADEON_CARDS="r100 r200 r300 r600 radeon radeonsi"
610 VIDEO_CARDS="${INTEL_CARDS} ${RADEON_CARDS} freedreno nouveau vmware"
611 for card in ${VIDEO_CARDS}; do
612 IUSE_VIDEO_CARDS+=" video_cards_${card}"
613 done
614
615 IUSE="${IUSE_VIDEO_CARDS}
616 bindist +classic debug +dri3 +egl +gallium gbm gles1 gles2 +llvm +nptl
617 opencl openvg osmesa pax_kernel openmax pic r600-llvm-compiler selinux
618 vdpau wayland xvmc xa kernel_FreeBSD"
619
620 REQUIRED_USE="
621 llvm? ( gallium )
622 openvg? ( egl gallium )
623 opencl? (
624 gallium
625 video_cards_r600? ( r600-llvm-compiler )
626 video_cards_radeon? ( r600-llvm-compiler )
627 video_cards_radeonsi? ( r600-llvm-compiler )
628 )
629 openmax? ( gallium )
630 gles1? ( egl )
631 gles2? ( egl )
632 r600-llvm-compiler? ( gallium llvm || ( video_cards_r600 video_cards_radeonsi video_cards_radeon ) )
633 wayland? ( egl gbm )
634 xa? ( gallium )
635 video_cards_freedreno? ( gallium )
636 video_cards_intel? ( || ( classic gallium ) )
637 video_cards_i915? ( || ( classic gallium ) )
638 video_cards_i965? ( classic )
639 video_cards_ilo? ( gallium )
640 video_cards_nouveau? ( || ( classic gallium ) )
641 video_cards_radeon? ( || ( classic gallium ) )
642 video_cards_r100? ( classic )
643 video_cards_r200? ( classic )
644 video_cards_r300? ( gallium )
645 video_cards_r600? ( gallium )
646 video_cards_radeonsi? ( gallium llvm )
647 video_cards_vmware? ( gallium )
648 ${PYTHON_REQUIRED_USE}
649 "
650
651 LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.54"
652 # keep correct libdrm and dri2proto dep
653 # keep blocks in rdepend for binpkg
654 RDEPEND="
655 !<x11-base/xorg-server-1.7
656 !<=x11-proto/xf86driproto-2.0.3
657 abi_x86_32? ( !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)] )
658 classic? ( app-admin/eselect-mesa )
659 gallium? ( app-admin/eselect-mesa )
660 >=app-admin/eselect-opengl-1.2.7
661 >=dev-libs/expat-2.1.0-r3[${MULTILIB_USEDEP}]
662 gbm? ( >=virtual/udev-208-r2[${MULTILIB_USEDEP}] )
663 dri3? ( >=virtual/udev-208-r2[${MULTILIB_USEDEP}] )
664 >=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
665 >=x11-libs/libxshmfence-1.1[${MULTILIB_USEDEP}]
666 >=x11-libs/libXdamage-1.1.4-r1[${MULTILIB_USEDEP}]
667 >=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
668 >=x11-libs/libXxf86vm-1.1.3[${MULTILIB_USEDEP}]
669 >=x11-libs/libxcb-1.9.3[${MULTILIB_USEDEP}]
670 llvm? (
671 video_cards_radeonsi? ( || (
672 >=dev-libs/elfutils-0.155-r1[${MULTILIB_USEDEP}]
673 >=dev-libs/libelf-0.8.13-r2[${MULTILIB_USEDEP}]
674 ) )
675 video_cards_r600? ( || (
676 >=dev-libs/elfutils-0.155-r1[${MULTILIB_USEDEP}]
677 >=dev-libs/libelf-0.8.13-r2[${MULTILIB_USEDEP}]
678 ) )
679 !video_cards_r600? (
680 video_cards_radeon? ( || (
681 >=dev-libs/elfutils-0.155-r1[${MULTILIB_USEDEP}]
682 >=dev-libs/libelf-0.8.13-r2[${MULTILIB_USEDEP}]
683 ) )
684 )
685 >=sys-devel/llvm-3.3-r3[${MULTILIB_USEDEP}]
686 )
687 opencl? (
688 app-admin/eselect-opencl
689 dev-libs/libclc
690 )
691 openmax? ( >=media-libs/libomxil-bellagio-0.9.3[${MULTILIB_USEDEP}] )
692 vdpau? ( >=x11-libs/libvdpau-0.7[${MULTILIB_USEDEP}] )
693 wayland? ( >=dev-libs/wayland-1.2.0[${MULTILIB_USEDEP}] )
694 xvmc? ( >=x11-libs/libXvMC-1.0.8[${MULTILIB_USEDEP}] )
695 ${LIBDRM_DEPSTRING}[video_cards_freedreno?,video_cards_nouveau?,video_cards_vmware?,${MULTILIB_USEDEP}]
696 "
697 for card in ${INTEL_CARDS}; do
698 RDEPEND="${RDEPEND}
699 video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
700 "
701 done
702
703 for card in ${RADEON_CARDS}; do
704 RDEPEND="${RDEPEND}
705 video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_radeon] )
706 "
707 done
708
709 DEPEND="${RDEPEND}
710 ${PYTHON_DEPS}
711 llvm? (
712 r600-llvm-compiler? ( sys-devel/llvm[video_cards_radeon] )
713 video_cards_radeonsi? ( sys-devel/llvm[video_cards_radeon] )
714 )
715 opencl? (
716 >=sys-devel/llvm-3.3-r3[${MULTILIB_USEDEP}]
717 >=sys-devel/clang-3.3[${MULTILIB_USEDEP}]
718 >=sys-devel/gcc-4.6
719 )
720 sys-devel/bison
721 sys-devel/flex
722 sys-devel/gettext
723 virtual/pkgconfig
724 >=x11-proto/dri2proto-2.8-r1[${MULTILIB_USEDEP}]
725 dri3? (
726 >=x11-proto/dri3proto-1.0[${MULTILIB_USEDEP}]
727 >=x11-proto/presentproto-1.0[${MULTILIB_USEDEP}]
728 )
729 >=x11-proto/glproto-1.4.16-r1[${MULTILIB_USEDEP}]
730 >=x11-proto/xextproto-7.2.1-r1[${MULTILIB_USEDEP}]
731 >=x11-proto/xf86driproto-2.1.1-r1[${MULTILIB_USEDEP}]
732 >=x11-proto/xf86vidmodeproto-2.3.1-r1[${MULTILIB_USEDEP}]
733 "
734
735 S="${WORKDIR}/${MY_P}"
736 EGIT_CHECKOUT_DIR=${S}
737
738 # It is slow without texrels, if someone wants slow
739 # mesa without texrels +pic use is worth the shot
740 QA_EXECSTACK="usr/lib*/opengl/xorg-x11/lib/libGL.so*"
741 QA_WX_LOAD="usr/lib*/opengl/xorg-x11/lib/libGL.so*"
742
743 # Think about: ggi, fbcon, no-X configs
744
745 pkg_setup() {
746 # workaround toc-issue wrt #386545
747 use ppc64 && append-flags -mminimal-toc
748
749 # warning message for bug 459306
750 if use llvm && has_version sys-devel/llvm[!debug=]; then
751 ewarn "Mismatch between debug USE flags in media-libs/mesa and sys-devel/llvm"
752 ewarn "detected! This can cause problems. For details, see bug 459306."
753 fi
754
755 python-any-r1_pkg_setup
756 }
757
758 src_unpack() {
759 default
760 [[ $PV = 9999* ]] && git-r3_src_unpack
761 }
762
763 src_prepare() {
764 # apply patches
765 if [[ ${PV} != 9999* && -n ${SRC_PATCHES} ]]; then
766 EPATCH_FORCE="yes" \
767 EPATCH_SOURCE="${WORKDIR}/patches" \
768 EPATCH_SUFFIX="patch" \
769 epatch
770 fi
771
772 # relax the requirement that r300 must have llvm, bug 380303
773 epatch "${FILESDIR}"/${PN}-10.2-dont-require-llvm-for-r300.patch
774
775 # fix for hardened pax_kernel, bug 240956
776 [[ ${PV} != 9999* ]] && epatch "${FILESDIR}"/glx_ro_text_segm.patch
777
778 # Solaris needs some recent POSIX stuff in our case
779 if [[ ${CHOST} == *-solaris* ]] ; then
780 sed -i -e "s/-DSVR4/-D_POSIX_C_SOURCE=200112L/" configure.ac || die
781 fi
782
783 base_src_prepare
784
785 eautoreconf
786 multilib_copy_sources
787 }
788
789 multilib_src_configure() {
790 local myconf
791
792 if use classic; then
793 # Configurable DRI drivers
794 driver_enable swrast
795
796 # Intel code
797 driver_enable video_cards_i915 i915
798 driver_enable video_cards_i965 i965
799 if ! use video_cards_i915 && \
800 ! use video_cards_i965; then
801 driver_enable video_cards_intel i915 i965
802 fi
803
804 # Nouveau code
805 driver_enable video_cards_nouveau nouveau
806
807 # ATI code
808 driver_enable video_cards_r100 radeon
809 driver_enable video_cards_r200 r200
810 if ! use video_cards_r100 && \
811 ! use video_cards_r200; then
812 driver_enable video_cards_radeon radeon r200
813 fi
814 fi
815
816 if use egl; then
817 myconf+="--with-egl-platforms=x11$(use wayland && echo ",wayland")$(use gbm && echo ",drm") "
818 fi
819
820 if use gallium; then
821 myconf+="
822 $(use_enable llvm gallium-llvm)
823 $(use_enable openvg)
824 $(use_enable openvg gallium-egl)
825 $(use_enable openmax omx)
826 $(use_enable r600-llvm-compiler)
827 $(use_enable vdpau)
828 $(use_enable xa)
829 $(use_enable xvmc)
830 "
831 gallium_enable swrast
832 gallium_enable video_cards_vmware svga
833 gallium_enable video_cards_nouveau nouveau
834 gallium_enable video_cards_i915 i915
835 gallium_enable video_cards_ilo ilo
836 if ! use video_cards_i915 && \
837 ! use video_cards_i965; then
838 gallium_enable video_cards_intel i915
839 fi
840
841 gallium_enable video_cards_r300 r300
842 gallium_enable video_cards_r600 r600
843 gallium_enable video_cards_radeonsi radeonsi
844 if ! use video_cards_r300 && \
845 ! use video_cards_r600; then
846 gallium_enable video_cards_radeon r300 r600
847 fi
848
849 gallium_enable video_cards_freedreno freedreno
850 # opencl stuff
851 if use opencl; then
852 myconf+="
853 $(use_enable opencl)
854 --with-opencl-libdir="${EPREFIX}/usr/$(get_libdir)/OpenCL/vendors/mesa"
855 --with-clang-libdir="${EPREFIX}/usr/lib"
856 "
857 fi
858 fi
859
860 # x86 hardened pax_kernel needs glx-rts, bug 240956
861 if use pax_kernel; then
862 myconf+="
863 $(use_enable x86 glx-rts)
864 "
865 fi
866
867 # build fails with BSD indent, bug #428112
868 use userland_GNU || export INDENT=cat
869
870 econf \
871 --enable-dri \
872 --enable-glx \
873 --enable-shared-glapi \
874 $(use_enable !bindist texture-float) \
875 $(use_enable debug) \
876 $(use_enable dri3) \
877 $(use_enable egl) \
878 $(use_enable gbm) \
879 $(use_enable gles1) \
880 $(use_enable gles2) \
881 $(use_enable nptl glx-tls) \
882 $(use_enable osmesa) \
883 $(use_enable !pic asm) \
884 --enable-llvm-shared-libs \
885 --with-dri-drivers=${DRI_DRIVERS} \
886 --with-gallium-drivers=${GALLIUM_DRIVERS} \
887 PYTHON2="${PYTHON}" \
888 ${myconf}
889 }
890
891 multilib_src_install() {
892 emake install DESTDIR="${D}"
893
894 # Move libGL and others from /usr/lib to /usr/lib/opengl/blah/lib
895 # because user can eselect desired GL provider.
896 ebegin "Moving libGL and friends for dynamic switching"
897 local x
898 local gl_dir="/usr/$(get_libdir)/opengl/${OPENGL_DIR}/"
899 dodir ${gl_dir}/{lib,extensions,include/GL}
900 for x in "${ED}"/usr/$(get_libdir)/lib{EGL,GL*,OpenVG}.{la,a,so*}; do
901 if [ -f ${x} -o -L ${x} ]; then
902 mv -f "${x}" "${ED}${gl_dir}"/lib \
903 || die "Failed to move ${x}"
904 fi
905 done
906 for x in "${ED}"/usr/include/GL/{gl.h,glx.h,glext.h,glxext.h}; do
907 if [ -f ${x} -o -L ${x} ]; then
908 mv -f "${x}" "${ED}${gl_dir}"/include/GL \
909 || die "Failed to move ${x}"
910 fi
911 done
912 for x in "${ED}"/usr/include/{EGL,GLES*,VG,KHR}; do
913 if [ -d ${x} ]; then
914 mv -f "${x}" "${ED}${gl_dir}"/include \
915 || die "Failed to move ${x}"
916 fi
917 done
918 eend $?
919
920 if use classic || use gallium; then
921 ebegin "Moving DRI/Gallium drivers for dynamic switching"
922 local gallium_drivers=( i915_dri.so i965_dri.so r300_dri.so r600_dri.so swrast_dri.so )
923 keepdir /usr/$(get_libdir)/dri
924 dodir /usr/$(get_libdir)/mesa
925 for x in ${gallium_drivers[@]}; do
926 if [ -f "$(get_libdir)/gallium/${x}" ]; then
927 mv -f "${ED}/usr/$(get_libdir)/dri/${x}" "${ED}/usr/$(get_libdir)/dri/${x/_dri.so/g_dri.so}" \
928 || die "Failed to move ${x}"
929 fi
930 done
931 if use classic; then
932 emake -C "${BUILD_DIR}/src/mesa/drivers/dri" DESTDIR="${D}" install
933 fi
934 for x in "${ED}"/usr/$(get_libdir)/dri/*.so; do
935 if [ -f ${x} -o -L ${x} ]; then
936 mv -f "${x}" "${x/dri/mesa}" \
937 || die "Failed to move ${x}"
938 fi
939 done
940 pushd "${ED}"/usr/$(get_libdir)/dri || die "pushd failed"
941 ln -s ../mesa/*.so . || die "Creating symlink failed"
942 # remove symlinks to drivers known to eselect
943 for x in ${gallium_drivers[@]}; do
944 if [ -f ${x} -o -L ${x} ]; then
945 rm "${x}" || die "Failed to remove ${x}"
946 fi
947 done
948 popd
949 eend $?
950 fi
951 if use opencl; then
952 ebegin "Moving Gallium/Clover OpenCL implementation for dynamic switching"
953 local cl_dir="/usr/$(get_libdir)/OpenCL/vendors/mesa"
954 dodir ${cl_dir}/{lib,include}
955 if [ -f "${ED}/usr/$(get_libdir)/libOpenCL.so" ]; then
956 mv -f "${ED}"/usr/$(get_libdir)/libOpenCL.so* \
957 "${ED}"${cl_dir}
958 fi
959 if [ -f "${ED}/usr/include/CL/opencl.h" ]; then
960 mv -f "${ED}"/usr/include/CL \
961 "${ED}"${cl_dir}/include
962 fi
963 eend $?
964 fi
965
966 if use openmax; then
967 echo "XDG_DATA_DIRS=\"${EPREFIX}/usr/share/mesa/xdg\"" > "${T}/99mesaxdgomx"
968 doenvd "${T}"/99mesaxdgomx
969 keepdir /usr/share/mesa/xdg
970 fi
971 }
972
973 multilib_src_install_all() {
974 prune_libtool_files --all
975 einstalldocs
976
977 if use !bindist; then
978 dodoc docs/patents.txt
979 fi
980
981 # Install config file for eselect mesa
982 insinto /usr/share/mesa
983 newins "${FILESDIR}/eselect-mesa.conf.9.2" eselect-mesa.conf
984 }
985
986 multilib_src_test() {
987 if use llvm; then
988 local llvm_tests='lp_test_arit lp_test_arit lp_test_blend lp_test_blend lp_test_conv lp_test_conv lp_test_format lp_test_format lp_test_printf lp_test_printf'
989 pushd src/gallium/drivers/llvmpipe >/dev/null || die
990 emake ${llvm_tests}
991 pax-mark m ${llvm_tests}
992 popd >/dev/null || die
993 fi
994 emake check
995 }
996
997 pkg_postinst() {
998 # Switch to the xorg implementation.
999 echo
1000 eselect opengl set --use-old ${OPENGL_DIR}
1001
1002 # switch to xorg-x11 and back if necessary, bug #374647 comment 11
1003 OLD_IMPLEM="$(eselect opengl show)"
1004 if [[ ${OPENGL_DIR}x != ${OLD_IMPLEM}x ]]; then
1005 eselect opengl set ${OPENGL_DIR}
1006 eselect opengl set ${OLD_IMPLEM}
1007 fi
1008
1009 # Select classic/gallium drivers
1010 if use classic || use gallium; then
1011 eselect mesa set --auto
1012 fi
1013
1014 # Switch to mesa opencl
1015 if use opencl; then
1016 eselect opencl set --use-old ${PN}
1017 fi
1018
1019 # run omxregister-bellagio to make the OpenMAX drivers known system-wide
1020 if use openmax; then
1021 ebegin "Registering OpenMAX drivers"
1022 BELLAGIO_SEARCH_PATH="${EPREFIX}/usr/$(get_libdir)/libomxil-bellagio0" \
1023 OMX_BELLAGIO_REGISTRY=${EPREFIX}/usr/share/mesa/xdg/.omxregister \
1024 omxregister-bellagio
1025 eend $?
1026 fi
1027
1028 # warn about patent encumbered texture-float
1029 if use !bindist; then
1030 elog "USE=\"bindist\" was not set. Potentially patent encumbered code was"
1031 elog "enabled. Please see patents.txt for an explanation."
1032 fi
1033
1034 local using_radeon r_flag
1035 for r_flag in ${RADEON_CARDS}; do
1036 if use video_cards_${r_flag}; then
1037 using_radeon=1
1038 break
1039 fi
1040 done
1041
1042 if [[ ${using_radeon} = 1 ]] && ! has_version media-libs/libtxc_dxtn; then
1043 elog "Note that in order to have full S3TC support, it is necessary to install"
1044 elog "media-libs/libtxc_dxtn as well. This may be necessary to get nice"
1045 elog "textures in some apps, and some others even require this to run."
1046 fi
1047 }
1048
1049 pkg_prerm() {
1050 if use openmax; then
1051 rm "${EPREFIX}"/usr/share/mesa/xdg/.omxregister
1052 fi
1053 }
1054
1055 # $1 - VIDEO_CARDS flag
1056 # other args - names of DRI drivers to enable
1057 # TODO: avoid code duplication for a more elegant implementation
1058 driver_enable() {
1059 case $# in
1060 # for enabling unconditionally
1061 1)
1062 DRI_DRIVERS+=",$1"
1063 ;;
1064 *)
1065 if use $1; then
1066 shift
1067 for i in $@; do
1068 DRI_DRIVERS+=",${i}"
1069 done
1070 fi
1071 ;;
1072 esac
1073 }
1074
1075 gallium_enable() {
1076 case $# in
1077 # for enabling unconditionally
1078 1)
1079 GALLIUM_DRIVERS+=",$1"
1080 ;;
1081 *)
1082 if use $1; then
1083 shift
1084 for i in $@; do
1085 GALLIUM_DRIVERS+=",${i}"
1086 done
1087 fi
1088 ;;
1089 esac
1090 }