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, 23 Feb 2022 22:16:03
Message-Id: 1645654554.643c92de8739b4b96a0ce2f44b1fdae0ca4dfceb.mattst88@gentoo
1 commit: 643c92de8739b4b96a0ce2f44b1fdae0ca4dfceb
2 Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
3 AuthorDate: Wed Feb 23 21:54:52 2022 +0000
4 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
5 CommitDate: Wed Feb 23 22:15:54 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=643c92de
7
8 media-libs/mesa: Version bump to 21.3.7
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.7.ebuild | 560 +++++++++++++++++++++++++++++++++++++
14 2 files changed, 561 insertions(+)
15
16 diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
17 index efd5e17f6693..5497e0059eca 100644
18 --- a/media-libs/mesa/Manifest
19 +++ b/media-libs/mesa/Manifest
20 @@ -1,4 +1,5 @@
21 DIST mesa-21.3.5.tar.xz 16521664 BLAKE2B 4dcf2e40103233332724289434998149c41a86fdaef622c2fc92065d1708a0635ed5a179e5fc8e51d82efe794f4f99c7de734ed61a8804b5e94aecb071656795 SHA512 417d1787f8177567f0c547dde3e24212f7497f2fe7cdaa945fe998cd61ec0e9eb9388feb444e377c4fd8794b056af02aac28d1bbfb9527844391ba49e6893933
22 DIST mesa-21.3.6.tar.xz 16544464 BLAKE2B 2f87d62cb9386f3b84c6bb2a96d4b29a97153e5fd628c61ac996b200f0083cfa410ac42f5e80094fdfb00d266af2da8fe6543a62ae192c34e78434e3d159846a SHA512 8c930e04eade29f689384ee7d6e2f178acbbf30fa6c9fdf132281279658c3c221ec7f9b1318e3c0a654c6136f925a5c0a35eaf849b65db7674641127c71e8a4f
23 +DIST mesa-21.3.7.tar.xz 16569592 BLAKE2B 7c5a3f144b1ce9e8bbb3560ae2bf46afda9d5c4a3e7b825d406f9a5090dfd51e2b3cc6ee2c10df09c817f5836ffbd09bfc86fbaf63bcc907caef290fd44baee6 SHA512 0991543e9435457fa4d077517408b3f197be32ed61a6c7ca34ddb3906eed208791f1a57227f74115f99df18e612efab1d2c6809b7cf426d273633b53d4aefc88
24 DIST mesa-22.0.0-rc1.tar.xz 15509952 BLAKE2B 06171bb1fcc67811cb27526b3ae3677315e8f581f4db23f3464aa8b1bb065304782e0234c2b86daf076803a92dd3066217fe1f1f21faf7c85e34c4eb7a6f0027 SHA512 6f8d961c7cde5cbd32bc40bc3dc3d8e9b0cea16dc668d8a2b078c61179b0e95725c719c0f0e8994c43591599724b754646050c68777fd4c97ad4ec5a0ee4a420
25 DIST mesa-22.0.0-rc2.tar.xz 15517448 BLAKE2B abea8387807c9004ee106898518056083256bd726e75130d609617ee4d3378a429d9897ac1c765f1ae564abfb6717ad0a37211454f51d6fc6253a3c1db777683 SHA512 9e05355a31f1640df6e800ccdf3150720d1a54aa21d9eb748d567b2b64090b09b6bc54318f2f72644b48c8d08f9db0f7ab3d35c9e1b629ded932fd9ed2e87630
26
27 diff --git a/media-libs/mesa/mesa-21.3.7.ebuild b/media-libs/mesa/mesa-21.3.7.ebuild
28 new file mode 100644
29 index 000000000000..80255df71dda
30 --- /dev/null
31 +++ b/media-libs/mesa/mesa-21.3.7.ebuild
32 @@ -0,0 +1,560 @@
33 +# Copyright 1999-2022 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=7
37 +
38 +PYTHON_COMPAT=( python3_{8..10} )
39 +
40 +inherit llvm meson-multilib python-any-r1 linux-info
41 +
42 +MY_P="${P/_/-}"
43 +
44 +DESCRIPTION="OpenGL-like graphic library for Linux"
45 +HOMEPAGE="https://www.mesa3d.org/ https://mesa.freedesktop.org/"
46 +
47 +if [[ ${PV} == 9999 ]]; then
48 + EGIT_REPO_URI="https://gitlab.freedesktop.org/mesa/mesa.git"
49 + inherit git-r3
50 +else
51 + SRC_URI="https://archive.mesa3d.org/${MY_P}.tar.xz"
52 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris"
53 +fi
54 +
55 +LICENSE="MIT"
56 +SLOT="0"
57 +RESTRICT="
58 + !test? ( test )
59 +"
60 +
61 +RADEON_CARDS="r100 r200 r300 r600 radeon radeonsi"
62 +VIDEO_CARDS="${RADEON_CARDS} crocus freedreno i915 i965 intel iris lima nouveau panfrost v3d vc4 virgl vivante vmware"
63 +for card in ${VIDEO_CARDS}; do
64 + IUSE_VIDEO_CARDS+=" video_cards_${card}"
65 +done
66 +
67 +IUSE="${IUSE_VIDEO_CARDS}
68 + +classic cpu_flags_x86_sse2 d3d9 debug +egl +gallium +gbm gles1 +gles2 +llvm
69 + lm-sensors opencl osmesa selinux test unwind vaapi valgrind vdpau vulkan
70 + vulkan-overlay wayland +X xa xvmc zink +zstd"
71 +
72 +REQUIRED_USE="
73 + d3d9? ( || ( video_cards_iris video_cards_r300 video_cards_r600 video_cards_radeonsi video_cards_nouveau video_cards_vmware ) )
74 + gles1? ( egl )
75 + gles2? ( egl )
76 + osmesa? ( gallium )
77 + vulkan? ( video_cards_radeonsi? ( llvm ) )
78 + vulkan-overlay? ( vulkan )
79 + wayland? ( egl gbm )
80 + video_cards_crocus? ( gallium )
81 + video_cards_freedreno? ( gallium )
82 + video_cards_intel? ( classic )
83 + video_cards_i915? ( || ( classic gallium ) )
84 + video_cards_i965? ( classic )
85 + video_cards_iris? ( gallium )
86 + video_cards_lima? ( gallium )
87 + video_cards_nouveau? ( || ( classic gallium ) )
88 + video_cards_panfrost? ( gallium )
89 + video_cards_radeon? ( || ( classic gallium )
90 + gallium? ( x86? ( llvm ) amd64? ( llvm ) ) )
91 + video_cards_r100? ( classic )
92 + video_cards_r200? ( classic )
93 + video_cards_r300? ( gallium x86? ( llvm ) amd64? ( llvm ) )
94 + video_cards_r600? ( gallium )
95 + video_cards_radeonsi? ( gallium llvm )
96 + video_cards_v3d? ( gallium )
97 + video_cards_vc4? ( gallium )
98 + video_cards_virgl? ( gallium )
99 + video_cards_vivante? ( gallium gbm )
100 + video_cards_vmware? ( gallium )
101 + xa? ( X )
102 + xvmc? ( X )
103 + zink? ( gallium vulkan )
104 +"
105 +
106 +LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.107"
107 +RDEPEND="
108 + >=dev-libs/expat-2.1.0-r3:=[${MULTILIB_USEDEP}]
109 + >=media-libs/libglvnd-1.3.2[X?,${MULTILIB_USEDEP}]
110 + >=sys-libs/zlib-1.2.8[${MULTILIB_USEDEP}]
111 + gallium? (
112 + unwind? ( sys-libs/libunwind[${MULTILIB_USEDEP}] )
113 + llvm? (
114 + video_cards_radeonsi? (
115 + virtual/libelf:0=[${MULTILIB_USEDEP}]
116 + )
117 + video_cards_r600? (
118 + virtual/libelf:0=[${MULTILIB_USEDEP}]
119 + )
120 + video_cards_radeon? (
121 + virtual/libelf:0=[${MULTILIB_USEDEP}]
122 + )
123 + )
124 + lm-sensors? ( sys-apps/lm-sensors:=[${MULTILIB_USEDEP}] )
125 + opencl? (
126 + >=virtual/opencl-3[${MULTILIB_USEDEP}]
127 + dev-libs/libclc
128 + virtual/libelf:0=[${MULTILIB_USEDEP}]
129 + )
130 + vaapi? (
131 + >=x11-libs/libva-1.7.3:=[${MULTILIB_USEDEP}]
132 + )
133 + vdpau? ( >=x11-libs/libvdpau-1.1:=[${MULTILIB_USEDEP}] )
134 + xvmc? ( >=x11-libs/libXvMC-1.0.8:=[${MULTILIB_USEDEP}] )
135 + )
136 + selinux? ( sys-libs/libselinux[${MULTILIB_USEDEP}] )
137 + wayland? (
138 + >=dev-libs/wayland-1.18.0:=[${MULTILIB_USEDEP}]
139 + >=dev-libs/wayland-protocols-1.8
140 + )
141 + ${LIBDRM_DEPSTRING}[video_cards_freedreno?,video_cards_nouveau?,video_cards_vc4?,video_cards_vivante?,video_cards_vmware?,${MULTILIB_USEDEP}]
142 + video_cards_intel? (
143 + !video_cards_i965? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
144 + )
145 + video_cards_i915? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
146 + vulkan-overlay? ( dev-util/glslang:0=[${MULTILIB_USEDEP}] )
147 + X? (
148 + >=x11-libs/libX11-1.6.2:=[${MULTILIB_USEDEP}]
149 + >=x11-libs/libxshmfence-1.1:=[${MULTILIB_USEDEP}]
150 + >=x11-libs/libXext-1.3.2:=[${MULTILIB_USEDEP}]
151 + >=x11-libs/libXxf86vm-1.1.3:=[${MULTILIB_USEDEP}]
152 + >=x11-libs/libxcb-1.13:=[${MULTILIB_USEDEP}]
153 + x11-libs/libXfixes:=[${MULTILIB_USEDEP}]
154 + )
155 + zink? ( media-libs/vulkan-loader:=[${MULTILIB_USEDEP}] )
156 + zstd? ( app-arch/zstd:=[${MULTILIB_USEDEP}] )
157 +"
158 +for card in ${RADEON_CARDS}; do
159 + RDEPEND="${RDEPEND}
160 + video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_radeon] )
161 + "
162 +done
163 +RDEPEND="${RDEPEND}
164 + video_cards_radeonsi? ( ${LIBDRM_DEPSTRING}[video_cards_amdgpu] )
165 +"
166 +
167 +# Please keep the LLVM dependency block separate. Since LLVM is slotted,
168 +# we need to *really* make sure we're not pulling one than more slot
169 +# simultaneously.
170 +#
171 +# How to use it:
172 +# 1. List all the working slots (with min versions) in ||, newest first.
173 +# 2. Update the := to specify *max* version, e.g. < 10.
174 +# 3. Specify LLVM_MAX_SLOT, e.g. 9.
175 +LLVM_MAX_SLOT="13"
176 +LLVM_DEPSTR="
177 + || (
178 + sys-devel/llvm:13[${MULTILIB_USEDEP}]
179 + sys-devel/llvm:12[${MULTILIB_USEDEP}]
180 + sys-devel/llvm:11[${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 )
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_freedreno &&
291 + ! use video_cards_i965 &&
292 + ! use video_cards_iris &&
293 + ! use video_cards_radeonsi &&
294 + ! use video_cards_v3d; then
295 + ewarn "Ignoring USE=vulkan since VIDEO_CARDS does not contain freedreno, i965, iris, radeonsi, or v3d"
296 + fi
297 + fi
298 +
299 + if use opencl; then
300 + if ! use video_cards_r600 &&
301 + ! use video_cards_radeonsi; then
302 + ewarn "Ignoring USE=opencl since VIDEO_CARDS does not contain r600 or radeonsi"
303 + fi
304 + fi
305 +
306 + if use vaapi; then
307 + if ! use video_cards_r600 &&
308 + ! use video_cards_radeonsi &&
309 + ! use video_cards_nouveau; then
310 + ewarn "Ignoring USE=vaapi since VIDEO_CARDS does not contain r600, radeonsi, or nouveau"
311 + fi
312 + fi
313 +
314 + if use vdpau; then
315 + if ! use video_cards_r300 &&
316 + ! use video_cards_r600 &&
317 + ! use video_cards_radeonsi &&
318 + ! use video_cards_nouveau; then
319 + ewarn "Ignoring USE=vdpau since VIDEO_CARDS does not contain r300, r600, radeonsi, or nouveau"
320 + fi
321 + fi
322 +
323 + if use xa; then
324 + if ! use video_cards_freedreno &&
325 + ! use video_cards_nouveau &&
326 + ! use video_cards_vmware; then
327 + ewarn "Ignoring USE=xa since VIDEO_CARDS does not contain freedreno, nouveau, or vmware"
328 + fi
329 + fi
330 +
331 + if use xvmc; then
332 + if ! use video_cards_r600 &&
333 + ! use video_cards_nouveau; then
334 + ewarn "Ignoring USE=xvmc since VIDEO_CARDS does not contain r600 or nouveau"
335 + fi
336 + fi
337 +
338 + if ! use gallium; then
339 + use lm-sensors && ewarn "Ignoring USE=lm-sensors since USE does not contain gallium"
340 + use llvm && ewarn "Ignoring USE=llvm since USE does not contain gallium"
341 + use opencl && ewarn "Ignoring USE=opencl since USE does not contain gallium"
342 + use vaapi && ewarn "Ignoring USE=vaapi since USE does not contain gallium"
343 + use vdpau && ewarn "Ignoring USE=vdpau since USE does not contain gallium"
344 + use unwind && ewarn "Ignoring USE=unwind since USE does not contain gallium"
345 + use xa && ewarn "Ignoring USE=xa since USE does not contain gallium"
346 + use xvmc && ewarn "Ignoring USE=xvmc since USE does not contain gallium"
347 + fi
348 +
349 + if ! use llvm; then
350 + use opencl && ewarn "Ignoring USE=opencl since USE does not contain llvm"
351 + fi
352 +
353 + if use osmesa && ! use llvm; then
354 + ewarn "OSMesa will be slow without enabling USE=llvm"
355 + fi
356 +}
357 +
358 +python_check_deps() {
359 + has_version -b ">=dev-python/mako-0.8.0[${PYTHON_USEDEP}]"
360 +}
361 +
362 +pkg_setup() {
363 + # warning message for bug 459306
364 + if use llvm && has_version sys-devel/llvm[!debug=]; then
365 + ewarn "Mismatch between debug USE flags in media-libs/mesa and sys-devel/llvm"
366 + ewarn "detected! This can cause problems. For details, see bug 459306."
367 + fi
368 +
369 + if use video_cards_i965 ||
370 + use video_cards_iris ||
371 + use video_cards_radeonsi; then
372 + if kernel_is -ge 5 11 3; then
373 + CONFIG_CHECK="~KCMP"
374 + elif kernel_is -ge 5 11; then
375 + CONFIG_CHECK="~CHECKPOINT_RESTORE"
376 + elif kernel_is -ge 5 10 20; then
377 + CONFIG_CHECK="~KCMP"
378 + else
379 + CONFIG_CHECK="~CHECKPOINT_RESTORE"
380 + fi
381 + linux-info_pkg_setup
382 + fi
383 +
384 + if use gallium && use llvm; then
385 + llvm_pkg_setup
386 + fi
387 + python-any-r1_pkg_setup
388 +}
389 +
390 +multilib_src_configure() {
391 + local emesonargs=()
392 +
393 + if use classic; then
394 + # Intel code
395 + dri_driver_enable video_cards_i915 i915
396 + dri_driver_enable video_cards_i965 i965
397 + if ! use video_cards_i915 && \
398 + ! use video_cards_i965; then
399 + dri_driver_enable video_cards_intel i915 i965
400 + fi
401 +
402 + # Nouveau code
403 + dri_driver_enable video_cards_nouveau nouveau
404 +
405 + # ATI code
406 + dri_driver_enable video_cards_r100 r100
407 + dri_driver_enable video_cards_r200 r200
408 + if ! use video_cards_r100 && \
409 + ! use video_cards_r200; then
410 + dri_driver_enable video_cards_radeon r100 r200
411 + fi
412 + fi
413 +
414 + local platforms
415 + use X && platforms+="x11"
416 + use wayland && platforms+=",wayland"
417 + emesonargs+=(-Dplatforms=${platforms#,})
418 +
419 + if use X || use egl; then
420 + emesonargs+=(-Dglvnd=true)
421 + else
422 + emesonargs+=(-Dglvnd=false)
423 + fi
424 +
425 + if use gallium; then
426 + emesonargs+=(
427 + $(meson_feature llvm)
428 + $(meson_feature lm-sensors lmsensors)
429 + $(meson_feature unwind libunwind)
430 + )
431 +
432 + if use video_cards_iris ||
433 + use video_cards_r300 ||
434 + use video_cards_r600 ||
435 + use video_cards_radeonsi ||
436 + use video_cards_nouveau ||
437 + use video_cards_vmware; then
438 + emesonargs+=($(meson_use d3d9 gallium-nine))
439 + else
440 + emesonargs+=(-Dgallium-nine=false)
441 + fi
442 +
443 + if use video_cards_r600 ||
444 + use video_cards_radeonsi ||
445 + use video_cards_nouveau; then
446 + emesonargs+=($(meson_feature vaapi gallium-va))
447 + use vaapi && emesonargs+=( -Dva-libs-path="${EPREFIX}"/usr/$(get_libdir)/va/drivers )
448 + else
449 + emesonargs+=(-Dgallium-va=disabled)
450 + fi
451 +
452 + if use video_cards_r300 ||
453 + use video_cards_r600 ||
454 + use video_cards_radeonsi ||
455 + use video_cards_nouveau; then
456 + emesonargs+=($(meson_feature vdpau gallium-vdpau))
457 + else
458 + emesonargs+=(-Dgallium-vdpau=disabled)
459 + fi
460 +
461 + if use video_cards_freedreno ||
462 + use video_cards_nouveau ||
463 + use video_cards_vmware; then
464 + emesonargs+=($(meson_feature xa gallium-xa))
465 + else
466 + emesonargs+=(-Dgallium-xa=disabled)
467 + fi
468 +
469 + if use video_cards_r600 ||
470 + use video_cards_nouveau; then
471 + emesonargs+=($(meson_feature xvmc gallium-xvmc))
472 + else
473 + emesonargs+=(-Dgallium-xvmc=disabled)
474 + fi
475 +
476 + if use video_cards_freedreno ||
477 + use video_cards_lima ||
478 + use video_cards_panfrost ||
479 + use video_cards_v3d ||
480 + use video_cards_vc4 ||
481 + use video_cards_vivante; then
482 + gallium_enable -- kmsro
483 + fi
484 +
485 + gallium_enable -- swrast
486 + gallium_enable video_cards_lima lima
487 + gallium_enable video_cards_panfrost panfrost
488 + gallium_enable video_cards_v3d v3d
489 + gallium_enable video_cards_vc4 vc4
490 + gallium_enable video_cards_vivante etnaviv
491 + gallium_enable video_cards_vmware svga
492 + gallium_enable video_cards_nouveau nouveau
493 + gallium_enable zink zink
494 +
495 + # Only one i915 driver (classic vs gallium). Default to classic.
496 + if ! use classic; then
497 + gallium_enable video_cards_i915 i915
498 + if ! use video_cards_i915 && \
499 + ! use video_cards_i965; then
500 + gallium_enable video_cards_intel i915
501 + fi
502 + fi
503 +
504 + gallium_enable video_cards_crocus crocus
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_freedreno freedreno
526 + vulkan_enable video_cards_i965 intel
527 + vulkan_enable video_cards_iris intel
528 + vulkan_enable video_cards_radeonsi amd
529 + vulkan_enable video_cards_v3d broadcom
530 + fi
531 +
532 + driver_list() {
533 + local drivers="$(sort -u <<< "${1// /$'\n'}")"
534 + echo "${drivers//$'\n'/,}"
535 + }
536 +
537 + local vulkan_layers
538 + use vulkan && vulkan_layers+="device-select"
539 + use vulkan-overlay && vulkan_layers+=",overlay"
540 + emesonargs+=(-Dvulkan-layers=${vulkan_layers#,})
541 +
542 + emesonargs+=(
543 + $(meson_use test build-tests)
544 + -Dglx=$(usex X dri disabled)
545 + -Dshared-glapi=enabled
546 + -Ddri3=enabled
547 + $(meson_feature egl)
548 + $(meson_feature gbm)
549 + $(meson_feature gles1)
550 + $(meson_feature gles2)
551 + $(meson_use osmesa)
552 + $(meson_use selinux)
553 + $(meson_feature zstd)
554 + $(meson_use video_cards_crocus prefer-crocus)
555 + $(meson_use video_cards_iris prefer-iris)
556 + $(meson_use cpu_flags_x86_sse2 sse2)
557 + -Dvalgrind=$(usex valgrind auto disabled)
558 + -Ddri-drivers=$(driver_list "${DRI_DRIVERS[*]}")
559 + -Dgallium-drivers=$(driver_list "${GALLIUM_DRIVERS[*]}")
560 + -Dvulkan-drivers=$(driver_list "${VULKAN_DRIVERS[*]}")
561 + --buildtype $(usex debug debug plain)
562 + -Db_ndebug=$(usex debug false true)
563 + )
564 + meson_src_configure
565 +}
566 +
567 +multilib_src_test() {
568 + meson_src_test -t 100
569 +}
570 +
571 +# $1 - VIDEO_CARDS flag (check skipped for "--")
572 +# other args - names of DRI drivers to enable
573 +dri_driver_enable() {
574 + if [[ $1 == -- ]] || use $1; then
575 + shift
576 + DRI_DRIVERS+=("$@")
577 + fi
578 +}
579 +
580 +gallium_enable() {
581 + if [[ $1 == -- ]] || use $1; then
582 + shift
583 + GALLIUM_DRIVERS+=("$@")
584 + fi
585 +}
586 +
587 +vulkan_enable() {
588 + if [[ $1 == -- ]] || use $1; then
589 + shift
590 + VULKAN_DRIVERS+=("$@")
591 + fi
592 +}