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