Gentoo Archives: gentoo-commits

From: Aric Belsito <lluixhi@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/musl:master commit in: media-libs/mesa/
Date: Sat, 02 Jun 2018 01:18:23
Message-Id: 1527902267.5ea0ed7b2a426a6e7cedc21d742168d0ec1a2dae.lluixhi@gentoo
1 commit: 5ea0ed7b2a426a6e7cedc21d742168d0ec1a2dae
2 Author: Aric Belsito <lluixhi <AT> gmail <DOT> com>
3 AuthorDate: Sat Jun 2 01:17:47 2018 +0000
4 Commit: Aric Belsito <lluixhi <AT> gmail <DOT> com>
5 CommitDate: Sat Jun 2 01:17:47 2018 +0000
6 URL: https://gitweb.gentoo.org/proj/musl.git/commit/?id=5ea0ed7b
7
8 media-libs/mesa: version bump to 18.1.0-r1
9
10 media-libs/mesa/mesa-18.1.0-r1.ebuild | 538 ++++++++++++++++++++++++++++++++++
11 1 file changed, 538 insertions(+)
12
13 diff --git a/media-libs/mesa/mesa-18.1.0-r1.ebuild b/media-libs/mesa/mesa-18.1.0-r1.ebuild
14 new file mode 100644
15 index 0000000..60501fc
16 --- /dev/null
17 +++ b/media-libs/mesa/mesa-18.1.0-r1.ebuild
18 @@ -0,0 +1,538 @@
19 +# Copyright 1999-2018 Gentoo Foundation
20 +# Distributed under the terms of the GNU General Public License v2
21 +
22 +EAPI=6
23 +
24 +EGIT_REPO_URI="https://anongit.freedesktop.org/git/mesa/mesa.git"
25 +
26 +if [[ ${PV} = 9999 ]]; then
27 + GIT_ECLASS="git-r3"
28 + EXPERIMENTAL="true"
29 +fi
30 +
31 +PYTHON_COMPAT=( python2_7 )
32 +
33 +inherit autotools llvm multilib-minimal python-any-r1 pax-utils ${GIT_ECLASS}
34 +
35 +OPENGL_DIR="xorg-x11"
36 +
37 +MY_P="${P/_/-}"
38 +
39 +DESCRIPTION="OpenGL-like graphic library for Linux"
40 +HOMEPAGE="https://www.mesa3d.org/ https://mesa.freedesktop.org/"
41 +
42 +if [[ $PV == 9999 ]]; then
43 + SRC_URI=""
44 +else
45 + SRC_URI="https://mesa.freedesktop.org/archive/${MY_P}.tar.xz"
46 + KEYWORDS="~amd64 ~arm ~ia64 ~mips ~ppc ~sh ~sparc ~x86"
47 +fi
48 +
49 +LICENSE="MIT"
50 +SLOT="0"
51 +RESTRICT="!bindist? ( bindist )"
52 +
53 +RADEON_CARDS="r100 r200 r300 r600 radeon radeonsi"
54 +VIDEO_CARDS="${RADEON_CARDS} freedreno i915 i965 imx intel nouveau vc4 virgl vivante vmware"
55 +for card in ${VIDEO_CARDS}; do
56 + IUSE_VIDEO_CARDS+=" video_cards_${card}"
57 +done
58 +
59 +IUSE="${IUSE_VIDEO_CARDS}
60 + bindist +classic d3d9 debug +dri3 +egl +gallium +gbm gles1 gles2 unwind
61 + +llvm +nptl opencl osmesa pax_kernel openmax pic selinux vaapi valgrind
62 + vdpau vulkan wayland xvmc xa"
63 +
64 +REQUIRED_USE="
65 + d3d9? ( dri3 gallium )
66 + llvm? ( gallium )
67 + opencl? ( gallium llvm )
68 + openmax? ( gallium )
69 + gles1? ( egl )
70 + gles2? ( egl )
71 + vaapi? ( gallium )
72 + vdpau? ( gallium )
73 + vulkan? ( || ( video_cards_i965 video_cards_radeonsi )
74 + video_cards_radeonsi? ( llvm ) )
75 + wayland? ( egl gbm )
76 + xa? ( gallium )
77 + video_cards_freedreno? ( gallium )
78 + video_cards_intel? ( classic )
79 + video_cards_i915? ( || ( classic gallium ) )
80 + video_cards_i965? ( classic )
81 + video_cards_imx? ( gallium video_cards_vivante )
82 + video_cards_nouveau? ( || ( classic gallium ) )
83 + video_cards_radeon? ( || ( classic gallium )
84 + gallium? ( x86? ( llvm ) amd64? ( llvm ) ) )
85 + video_cards_r100? ( classic )
86 + video_cards_r200? ( classic )
87 + video_cards_r300? ( gallium x86? ( llvm ) amd64? ( llvm ) )
88 + video_cards_r600? ( gallium )
89 + video_cards_radeonsi? ( gallium llvm )
90 + video_cards_vc4? ( gallium )
91 + video_cards_virgl? ( gallium )
92 + video_cards_vivante? ( gallium gbm )
93 + video_cards_vmware? ( gallium )
94 +"
95 +
96 +LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.91"
97 +RDEPEND="
98 + !app-eselect/eselect-mesa
99 + >=app-eselect/eselect-opengl-1.3.0
100 + >=dev-libs/expat-2.1.0-r3:=[${MULTILIB_USEDEP}]
101 + >=sys-libs/zlib-1.2.8[${MULTILIB_USEDEP}]
102 + >=x11-libs/libX11-1.6.2:=[${MULTILIB_USEDEP}]
103 + >=x11-libs/libxshmfence-1.1:=[${MULTILIB_USEDEP}]
104 + >=x11-libs/libXdamage-1.1.4-r1:=[${MULTILIB_USEDEP}]
105 + >=x11-libs/libXext-1.3.2:=[${MULTILIB_USEDEP}]
106 + >=x11-libs/libXxf86vm-1.1.3:=[${MULTILIB_USEDEP}]
107 + >=x11-libs/libxcb-1.13:=[${MULTILIB_USEDEP}]
108 + x11-libs/libXfixes:=[${MULTILIB_USEDEP}]
109 + unwind? ( sys-libs/libunwind[${MULTILIB_USEDEP}] )
110 + llvm? (
111 + video_cards_radeonsi? (
112 + virtual/libelf:0=[${MULTILIB_USEDEP}]
113 + )
114 + video_cards_r600? (
115 + virtual/libelf:0=[${MULTILIB_USEDEP}]
116 + )
117 + video_cards_radeon? (
118 + virtual/libelf:0=[${MULTILIB_USEDEP}]
119 + )
120 + )
121 + opencl? (
122 + app-eselect/eselect-opencl
123 + dev-libs/libclc
124 + virtual/libelf:0=[${MULTILIB_USEDEP}]
125 + )
126 + openmax? (
127 + >=media-libs/libomxil-bellagio-0.9.3:=[${MULTILIB_USEDEP}]
128 + x11-misc/xdg-utils
129 + )
130 + vaapi? (
131 + >=x11-libs/libva-1.7.3:=[${MULTILIB_USEDEP}]
132 + video_cards_nouveau? ( !<=x11-libs/libva-vdpau-driver-0.7.4-r3 )
133 + )
134 + vdpau? ( >=x11-libs/libvdpau-1.1:=[${MULTILIB_USEDEP}] )
135 + wayland? (
136 + >=dev-libs/wayland-1.11.0:=[${MULTILIB_USEDEP}]
137 + >=dev-libs/wayland-protocols-1.8
138 + )
139 + xvmc? ( >=x11-libs/libXvMC-1.0.8:=[${MULTILIB_USEDEP}] )
140 + ${LIBDRM_DEPSTRING}[video_cards_freedreno?,video_cards_nouveau?,video_cards_vc4?,video_cards_vivante?,video_cards_vmware?,${MULTILIB_USEDEP}]
141 +
142 + video_cards_intel? (
143 + !video_cards_i965? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
144 + )
145 + video_cards_i915? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
146 +"
147 +for card in ${RADEON_CARDS}; do
148 + RDEPEND="${RDEPEND}
149 + video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_radeon] )
150 + "
151 +done
152 +RDEPEND="${RDEPEND}
153 + video_cards_radeonsi? ( ${LIBDRM_DEPSTRING}[video_cards_amdgpu] )
154 +"
155 +
156 +# Please keep the LLVM dependency block separate. Since LLVM is slotted,
157 +# we need to *really* make sure we're not pulling one than more slot
158 +# simultaneously.
159 +#
160 +# How to use it:
161 +# 1. List all the working slots (with min versions) in ||, newest first.
162 +# 2. Update the := to specify *max* version, e.g. < 7.
163 +# 3. Specify LLVM_MAX_SLOT, e.g. 6.
164 +LLVM_DEPSTR="
165 + || (
166 + sys-devel/llvm:7[${MULTILIB_USEDEP}]
167 + sys-devel/llvm:6[${MULTILIB_USEDEP}]
168 + sys-devel/llvm:5[${MULTILIB_USEDEP}]
169 + sys-devel/llvm:4[${MULTILIB_USEDEP}]
170 + >=sys-devel/llvm-3.9.0:0[${MULTILIB_USEDEP}]
171 + )
172 + sys-devel/llvm:=[${MULTILIB_USEDEP}]
173 +"
174 +LLVM_DEPSTR_AMDGPU=${LLVM_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
175 +CLANG_DEPSTR=${LLVM_DEPSTR//llvm/clang}
176 +CLANG_DEPSTR_AMDGPU=${CLANG_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
177 +RDEPEND="${RDEPEND}
178 + llvm? (
179 + opencl? (
180 + video_cards_r600? (
181 + ${CLANG_DEPSTR_AMDGPU}
182 + )
183 + !video_cards_r600? (
184 + video_cards_radeonsi? (
185 + ${CLANG_DEPSTR_AMDGPU}
186 + )
187 + )
188 + !video_cards_r600? (
189 + !video_cards_radeonsi? (
190 + video_cards_radeon? (
191 + ${CLANG_DEPSTR_AMDGPU}
192 + )
193 + )
194 + )
195 + !video_cards_r600? (
196 + !video_cards_radeon? (
197 + !video_cards_radeonsi? (
198 + ${CLANG_DEPSTR}
199 + )
200 + )
201 + )
202 + )
203 + !opencl? (
204 + video_cards_r600? (
205 + ${LLVM_DEPSTR_AMDGPU}
206 + )
207 + !video_cards_r600? (
208 + video_cards_radeonsi? (
209 + ${LLVM_DEPSTR_AMDGPU}
210 + )
211 + )
212 + !video_cards_r600? (
213 + !video_cards_radeonsi? (
214 + video_cards_radeon? (
215 + ${LLVM_DEPSTR_AMDGPU}
216 + )
217 + )
218 + )
219 + !video_cards_r600? (
220 + !video_cards_radeon? (
221 + !video_cards_radeonsi? (
222 + ${LLVM_DEPSTR}
223 + )
224 + )
225 + )
226 + )
227 + )
228 +"
229 +unset {LLVM,CLANG}_DEPSTR{,_AMDGPU}
230 +
231 +DEPEND="${RDEPEND}
232 + ${PYTHON_DEPS}
233 + opencl? (
234 + >=sys-devel/gcc-4.6
235 + )
236 + sys-devel/gettext
237 + virtual/pkgconfig
238 + valgrind? ( dev-util/valgrind )
239 + x11-base/xorg-proto
240 + vulkan? (
241 + $(python_gen_any_dep ">=dev-python/mako-0.7.3[\${PYTHON_USEDEP}]")
242 + )
243 +"
244 +[[ ${PV} == 9999 ]] && DEPEND+="
245 + sys-devel/bison
246 + sys-devel/flex
247 + $(python_gen_any_dep ">=dev-python/mako-0.7.3[\${PYTHON_USEDEP}]")
248 +"
249 +
250 +S="${WORKDIR}/${MY_P}"
251 +EGIT_CHECKOUT_DIR=${S}
252 +
253 +QA_WX_LOAD="
254 +x86? (
255 + !pic? (
256 + usr/lib*/libglapi.so.0.0.0
257 + usr/lib*/libGLESv1_CM.so.1.1.0
258 + usr/lib*/libGLESv2.so.2.0.0
259 + usr/lib*/libGL.so.1.2.0
260 + usr/lib*/libOSMesa.so.8.0.0
261 + )
262 +)"
263 +
264 +llvm_check_deps() {
265 + local flags=${MULTILIB_USEDEP}
266 + if use video_cards_r600 || use video_cards_radeon || use video_cards_radeonsi
267 + then
268 + flags+=",llvm_targets_AMDGPU(-)"
269 + fi
270 +
271 + if use opencl; then
272 + has_version "sys-devel/clang[${flags}]" || return 1
273 + fi
274 + has_version "sys-devel/llvm[${flags}]"
275 +}
276 +
277 +pkg_setup() {
278 + # warning message for bug 459306
279 + if use llvm && has_version sys-devel/llvm[!debug=]; then
280 + ewarn "Mismatch between debug USE flags in media-libs/mesa and sys-devel/llvm"
281 + ewarn "detected! This can cause problems. For details, see bug 459306."
282 + fi
283 +
284 + if use llvm; then
285 + llvm_pkg_setup
286 + fi
287 + python-any-r1_pkg_setup
288 +}
289 +
290 +src_prepare() {
291 + eapply "${FILESDIR}"/${PN}-17-execinfo.patch
292 + eapply "${FILESDIR}"/${PN}-17-musl-string_h.patch
293 + eapply "${FILESDIR}"/${PN}-17-musl-invocation_name.patch
294 + eapply "${FILESDIR}"/${PN}-18-musl-pthread.patch
295 + eapply "${FILESDIR}"/${PN}-18-intel-missing-time_t.patch
296 +
297 + eautoreconf
298 +
299 + eapply_user
300 +}
301 +
302 +multilib_src_configure() {
303 + local myconf
304 +
305 + if use classic; then
306 + # Configurable DRI drivers
307 + driver_enable swrast
308 +
309 + # Intel code
310 + driver_enable video_cards_i915 i915
311 + driver_enable video_cards_i965 i965
312 + if ! use video_cards_i915 && \
313 + ! use video_cards_i965; then
314 + driver_enable video_cards_intel i915 i965
315 + fi
316 +
317 + # Nouveau code
318 + driver_enable video_cards_nouveau nouveau
319 +
320 + # ATI code
321 + driver_enable video_cards_r100 radeon
322 + driver_enable video_cards_r200 r200
323 + if ! use video_cards_r100 && \
324 + ! use video_cards_r200; then
325 + driver_enable video_cards_radeon radeon r200
326 + fi
327 + fi
328 +
329 + if use egl; then
330 + myconf+=" --with-platforms=x11,surfaceless$(use wayland && echo ",wayland")$(use gbm && echo ",drm")"
331 + fi
332 +
333 + if use gallium; then
334 + myconf+="
335 + $(use_enable d3d9 nine)
336 + $(use_enable llvm)
337 + $(use_enable openmax omx-bellagio)
338 + $(use_enable vaapi va)
339 + $(use_enable vdpau)
340 + $(use_enable xa)
341 + $(use_enable xvmc)
342 + "
343 + use vaapi && myconf+=" --with-va-libdir=/usr/$(get_libdir)/va/drivers"
344 +
345 + gallium_enable swrast
346 + gallium_enable video_cards_vc4 vc4
347 + gallium_enable video_cards_vivante etnaviv
348 + gallium_enable video_cards_vmware svga
349 + gallium_enable video_cards_nouveau nouveau
350 + gallium_enable video_cards_i915 i915
351 + gallium_enable video_cards_imx imx
352 + if ! use video_cards_i915 && \
353 + ! use video_cards_i965; then
354 + gallium_enable video_cards_intel i915
355 + fi
356 +
357 + gallium_enable video_cards_r300 r300
358 + gallium_enable video_cards_r600 r600
359 + gallium_enable video_cards_radeonsi radeonsi
360 + if ! use video_cards_r300 && \
361 + ! use video_cards_r600; then
362 + gallium_enable video_cards_radeon r300 r600
363 + fi
364 +
365 + gallium_enable video_cards_freedreno freedreno
366 + # opencl stuff
367 + if use opencl; then
368 + myconf+="
369 + $(use_enable opencl)
370 + --with-clang-libdir="${EPREFIX}/usr/lib"
371 + "
372 + fi
373 +
374 + gallium_enable video_cards_virgl virgl
375 + fi
376 +
377 + if use vulkan; then
378 + vulkan_enable video_cards_i965 intel
379 + vulkan_enable video_cards_radeonsi radeon
380 + fi
381 +
382 + # x86 hardened pax_kernel needs glx-rts, bug 240956
383 + if [[ ${ABI} == x86 ]]; then
384 + myconf+=" $(use_enable pax_kernel glx-read-only-text)"
385 + fi
386 +
387 + # on abi_x86_32 hardened we need to have asm disable
388 + if [[ ${ABI} == x86* ]] && use pic; then
389 + myconf+=" --disable-asm"
390 + fi
391 +
392 + if use gallium; then
393 + myconf+=" $(use_enable osmesa gallium-osmesa)"
394 + else
395 + myconf+=" $(use_enable osmesa)"
396 + fi
397 +
398 + # build fails with BSD indent, bug #428112
399 + use userland_GNU || export INDENT=cat
400 +
401 + ECONF_SOURCE="${S}" \
402 + econf \
403 + --enable-dri \
404 + --enable-glx \
405 + --enable-shared-glapi \
406 + $(use_enable !bindist texture-float) \
407 + $(use_enable d3d9 nine) \
408 + $(use_enable debug) \
409 + $(use_enable dri3) \
410 + $(use_enable egl) \
411 + $(use_enable gbm) \
412 + $(use_enable gles1) \
413 + $(use_enable gles2) \
414 + $(use_enable nptl glx-tls) \
415 + $(use_enable unwind libunwind) \
416 + --enable-valgrind=$(usex valgrind auto no) \
417 + --enable-llvm-shared-libs \
418 + --disable-opencl-icd \
419 + --with-dri-drivers=${DRI_DRIVERS} \
420 + --with-gallium-drivers=${GALLIUM_DRIVERS} \
421 + --with-vulkan-drivers=${VULKAN_DRIVERS} \
422 + PYTHON2="${PYTHON}" \
423 + ${myconf}
424 +}
425 +
426 +multilib_src_install() {
427 + emake install DESTDIR="${D}"
428 +
429 + if use opencl; then
430 + ebegin "Moving Gallium/Clover OpenCL implementation for dynamic switching"
431 + local cl_dir="/usr/$(get_libdir)/OpenCL/vendors/mesa"
432 + dodir ${cl_dir}/{lib,include}
433 + if [ -f "${ED}/usr/$(get_libdir)/libOpenCL.so" ]; then
434 + mv -f "${ED}"/usr/$(get_libdir)/libOpenCL.so* \
435 + "${ED}"${cl_dir}
436 + fi
437 + if [ -f "${ED}/usr/include/CL/opencl.h" ]; then
438 + mv -f "${ED}"/usr/include/CL \
439 + "${ED}"${cl_dir}/include
440 + fi
441 + eend $?
442 + fi
443 +
444 + if use openmax; then
445 + echo "XDG_DATA_DIRS=\"${EPREFIX}/usr/share/mesa/xdg\"" > "${T}/99mesaxdgomx"
446 + doenvd "${T}"/99mesaxdgomx
447 + keepdir /usr/share/mesa/xdg
448 + fi
449 +}
450 +
451 +multilib_src_install_all() {
452 + find "${ED}" -name '*.la' -delete
453 + einstalldocs
454 +
455 + if use !bindist; then
456 + dodoc docs/patents.txt
457 + fi
458 +}
459 +
460 +multilib_src_test() {
461 + if use llvm; then
462 + 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'
463 + pushd src/gallium/drivers/llvmpipe >/dev/null || die
464 + emake ${llvm_tests}
465 + pax-mark m ${llvm_tests}
466 + popd >/dev/null || die
467 + fi
468 + emake check
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 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 /usr/share/doc/${P}/patents.txt.bz2 for an"
494 + elog "explanation."
495 + fi
496 +}
497 +
498 +pkg_prerm() {
499 + if use openmax; then
500 + rm "${EPREFIX}"/usr/share/mesa/xdg/.omxregister
501 + fi
502 +}
503 +
504 +# $1 - VIDEO_CARDS flag
505 +# other args - names of DRI drivers to enable
506 +# TODO: avoid code duplication for a more elegant implementation
507 +driver_enable() {
508 + case $# in
509 + # for enabling unconditionally
510 + 1)
511 + DRI_DRIVERS+=",$1"
512 + ;;
513 + *)
514 + if use $1; then
515 + shift
516 + for i in $@; do
517 + DRI_DRIVERS+=",${i}"
518 + done
519 + fi
520 + ;;
521 + esac
522 +}
523 +
524 +gallium_enable() {
525 + case $# in
526 + # for enabling unconditionally
527 + 1)
528 + GALLIUM_DRIVERS+=",$1"
529 + ;;
530 + *)
531 + if use $1; then
532 + shift
533 + for i in $@; do
534 + GALLIUM_DRIVERS+=",${i}"
535 + done
536 + fi
537 + ;;
538 + esac
539 +}
540 +
541 +vulkan_enable() {
542 + case $# in
543 + # for enabling unconditionally
544 + 1)
545 + VULKAN_DRIVERS+=",$1"
546 + ;;
547 + *)
548 + if use $1; then
549 + shift
550 + for i in $@; do
551 + VULKAN_DRIVERS+=",${i}"
552 + done
553 + fi
554 + ;;
555 + esac
556 +}