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, 28 May 2020 21:09:53
Message-Id: 1590700173.38faa8e8b2cd7227eaff4333b7a158d790844926.mattst88@gentoo
1 commit: 38faa8e8b2cd7227eaff4333b7a158d790844926
2 Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
3 AuthorDate: Thu May 28 21:04:52 2020 +0000
4 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
5 CommitDate: Thu May 28 21:09:33 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=38faa8e8
7
8 media-libs/mesa: Version bump to 20.1.0
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.0.ebuild | 559 +++++++++++++++++++++++++++++++++++++
14 2 files changed, 560 insertions(+)
15
16 diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
17 index 2e430f896b1..ea2b9a40494 100644
18 --- a/media-libs/mesa/Manifest
19 +++ b/media-libs/mesa/Manifest
20 @@ -2,3 +2,4 @@ DIST mesa-19.3.5.tar.xz 12064980 BLAKE2B a20ebfb149624f13951795e07154ab70dc1856a
21 DIST mesa-20.0.4.tar.xz 12292888 BLAKE2B a14b747045ee4ff3bc07e527ad43d5b22047d6c9700cf290ba9c95e07bd88b9252bdd14380d4f0033dcb8fb652664987889d972db09462bcc69c8a7e843b606f SHA512 17d8bc3b56779a8e5648d81da9ee97b66bcec015710801edce4e8055fbb314cd9ebc1d112e3035480ba844c7d9ae6b5b1f1eac0cc0817e69e9253a7748451a55
22 DIST mesa-20.0.7.tar.xz 12308160 BLAKE2B fac8dffd08ada27080ee4c6f1e0dce69218c8f15b97ca59d9a1dc84098b7d376cea6ccdf05957690beb47a7c2ecfd75497bfa150c7c46a0c509ba37abb0e5359 SHA512 00baae50f14bf2b08b5654dffb11cf67499dc1825e1700b137fb5719e767e0e78e789979df2c194f677ea9c5e531f34965d47b9e37c239944c38d0570c7a9685
23 DIST mesa-20.1.0-rc4.tar.xz 12601932 BLAKE2B a7d02e7f8f155ae1591df8c07aad642109cabfc64c0d015605bc0baa10233830b423e5aa57be23e450628f5ffc6f8655ce3962aecea08504574e54d7b2e1aa01 SHA512 31358470a330294fa4842997cd2e6f00c4ee6cac10d6c264aa673a10d82c29051fea2e83629e2a638b659df4cb17f4e2b9d0fff1c6f6259d07d9db4dbfa10824
24 +DIST mesa-20.1.0.tar.xz 12661712 BLAKE2B cdd5f1d9167ed2c2d1e4f63d5c8ededbaf3d10fc31a6366535a3424b89137fafa34df29f59443ca97eb071cad502e10fa85c32ca33982018d7a50299130d76c7 SHA512 f49230d18febe1bfd7c6282ab95fc244530f5cef56df0f804d8bece8a70bafcb445b8b83df96ad1b4c5af022c4e39a71f19a8f7e47b1fb09ada2b1a1317ff3be
25
26 diff --git a/media-libs/mesa/mesa-20.1.0.ebuild b/media-libs/mesa/mesa-20.1.0.ebuild
27 new file mode 100644
28 index 00000000000..ff719014070
29 --- /dev/null
30 +++ b/media-libs/mesa/mesa-20.1.0.ebuild
31 @@ -0,0 +1,559 @@
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 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 +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_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 +"
103 +
104 +LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.100"
105 +RDEPEND="
106 + !app-eselect/eselect-mesa
107 + >=dev-libs/expat-2.1.0-r3:=[${MULTILIB_USEDEP}]
108 + >=sys-libs/zlib-1.2.8[${MULTILIB_USEDEP}]
109 + libglvnd? (
110 + >=media-libs/libglvnd-1.2.0-r1[X?,${MULTILIB_USEDEP}]
111 + !app-eselect/eselect-opengl
112 + )
113 + !libglvnd? (
114 + >=app-eselect/eselect-opengl-1.3.0
115 + )
116 + gallium? (
117 + unwind? ( sys-libs/libunwind[${MULTILIB_USEDEP}] )
118 + llvm? (
119 + video_cards_radeonsi? (
120 + virtual/libelf:0=[${MULTILIB_USEDEP}]
121 + )
122 + video_cards_r600? (
123 + virtual/libelf:0=[${MULTILIB_USEDEP}]
124 + )
125 + video_cards_radeon? (
126 + virtual/libelf:0=[${MULTILIB_USEDEP}]
127 + )
128 + )
129 + lm-sensors? ( sys-apps/lm-sensors:=[${MULTILIB_USEDEP}] )
130 + opencl? (
131 + >=virtual/opencl-3[${MULTILIB_USEDEP}]
132 + dev-libs/libclc
133 + virtual/libelf:0=[${MULTILIB_USEDEP}]
134 + )
135 + vaapi? (
136 + >=x11-libs/libva-1.7.3:=[${MULTILIB_USEDEP}]
137 + )
138 + vdpau? ( >=x11-libs/libvdpau-1.1:=[${MULTILIB_USEDEP}] )
139 + xvmc? ( >=x11-libs/libXvMC-1.0.8:=[${MULTILIB_USEDEP}] )
140 + )
141 + selinux? ( sys-libs/libselinux[${MULTILIB_USEDEP}] )
142 + wayland? (
143 + >=dev-libs/wayland-1.15.0:=[${MULTILIB_USEDEP}]
144 + >=dev-libs/wayland-protocols-1.8
145 + )
146 + ${LIBDRM_DEPSTRING}[video_cards_freedreno?,video_cards_nouveau?,video_cards_vc4?,video_cards_vivante?,video_cards_vmware?,${MULTILIB_USEDEP}]
147 + video_cards_intel? (
148 + !video_cards_i965? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
149 + )
150 + video_cards_i915? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
151 + vulkan-overlay? ( dev-util/glslang:0=[${MULTILIB_USEDEP}] )
152 + X? (
153 + >=x11-libs/libX11-1.6.2:=[${MULTILIB_USEDEP}]
154 + >=x11-libs/libxshmfence-1.1:=[${MULTILIB_USEDEP}]
155 + >=x11-libs/libXdamage-1.1.4-r1:=[${MULTILIB_USEDEP}]
156 + >=x11-libs/libXext-1.3.2:=[${MULTILIB_USEDEP}]
157 + >=x11-libs/libXxf86vm-1.1.3:=[${MULTILIB_USEDEP}]
158 + >=x11-libs/libxcb-1.13:=[${MULTILIB_USEDEP}]
159 + x11-libs/libXfixes:=[${MULTILIB_USEDEP}]
160 + )
161 + zstd? ( app-arch/zstd:=[${MULTILIB_USEDEP}] )
162 +"
163 +for card in ${RADEON_CARDS}; do
164 + RDEPEND="${RDEPEND}
165 + video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_radeon] )
166 + "
167 +done
168 +RDEPEND="${RDEPEND}
169 + video_cards_radeonsi? ( ${LIBDRM_DEPSTRING}[video_cards_amdgpu] )
170 +"
171 +
172 +# Please keep the LLVM dependency block separate. Since LLVM is slotted,
173 +# we need to *really* make sure we're not pulling one than more slot
174 +# simultaneously.
175 +#
176 +# How to use it:
177 +# 1. List all the working slots (with min versions) in ||, newest first.
178 +# 2. Update the := to specify *max* version, e.g. < 10.
179 +# 3. Specify LLVM_MAX_SLOT, e.g. 9.
180 +LLVM_MAX_SLOT="10"
181 +LLVM_DEPSTR="
182 + || (
183 + sys-devel/llvm:10[${MULTILIB_USEDEP}]
184 + sys-devel/llvm:9[${MULTILIB_USEDEP}]
185 + sys-devel/llvm:8[${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 + # os_same_file_description requires the kcmp syscall,
369 + # which is only available with CONFIG_CHECKPOINT_RESTORE=y.
370 + # Currently only AMDGPU utilizes this function, so only AMDGPU users would
371 + # get a spooky warning message if the syscall fails.
372 + if use gallium && use video_cards_radeonsi; then
373 + CONFIG_CHECK="~CHECKPOINT_RESTORE"
374 + linux-info_pkg_setup
375 + fi
376 +
377 + if use gallium && use llvm; then
378 + llvm_pkg_setup
379 + fi
380 + python-any-r1_pkg_setup
381 +}
382 +
383 +multilib_src_configure() {
384 + local emesonargs=()
385 +
386 + if use classic; then
387 + # Intel code
388 + dri_driver_enable video_cards_i915 i915
389 + dri_driver_enable video_cards_i965 i965
390 + if ! use video_cards_i915 && \
391 + ! use video_cards_i965; then
392 + dri_driver_enable video_cards_intel i915 i965
393 + fi
394 +
395 + # Nouveau code
396 + dri_driver_enable video_cards_nouveau nouveau
397 +
398 + # ATI code
399 + dri_driver_enable video_cards_r100 r100
400 + dri_driver_enable video_cards_r200 r200
401 + if ! use video_cards_r100 && \
402 + ! use video_cards_r200; then
403 + dri_driver_enable video_cards_radeon r100 r200
404 + fi
405 + fi
406 +
407 + emesonargs+=( -Dplatforms=$(use X && echo "x11,")$(use wayland && echo "wayland,")$(use gbm && echo "drm,")surfaceless )
408 +
409 + if use gallium; then
410 + emesonargs+=(
411 + $(meson_use llvm)
412 + $(meson_use lm-sensors lmsensors)
413 + $(meson_use unwind libunwind)
414 + )
415 +
416 + if use video_cards_iris ||
417 + use video_cards_r300 ||
418 + use video_cards_r600 ||
419 + use video_cards_radeonsi ||
420 + use video_cards_nouveau ||
421 + use video_cards_vmware; then
422 + emesonargs+=($(meson_use d3d9 gallium-nine))
423 + else
424 + emesonargs+=(-Dgallium-nine=false)
425 + fi
426 +
427 + if use video_cards_r600 ||
428 + use video_cards_radeonsi ||
429 + use video_cards_nouveau; then
430 + emesonargs+=($(meson_use vaapi gallium-va))
431 + use vaapi && emesonargs+=( -Dva-libs-path="${EPREFIX}"/usr/$(get_libdir)/va/drivers )
432 + else
433 + emesonargs+=(-Dgallium-va=false)
434 + fi
435 +
436 + if use video_cards_r300 ||
437 + use video_cards_r600 ||
438 + use video_cards_radeonsi ||
439 + use video_cards_nouveau; then
440 + emesonargs+=($(meson_use vdpau gallium-vdpau))
441 + else
442 + emesonargs+=(-Dgallium-vdpau=false)
443 + fi
444 +
445 + if use video_cards_freedreno ||
446 + use video_cards_nouveau ||
447 + use video_cards_vmware; then
448 + emesonargs+=($(meson_use xa gallium-xa))
449 + else
450 + emesonargs+=(-Dgallium-xa=false)
451 + fi
452 +
453 + if use video_cards_r600 ||
454 + use video_cards_nouveau; then
455 + emesonargs+=($(meson_use xvmc gallium-xvmc))
456 + else
457 + emesonargs+=(-Dgallium-xvmc=false)
458 + fi
459 +
460 + if use video_cards_freedreno ||
461 + use video_cards_lima ||
462 + use video_cards_panfrost ||
463 + use video_cards_vc4 ||
464 + use video_cards_vivante; then
465 + gallium_enable -- kmsro
466 + fi
467 +
468 + gallium_enable video_cards_lima lima
469 + gallium_enable video_cards_panfrost panfrost
470 + gallium_enable video_cards_vc4 vc4
471 + gallium_enable video_cards_vivante etnaviv
472 + gallium_enable video_cards_vmware svga
473 + gallium_enable video_cards_nouveau nouveau
474 +
475 + # Only one i915 driver (classic vs gallium). Default to classic.
476 + if ! use classic; then
477 + gallium_enable video_cards_i915 i915
478 + if ! use video_cards_i915 && \
479 + ! use video_cards_i965; then
480 + gallium_enable video_cards_intel i915
481 + fi
482 + fi
483 +
484 + gallium_enable video_cards_iris iris
485 +
486 + gallium_enable video_cards_r300 r300
487 + gallium_enable video_cards_r600 r600
488 + gallium_enable video_cards_radeonsi radeonsi
489 + if ! use video_cards_r300 && \
490 + ! use video_cards_r600; then
491 + gallium_enable video_cards_radeon r300 r600
492 + fi
493 +
494 + gallium_enable video_cards_freedreno freedreno
495 + gallium_enable video_cards_virgl virgl
496 +
497 + # opencl stuff
498 + emesonargs+=(
499 + -Dgallium-opencl="$(usex opencl icd disabled)"
500 + )
501 + fi
502 +
503 + if use vulkan; then
504 + vulkan_enable video_cards_i965 intel
505 + vulkan_enable video_cards_iris intel
506 + vulkan_enable video_cards_radeonsi amd
507 + fi
508 +
509 + if use gallium; then
510 + gallium_enable -- swrast
511 + emesonargs+=( -Dosmesa=$(usex osmesa gallium none) )
512 + else
513 + dri_driver_enable -- swrast
514 + emesonargs+=( -Dosmesa=$(usex osmesa classic none) )
515 + fi
516 +
517 + driver_list() {
518 + local drivers="$(sort -u <<< "${1// /$'\n'}")"
519 + echo "${drivers//$'\n'/,}"
520 + }
521 +
522 + emesonargs+=(
523 + $(meson_use test build-tests)
524 + -Dglx=$(usex X dri disabled)
525 + -Dshared-glapi=true
526 + $(meson_use dri3)
527 + $(meson_use egl)
528 + $(meson_use gbm)
529 + $(meson_use gles1)
530 + $(meson_use gles2)
531 + $(meson_use libglvnd glvnd)
532 + $(meson_use selinux)
533 + $(meson_use zstd)
534 + -Dvalgrind=$(usex valgrind auto false)
535 + -Ddri-drivers=$(driver_list "${DRI_DRIVERS[*]}")
536 + -Dgallium-drivers=$(driver_list "${GALLIUM_DRIVERS[*]}")
537 + -Dvulkan-drivers=$(driver_list "${VULKAN_DRIVERS[*]}")
538 + $(meson_use vulkan-overlay vulkan-overlay-layer)
539 + --buildtype $(usex debug debug plain)
540 + -Db_ndebug=$(usex debug false true)
541 + )
542 + meson_src_configure
543 +}
544 +
545 +multilib_src_compile() {
546 + meson_src_compile
547 +}
548 +
549 +multilib_src_install() {
550 + meson_src_install
551 +}
552 +
553 +multilib_src_install_all() {
554 + einstalldocs
555 +}
556 +
557 +multilib_src_test() {
558 + meson test -v -C "${BUILD_DIR}" -t 100
559 +}
560 +
561 +pkg_postinst() {
562 + if ! use libglvnd; then
563 + # Switch to the xorg implementation.
564 + echo
565 + eselect opengl set --use-old ${OPENGL_DIR}
566 + fi
567 +}
568 +
569 +# $1 - VIDEO_CARDS flag (check skipped for "--")
570 +# other args - names of DRI drivers to enable
571 +dri_driver_enable() {
572 + if [[ $1 == -- ]] || use $1; then
573 + shift
574 + DRI_DRIVERS+=("$@")
575 + fi
576 +}
577 +
578 +gallium_enable() {
579 + if [[ $1 == -- ]] || use $1; then
580 + shift
581 + GALLIUM_DRIVERS+=("$@")
582 + fi
583 +}
584 +
585 +vulkan_enable() {
586 + if [[ $1 == -- ]] || use $1; then
587 + shift
588 + VULKAN_DRIVERS+=("$@")
589 + fi
590 +}