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