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: Mon, 28 Mar 2022 14:30:43
Message-Id: 1648477828.0ab20faf2aeb36af54cb0de6c4fb36d0e85a6e80.mattst88@gentoo
1 commit: 0ab20faf2aeb36af54cb0de6c4fb36d0e85a6e80
2 Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
3 AuthorDate: Mon Mar 28 14:29:47 2022 +0000
4 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
5 CommitDate: Mon Mar 28 14:30:28 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0ab20faf
7
8 media-libs/mesa: Version bump to 21.3.8
9
10 Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>
11
12 media-libs/mesa/Manifest | 1 +
13 media-libs/mesa/mesa-21.3.8.ebuild | 561 +++++++++++++++++++++++++++++++++++++
14 2 files changed, 562 insertions(+)
15
16 diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
17 index 4992512ef57b..0496a26ef591 100644
18 --- a/media-libs/mesa/Manifest
19 +++ b/media-libs/mesa/Manifest
20 @@ -1,2 +1,3 @@
21 DIST mesa-21.3.7.tar.xz 16569592 BLAKE2B 7c5a3f144b1ce9e8bbb3560ae2bf46afda9d5c4a3e7b825d406f9a5090dfd51e2b3cc6ee2c10df09c817f5836ffbd09bfc86fbaf63bcc907caef290fd44baee6 SHA512 0991543e9435457fa4d077517408b3f197be32ed61a6c7ca34ddb3906eed208791f1a57227f74115f99df18e612efab1d2c6809b7cf426d273633b53d4aefc88
22 +DIST mesa-21.3.8.tar.xz 16593540 BLAKE2B 89a471af3354ae0cf0597c1b6bcd2aff8074d58c16504154291f86cd9a9701f98883cf1077f60a8f17d24be800691a5bfb7ef4ddb10dfa355181bf87805b660c SHA512 0462c44fa8e358dafd03088411452bc172a365902795b3198df1e6cfbf1d87675ef5b72b572de7f15e5ee87b30ce5b2f217c81ea72b376962f6428c6ff83f2e9
23 DIST mesa-22.0.0.tar.xz 15565680 BLAKE2B 65dd09e1864f353f07ab01cb21cb89f858a071d74043b1913b0abe3ee3b3a992ca3878d40ffe52cc45546770d5ad9e198c93a24a8564ffeb9c8a05da38af300c SHA512 9faef66adbacba24d11dfe8e2d1a753295798883a10a7cc91e6df9d678c64a8286a12e60c0d8576d944a8cc76f00c30d27c3a71d3458bbe3dbcd66c88a454c3b
24
25 diff --git a/media-libs/mesa/mesa-21.3.8.ebuild b/media-libs/mesa/mesa-21.3.8.ebuild
26 new file mode 100644
27 index 000000000000..082bfd9f9739
28 --- /dev/null
29 +++ b/media-libs/mesa/mesa-21.3.8.ebuild
30 @@ -0,0 +1,561 @@
31 +# Copyright 1999-2022 Gentoo Authors
32 +# Distributed under the terms of the GNU General Public License v2
33 +
34 +EAPI=7
35 +
36 +PYTHON_COMPAT=( python3_{8..10} )
37 +
38 +inherit llvm meson-multilib python-any-r1 linux-info
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 + EGIT_REPO_URI="https://gitlab.freedesktop.org/mesa/mesa.git"
47 + inherit git-r3
48 +else
49 + SRC_URI="https://archive.mesa3d.org/${MY_P}.tar.xz"
50 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris"
51 +fi
52 +
53 +LICENSE="MIT"
54 +SLOT="0"
55 +RESTRICT="
56 + !test? ( test )
57 +"
58 +
59 +RADEON_CARDS="r100 r200 r300 r600 radeon radeonsi"
60 +VIDEO_CARDS="${RADEON_CARDS} crocus freedreno i915 i965 intel iris lima nouveau panfrost v3d vc4 virgl vivante vmware"
61 +for card in ${VIDEO_CARDS}; do
62 + IUSE_VIDEO_CARDS+=" video_cards_${card}"
63 +done
64 +
65 +IUSE="${IUSE_VIDEO_CARDS}
66 + +classic cpu_flags_x86_sse2 d3d9 debug +egl +gallium +gbm gles1 +gles2 +llvm
67 + lm-sensors opencl osmesa selinux test unwind vaapi valgrind vdpau vulkan
68 + vulkan-overlay wayland +X xa xvmc zink +zstd"
69 +
70 +REQUIRED_USE="
71 + d3d9? ( || ( video_cards_iris video_cards_r300 video_cards_r600 video_cards_radeonsi video_cards_nouveau video_cards_vmware ) )
72 + gles1? ( egl )
73 + gles2? ( egl )
74 + osmesa? ( gallium )
75 + vulkan? ( video_cards_radeonsi? ( llvm ) )
76 + vulkan-overlay? ( vulkan )
77 + wayland? ( egl gbm )
78 + video_cards_crocus? ( gallium )
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="13"
174 +LLVM_DEPSTR="
175 + || (
176 + sys-devel/llvm:13[${MULTILIB_USEDEP}]
177 + sys-devel/llvm:12[${MULTILIB_USEDEP}]
178 + sys-devel/llvm:11[${MULTILIB_USEDEP}]
179 + )
180 + <sys-devel/llvm-$((LLVM_MAX_SLOT + 1)):=[${MULTILIB_USEDEP}]
181 +"
182 +LLVM_DEPSTR_AMDGPU=${LLVM_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
183 +CLANG_DEPSTR=${LLVM_DEPSTR//llvm/clang}
184 +CLANG_DEPSTR_AMDGPU=${CLANG_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
185 +RDEPEND="${RDEPEND}
186 + gallium? (
187 + llvm? (
188 + opencl? (
189 + video_cards_r600? (
190 + ${CLANG_DEPSTR_AMDGPU}
191 + )
192 + !video_cards_r600? (
193 + video_cards_radeonsi? (
194 + ${CLANG_DEPSTR_AMDGPU}
195 + )
196 + )
197 + !video_cards_r600? (
198 + !video_cards_radeonsi? (
199 + video_cards_radeon? (
200 + ${CLANG_DEPSTR_AMDGPU}
201 + )
202 + )
203 + )
204 + !video_cards_r600? (
205 + !video_cards_radeon? (
206 + !video_cards_radeonsi? (
207 + ${CLANG_DEPSTR}
208 + )
209 + )
210 + )
211 + )
212 + !opencl? (
213 + video_cards_r600? (
214 + ${LLVM_DEPSTR_AMDGPU}
215 + )
216 + !video_cards_r600? (
217 + video_cards_radeonsi? (
218 + ${LLVM_DEPSTR_AMDGPU}
219 + )
220 + )
221 + !video_cards_r600? (
222 + !video_cards_radeonsi? (
223 + video_cards_radeon? (
224 + ${LLVM_DEPSTR_AMDGPU}
225 + )
226 + )
227 + )
228 + !video_cards_r600? (
229 + !video_cards_radeon? (
230 + !video_cards_radeonsi? (
231 + ${LLVM_DEPSTR}
232 + )
233 + )
234 + )
235 + )
236 + )
237 + )
238 +"
239 +unset {LLVM,CLANG}_DEPSTR{,_AMDGPU}
240 +
241 +DEPEND="${RDEPEND}
242 + valgrind? ( dev-util/valgrind )
243 + X? (
244 + x11-libs/libXrandr[${MULTILIB_USEDEP}]
245 + x11-base/xorg-proto
246 + )
247 +"
248 +BDEPEND="
249 + ${PYTHON_DEPS}
250 + opencl? (
251 + >=sys-devel/gcc-4.6
252 + )
253 + sys-devel/bison
254 + sys-devel/flex
255 + virtual/pkgconfig
256 + $(python_gen_any_dep ">=dev-python/mako-0.8.0[\${PYTHON_USEDEP}]")
257 + wayland? ( dev-util/wayland-scanner )
258 +"
259 +
260 +S="${WORKDIR}/${MY_P}"
261 +EGIT_CHECKOUT_DIR=${S}
262 +
263 +QA_WX_LOAD="
264 +x86? (
265 + usr/lib*/libglapi.so.0.0.0
266 + usr/lib*/libGLESv1_CM.so.1.1.0
267 + usr/lib*/libGLESv2.so.2.0.0
268 + usr/lib*/libGL.so.1.2.0
269 + usr/lib*/libOSMesa.so.8.0.0
270 + usr/lib/libGLX_mesa.so.0.0.0
271 +)"
272 +
273 +llvm_check_deps() {
274 + local flags=${MULTILIB_USEDEP}
275 + if use video_cards_r600 || use video_cards_radeon || use video_cards_radeonsi
276 + then
277 + flags+=",llvm_targets_AMDGPU(-)"
278 + fi
279 +
280 + if use opencl; then
281 + has_version "sys-devel/clang:${LLVM_SLOT}[${flags}]" || return 1
282 + fi
283 + has_version "sys-devel/llvm:${LLVM_SLOT}[${flags}]"
284 +}
285 +
286 +pkg_pretend() {
287 + if use vulkan; then
288 + if ! use video_cards_freedreno &&
289 + ! use video_cards_i965 &&
290 + ! use video_cards_iris &&
291 + ! use video_cards_radeonsi &&
292 + ! use video_cards_v3d; then
293 + ewarn "Ignoring USE=vulkan since VIDEO_CARDS does not contain freedreno, i965, iris, radeonsi, or v3d"
294 + fi
295 + fi
296 +
297 + if use opencl; then
298 + if ! use video_cards_r600 &&
299 + ! use video_cards_radeonsi; then
300 + ewarn "Ignoring USE=opencl since VIDEO_CARDS does not contain r600 or radeonsi"
301 + fi
302 + fi
303 +
304 + if use vaapi; then
305 + if ! use video_cards_r600 &&
306 + ! use video_cards_radeonsi &&
307 + ! use video_cards_nouveau; then
308 + ewarn "Ignoring USE=vaapi since VIDEO_CARDS does not contain r600, radeonsi, or nouveau"
309 + fi
310 + fi
311 +
312 + if use vdpau; then
313 + if ! use video_cards_r300 &&
314 + ! use video_cards_r600 &&
315 + ! use video_cards_radeonsi &&
316 + ! use video_cards_nouveau; then
317 + ewarn "Ignoring USE=vdpau since VIDEO_CARDS does not contain r300, r600, radeonsi, or nouveau"
318 + fi
319 + fi
320 +
321 + if use xa; then
322 + if ! use video_cards_freedreno &&
323 + ! use video_cards_nouveau &&
324 + ! use video_cards_vmware; then
325 + ewarn "Ignoring USE=xa since VIDEO_CARDS does not contain freedreno, nouveau, or vmware"
326 + fi
327 + fi
328 +
329 + if use xvmc; then
330 + if ! use video_cards_r600 &&
331 + ! use video_cards_nouveau; then
332 + ewarn "Ignoring USE=xvmc since VIDEO_CARDS does not contain r600 or nouveau"
333 + fi
334 + fi
335 +
336 + if ! use gallium; then
337 + use lm-sensors && ewarn "Ignoring USE=lm-sensors since USE does not contain gallium"
338 + use llvm && ewarn "Ignoring USE=llvm since USE does not contain gallium"
339 + use opencl && ewarn "Ignoring USE=opencl since USE does not contain gallium"
340 + use vaapi && ewarn "Ignoring USE=vaapi since USE does not contain gallium"
341 + use vdpau && ewarn "Ignoring USE=vdpau since USE does not contain gallium"
342 + use unwind && ewarn "Ignoring USE=unwind since USE does not contain gallium"
343 + use xa && ewarn "Ignoring USE=xa since USE does not contain gallium"
344 + use xvmc && ewarn "Ignoring USE=xvmc since USE does not contain gallium"
345 + fi
346 +
347 + if ! use llvm; then
348 + use opencl && ewarn "Ignoring USE=opencl since USE does not contain llvm"
349 + fi
350 +
351 + if use osmesa && ! use llvm; then
352 + ewarn "OSMesa will be slow without enabling USE=llvm"
353 + fi
354 +}
355 +
356 +python_check_deps() {
357 + has_version -b ">=dev-python/mako-0.8.0[${PYTHON_USEDEP}]"
358 +}
359 +
360 +pkg_setup() {
361 + # warning message for bug 459306
362 + if use llvm && has_version sys-devel/llvm[!debug=]; then
363 + ewarn "Mismatch between debug USE flags in media-libs/mesa and sys-devel/llvm"
364 + ewarn "detected! This can cause problems. For details, see bug 459306."
365 + fi
366 +
367 + if use video_cards_i965 ||
368 + use video_cards_iris ||
369 + use video_cards_radeonsi; then
370 + if kernel_is -ge 5 11 3; then
371 + CONFIG_CHECK="~KCMP"
372 + elif kernel_is -ge 5 11; then
373 + CONFIG_CHECK="~CHECKPOINT_RESTORE"
374 + elif kernel_is -ge 5 10 20; then
375 + CONFIG_CHECK="~KCMP"
376 + else
377 + CONFIG_CHECK="~CHECKPOINT_RESTORE"
378 + fi
379 + linux-info_pkg_setup
380 + fi
381 +
382 + if use gallium && use llvm; then
383 + llvm_pkg_setup
384 + fi
385 + python-any-r1_pkg_setup
386 +}
387 +
388 +multilib_src_configure() {
389 + local emesonargs=()
390 +
391 + if use classic; then
392 + # Intel code
393 + dri_driver_enable video_cards_i915 i915
394 + dri_driver_enable video_cards_i965 i965
395 + if ! use video_cards_i915 && \
396 + ! use video_cards_i965; then
397 + dri_driver_enable video_cards_intel i915 i965
398 + fi
399 +
400 + # Nouveau code
401 + dri_driver_enable video_cards_nouveau nouveau
402 +
403 + # ATI code
404 + dri_driver_enable video_cards_r100 r100
405 + dri_driver_enable video_cards_r200 r200
406 + if ! use video_cards_r100 && \
407 + ! use video_cards_r200; then
408 + dri_driver_enable video_cards_radeon r100 r200
409 + fi
410 + fi
411 +
412 + local platforms
413 + use X && platforms+="x11"
414 + use wayland && platforms+=",wayland"
415 + emesonargs+=(-Dplatforms=${platforms#,})
416 +
417 + if use X || use egl; then
418 + emesonargs+=(-Dglvnd=true)
419 + else
420 + emesonargs+=(-Dglvnd=false)
421 + fi
422 +
423 + if use gallium; then
424 + emesonargs+=(
425 + $(meson_feature llvm)
426 + $(meson_feature lm-sensors lmsensors)
427 + $(meson_feature unwind libunwind)
428 + )
429 +
430 + if use video_cards_iris ||
431 + use video_cards_r300 ||
432 + use video_cards_r600 ||
433 + use video_cards_radeonsi ||
434 + use video_cards_nouveau ||
435 + use video_cards_vmware; then
436 + emesonargs+=($(meson_use d3d9 gallium-nine))
437 + else
438 + emesonargs+=(-Dgallium-nine=false)
439 + fi
440 +
441 + if use video_cards_r600 ||
442 + use video_cards_radeonsi ||
443 + use video_cards_nouveau; then
444 + emesonargs+=($(meson_feature vaapi gallium-va))
445 + use vaapi && emesonargs+=( -Dva-libs-path="${EPREFIX}"/usr/$(get_libdir)/va/drivers )
446 + else
447 + emesonargs+=(-Dgallium-va=disabled)
448 + fi
449 +
450 + if use video_cards_r300 ||
451 + use video_cards_r600 ||
452 + use video_cards_radeonsi ||
453 + use video_cards_nouveau; then
454 + emesonargs+=($(meson_feature vdpau gallium-vdpau))
455 + else
456 + emesonargs+=(-Dgallium-vdpau=disabled)
457 + fi
458 +
459 + if use video_cards_freedreno ||
460 + use video_cards_nouveau ||
461 + use video_cards_vmware; then
462 + emesonargs+=($(meson_feature xa gallium-xa))
463 + else
464 + emesonargs+=(-Dgallium-xa=disabled)
465 + fi
466 +
467 + if use video_cards_r600 ||
468 + use video_cards_nouveau; then
469 + emesonargs+=($(meson_feature xvmc gallium-xvmc))
470 + else
471 + emesonargs+=(-Dgallium-xvmc=disabled)
472 + fi
473 +
474 + if use video_cards_freedreno ||
475 + use video_cards_lima ||
476 + use video_cards_panfrost ||
477 + use video_cards_v3d ||
478 + use video_cards_vc4 ||
479 + use video_cards_vivante; then
480 + gallium_enable -- kmsro
481 + fi
482 +
483 + gallium_enable -- swrast
484 + gallium_enable video_cards_lima lima
485 + gallium_enable video_cards_panfrost panfrost
486 + gallium_enable video_cards_v3d v3d
487 + gallium_enable video_cards_vc4 vc4
488 + gallium_enable video_cards_vivante etnaviv
489 + gallium_enable video_cards_vmware svga
490 + gallium_enable video_cards_nouveau nouveau
491 + gallium_enable zink zink
492 +
493 + # Only one i915 driver (classic vs gallium). Default to classic.
494 + if ! use classic; then
495 + gallium_enable video_cards_i915 i915
496 + if ! use video_cards_i915 && \
497 + ! use video_cards_i965; then
498 + gallium_enable video_cards_intel i915
499 + fi
500 + fi
501 +
502 + gallium_enable video_cards_crocus crocus
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_freedreno freedreno
524 + vulkan_enable video_cards_i965 intel
525 + vulkan_enable video_cards_iris intel
526 + vulkan_enable video_cards_radeonsi amd
527 + vulkan_enable video_cards_v3d broadcom
528 + fi
529 +
530 + driver_list() {
531 + local drivers="$(sort -u <<< "${1// /$'\n'}")"
532 + echo "${drivers//$'\n'/,}"
533 + }
534 +
535 + local vulkan_layers
536 + use vulkan && vulkan_layers+="device-select"
537 + use vulkan-overlay && vulkan_layers+=",overlay"
538 + emesonargs+=(-Dvulkan-layers=${vulkan_layers#,})
539 +
540 + emesonargs+=(
541 + -Damber=false
542 + $(meson_use test build-tests)
543 + -Dglx=$(usex X dri disabled)
544 + -Dshared-glapi=enabled
545 + -Ddri3=enabled
546 + $(meson_feature egl)
547 + $(meson_feature gbm)
548 + $(meson_feature gles1)
549 + $(meson_feature gles2)
550 + $(meson_use osmesa)
551 + $(meson_use selinux)
552 + $(meson_feature zstd)
553 + $(meson_use video_cards_crocus prefer-crocus)
554 + $(meson_use video_cards_iris prefer-iris)
555 + $(meson_use cpu_flags_x86_sse2 sse2)
556 + -Dvalgrind=$(usex valgrind auto disabled)
557 + -Ddri-drivers=$(driver_list "${DRI_DRIVERS[*]}")
558 + -Dgallium-drivers=$(driver_list "${GALLIUM_DRIVERS[*]}")
559 + -Dvulkan-drivers=$(driver_list "${VULKAN_DRIVERS[*]}")
560 + --buildtype $(usex debug debug plain)
561 + -Db_ndebug=$(usex debug false true)
562 + )
563 + meson_src_configure
564 +}
565 +
566 +multilib_src_test() {
567 + meson_src_test -t 100
568 +}
569 +
570 +# $1 - VIDEO_CARDS flag (check skipped for "--")
571 +# other args - names of DRI drivers to enable
572 +dri_driver_enable() {
573 + if [[ $1 == -- ]] || use $1; then
574 + shift
575 + DRI_DRIVERS+=("$@")
576 + fi
577 +}
578 +
579 +gallium_enable() {
580 + if [[ $1 == -- ]] || use $1; then
581 + shift
582 + GALLIUM_DRIVERS+=("$@")
583 + fi
584 +}
585 +
586 +vulkan_enable() {
587 + if [[ $1 == -- ]] || use $1; then
588 + shift
589 + VULKAN_DRIVERS+=("$@")
590 + fi
591 +}