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, 09 Mar 2020 23:35:26
Message-Id: 1583796914.8a405f95dd56d6614c14038eb15ce9655529747d.mattst88@gentoo
1 commit: 8a405f95dd56d6614c14038eb15ce9655529747d
2 Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
3 AuthorDate: Mon Mar 9 23:34:08 2020 +0000
4 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
5 CommitDate: Mon Mar 9 23:35:14 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8a405f95
7
8 media-libs/mesa: Version bump to 19.3.5
9
10 Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>
11
12 media-libs/mesa/Manifest | 1 +
13 media-libs/mesa/mesa-19.3.5.ebuild | 547 +++++++++++++++++++++++++++++++++++++
14 2 files changed, 548 insertions(+)
15
16 diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
17 index e9603faf090..c6d4d409449 100644
18 --- a/media-libs/mesa/Manifest
19 +++ b/media-libs/mesa/Manifest
20 @@ -1,2 +1,3 @@
21 DIST mesa-19.3.4.tar.xz 11968288 BLAKE2B be39a2ca08d91f8afbc2f3a47d596b14445fac62600f64d627b23d63b340b002bc05246eece95e19b33485a92c01f7980fff52b2375b7a2053161e0aa87d0b38 SHA512 2bbb3dc8f1d839f11fe12cc959393cd69607fa6714b2166b80299e0559d2d3b0ac38ed4e15ac3e5f472264eb24536d1901d350f7409f3a7e00d6f4ccbb2312fb
22 +DIST mesa-19.3.5.tar.xz 12064980 BLAKE2B a20ebfb149624f13951795e07154ab70dc1856a7a1261b339b0bdf0009511111756c88439e7b8729f768b0b4b298301b9a3c0c10d7f2fab3abd91649c12ba51c SHA512 413929573fab31e1bb2a1a04c0c770161c2db464a5aab3f0567d27603fff889ede70e1f6e197e7ff1c1639dc4cc543457bcf45761f0f8e6dffafccfa773a4e3f
23 DIST mesa-20.0.1.tar.xz 12174080 BLAKE2B bc25d95b6737006d755384cfe759439819fadfacf441db723247fd5d0c7dad1daa84695dfdf86319ba2ac68ac2d66f48dc396e8d7e8c579faa7fbdda4391636f SHA512 9e005ebbb699c1ad83b73c503c467907958a3d9cad644d8f7ac95804fd265debcf563784a1054c8e0bf40106e33b13185607e8270a197e9ddc34c50b1b2c4d82
24
25 diff --git a/media-libs/mesa/mesa-19.3.5.ebuild b/media-libs/mesa/mesa-19.3.5.ebuild
26 new file mode 100644
27 index 00000000000..ea716c993c1
28 --- /dev/null
29 +++ b/media-libs/mesa/mesa-19.3.5.ebuild
30 @@ -0,0 +1,547 @@
31 +# Copyright 1999-2020 Gentoo Authors
32 +# Distributed under the terms of the GNU General Public License v2
33 +
34 +EAPI=7
35 +
36 +PYTHON_COMPAT=( python3_{6,7,8} )
37 +
38 +inherit llvm meson multilib-minimal pax-utils python-any-r1
39 +
40 +OPENGL_DIR="xorg-x11"
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://mesa.freedesktop.org/archive/${MY_P}.tar.xz"
52 + KEYWORDS="~alpha amd64 arm arm64 ~hppa ia64 ~mips ppc ppc64 ~s390 ~sh 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} freedreno i915 i965 intel iris lima nouveau panfrost 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 d3d9 debug +dri3 +egl +gallium +gbm gles1 +gles2 +libglvnd +llvm
69 + lm-sensors opencl osmesa pax_kernel selinux test unwind vaapi valgrind
70 + vdpau vulkan vulkan-overlay wayland +X xa xvmc"
71 +
72 +REQUIRED_USE="
73 + d3d9? ( dri3 || ( 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 + vulkan? ( dri3
77 + || ( video_cards_i965 video_cards_iris video_cards_radeonsi )
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 + dev-libs/ocl-icd[khronos-headers,${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 +"
162 +for card in ${RADEON_CARDS}; do
163 + RDEPEND="${RDEPEND}
164 + video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_radeon] )
165 + "
166 +done
167 +RDEPEND="${RDEPEND}
168 + video_cards_radeonsi? ( ${LIBDRM_DEPSTRING}[video_cards_amdgpu] )
169 +"
170 +
171 +# Please keep the LLVM dependency block separate. Since LLVM is slotted,
172 +# we need to *really* make sure we're not pulling one than more slot
173 +# simultaneously.
174 +#
175 +# How to use it:
176 +# 1. List all the working slots (with min versions) in ||, newest first.
177 +# 2. Update the := to specify *max* version, e.g. < 10.
178 +# 3. Specify LLVM_MAX_SLOT, e.g. 9.
179 +LLVM_MAX_SLOT="9"
180 +LLVM_DEPSTR="
181 + || (
182 + sys-devel/llvm:9[${MULTILIB_USEDEP}]
183 + sys-devel/llvm:8[${MULTILIB_USEDEP}]
184 + )
185 + sys-devel/llvm:=[${MULTILIB_USEDEP}]
186 +"
187 +LLVM_DEPSTR_AMDGPU=${LLVM_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
188 +CLANG_DEPSTR=${LLVM_DEPSTR//llvm/clang}
189 +CLANG_DEPSTR_AMDGPU=${CLANG_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
190 +RDEPEND="${RDEPEND}
191 + gallium? (
192 + llvm? (
193 + opencl? (
194 + video_cards_r600? (
195 + ${CLANG_DEPSTR_AMDGPU}
196 + )
197 + !video_cards_r600? (
198 + video_cards_radeonsi? (
199 + ${CLANG_DEPSTR_AMDGPU}
200 + )
201 + )
202 + !video_cards_r600? (
203 + !video_cards_radeonsi? (
204 + video_cards_radeon? (
205 + ${CLANG_DEPSTR_AMDGPU}
206 + )
207 + )
208 + )
209 + !video_cards_r600? (
210 + !video_cards_radeon? (
211 + !video_cards_radeonsi? (
212 + ${CLANG_DEPSTR}
213 + )
214 + )
215 + )
216 + )
217 + !opencl? (
218 + video_cards_r600? (
219 + ${LLVM_DEPSTR_AMDGPU}
220 + )
221 + !video_cards_r600? (
222 + video_cards_radeonsi? (
223 + ${LLVM_DEPSTR_AMDGPU}
224 + )
225 + )
226 + !video_cards_r600? (
227 + !video_cards_radeonsi? (
228 + video_cards_radeon? (
229 + ${LLVM_DEPSTR_AMDGPU}
230 + )
231 + )
232 + )
233 + !video_cards_r600? (
234 + !video_cards_radeon? (
235 + !video_cards_radeonsi? (
236 + ${LLVM_DEPSTR}
237 + )
238 + )
239 + )
240 + )
241 + )
242 + )
243 +"
244 +unset {LLVM,CLANG}_DEPSTR{,_AMDGPU}
245 +
246 +DEPEND="${RDEPEND}
247 + valgrind? ( dev-util/valgrind )
248 + X? (
249 + x11-libs/libXrandr[${MULTILIB_USEDEP}]
250 + x11-base/xorg-proto
251 + )
252 +"
253 +BDEPEND="
254 + ${PYTHON_DEPS}
255 + opencl? (
256 + >=sys-devel/gcc-4.6
257 + )
258 + sys-devel/bison
259 + sys-devel/flex
260 + sys-devel/gettext
261 + virtual/pkgconfig
262 + $(python_gen_any_dep ">=dev-python/mako-0.8.0[\${PYTHON_USEDEP}]")
263 +"
264 +
265 +S="${WORKDIR}/${MY_P}"
266 +EGIT_CHECKOUT_DIR=${S}
267 +
268 +QA_WX_LOAD="
269 +x86? (
270 + usr/lib*/libglapi.so.0.0.0
271 + usr/lib*/libGLESv1_CM.so.1.1.0
272 + usr/lib*/libGLESv2.so.2.0.0
273 + usr/lib*/libGL.so.1.2.0
274 + usr/lib*/libOSMesa.so.8.0.0
275 + libglvnd? ( usr/lib/libGLX_mesa.so.0.0.0 )
276 +)"
277 +
278 +llvm_check_deps() {
279 + local flags=${MULTILIB_USEDEP}
280 + if use video_cards_r600 || use video_cards_radeon || use video_cards_radeonsi
281 + then
282 + flags+=",llvm_targets_AMDGPU(-)"
283 + fi
284 +
285 + if use opencl; then
286 + has_version "sys-devel/clang:${LLVM_SLOT}[${flags}]" || return 1
287 + fi
288 + has_version "sys-devel/llvm:${LLVM_SLOT}[${flags}]"
289 +}
290 +
291 +pkg_pretend() {
292 + if use opencl; then
293 + if ! use video_cards_r600 &&
294 + ! use video_cards_radeonsi; then
295 + ewarn "Ignoring USE=opencl since VIDEO_CARDS does not contain r600 or radeonsi"
296 + fi
297 + fi
298 +
299 + if use vaapi; then
300 + if ! use video_cards_r600 &&
301 + ! use video_cards_radeonsi &&
302 + ! use video_cards_nouveau; then
303 + ewarn "Ignoring USE=vaapi since VIDEO_CARDS does not contain r600, radeonsi, or nouveau"
304 + fi
305 + fi
306 +
307 + if use vdpau; then
308 + if ! use video_cards_r300 &&
309 + ! use video_cards_r600 &&
310 + ! use video_cards_radeonsi &&
311 + ! use video_cards_nouveau; then
312 + ewarn "Ignoring USE=vdpau since VIDEO_CARDS does not contain r300, r600, radeonsi, or nouveau"
313 + fi
314 + fi
315 +
316 + if use xa; then
317 + if ! use video_cards_freedreno &&
318 + ! use video_cards_nouveau &&
319 + ! use video_cards_vmware; then
320 + ewarn "Ignoring USE=xa since VIDEO_CARDS does not contain freedreno, nouveau, or vmware"
321 + fi
322 + fi
323 +
324 + if use xvmc; then
325 + if ! use video_cards_r600 &&
326 + ! use video_cards_nouveau; then
327 + ewarn "Ignoring USE=xvmc since VIDEO_CARDS does not contain r600 or nouveau"
328 + fi
329 + fi
330 +
331 + if ! use gallium; then
332 + use lm-sensors && ewarn "Ignoring USE=lm-sensors since USE does not contain gallium"
333 + use llvm && ewarn "Ignoring USE=llvm since USE does not contain gallium"
334 + use opencl && ewarn "Ignoring USE=opencl since USE does not contain gallium"
335 + use vaapi && ewarn "Ignoring USE=vaapi since USE does not contain gallium"
336 + use vdpau && ewarn "Ignoring USE=vdpau since USE does not contain gallium"
337 + use unwind && ewarn "Ignoring USE=unwind since USE does not contain gallium"
338 + use xa && ewarn "Ignoring USE=xa since USE does not contain gallium"
339 + use xvmc && ewarn "Ignoring USE=xvmc since USE does not contain gallium"
340 + fi
341 +
342 + if ! use llvm; then
343 + use opencl && ewarn "Ignoring USE=opencl since USE does not contain llvm"
344 + fi
345 +}
346 +
347 +python_check_deps() {
348 + has_version -b ">=dev-python/mako-0.8.0[${PYTHON_USEDEP}]"
349 +}
350 +
351 +pkg_setup() {
352 + # warning message for bug 459306
353 + if use llvm && has_version sys-devel/llvm[!debug=]; then
354 + ewarn "Mismatch between debug USE flags in media-libs/mesa and sys-devel/llvm"
355 + ewarn "detected! This can cause problems. For details, see bug 459306."
356 + fi
357 +
358 + if use llvm; then
359 + llvm_pkg_setup
360 + fi
361 + python-any-r1_pkg_setup
362 +}
363 +
364 +multilib_src_configure() {
365 + local emesonargs=()
366 +
367 + if use classic; then
368 + # Intel code
369 + dri_driver_enable video_cards_i915 i915
370 + dri_driver_enable video_cards_i965 i965
371 + if ! use video_cards_i915 && \
372 + ! use video_cards_i965; then
373 + dri_driver_enable video_cards_intel i915 i965
374 + fi
375 +
376 + # Nouveau code
377 + dri_driver_enable video_cards_nouveau nouveau
378 +
379 + # ATI code
380 + dri_driver_enable video_cards_r100 r100
381 + dri_driver_enable video_cards_r200 r200
382 + if ! use video_cards_r100 && \
383 + ! use video_cards_r200; then
384 + dri_driver_enable video_cards_radeon r100 r200
385 + fi
386 + fi
387 +
388 + emesonargs+=( -Dplatforms=$(use X && echo "x11,")$(use wayland && echo "wayland,")$(use gbm && echo "drm,")surfaceless )
389 +
390 + if use gallium; then
391 + emesonargs+=(
392 + $(meson_use llvm)
393 + $(meson_use lm-sensors lmsensors)
394 + $(meson_use unwind libunwind)
395 + )
396 +
397 + if use video_cards_iris ||
398 + use video_cards_r300 ||
399 + use video_cards_r600 ||
400 + use video_cards_radeonsi ||
401 + use video_cards_nouveau ||
402 + use video_cards_vmware; then
403 + emesonargs+=($(meson_use d3d9 gallium-nine))
404 + else
405 + emesonargs+=(-Dgallium-nine=false)
406 + fi
407 +
408 + if use video_cards_r600 ||
409 + use video_cards_radeonsi ||
410 + use video_cards_nouveau; then
411 + emesonargs+=($(meson_use vaapi gallium-va))
412 + use vaapi && emesonargs+=( -Dva-libs-path="${EPREFIX}"/usr/$(get_libdir)/va/drivers )
413 + else
414 + emesonargs+=(-Dgallium-va=false)
415 + fi
416 +
417 + if use video_cards_r300 ||
418 + use video_cards_r600 ||
419 + use video_cards_radeonsi ||
420 + use video_cards_nouveau; then
421 + emesonargs+=($(meson_use vdpau gallium-vdpau))
422 + else
423 + emesonargs+=(-Dgallium-vdpau=false)
424 + fi
425 +
426 + if use video_cards_freedreno ||
427 + use video_cards_nouveau ||
428 + use video_cards_vmware; then
429 + emesonargs+=($(meson_use xa gallium-xa))
430 + else
431 + emesonargs+=(-Dgallium-xa=false)
432 + fi
433 +
434 + if use video_cards_r600 ||
435 + use video_cards_nouveau; then
436 + emesonargs+=($(meson_use xvmc gallium-xvmc))
437 + else
438 + emesonargs+=(-Dgallium-xvmc=false)
439 + fi
440 +
441 + if use video_cards_freedreno ||
442 + use video_cards_lima ||
443 + use video_cards_panfrost ||
444 + use video_cards_vc4 ||
445 + use video_cards_vivante; then
446 + gallium_enable -- kmsro
447 + fi
448 +
449 + gallium_enable video_cards_lima lima
450 + gallium_enable video_cards_panfrost panfrost
451 + gallium_enable video_cards_vc4 vc4
452 + gallium_enable video_cards_vivante etnaviv
453 + gallium_enable video_cards_vmware svga
454 + gallium_enable video_cards_nouveau nouveau
455 +
456 + # Only one i915 driver (classic vs gallium). Default to classic.
457 + if ! use classic; then
458 + gallium_enable video_cards_i915 i915
459 + if ! use video_cards_i915 && \
460 + ! use video_cards_i965; then
461 + gallium_enable video_cards_intel i915
462 + fi
463 + fi
464 +
465 + gallium_enable video_cards_iris iris
466 +
467 + gallium_enable video_cards_r300 r300
468 + gallium_enable video_cards_r600 r600
469 + gallium_enable video_cards_radeonsi radeonsi
470 + if ! use video_cards_r300 && \
471 + ! use video_cards_r600; then
472 + gallium_enable video_cards_radeon r300 r600
473 + fi
474 +
475 + gallium_enable video_cards_freedreno freedreno
476 + gallium_enable video_cards_virgl virgl
477 +
478 + # opencl stuff
479 + emesonargs+=(
480 + -Dgallium-opencl="$(usex opencl icd disabled)"
481 + )
482 + fi
483 +
484 + if use vulkan; then
485 + vulkan_enable video_cards_i965 intel
486 + vulkan_enable video_cards_iris intel
487 + vulkan_enable video_cards_radeonsi amd
488 + fi
489 +
490 + # x86 hardened pax_kernel needs glx-rts, bug 240956
491 + if [[ ${ABI} == x86 ]]; then
492 + emesonargs+=( $(meson_use pax_kernel glx-read-only-text) )
493 + fi
494 +
495 + if use gallium; then
496 + gallium_enable -- swrast
497 + emesonargs+=( -Dosmesa=$(usex osmesa gallium none) )
498 + else
499 + dri_driver_enable -- swrast
500 + emesonargs+=( -Dosmesa=$(usex osmesa classic none) )
501 + fi
502 +
503 + driver_list() {
504 + local drivers="$(sort -u <<< "${1// /$'\n'}")"
505 + echo "${drivers//$'\n'/,}"
506 + }
507 +
508 + emesonargs+=(
509 + $(meson_use test build-tests)
510 + -Dglx=$(usex X dri disabled)
511 + -Dshared-glapi=true
512 + $(meson_use dri3)
513 + $(meson_use egl)
514 + $(meson_use gbm)
515 + $(meson_use gles1)
516 + $(meson_use gles2)
517 + $(meson_use libglvnd glvnd)
518 + $(meson_use selinux)
519 + -Dvalgrind=$(usex valgrind auto false)
520 + -Ddri-drivers=$(driver_list "${DRI_DRIVERS[*]}")
521 + -Dgallium-drivers=$(driver_list "${GALLIUM_DRIVERS[*]}")
522 + -Dvulkan-drivers=$(driver_list "${VULKAN_DRIVERS[*]}")
523 + $(meson_use vulkan-overlay vulkan-overlay-layer)
524 + --buildtype $(usex debug debug plain)
525 + -Db_ndebug=$(usex debug false true)
526 + )
527 + meson_src_configure
528 +}
529 +
530 +multilib_src_compile() {
531 + meson_src_compile
532 +}
533 +
534 +multilib_src_install() {
535 + meson_src_install
536 +
537 + use libglvnd && rm -f "${D}"/usr/$(get_libdir)/pkgconfig/{egl,gl}.pc
538 +}
539 +
540 +multilib_src_install_all() {
541 + einstalldocs
542 +}
543 +
544 +multilib_src_test() {
545 + meson test -v -C "${BUILD_DIR}" -t 100
546 +}
547 +
548 +pkg_postinst() {
549 + if ! use libglvnd; then
550 + # Switch to the xorg implementation.
551 + echo
552 + eselect opengl set --use-old ${OPENGL_DIR}
553 + fi
554 +}
555 +
556 +# $1 - VIDEO_CARDS flag (check skipped for "--")
557 +# other args - names of DRI drivers to enable
558 +dri_driver_enable() {
559 + if [[ $1 == -- ]] || use $1; then
560 + shift
561 + DRI_DRIVERS+=("$@")
562 + fi
563 +}
564 +
565 +gallium_enable() {
566 + if [[ $1 == -- ]] || use $1; then
567 + shift
568 + GALLIUM_DRIVERS+=("$@")
569 + fi
570 +}
571 +
572 +vulkan_enable() {
573 + if [[ $1 == -- ]] || use $1; then
574 + shift
575 + VULKAN_DRIVERS+=("$@")
576 + fi
577 +}