Gentoo Archives: gentoo-commits

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