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