Gentoo Archives: gentoo-commits

From: Matt Turner <mattst88@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/mesa/
Date: Wed, 21 Apr 2021 21:26:30
Message-Id: 1619040354.c3ac18f3f6f3bd3eb2c266a8e79bdb4eb2bfb4fe.mattst88@gentoo
1 commit: c3ac18f3f6f3bd3eb2c266a8e79bdb4eb2bfb4fe
2 Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
3 AuthorDate: Wed Apr 21 21:23:17 2021 +0000
4 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
5 CommitDate: Wed Apr 21 21:25:54 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c3ac18f3
7
8 media-libs/mesa: Version bump to 21.1.0_rc2
9
10 Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>
11
12 media-libs/mesa/Manifest | 1 +
13 media-libs/mesa/mesa-21.1.0_rc2.ebuild | 564 +++++++++++++++++++++++++++++++++
14 2 files changed, 565 insertions(+)
15
16 diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
17 index 12fd22ba98e..13e28e4a72f 100644
18 --- a/media-libs/mesa/Manifest
19 +++ b/media-libs/mesa/Manifest
20 @@ -1,3 +1,4 @@
21 DIST mesa-20.3.5.tar.xz 14367412 BLAKE2B 7bad876ce702158e727a752eda6722e7165b497fd3a485dae4e989f22b13288a93f51bcd5e6a69b979f0bbe41599fa237c08f3bbb81cb9c6dc4c06827f8ad5f4 SHA512 481e710ed80d8f215a8d541cfe51b960862c2403c2b9e7e6932c8236b8decb5d478871d6c73559d6d795ada143803764f3a93b2329588c80f62e2e5ec98c78a9
22 DIST mesa-21.0.1.tar.xz 14648932 BLAKE2B 70e1277336320d7b4351c72f42a72cbcb91dcbc46cc1bf30996b8895bbc30552265404508130c828b67a7d045c9f6eece5ac3d07c2443cea581774c585ba0b69 SHA512 b31b78778b6092dfaf0712f90de3074217574389c4236f8379c127739874f6bd1b47883140a26445d25e58df87e6207278efd048453096ee710d334b1dcfe419
23 DIST mesa-21.0.2.tar.xz 14671512 BLAKE2B 5733e65e7e8ffe3e6bed17f499c4d40d2dfbd3dafef967f6b1dbbd14089734640aed02d39568a32d362cc27b4125f425874c25625fd58731500910427dc6c594 SHA512 c3d7969b56e1c31ee642e3b7143d565c4233173dab7cc5576b686c873c27134dc8292a9f2caa0a0dd3c54d0c89d27d6030f36a2c84f85dcedee7ae80b19e5c3b
24 +DIST mesa-21.1.0-rc2.tar.xz 15053612 BLAKE2B 25d83aebf4498e1e0ad096999a97b8b8e336b066c19507ee104191d64c495208711e2bb91a62d8dfc4d7b1654dc623a94ad54c9d1951b37182dd8291fff82cd9 SHA512 1f8cbbbc597519a025e9adf34e65b176781ebdab3d3b7ed20312bef79d727da4c778ac7daf94cef8d652c0e05f77fe534cf347d4bebeb00c682d0d807a148f5d
25
26 diff --git a/media-libs/mesa/mesa-21.1.0_rc2.ebuild b/media-libs/mesa/mesa-21.1.0_rc2.ebuild
27 new file mode 100644
28 index 00000000000..1c0e0aaca5d
29 --- /dev/null
30 +++ b/media-libs/mesa/mesa-21.1.0_rc2.ebuild
31 @@ -0,0 +1,564 @@
32 +# Copyright 1999-2021 Gentoo Authors
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=7
36 +
37 +PYTHON_COMPAT=( python3_{7,8,9} )
38 +
39 +inherit llvm meson multilib-minimal python-any-r1 linux-info
40 +
41 +OPENGL_DIR="xorg-x11"
42 +
43 +MY_P="${P/_/-}"
44 +
45 +DESCRIPTION="OpenGL-like graphic library for Linux"
46 +HOMEPAGE="https://www.mesa3d.org/ https://mesa.freedesktop.org/"
47 +
48 +if [[ ${PV} == 9999 ]]; then
49 + EGIT_REPO_URI="https://gitlab.freedesktop.org/mesa/mesa.git"
50 + inherit git-r3
51 +else
52 + SRC_URI="https://archive.mesa3d.org/${MY_P}.tar.xz"
53 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris"
54 +fi
55 +
56 +LICENSE="MIT"
57 +SLOT="0"
58 +RESTRICT="
59 + !test? ( test )
60 +"
61 +
62 +RADEON_CARDS="r100 r200 r300 r600 radeon radeonsi"
63 +VIDEO_CARDS="${RADEON_CARDS} freedreno i915 i965 intel iris lima nouveau panfrost v3d vc4 virgl vivante vmware"
64 +for card in ${VIDEO_CARDS}; do
65 + IUSE_VIDEO_CARDS+=" video_cards_${card}"
66 +done
67 +
68 +IUSE="${IUSE_VIDEO_CARDS}
69 + +classic d3d9 debug +dri3 +egl +gallium +gbm gles1 +gles2 +llvm
70 + lm-sensors opencl osmesa selinux test unwind vaapi valgrind vdpau vulkan
71 + vulkan-overlay wayland +X xa xvmc zink +zstd"
72 +
73 +REQUIRED_USE="
74 + d3d9? ( dri3 || ( video_cards_iris video_cards_r300 video_cards_r600 video_cards_radeonsi video_cards_nouveau video_cards_vmware ) )
75 + gles1? ( egl )
76 + gles2? ( egl )
77 + osmesa? ( gallium )
78 + vulkan? ( dri3
79 + video_cards_radeonsi? ( llvm ) )
80 + vulkan-overlay? ( vulkan )
81 + wayland? ( egl gbm )
82 + video_cards_freedreno? ( gallium )
83 + video_cards_intel? ( classic )
84 + video_cards_i915? ( || ( classic gallium ) )
85 + video_cards_i965? ( classic )
86 + video_cards_iris? ( gallium )
87 + video_cards_lima? ( gallium )
88 + video_cards_nouveau? ( || ( classic gallium ) )
89 + video_cards_panfrost? ( gallium )
90 + video_cards_radeon? ( || ( classic gallium )
91 + gallium? ( x86? ( llvm ) amd64? ( llvm ) ) )
92 + video_cards_r100? ( classic )
93 + video_cards_r200? ( classic )
94 + video_cards_r300? ( gallium x86? ( llvm ) amd64? ( llvm ) )
95 + video_cards_r600? ( gallium )
96 + video_cards_radeonsi? ( gallium llvm )
97 + video_cards_v3d? ( gallium )
98 + video_cards_vc4? ( gallium )
99 + video_cards_virgl? ( gallium )
100 + video_cards_vivante? ( gallium gbm )
101 + video_cards_vmware? ( gallium )
102 + xa? ( X )
103 + xvmc? ( X )
104 + zink? ( gallium vulkan )
105 +"
106 +
107 +LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.105"
108 +RDEPEND="
109 + >=dev-libs/expat-2.1.0-r3:=[${MULTILIB_USEDEP}]
110 + >=media-libs/libglvnd-1.3.2[X?,${MULTILIB_USEDEP}]
111 + >=sys-libs/zlib-1.2.8[${MULTILIB_USEDEP}]
112 + gallium? (
113 + unwind? ( sys-libs/libunwind[${MULTILIB_USEDEP}] )
114 + llvm? (
115 + video_cards_radeonsi? (
116 + virtual/libelf:0=[${MULTILIB_USEDEP}]
117 + )
118 + video_cards_r600? (
119 + virtual/libelf:0=[${MULTILIB_USEDEP}]
120 + )
121 + video_cards_radeon? (
122 + virtual/libelf:0=[${MULTILIB_USEDEP}]
123 + )
124 + )
125 + lm-sensors? ( sys-apps/lm-sensors:=[${MULTILIB_USEDEP}] )
126 + opencl? (
127 + >=virtual/opencl-3[${MULTILIB_USEDEP}]
128 + dev-libs/libclc
129 + virtual/libelf:0=[${MULTILIB_USEDEP}]
130 + )
131 + vaapi? (
132 + >=x11-libs/libva-1.7.3:=[${MULTILIB_USEDEP}]
133 + )
134 + vdpau? ( >=x11-libs/libvdpau-1.1:=[${MULTILIB_USEDEP}] )
135 + xvmc? ( >=x11-libs/libXvMC-1.0.8:=[${MULTILIB_USEDEP}] )
136 + )
137 + selinux? ( sys-libs/libselinux[${MULTILIB_USEDEP}] )
138 + wayland? (
139 + >=dev-libs/wayland-1.18.0:=[${MULTILIB_USEDEP}]
140 + >=dev-libs/wayland-protocols-1.8
141 + )
142 + ${LIBDRM_DEPSTRING}[video_cards_freedreno?,video_cards_nouveau?,video_cards_vc4?,video_cards_vivante?,video_cards_vmware?,${MULTILIB_USEDEP}]
143 + video_cards_intel? (
144 + !video_cards_i965? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
145 + )
146 + video_cards_i915? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
147 + vulkan-overlay? ( dev-util/glslang:0=[${MULTILIB_USEDEP}] )
148 + X? (
149 + >=x11-libs/libX11-1.6.2:=[${MULTILIB_USEDEP}]
150 + >=x11-libs/libxshmfence-1.1:=[${MULTILIB_USEDEP}]
151 + >=x11-libs/libXext-1.3.2:=[${MULTILIB_USEDEP}]
152 + >=x11-libs/libXxf86vm-1.1.3:=[${MULTILIB_USEDEP}]
153 + >=x11-libs/libxcb-1.13:=[${MULTILIB_USEDEP}]
154 + x11-libs/libXfixes:=[${MULTILIB_USEDEP}]
155 + )
156 + zink? ( media-libs/vulkan-loader:=[${MULTILIB_USEDEP}] )
157 + zstd? ( app-arch/zstd:=[${MULTILIB_USEDEP}] )
158 +"
159 +for card in ${RADEON_CARDS}; do
160 + RDEPEND="${RDEPEND}
161 + video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_radeon] )
162 + "
163 +done
164 +RDEPEND="${RDEPEND}
165 + video_cards_radeonsi? ( ${LIBDRM_DEPSTRING}[video_cards_amdgpu] )
166 +"
167 +
168 +# Please keep the LLVM dependency block separate. Since LLVM is slotted,
169 +# we need to *really* make sure we're not pulling one than more slot
170 +# simultaneously.
171 +#
172 +# How to use it:
173 +# 1. List all the working slots (with min versions) in ||, newest first.
174 +# 2. Update the := to specify *max* version, e.g. < 10.
175 +# 3. Specify LLVM_MAX_SLOT, e.g. 9.
176 +LLVM_MAX_SLOT="11"
177 +LLVM_DEPSTR="
178 + || (
179 + sys-devel/llvm:11[${MULTILIB_USEDEP}]
180 + sys-devel/llvm:10[${MULTILIB_USEDEP}]
181 + )
182 + <sys-devel/llvm-$((LLVM_MAX_SLOT + 1)):=[${MULTILIB_USEDEP}]
183 +"
184 +LLVM_DEPSTR_AMDGPU=${LLVM_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
185 +CLANG_DEPSTR=${LLVM_DEPSTR//llvm/clang}
186 +CLANG_DEPSTR_AMDGPU=${CLANG_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
187 +RDEPEND="${RDEPEND}
188 + gallium? (
189 + llvm? (
190 + opencl? (
191 + video_cards_r600? (
192 + ${CLANG_DEPSTR_AMDGPU}
193 + )
194 + !video_cards_r600? (
195 + video_cards_radeonsi? (
196 + ${CLANG_DEPSTR_AMDGPU}
197 + )
198 + )
199 + !video_cards_r600? (
200 + !video_cards_radeonsi? (
201 + video_cards_radeon? (
202 + ${CLANG_DEPSTR_AMDGPU}
203 + )
204 + )
205 + )
206 + !video_cards_r600? (
207 + !video_cards_radeon? (
208 + !video_cards_radeonsi? (
209 + ${CLANG_DEPSTR}
210 + )
211 + )
212 + )
213 + )
214 + !opencl? (
215 + video_cards_r600? (
216 + ${LLVM_DEPSTR_AMDGPU}
217 + )
218 + !video_cards_r600? (
219 + video_cards_radeonsi? (
220 + ${LLVM_DEPSTR_AMDGPU}
221 + )
222 + )
223 + !video_cards_r600? (
224 + !video_cards_radeonsi? (
225 + video_cards_radeon? (
226 + ${LLVM_DEPSTR_AMDGPU}
227 + )
228 + )
229 + )
230 + !video_cards_r600? (
231 + !video_cards_radeon? (
232 + !video_cards_radeonsi? (
233 + ${LLVM_DEPSTR}
234 + )
235 + )
236 + )
237 + )
238 + )
239 + )
240 +"
241 +unset {LLVM,CLANG}_DEPSTR{,_AMDGPU}
242 +
243 +DEPEND="${RDEPEND}
244 + valgrind? ( dev-util/valgrind )
245 + X? (
246 + x11-libs/libXrandr[${MULTILIB_USEDEP}]
247 + x11-base/xorg-proto
248 + )
249 +"
250 +BDEPEND="
251 + ${PYTHON_DEPS}
252 + opencl? (
253 + >=sys-devel/gcc-4.6
254 + )
255 + sys-devel/bison
256 + sys-devel/flex
257 + virtual/pkgconfig
258 + $(python_gen_any_dep ">=dev-python/mako-0.8.0[\${PYTHON_USEDEP}]")
259 + wayland? ( dev-util/wayland-scanner[${MULTILIB_USEDEP}] )
260 +"
261 +
262 +S="${WORKDIR}/${MY_P}"
263 +EGIT_CHECKOUT_DIR=${S}
264 +
265 +QA_WX_LOAD="
266 +x86? (
267 + usr/lib*/libglapi.so.0.0.0
268 + usr/lib*/libGLESv1_CM.so.1.1.0
269 + usr/lib*/libGLESv2.so.2.0.0
270 + usr/lib*/libGL.so.1.2.0
271 + usr/lib*/libOSMesa.so.8.0.0
272 + usr/lib/libGLX_mesa.so.0.0.0
273 +)"
274 +
275 +llvm_check_deps() {
276 + local flags=${MULTILIB_USEDEP}
277 + if use video_cards_r600 || use video_cards_radeon || use video_cards_radeonsi
278 + then
279 + flags+=",llvm_targets_AMDGPU(-)"
280 + fi
281 +
282 + if use opencl; then
283 + has_version "sys-devel/clang:${LLVM_SLOT}[${flags}]" || return 1
284 + fi
285 + has_version "sys-devel/llvm:${LLVM_SLOT}[${flags}]"
286 +}
287 +
288 +pkg_pretend() {
289 + if use vulkan; then
290 + if ! use video_cards_i965 &&
291 + ! use video_cards_iris &&
292 + ! use video_cards_radeonsi &&
293 + ! use video_cards_v3d; then
294 + ewarn "Ignoring USE=vulkan since VIDEO_CARDS does not contain i965, iris, radeonsi, or v3d"
295 + fi
296 + fi
297 +
298 + if use opencl; then
299 + if ! use video_cards_r600 &&
300 + ! use video_cards_radeonsi; then
301 + ewarn "Ignoring USE=opencl since VIDEO_CARDS does not contain r600 or radeonsi"
302 + fi
303 + fi
304 +
305 + if use vaapi; then
306 + if ! use video_cards_r600 &&
307 + ! use video_cards_radeonsi &&
308 + ! use video_cards_nouveau; then
309 + ewarn "Ignoring USE=vaapi since VIDEO_CARDS does not contain r600, radeonsi, or nouveau"
310 + fi
311 + fi
312 +
313 + if use vdpau; then
314 + if ! use video_cards_r300 &&
315 + ! use video_cards_r600 &&
316 + ! use video_cards_radeonsi &&
317 + ! use video_cards_nouveau; then
318 + ewarn "Ignoring USE=vdpau since VIDEO_CARDS does not contain r300, r600, radeonsi, or nouveau"
319 + fi
320 + fi
321 +
322 + if use xa; then
323 + if ! use video_cards_freedreno &&
324 + ! use video_cards_nouveau &&
325 + ! use video_cards_vmware; then
326 + ewarn "Ignoring USE=xa since VIDEO_CARDS does not contain freedreno, nouveau, or vmware"
327 + fi
328 + fi
329 +
330 + if use xvmc; then
331 + if ! use video_cards_r600 &&
332 + ! use video_cards_nouveau; then
333 + ewarn "Ignoring USE=xvmc since VIDEO_CARDS does not contain r600 or nouveau"
334 + fi
335 + fi
336 +
337 + if ! use gallium; then
338 + use lm-sensors && ewarn "Ignoring USE=lm-sensors since USE does not contain gallium"
339 + use llvm && ewarn "Ignoring USE=llvm since USE does not contain gallium"
340 + use opencl && ewarn "Ignoring USE=opencl since USE does not contain gallium"
341 + use vaapi && ewarn "Ignoring USE=vaapi since USE does not contain gallium"
342 + use vdpau && ewarn "Ignoring USE=vdpau since USE does not contain gallium"
343 + use unwind && ewarn "Ignoring USE=unwind since USE does not contain gallium"
344 + use xa && ewarn "Ignoring USE=xa since USE does not contain gallium"
345 + use xvmc && ewarn "Ignoring USE=xvmc since USE does not contain gallium"
346 + fi
347 +
348 + if ! use llvm; then
349 + use opencl && ewarn "Ignoring USE=opencl since USE does not contain llvm"
350 + fi
351 +
352 + if use osmesa && ! use llvm; then
353 + ewarn "OSMesa will be slow without enabling USE=llvm"
354 + fi
355 +}
356 +
357 +python_check_deps() {
358 + has_version -b ">=dev-python/mako-0.8.0[${PYTHON_USEDEP}]"
359 +}
360 +
361 +pkg_setup() {
362 + # warning message for bug 459306
363 + if use llvm && has_version sys-devel/llvm[!debug=]; then
364 + ewarn "Mismatch between debug USE flags in media-libs/mesa and sys-devel/llvm"
365 + ewarn "detected! This can cause problems. For details, see bug 459306."
366 + fi
367 +
368 + if use video_cards_i965 ||
369 + use video_cards_iris ||
370 + use video_cards_radeonsi; then
371 + if kernel_is -ge 5 11 3; then
372 + CONFIG_CHECK="~KCMP"
373 + elif kernel_is -ge 5 11; then
374 + CONFIG_CHECK="~CHECKPOINT_RESTORE"
375 + elif kernel_is -ge 5 10 20; then
376 + CONFIG_CHECK="~KCMP"
377 + else
378 + CONFIG_CHECK="~CHECKPOINT_RESTORE"
379 + fi
380 + linux-info_pkg_setup
381 + fi
382 +
383 + if use gallium && use llvm; then
384 + llvm_pkg_setup
385 + fi
386 + python-any-r1_pkg_setup
387 +}
388 +
389 +multilib_src_configure() {
390 + local emesonargs=()
391 +
392 + if use classic; then
393 + # Intel code
394 + dri_driver_enable video_cards_i915 i915
395 + dri_driver_enable video_cards_i965 i965
396 + if ! use video_cards_i915 && \
397 + ! use video_cards_i965; then
398 + dri_driver_enable video_cards_intel i915 i965
399 + fi
400 +
401 + # Nouveau code
402 + dri_driver_enable video_cards_nouveau nouveau
403 +
404 + # ATI code
405 + dri_driver_enable video_cards_r100 r100
406 + dri_driver_enable video_cards_r200 r200
407 + if ! use video_cards_r100 && \
408 + ! use video_cards_r200; then
409 + dri_driver_enable video_cards_radeon r100 r200
410 + fi
411 + fi
412 +
413 + local platforms
414 + use X && platforms+="x11"
415 + use wayland && platforms+=",wayland"
416 + emesonargs+=(-Dplatforms=${platforms#,})
417 +
418 + if use X || use egl; then
419 + emesonargs+=(-Dglvnd=true)
420 + else
421 + emesonargs+=(-Dglvnd=false)
422 + fi
423 +
424 + if use gallium; then
425 + emesonargs+=(
426 + $(meson_feature llvm)
427 + $(meson_feature lm-sensors lmsensors)
428 + $(meson_feature unwind libunwind)
429 + )
430 +
431 + if use video_cards_iris ||
432 + use video_cards_r300 ||
433 + use video_cards_r600 ||
434 + use video_cards_radeonsi ||
435 + use video_cards_nouveau ||
436 + use video_cards_vmware; then
437 + emesonargs+=($(meson_use d3d9 gallium-nine))
438 + else
439 + emesonargs+=(-Dgallium-nine=false)
440 + fi
441 +
442 + if use video_cards_r600 ||
443 + use video_cards_radeonsi ||
444 + use video_cards_nouveau; then
445 + emesonargs+=($(meson_feature vaapi gallium-va))
446 + use vaapi && emesonargs+=( -Dva-libs-path="${EPREFIX}"/usr/$(get_libdir)/va/drivers )
447 + else
448 + emesonargs+=(-Dgallium-va=disabled)
449 + fi
450 +
451 + if use video_cards_r300 ||
452 + use video_cards_r600 ||
453 + use video_cards_radeonsi ||
454 + use video_cards_nouveau; then
455 + emesonargs+=($(meson_feature vdpau gallium-vdpau))
456 + else
457 + emesonargs+=(-Dgallium-vdpau=disabled)
458 + fi
459 +
460 + if use video_cards_freedreno ||
461 + use video_cards_nouveau ||
462 + use video_cards_vmware; then
463 + emesonargs+=($(meson_feature xa gallium-xa))
464 + else
465 + emesonargs+=(-Dgallium-xa=disabled)
466 + fi
467 +
468 + if use video_cards_r600 ||
469 + use video_cards_nouveau; then
470 + emesonargs+=($(meson_feature xvmc gallium-xvmc))
471 + else
472 + emesonargs+=(-Dgallium-xvmc=disabled)
473 + fi
474 +
475 + if use video_cards_freedreno ||
476 + use video_cards_lima ||
477 + use video_cards_panfrost ||
478 + use video_cards_v3d ||
479 + use video_cards_vc4 ||
480 + use video_cards_vivante; then
481 + gallium_enable -- kmsro
482 + fi
483 +
484 + gallium_enable -- swrast
485 + gallium_enable video_cards_lima lima
486 + gallium_enable video_cards_panfrost panfrost
487 + gallium_enable video_cards_v3d v3d
488 + gallium_enable video_cards_vc4 vc4
489 + gallium_enable video_cards_vivante etnaviv
490 + gallium_enable video_cards_vmware svga
491 + gallium_enable video_cards_nouveau nouveau
492 + gallium_enable zink zink
493 +
494 + # Only one i915 driver (classic vs gallium). Default to classic.
495 + if ! use classic; then
496 + gallium_enable video_cards_i915 i915
497 + if ! use video_cards_i915 && \
498 + ! use video_cards_i965; then
499 + gallium_enable video_cards_intel i915
500 + fi
501 + fi
502 +
503 + gallium_enable video_cards_iris iris
504 +
505 + gallium_enable video_cards_r300 r300
506 + gallium_enable video_cards_r600 r600
507 + gallium_enable video_cards_radeonsi radeonsi
508 + if ! use video_cards_r300 && \
509 + ! use video_cards_r600; then
510 + gallium_enable video_cards_radeon r300 r600
511 + fi
512 +
513 + gallium_enable video_cards_freedreno freedreno
514 + gallium_enable video_cards_virgl virgl
515 +
516 + # opencl stuff
517 + emesonargs+=(
518 + -Dgallium-opencl="$(usex opencl icd disabled)"
519 + )
520 + fi
521 +
522 + if use vulkan; then
523 + vulkan_enable video_cards_i965 intel
524 + vulkan_enable video_cards_iris intel
525 + vulkan_enable video_cards_radeonsi amd
526 + vulkan_enable video_cards_v3d broadcom
527 + fi
528 +
529 + driver_list() {
530 + local drivers="$(sort -u <<< "${1// /$'\n'}")"
531 + echo "${drivers//$'\n'/,}"
532 + }
533 +
534 + emesonargs+=(
535 + $(meson_use test build-tests)
536 + -Dglx=$(usex X dri disabled)
537 + -Dshared-glapi=enabled
538 + $(meson_feature dri3)
539 + $(meson_feature egl)
540 + $(meson_feature gbm)
541 + $(meson_feature gles1)
542 + $(meson_feature gles2)
543 + $(meson_use osmesa)
544 + $(meson_use selinux)
545 + $(meson_feature zstd)
546 + -Dvalgrind=$(usex valgrind auto false)
547 + -Ddri-drivers=$(driver_list "${DRI_DRIVERS[*]}")
548 + -Dgallium-drivers=$(driver_list "${GALLIUM_DRIVERS[*]}")
549 + -Dvulkan-drivers=$(driver_list "${VULKAN_DRIVERS[*]}")
550 + $(meson_use vulkan vulkan-device-select-layer)
551 + $(meson_use vulkan-overlay vulkan-overlay-layer)
552 + --buildtype $(usex debug debug plain)
553 + -Db_ndebug=$(usex debug false true)
554 + )
555 + meson_src_configure
556 +}
557 +
558 +multilib_src_compile() {
559 + meson_src_compile
560 +}
561 +
562 +multilib_src_install() {
563 + meson_src_install
564 +}
565 +
566 +multilib_src_install_all() {
567 + einstalldocs
568 +}
569 +
570 +multilib_src_test() {
571 + meson_src_test -t 100
572 +}
573 +
574 +# $1 - VIDEO_CARDS flag (check skipped for "--")
575 +# other args - names of DRI drivers to enable
576 +dri_driver_enable() {
577 + if [[ $1 == -- ]] || use $1; then
578 + shift
579 + DRI_DRIVERS+=("$@")
580 + fi
581 +}
582 +
583 +gallium_enable() {
584 + if [[ $1 == -- ]] || use $1; then
585 + shift
586 + GALLIUM_DRIVERS+=("$@")
587 + fi
588 +}
589 +
590 +vulkan_enable() {
591 + if [[ $1 == -- ]] || use $1; then
592 + shift
593 + VULKAN_DRIVERS+=("$@")
594 + fi
595 +}