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