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: Thu, 03 Sep 2020 20:37:58
Message-Id: 1599164687.b7f7297c211c027fe00a88ce93ed59fbb6605fa8.mattst88@gentoo
1 commit: b7f7297c211c027fe00a88ce93ed59fbb6605fa8
2 Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
3 AuthorDate: Thu Sep 3 19:50:02 2020 +0000
4 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
5 CommitDate: Thu Sep 3 20:24:47 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b7f7297c
7
8 media-libs/mesa: Version bump to 20.1.7
9
10 Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>
11
12 media-libs/mesa/Manifest | 1 +
13 media-libs/mesa/mesa-20.1.7.ebuild | 557 +++++++++++++++++++++++++++++++++++++
14 2 files changed, 558 insertions(+)
15
16 diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
17 index 647554ef852..3c95a225473 100644
18 --- a/media-libs/mesa/Manifest
19 +++ b/media-libs/mesa/Manifest
20 @@ -1,4 +1,5 @@
21 DIST mesa-20.0.8.tar.xz 12360736 BLAKE2B 19e3f8a40b34b5f17ed76077c5d92f728a134b2479c43d86674ed1818ab99639a9b732041f67488251df808564f6abe5b587d756ef9c7c13dcada87cd0fc05de SHA512 d906330c412899907dd05a84034a929107fccaf3044814c4b1f30ba5690cbcf1587b5f17534c6345111f3cb7cf292afd5984a60486643ff6f534b57cec615374
22 DIST mesa-20.1.6.tar.xz 12805724 BLAKE2B d652b59e4987436d2e05de9138f2e2fb4a8bf435c24d9c7ad08bcb82a3bf7c9c64bc71b15b4b6d334f8b574341719f372aa1b893283abc21191a4d71d9d30fee SHA512 5ef28334ecb7effaaf597ea3efe0406af62419e6fa629e835d843161ab8d83515626ec0f0495c4cc66af9e5669398ac96c16ca626e4965a9831e1704c995fb09
23 +DIST mesa-20.1.7.tar.xz 12825368 BLAKE2B 2fedda518ff29bfda49af12d714dc258e48fca3492d2327ce5080d11bbaea5ad646d438f3e2d5ddabeffae83211976fb15001c650cd6ab4052ab09d97342afdc SHA512 5ff614c3f7568db7673cd2398615e5398c7f50093abdabd0730e07fe9c358310793fea3f130058110c9a2aa284c6efd207e1bdca3d1a1ba46fb18d76e34f361a
24 DIST mesa-20.2.0-rc2.tar.xz 13528208 BLAKE2B 6505446829ec2c01c0de7a7d9c1187db874111402da5ffe2f9f5872df7b6a5e53a3b628c190172bb9a806851b3b85aa0e3b53a4fcfb40f99adfc48cc3876c9f5 SHA512 36d9a74db50335bd31a8d5c47f7c657f05eeda044530fe123c06c472ed27c9b5dff19716d11d95256449223e82dde38895547cf6ae60b7460d3b1e9ed440704a
25 DIST mesa-20.2.0-rc3.tar.xz 13550928 BLAKE2B b3e8a257422c06d1cbd7b7309b73d988be51adf4a60c4cd8e401c8fb86a430c7059956ef8264bbbce45ee5e38535916903dc915ab3660b0e5bc14b980d557d67 SHA512 56a692e02abed95ee16be17930f4c71519191def1a6465d465af6ebbf9d8b7e204a240e720b0fc512f4f18da3e4f37dbf8d96c3231ffba15e7114c240be71444
26
27 diff --git a/media-libs/mesa/mesa-20.1.7.ebuild b/media-libs/mesa/mesa-20.1.7.ebuild
28 new file mode 100644
29 index 00000000000..b38b99a81f5
30 --- /dev/null
31 +++ b/media-libs/mesa/mesa-20.1.7.ebuild
32 @@ -0,0 +1,557 @@
33 +# Copyright 1999-2020 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=7
37 +
38 +PYTHON_COMPAT=( python3_{6,7,8} )
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 ~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 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 +libglvnd +llvm
71 + lm-sensors opencl osmesa selinux test unwind vaapi valgrind vdpau vulkan
72 + vulkan-overlay wayland +X xa xvmc +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 + vulkan? ( dri3
79 + video_cards_radeonsi? ( llvm ) )
80 + vulkan-overlay? ( vulkan )
81 + wayland? ( egl gbm )
82 + video_cards_freedreno? ( gallium )
83 + video_cards_intel? ( classic )
84 + video_cards_i915? ( || ( classic gallium ) )
85 + video_cards_i965? ( classic )
86 + video_cards_iris? ( gallium )
87 + video_cards_lima? ( gallium )
88 + video_cards_nouveau? ( || ( classic gallium ) )
89 + video_cards_panfrost? ( gallium )
90 + video_cards_radeon? ( || ( classic gallium )
91 + gallium? ( x86? ( llvm ) amd64? ( llvm ) ) )
92 + video_cards_r100? ( classic )
93 + video_cards_r200? ( classic )
94 + video_cards_r300? ( gallium x86? ( llvm ) amd64? ( llvm ) )
95 + video_cards_r600? ( gallium )
96 + video_cards_radeonsi? ( gallium llvm )
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 +"
104 +
105 +LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.100"
106 +RDEPEND="
107 + !app-eselect/eselect-mesa
108 + >=dev-libs/expat-2.1.0-r3:=[${MULTILIB_USEDEP}]
109 + >=sys-libs/zlib-1.2.8[${MULTILIB_USEDEP}]
110 + libglvnd? (
111 + >=media-libs/libglvnd-1.2.0-r1[X?,${MULTILIB_USEDEP}]
112 + !app-eselect/eselect-opengl
113 + )
114 + !libglvnd? (
115 + >=app-eselect/eselect-opengl-1.3.0
116 + )
117 + gallium? (
118 + unwind? ( sys-libs/libunwind[${MULTILIB_USEDEP}] )
119 + llvm? (
120 + video_cards_radeonsi? (
121 + virtual/libelf:0=[${MULTILIB_USEDEP}]
122 + )
123 + video_cards_r600? (
124 + virtual/libelf:0=[${MULTILIB_USEDEP}]
125 + )
126 + video_cards_radeon? (
127 + virtual/libelf:0=[${MULTILIB_USEDEP}]
128 + )
129 + )
130 + lm-sensors? ( sys-apps/lm-sensors:=[${MULTILIB_USEDEP}] )
131 + opencl? (
132 + >=virtual/opencl-3[${MULTILIB_USEDEP}]
133 + dev-libs/libclc
134 + virtual/libelf:0=[${MULTILIB_USEDEP}]
135 + )
136 + vaapi? (
137 + >=x11-libs/libva-1.7.3:=[${MULTILIB_USEDEP}]
138 + )
139 + vdpau? ( >=x11-libs/libvdpau-1.1:=[${MULTILIB_USEDEP}] )
140 + xvmc? ( >=x11-libs/libXvMC-1.0.8:=[${MULTILIB_USEDEP}] )
141 + )
142 + selinux? ( sys-libs/libselinux[${MULTILIB_USEDEP}] )
143 + wayland? (
144 + >=dev-libs/wayland-1.15.0:=[${MULTILIB_USEDEP}]
145 + >=dev-libs/wayland-protocols-1.8
146 + )
147 + ${LIBDRM_DEPSTRING}[video_cards_freedreno?,video_cards_nouveau?,video_cards_vc4?,video_cards_vivante?,video_cards_vmware?,${MULTILIB_USEDEP}]
148 + video_cards_intel? (
149 + !video_cards_i965? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
150 + )
151 + video_cards_i915? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
152 + vulkan-overlay? ( dev-util/glslang:0=[${MULTILIB_USEDEP}] )
153 + X? (
154 + >=x11-libs/libX11-1.6.2:=[${MULTILIB_USEDEP}]
155 + >=x11-libs/libxshmfence-1.1:=[${MULTILIB_USEDEP}]
156 + >=x11-libs/libXdamage-1.1.4-r1:=[${MULTILIB_USEDEP}]
157 + >=x11-libs/libXext-1.3.2:=[${MULTILIB_USEDEP}]
158 + >=x11-libs/libXxf86vm-1.1.3:=[${MULTILIB_USEDEP}]
159 + >=x11-libs/libxcb-1.13:=[${MULTILIB_USEDEP}]
160 + x11-libs/libXfixes:=[${MULTILIB_USEDEP}]
161 + )
162 + zstd? ( app-arch/zstd:=[${MULTILIB_USEDEP}] )
163 +"
164 +for card in ${RADEON_CARDS}; do
165 + RDEPEND="${RDEPEND}
166 + video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_radeon] )
167 + "
168 +done
169 +RDEPEND="${RDEPEND}
170 + video_cards_radeonsi? ( ${LIBDRM_DEPSTRING}[video_cards_amdgpu] )
171 +"
172 +
173 +# Please keep the LLVM dependency block separate. Since LLVM is slotted,
174 +# we need to *really* make sure we're not pulling one than more slot
175 +# simultaneously.
176 +#
177 +# How to use it:
178 +# 1. List all the working slots (with min versions) in ||, newest first.
179 +# 2. Update the := to specify *max* version, e.g. < 10.
180 +# 3. Specify LLVM_MAX_SLOT, e.g. 9.
181 +LLVM_MAX_SLOT="10"
182 +LLVM_DEPSTR="
183 + || (
184 + sys-devel/llvm:10[${MULTILIB_USEDEP}]
185 + sys-devel/llvm:9[${MULTILIB_USEDEP}]
186 + )
187 + <sys-devel/llvm-$((LLVM_MAX_SLOT + 1)):=[${MULTILIB_USEDEP}]
188 +"
189 +LLVM_DEPSTR_AMDGPU=${LLVM_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
190 +CLANG_DEPSTR=${LLVM_DEPSTR//llvm/clang}
191 +CLANG_DEPSTR_AMDGPU=${CLANG_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
192 +RDEPEND="${RDEPEND}
193 + gallium? (
194 + llvm? (
195 + opencl? (
196 + video_cards_r600? (
197 + ${CLANG_DEPSTR_AMDGPU}
198 + )
199 + !video_cards_r600? (
200 + video_cards_radeonsi? (
201 + ${CLANG_DEPSTR_AMDGPU}
202 + )
203 + )
204 + !video_cards_r600? (
205 + !video_cards_radeonsi? (
206 + video_cards_radeon? (
207 + ${CLANG_DEPSTR_AMDGPU}
208 + )
209 + )
210 + )
211 + !video_cards_r600? (
212 + !video_cards_radeon? (
213 + !video_cards_radeonsi? (
214 + ${CLANG_DEPSTR}
215 + )
216 + )
217 + )
218 + )
219 + !opencl? (
220 + video_cards_r600? (
221 + ${LLVM_DEPSTR_AMDGPU}
222 + )
223 + !video_cards_r600? (
224 + video_cards_radeonsi? (
225 + ${LLVM_DEPSTR_AMDGPU}
226 + )
227 + )
228 + !video_cards_r600? (
229 + !video_cards_radeonsi? (
230 + video_cards_radeon? (
231 + ${LLVM_DEPSTR_AMDGPU}
232 + )
233 + )
234 + )
235 + !video_cards_r600? (
236 + !video_cards_radeon? (
237 + !video_cards_radeonsi? (
238 + ${LLVM_DEPSTR}
239 + )
240 + )
241 + )
242 + )
243 + )
244 + )
245 +"
246 +unset {LLVM,CLANG}_DEPSTR{,_AMDGPU}
247 +
248 +DEPEND="${RDEPEND}
249 + valgrind? ( dev-util/valgrind )
250 + X? (
251 + x11-libs/libXrandr[${MULTILIB_USEDEP}]
252 + x11-base/xorg-proto
253 + )
254 +"
255 +BDEPEND="
256 + ${PYTHON_DEPS}
257 + opencl? (
258 + >=sys-devel/gcc-4.6
259 + )
260 + sys-devel/bison
261 + sys-devel/flex
262 + sys-devel/gettext
263 + virtual/pkgconfig
264 + $(python_gen_any_dep ">=dev-python/mako-0.8.0[\${PYTHON_USEDEP}]")
265 +"
266 +
267 +S="${WORKDIR}/${MY_P}"
268 +EGIT_CHECKOUT_DIR=${S}
269 +
270 +QA_WX_LOAD="
271 +x86? (
272 + usr/lib*/libglapi.so.0.0.0
273 + usr/lib*/libGLESv1_CM.so.1.1.0
274 + usr/lib*/libGLESv2.so.2.0.0
275 + usr/lib*/libGL.so.1.2.0
276 + usr/lib*/libOSMesa.so.8.0.0
277 + libglvnd? ( usr/lib/libGLX_mesa.so.0.0.0 )
278 +)"
279 +
280 +llvm_check_deps() {
281 + local flags=${MULTILIB_USEDEP}
282 + if use video_cards_r600 || use video_cards_radeon || use video_cards_radeonsi
283 + then
284 + flags+=",llvm_targets_AMDGPU(-)"
285 + fi
286 +
287 + if use opencl; then
288 + has_version "sys-devel/clang:${LLVM_SLOT}[${flags}]" || return 1
289 + fi
290 + has_version "sys-devel/llvm:${LLVM_SLOT}[${flags}]"
291 +}
292 +
293 +pkg_pretend() {
294 + if use vulkan; then
295 + if ! use video_cards_i965 &&
296 + ! use video_cards_iris &&
297 + ! use video_cards_radeonsi; then
298 + ewarn "Ignoring USE=vulkan since VIDEO_CARDS does not contain i965, iris, or radeonsi"
299 + fi
300 + fi
301 +
302 + if use opencl; then
303 + if ! use video_cards_r600 &&
304 + ! use video_cards_radeonsi; then
305 + ewarn "Ignoring USE=opencl since VIDEO_CARDS does not contain r600 or radeonsi"
306 + fi
307 + fi
308 +
309 + if use vaapi; then
310 + if ! use video_cards_r600 &&
311 + ! use video_cards_radeonsi &&
312 + ! use video_cards_nouveau; then
313 + ewarn "Ignoring USE=vaapi since VIDEO_CARDS does not contain r600, radeonsi, or nouveau"
314 + fi
315 + fi
316 +
317 + if use vdpau; then
318 + if ! use video_cards_r300 &&
319 + ! use video_cards_r600 &&
320 + ! use video_cards_radeonsi &&
321 + ! use video_cards_nouveau; then
322 + ewarn "Ignoring USE=vdpau since VIDEO_CARDS does not contain r300, r600, radeonsi, or nouveau"
323 + fi
324 + fi
325 +
326 + if use xa; then
327 + if ! use video_cards_freedreno &&
328 + ! use video_cards_nouveau &&
329 + ! use video_cards_vmware; then
330 + ewarn "Ignoring USE=xa since VIDEO_CARDS does not contain freedreno, nouveau, or vmware"
331 + fi
332 + fi
333 +
334 + if use xvmc; then
335 + if ! use video_cards_r600 &&
336 + ! use video_cards_nouveau; then
337 + ewarn "Ignoring USE=xvmc since VIDEO_CARDS does not contain r600 or nouveau"
338 + fi
339 + fi
340 +
341 + if ! use gallium; then
342 + use lm-sensors && ewarn "Ignoring USE=lm-sensors since USE does not contain gallium"
343 + use llvm && ewarn "Ignoring USE=llvm since USE does not contain gallium"
344 + use opencl && ewarn "Ignoring USE=opencl since USE does not contain gallium"
345 + use vaapi && ewarn "Ignoring USE=vaapi since USE does not contain gallium"
346 + use vdpau && ewarn "Ignoring USE=vdpau since USE does not contain gallium"
347 + use unwind && ewarn "Ignoring USE=unwind since USE does not contain gallium"
348 + use xa && ewarn "Ignoring USE=xa since USE does not contain gallium"
349 + use xvmc && ewarn "Ignoring USE=xvmc since USE does not contain gallium"
350 + fi
351 +
352 + if ! use llvm; then
353 + use opencl && ewarn "Ignoring USE=opencl since USE does not contain 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 + CONFIG_CHECK="~CHECKPOINT_RESTORE"
372 + linux-info_pkg_setup
373 + fi
374 +
375 + if use gallium && use llvm; then
376 + llvm_pkg_setup
377 + fi
378 + python-any-r1_pkg_setup
379 +}
380 +
381 +multilib_src_configure() {
382 + local emesonargs=()
383 +
384 + if use classic; then
385 + # Intel code
386 + dri_driver_enable video_cards_i915 i915
387 + dri_driver_enable video_cards_i965 i965
388 + if ! use video_cards_i915 && \
389 + ! use video_cards_i965; then
390 + dri_driver_enable video_cards_intel i915 i965
391 + fi
392 +
393 + # Nouveau code
394 + dri_driver_enable video_cards_nouveau nouveau
395 +
396 + # ATI code
397 + dri_driver_enable video_cards_r100 r100
398 + dri_driver_enable video_cards_r200 r200
399 + if ! use video_cards_r100 && \
400 + ! use video_cards_r200; then
401 + dri_driver_enable video_cards_radeon r100 r200
402 + fi
403 + fi
404 +
405 + emesonargs+=( -Dplatforms=$(use X && echo "x11,")$(use wayland && echo "wayland,")$(use gbm && echo "drm,")surfaceless )
406 +
407 + if use gallium; then
408 + emesonargs+=(
409 + $(meson_use llvm)
410 + $(meson_use lm-sensors lmsensors)
411 + $(meson_use unwind libunwind)
412 + )
413 +
414 + if use video_cards_iris ||
415 + use video_cards_r300 ||
416 + use video_cards_r600 ||
417 + use video_cards_radeonsi ||
418 + use video_cards_nouveau ||
419 + use video_cards_vmware; then
420 + emesonargs+=($(meson_use d3d9 gallium-nine))
421 + else
422 + emesonargs+=(-Dgallium-nine=false)
423 + fi
424 +
425 + if use video_cards_r600 ||
426 + use video_cards_radeonsi ||
427 + use video_cards_nouveau; then
428 + emesonargs+=($(meson_use vaapi gallium-va))
429 + use vaapi && emesonargs+=( -Dva-libs-path="${EPREFIX}"/usr/$(get_libdir)/va/drivers )
430 + else
431 + emesonargs+=(-Dgallium-va=false)
432 + fi
433 +
434 + if use video_cards_r300 ||
435 + use video_cards_r600 ||
436 + use video_cards_radeonsi ||
437 + use video_cards_nouveau; then
438 + emesonargs+=($(meson_use vdpau gallium-vdpau))
439 + else
440 + emesonargs+=(-Dgallium-vdpau=false)
441 + fi
442 +
443 + if use video_cards_freedreno ||
444 + use video_cards_nouveau ||
445 + use video_cards_vmware; then
446 + emesonargs+=($(meson_use xa gallium-xa))
447 + else
448 + emesonargs+=(-Dgallium-xa=false)
449 + fi
450 +
451 + if use video_cards_r600 ||
452 + use video_cards_nouveau; then
453 + emesonargs+=($(meson_use xvmc gallium-xvmc))
454 + else
455 + emesonargs+=(-Dgallium-xvmc=false)
456 + fi
457 +
458 + if use video_cards_freedreno ||
459 + use video_cards_lima ||
460 + use video_cards_panfrost ||
461 + use video_cards_vc4 ||
462 + use video_cards_vivante; then
463 + gallium_enable -- kmsro
464 + fi
465 +
466 + gallium_enable video_cards_lima lima
467 + gallium_enable video_cards_panfrost panfrost
468 + gallium_enable video_cards_vc4 vc4
469 + gallium_enable video_cards_vivante etnaviv
470 + gallium_enable video_cards_vmware svga
471 + gallium_enable video_cards_nouveau nouveau
472 +
473 + # Only one i915 driver (classic vs gallium). Default to classic.
474 + if ! use classic; then
475 + gallium_enable video_cards_i915 i915
476 + if ! use video_cards_i915 && \
477 + ! use video_cards_i965; then
478 + gallium_enable video_cards_intel i915
479 + fi
480 + fi
481 +
482 + gallium_enable video_cards_iris iris
483 +
484 + gallium_enable video_cards_r300 r300
485 + gallium_enable video_cards_r600 r600
486 + gallium_enable video_cards_radeonsi radeonsi
487 + if ! use video_cards_r300 && \
488 + ! use video_cards_r600; then
489 + gallium_enable video_cards_radeon r300 r600
490 + fi
491 +
492 + gallium_enable video_cards_freedreno freedreno
493 + gallium_enable video_cards_virgl virgl
494 +
495 + # opencl stuff
496 + emesonargs+=(
497 + -Dgallium-opencl="$(usex opencl icd disabled)"
498 + )
499 + fi
500 +
501 + if use vulkan; then
502 + vulkan_enable video_cards_i965 intel
503 + vulkan_enable video_cards_iris intel
504 + vulkan_enable video_cards_radeonsi amd
505 + fi
506 +
507 + if use gallium; then
508 + gallium_enable -- swrast
509 + emesonargs+=( -Dosmesa=$(usex osmesa gallium none) )
510 + else
511 + dri_driver_enable -- swrast
512 + emesonargs+=( -Dosmesa=$(usex osmesa classic none) )
513 + fi
514 +
515 + driver_list() {
516 + local drivers="$(sort -u <<< "${1// /$'\n'}")"
517 + echo "${drivers//$'\n'/,}"
518 + }
519 +
520 + emesonargs+=(
521 + $(meson_use test build-tests)
522 + -Dglx=$(usex X dri disabled)
523 + -Dshared-glapi=true
524 + $(meson_use dri3)
525 + $(meson_use egl)
526 + $(meson_use gbm)
527 + $(meson_use gles1)
528 + $(meson_use gles2)
529 + $(meson_use libglvnd glvnd)
530 + $(meson_use selinux)
531 + $(meson_use zstd)
532 + -Dvalgrind=$(usex valgrind auto false)
533 + -Ddri-drivers=$(driver_list "${DRI_DRIVERS[*]}")
534 + -Dgallium-drivers=$(driver_list "${GALLIUM_DRIVERS[*]}")
535 + -Dvulkan-drivers=$(driver_list "${VULKAN_DRIVERS[*]}")
536 + $(meson_use vulkan vulkan-device-select-layer)
537 + $(meson_use vulkan-overlay vulkan-overlay-layer)
538 + --buildtype $(usex debug debug plain)
539 + -Db_ndebug=$(usex debug false true)
540 + )
541 + meson_src_configure
542 +}
543 +
544 +multilib_src_compile() {
545 + meson_src_compile
546 +}
547 +
548 +multilib_src_install() {
549 + meson_src_install
550 +}
551 +
552 +multilib_src_install_all() {
553 + einstalldocs
554 +}
555 +
556 +multilib_src_test() {
557 + meson test -v -C "${BUILD_DIR}" -t 100
558 +}
559 +
560 +pkg_postinst() {
561 + if ! use libglvnd; then
562 + # Switch to the xorg implementation.
563 + echo
564 + eselect opengl set --use-old ${OPENGL_DIR}
565 + fi
566 +}
567 +
568 +# $1 - VIDEO_CARDS flag (check skipped for "--")
569 +# other args - names of DRI drivers to enable
570 +dri_driver_enable() {
571 + if [[ $1 == -- ]] || use $1; then
572 + shift
573 + DRI_DRIVERS+=("$@")
574 + fi
575 +}
576 +
577 +gallium_enable() {
578 + if [[ $1 == -- ]] || use $1; then
579 + shift
580 + GALLIUM_DRIVERS+=("$@")
581 + fi
582 +}
583 +
584 +vulkan_enable() {
585 + if [[ $1 == -- ]] || use $1; then
586 + shift
587 + VULKAN_DRIVERS+=("$@")
588 + fi
589 +}