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