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: Sat, 30 Oct 2021 23:04:33
Message-Id: 1635635055.7c0620b0e5e89a9bb926e675bb69eee9cf78522e.mattst88@gentoo
1 commit: 7c0620b0e5e89a9bb926e675bb69eee9cf78522e
2 Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
3 AuthorDate: Sat Oct 30 22:41:05 2021 +0000
4 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
5 CommitDate: Sat Oct 30 23:04:15 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7c0620b0
7
8 media-libs/mesa: Version bump to 21.3.0_rc3
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.0_rc3.ebuild | 560 +++++++++++++++++++++++++++++++++
14 2 files changed, 561 insertions(+)
15
16 diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
17 index f0f11dea4fd..ffdcdbb9b07 100644
18 --- a/media-libs/mesa/Manifest
19 +++ b/media-libs/mesa/Manifest
20 @@ -2,3 +2,4 @@ DIST mesa-21.1.7.tar.xz 15391776 BLAKE2B a9138f189ef953d5efa4e287fbbe795ef2539c1
21 DIST mesa-21.1.8.tar.xz 15410504 BLAKE2B 430a1a5f3120bb69b7eaab13438d9a09201f5b11c9d4581d7dd39f48041a1b70d7c125f36553a5c504d1164fe6e0e3d50853c209c4280787f4fa6935ab385b86 SHA512 80fcf2b1d59b49e384e9aa1ae63a3ce709833059af1ffd8eb821054c1976709134098cfc79fac1578a2f08a003223f1c96b38e2e650c5be49821c6f2fe1047af
22 DIST mesa-21.2.2.tar.xz 15755212 BLAKE2B a9c0f847d8d372fac076bd1a2a2113f34d4f5f57d5d459f88b2d1a14bd8a2a442d70c2959637ac17836d8be13941c2192bf639f42d3a7eaf7d8cdb5175268389 SHA512 0a4877b405384088c8bdac3031444cd22377d19552c41c08fb8928d6edf23d5f5a237ef1d6c5f96e3293c2e90c63f4702813226b85cb304fe5e01dd2710ba697
23 DIST mesa-21.2.5.tar.xz 15829684 BLAKE2B a5d00d6c566e699acd1f8cfcf1b52024c92cfa8a4cc9a6fb1d6493526ea0d65790ed97c47c5c174d4369e589caf1a361351df6d43aba89f818970f87f9a81059 SHA512 aaa1ebaa1e18eea76c3784c9a65942c3e417c1079d7bf75dcede574999dc459fb4d68d041cf2f767afb9cbfa834a985e0a4edd5a56b0fc90f8fdc506359aa5da
24 +DIST mesa-21.3.0-rc3.tar.xz 16349156 BLAKE2B bc25478b7ee2c6186baf8f8540da7d5a6847146badd37653b65e2d3a47f8a7ae866825058ad54b68563ddb4f8409180ebb7415925409b6f0b401be81a45eca9d SHA512 14c3cdf2085077db3ec6d7e7b66304fccdaf441dfd64cc085d6d83960fcbdaa18a48d8f6bcdc096def06b6d389f51c1a5cb0a6793a236d668e22c592bc8b2e4c
25
26 diff --git a/media-libs/mesa/mesa-21.3.0_rc3.ebuild b/media-libs/mesa/mesa-21.3.0_rc3.ebuild
27 new file mode 100644
28 index 00000000000..5829adce48f
29 --- /dev/null
30 +++ b/media-libs/mesa/mesa-21.3.0_rc3.ebuild
31 @@ -0,0 +1,560 @@
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} crocus 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 cpu_flags_x86_sse2 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_crocus? ( 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_iris? ( gallium )
85 + video_cards_lima? ( gallium )
86 + video_cards_nouveau? ( || ( classic gallium ) )
87 + video_cards_panfrost? ( gallium )
88 + video_cards_radeon? ( || ( classic gallium )
89 + gallium? ( x86? ( llvm ) amd64? ( llvm ) ) )
90 + video_cards_r100? ( classic )
91 + video_cards_r200? ( classic )
92 + video_cards_r300? ( gallium x86? ( llvm ) amd64? ( llvm ) )
93 + video_cards_r600? ( gallium )
94 + video_cards_radeonsi? ( gallium llvm )
95 + video_cards_v3d? ( gallium )
96 + video_cards_vc4? ( gallium )
97 + video_cards_virgl? ( gallium )
98 + video_cards_vivante? ( gallium gbm )
99 + video_cards_vmware? ( gallium )
100 + xa? ( X )
101 + xvmc? ( X )
102 + zink? ( gallium vulkan )
103 +"
104 +
105 +LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.107"
106 +RDEPEND="
107 + >=dev-libs/expat-2.1.0-r3:=[${MULTILIB_USEDEP}]
108 + >=media-libs/libglvnd-1.3.2[X?,${MULTILIB_USEDEP}]
109 + >=sys-libs/zlib-1.2.8[${MULTILIB_USEDEP}]
110 + gallium? (
111 + unwind? ( sys-libs/libunwind[${MULTILIB_USEDEP}] )
112 + llvm? (
113 + video_cards_radeonsi? (
114 + virtual/libelf:0=[${MULTILIB_USEDEP}]
115 + )
116 + video_cards_r600? (
117 + virtual/libelf:0=[${MULTILIB_USEDEP}]
118 + )
119 + video_cards_radeon? (
120 + virtual/libelf:0=[${MULTILIB_USEDEP}]
121 + )
122 + )
123 + lm-sensors? ( sys-apps/lm-sensors:=[${MULTILIB_USEDEP}] )
124 + opencl? (
125 + >=virtual/opencl-3[${MULTILIB_USEDEP}]
126 + dev-libs/libclc
127 + virtual/libelf:0=[${MULTILIB_USEDEP}]
128 + )
129 + vaapi? (
130 + >=x11-libs/libva-1.7.3:=[${MULTILIB_USEDEP}]
131 + )
132 + vdpau? ( >=x11-libs/libvdpau-1.1:=[${MULTILIB_USEDEP}] )
133 + xvmc? ( >=x11-libs/libXvMC-1.0.8:=[${MULTILIB_USEDEP}] )
134 + )
135 + selinux? ( sys-libs/libselinux[${MULTILIB_USEDEP}] )
136 + wayland? (
137 + >=dev-libs/wayland-1.18.0:=[${MULTILIB_USEDEP}]
138 + >=dev-libs/wayland-protocols-1.8
139 + )
140 + ${LIBDRM_DEPSTRING}[video_cards_freedreno?,video_cards_nouveau?,video_cards_vc4?,video_cards_vivante?,video_cards_vmware?,${MULTILIB_USEDEP}]
141 + video_cards_intel? (
142 + !video_cards_i965? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
143 + )
144 + video_cards_i915? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
145 + vulkan-overlay? ( dev-util/glslang:0=[${MULTILIB_USEDEP}] )
146 + X? (
147 + >=x11-libs/libX11-1.6.2:=[${MULTILIB_USEDEP}]
148 + >=x11-libs/libxshmfence-1.1:=[${MULTILIB_USEDEP}]
149 + >=x11-libs/libXext-1.3.2:=[${MULTILIB_USEDEP}]
150 + >=x11-libs/libXxf86vm-1.1.3:=[${MULTILIB_USEDEP}]
151 + >=x11-libs/libxcb-1.13:=[${MULTILIB_USEDEP}]
152 + x11-libs/libXfixes:=[${MULTILIB_USEDEP}]
153 + )
154 + zink? ( media-libs/vulkan-loader:=[${MULTILIB_USEDEP}] )
155 + zstd? ( app-arch/zstd:=[${MULTILIB_USEDEP}] )
156 +"
157 +for card in ${RADEON_CARDS}; do
158 + RDEPEND="${RDEPEND}
159 + video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_radeon] )
160 + "
161 +done
162 +RDEPEND="${RDEPEND}
163 + video_cards_radeonsi? ( ${LIBDRM_DEPSTRING}[video_cards_amdgpu] )
164 +"
165 +
166 +# Please keep the LLVM dependency block separate. Since LLVM is slotted,
167 +# we need to *really* make sure we're not pulling one than more slot
168 +# simultaneously.
169 +#
170 +# How to use it:
171 +# 1. List all the working slots (with min versions) in ||, newest first.
172 +# 2. Update the := to specify *max* version, e.g. < 10.
173 +# 3. Specify LLVM_MAX_SLOT, e.g. 9.
174 +LLVM_MAX_SLOT="13"
175 +LLVM_DEPSTR="
176 + || (
177 + sys-devel/llvm:13[${MULTILIB_USEDEP}]
178 + sys-devel/llvm:12[${MULTILIB_USEDEP}]
179 + sys-devel/llvm:11[${MULTILIB_USEDEP}]
180 + )
181 + <sys-devel/llvm-$((LLVM_MAX_SLOT + 1)):=[${MULTILIB_USEDEP}]
182 +"
183 +LLVM_DEPSTR_AMDGPU=${LLVM_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
184 +CLANG_DEPSTR=${LLVM_DEPSTR//llvm/clang}
185 +CLANG_DEPSTR_AMDGPU=${CLANG_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
186 +RDEPEND="${RDEPEND}
187 + gallium? (
188 + llvm? (
189 + opencl? (
190 + video_cards_r600? (
191 + ${CLANG_DEPSTR_AMDGPU}
192 + )
193 + !video_cards_r600? (
194 + video_cards_radeonsi? (
195 + ${CLANG_DEPSTR_AMDGPU}
196 + )
197 + )
198 + !video_cards_r600? (
199 + !video_cards_radeonsi? (
200 + video_cards_radeon? (
201 + ${CLANG_DEPSTR_AMDGPU}
202 + )
203 + )
204 + )
205 + !video_cards_r600? (
206 + !video_cards_radeon? (
207 + !video_cards_radeonsi? (
208 + ${CLANG_DEPSTR}
209 + )
210 + )
211 + )
212 + )
213 + !opencl? (
214 + video_cards_r600? (
215 + ${LLVM_DEPSTR_AMDGPU}
216 + )
217 + !video_cards_r600? (
218 + video_cards_radeonsi? (
219 + ${LLVM_DEPSTR_AMDGPU}
220 + )
221 + )
222 + !video_cards_r600? (
223 + !video_cards_radeonsi? (
224 + video_cards_radeon? (
225 + ${LLVM_DEPSTR_AMDGPU}
226 + )
227 + )
228 + )
229 + !video_cards_r600? (
230 + !video_cards_radeon? (
231 + !video_cards_radeonsi? (
232 + ${LLVM_DEPSTR}
233 + )
234 + )
235 + )
236 + )
237 + )
238 + )
239 +"
240 +unset {LLVM,CLANG}_DEPSTR{,_AMDGPU}
241 +
242 +DEPEND="${RDEPEND}
243 + valgrind? ( dev-util/valgrind )
244 + X? (
245 + x11-libs/libXrandr[${MULTILIB_USEDEP}]
246 + x11-base/xorg-proto
247 + )
248 +"
249 +BDEPEND="
250 + ${PYTHON_DEPS}
251 + opencl? (
252 + >=sys-devel/gcc-4.6
253 + )
254 + sys-devel/bison
255 + sys-devel/flex
256 + virtual/pkgconfig
257 + $(python_gen_any_dep ">=dev-python/mako-0.8.0[\${PYTHON_USEDEP}]")
258 + wayland? ( dev-util/wayland-scanner[${MULTILIB_USEDEP}] )
259 +"
260 +
261 +S="${WORKDIR}/${MY_P}"
262 +EGIT_CHECKOUT_DIR=${S}
263 +
264 +QA_WX_LOAD="
265 +x86? (
266 + usr/lib*/libglapi.so.0.0.0
267 + usr/lib*/libGLESv1_CM.so.1.1.0
268 + usr/lib*/libGLESv2.so.2.0.0
269 + usr/lib*/libGL.so.1.2.0
270 + usr/lib*/libOSMesa.so.8.0.0
271 + usr/lib/libGLX_mesa.so.0.0.0
272 +)"
273 +
274 +llvm_check_deps() {
275 + local flags=${MULTILIB_USEDEP}
276 + if use video_cards_r600 || use video_cards_radeon || use video_cards_radeonsi
277 + then
278 + flags+=",llvm_targets_AMDGPU(-)"
279 + fi
280 +
281 + if use opencl; then
282 + has_version "sys-devel/clang:${LLVM_SLOT}[${flags}]" || return 1
283 + fi
284 + has_version "sys-devel/llvm:${LLVM_SLOT}[${flags}]"
285 +}
286 +
287 +pkg_pretend() {
288 + if use vulkan; then
289 + if ! use video_cards_freedreno &&
290 + ! 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 freedreno, 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_crocus crocus
504 + gallium_enable video_cards_iris iris
505 +
506 + gallium_enable video_cards_r300 r300
507 + gallium_enable video_cards_r600 r600
508 + gallium_enable video_cards_radeonsi radeonsi
509 + if ! use video_cards_r300 && \
510 + ! use video_cards_r600; then
511 + gallium_enable video_cards_radeon r300 r600
512 + fi
513 +
514 + gallium_enable video_cards_freedreno freedreno
515 + gallium_enable video_cards_virgl virgl
516 +
517 + # opencl stuff
518 + emesonargs+=(
519 + -Dgallium-opencl="$(usex opencl icd disabled)"
520 + )
521 + fi
522 +
523 + if use vulkan; then
524 + vulkan_enable video_cards_freedreno freedreno
525 + vulkan_enable video_cards_i965 intel
526 + vulkan_enable video_cards_iris intel
527 + vulkan_enable video_cards_radeonsi amd
528 + vulkan_enable video_cards_v3d broadcom
529 + fi
530 +
531 + driver_list() {
532 + local drivers="$(sort -u <<< "${1// /$'\n'}")"
533 + echo "${drivers//$'\n'/,}"
534 + }
535 +
536 + local vulkan_layers
537 + use vulkan && vulkan_layers+="device-select"
538 + use vulkan-overlay && vulkan_layers+=",overlay"
539 + emesonargs+=(-Dvulkan-layers=${vulkan_layers#,})
540 +
541 + emesonargs+=(
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 +}