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, 13 Nov 2019 19:14:07
Message-Id: 1573672421.035495f8f7cb0670560a53b33a571672e555175c.mattst88@gentoo
1 commit: 035495f8f7cb0670560a53b33a571672e555175c
2 Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
3 AuthorDate: Wed Nov 13 19:12:09 2019 +0000
4 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
5 CommitDate: Wed Nov 13 19:13:41 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=035495f8
7
8 media-libs/mesa: Version bump to 19.2.4
9
10 Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>
11
12 media-libs/mesa/Manifest | 1 +
13 media-libs/mesa/mesa-19.2.4.ebuild | 548 +++++++++++++++++++++++++++++++++++++
14 2 files changed, 549 insertions(+)
15
16 diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
17 index f34d13b2ed6..b039a712881 100644
18 --- a/media-libs/mesa/Manifest
19 +++ b/media-libs/mesa/Manifest
20 @@ -2,4 +2,5 @@ DIST mesa-19.1.7.tar.xz 10941152 BLAKE2B 6be14ddac404668bdd8b7b8756388019c3610ac
21 DIST mesa-19.1.8.tar.xz 10945480 BLAKE2B df2ce0561cd0a61f0f35a406a5a9b2384c0c5869efadabfa40b07cf96a592214aa5c6d03423598c531f117075c3b59aa5af6f9b1c5dfa5914aabe41f60b592a0 SHA512 3bcc90c17cf966ce3399434ca2d4f363c5778e52c56b8184d6cdf22ef2e4a4fdb9c3fbff5c98efc856e3535f81259608a6daa74af1f3bdce30ea251d86435c74
22 DIST mesa-19.2.2.tar.xz 11456352 BLAKE2B b0900a486d5883759dc395a25195c46fbc90d0388840099d515713a3c1e27560ea6cf9f6bfc5987c9704593b174e26f49a4cd08ff1260b1c1b2197b56c6919b6 SHA512 a3269052c2dfb5404180d1aebd68f5b9b0cc136d634ba89fed3f60fcc9b279072e09ee2db9b485375d39e886209053841df920c9d0b975e0de2825e3da4164a5
23 DIST mesa-19.2.3.tar.xz 11457544 BLAKE2B 60ff0296408447077ff0594022bf3e8d295274a6ce3009266ddd01bfb5b74e33ff3be802e61e777e1a61856bcc1c402428ca7d310256e59eb7b568b068e8c384 SHA512 a64a6b508c28a61b9f5a50f639d0cdca2546caa2118c2478100e3535961d76bf3877357d4a7ddd7dc1d3dfc617883c8ee188915523b003aed8db03e0d5e1c007
24 +DIST mesa-19.2.4.tar.xz 11458340 BLAKE2B 2403f50e3d31f87981b8f243d8473672305c88f93daa11c0d9a373d5b68f52af105b134d9deda71bc9d4f56e6c8b2d6358b298060229802987ef88dd58bc5d21 SHA512 e8a0e90460f3153d730f8fb13f2c912a9826c05d2af9e22dc575bcd8885bf6a33c0af1c6659e81701ff097a132df88eead208e89dceb552b9da809ab543fa479
25 DIST mesa-19.3.0-rc2.tar.xz 11790920 BLAKE2B a1cf1b504cdd818aff33b739159dd715af2d30f346f396b9b7634096b74d77a798f302c044241bc42191b318c6314342f2fa670ec0f92279a50d1a0f7993fd71 SHA512 bc198c8cb625b59e11e7bc15e4021ac42733f297f30eb5a08e6fe9830df6f47416a5e8239a249ec2ce5038928fe63aacf5c6647edadf0ef8bb98ff2e9f85a66a
26
27 diff --git a/media-libs/mesa/mesa-19.2.4.ebuild b/media-libs/mesa/mesa-19.2.4.ebuild
28 new file mode 100644
29 index 00000000000..9fb49167ff4
30 --- /dev/null
31 +++ b/media-libs/mesa/mesa-19.2.4.ebuild
32 @@ -0,0 +1,548 @@
33 +# Copyright 1999-2019 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=7
37 +
38 +PYTHON_COMPAT=( python3_5 python3_6 python3_7 )
39 +
40 +inherit llvm meson multilib-minimal pax-utils python-any-r1
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://mesa.freedesktop.org/archive/${MY_P}.tar.xz"
54 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~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 pax_kernel selinux test unwind vaapi valgrind
72 + vdpau vulkan vulkan-overlay wayland +X xa xvmc"
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_i965 video_cards_iris video_cards_radeonsi )
80 + video_cards_radeonsi? ( llvm ) )
81 + vulkan-overlay? ( vulkan )
82 + wayland? ( egl gbm )
83 + video_cards_freedreno? ( gallium )
84 + video_cards_intel? ( classic )
85 + video_cards_i915? ( || ( classic gallium ) )
86 + video_cards_i965? ( classic )
87 + video_cards_iris? ( gallium )
88 + video_cards_lima? ( gallium )
89 + video_cards_nouveau? ( || ( classic gallium ) )
90 + video_cards_panfrost? ( gallium )
91 + video_cards_radeon? ( || ( classic gallium )
92 + gallium? ( x86? ( llvm ) amd64? ( llvm ) ) )
93 + video_cards_r100? ( classic )
94 + video_cards_r200? ( classic )
95 + video_cards_r300? ( gallium x86? ( llvm ) amd64? ( llvm ) )
96 + video_cards_r600? ( gallium )
97 + video_cards_radeonsi? ( gallium llvm )
98 + video_cards_vc4? ( gallium )
99 + video_cards_virgl? ( gallium )
100 + video_cards_vivante? ( gallium gbm )
101 + video_cards_vmware? ( gallium )
102 + xa? ( X )
103 + xvmc? ( X )
104 +"
105 +
106 +LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.99"
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.2.0-r1[${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 + dev-libs/ocl-icd[khronos-headers,${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 + video_cards_nouveau? ( !<=x11-libs/libva-vdpau-driver-0.7.4-r3 )
140 + )
141 + vdpau? ( >=x11-libs/libvdpau-1.1:=[${MULTILIB_USEDEP}] )
142 + xvmc? ( >=x11-libs/libXvMC-1.0.8:=[${MULTILIB_USEDEP}] )
143 + )
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 +
150 + video_cards_intel? (
151 + !video_cards_i965? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
152 + )
153 + video_cards_i915? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
154 + vulkan-overlay? ( dev-util/glslang:0=[${MULTILIB_USEDEP}] )
155 + X? (
156 + >=x11-libs/libX11-1.6.2:=[${MULTILIB_USEDEP}]
157 + >=x11-libs/libxshmfence-1.1:=[${MULTILIB_USEDEP}]
158 + >=x11-libs/libXdamage-1.1.4-r1:=[${MULTILIB_USEDEP}]
159 + >=x11-libs/libXext-1.3.2:=[${MULTILIB_USEDEP}]
160 + >=x11-libs/libXxf86vm-1.1.3:=[${MULTILIB_USEDEP}]
161 + >=x11-libs/libxcb-1.13:=[${MULTILIB_USEDEP}]
162 + x11-libs/libXfixes:=[${MULTILIB_USEDEP}]
163 + )
164 +"
165 +for card in ${RADEON_CARDS}; do
166 + RDEPEND="${RDEPEND}
167 + video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_radeon] )
168 + "
169 +done
170 +RDEPEND="${RDEPEND}
171 + video_cards_radeonsi? ( ${LIBDRM_DEPSTRING}[video_cards_amdgpu] )
172 +"
173 +
174 +# Please keep the LLVM dependency block separate. Since LLVM is slotted,
175 +# we need to *really* make sure we're not pulling one than more slot
176 +# simultaneously.
177 +#
178 +# How to use it:
179 +# 1. List all the working slots (with min versions) in ||, newest first.
180 +# 2. Update the := to specify *max* version, e.g. < 10.
181 +# 3. Specify LLVM_MAX_SLOT, e.g. 9.
182 +LLVM_MAX_SLOT="10"
183 +LLVM_DEPSTR="
184 + || (
185 + sys-devel/llvm:10[${MULTILIB_USEDEP}]
186 + sys-devel/llvm:9[${MULTILIB_USEDEP}]
187 + sys-devel/llvm:8[${MULTILIB_USEDEP}]
188 + sys-devel/llvm:7[${MULTILIB_USEDEP}]
189 + )
190 + sys-devel/llvm:=[${MULTILIB_USEDEP}]
191 +"
192 +LLVM_DEPSTR_AMDGPU=${LLVM_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
193 +CLANG_DEPSTR=${LLVM_DEPSTR//llvm/clang}
194 +CLANG_DEPSTR_AMDGPU=${CLANG_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
195 +RDEPEND="${RDEPEND}
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 +unset {LLVM,CLANG}_DEPSTR{,_AMDGPU}
248 +
249 +DEPEND="${RDEPEND}
250 + valgrind? ( dev-util/valgrind )
251 + X? (
252 + x11-libs/libXrandr[${MULTILIB_USEDEP}]
253 + x11-base/xorg-proto
254 + )
255 +"
256 +BDEPEND="
257 + ${PYTHON_DEPS}
258 + opencl? (
259 + >=sys-devel/gcc-4.6
260 + )
261 + sys-devel/bison
262 + sys-devel/flex
263 + sys-devel/gettext
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 opencl; then
296 + if ! use video_cards_r600 &&
297 + ! use video_cards_radeonsi; then
298 + ewarn "Ignoring USE=opencl since VIDEO_CARDS does not contain r600 or radeonsi"
299 + fi
300 + fi
301 +
302 + if use vaapi; then
303 + if ! use video_cards_r600 &&
304 + ! use video_cards_radeonsi &&
305 + ! use video_cards_nouveau; then
306 + ewarn "Ignoring USE=vaapi since VIDEO_CARDS does not contain r600, radeonsi, or nouveau"
307 + fi
308 + fi
309 +
310 + if use vdpau; then
311 + if ! use video_cards_r300 &&
312 + ! use video_cards_r600 &&
313 + ! use video_cards_radeonsi &&
314 + ! use video_cards_nouveau; then
315 + ewarn "Ignoring USE=vdpau since VIDEO_CARDS does not contain r300, r600, radeonsi, or nouveau"
316 + fi
317 + fi
318 +
319 + if use xa; then
320 + if ! use video_cards_freedreno &&
321 + ! use video_cards_nouveau &&
322 + ! use video_cards_vmware; then
323 + ewarn "Ignoring USE=xa since VIDEO_CARDS does not contain freedreno, nouveau, or vmware"
324 + fi
325 + fi
326 +
327 + if use xvmc; then
328 + if ! use video_cards_r600 &&
329 + ! use video_cards_nouveau; then
330 + ewarn "Ignoring USE=xvmc since VIDEO_CARDS does not contain r600 or nouveau"
331 + fi
332 + fi
333 +
334 + if ! use gallium; then
335 + use lm-sensors && ewarn "Ignoring USE=lm-sensors since USE does not contain gallium"
336 + use llvm && ewarn "Ignoring USE=llvm since USE does not contain gallium"
337 + use opencl && ewarn "Ignoring USE=opencl since USE does not contain gallium"
338 + use vaapi && ewarn "Ignoring USE=vaapi since USE does not contain gallium"
339 + use vdpau && ewarn "Ignoring USE=vdpau since USE does not contain gallium"
340 + use unwind && ewarn "Ignoring USE=unwind since USE does not contain gallium"
341 + use xa && ewarn "Ignoring USE=xa since USE does not contain gallium"
342 + use xvmc && ewarn "Ignoring USE=xvmc since USE does not contain gallium"
343 + fi
344 +
345 + if ! use llvm; then
346 + use opencl && ewarn "Ignoring USE=opencl since USE does not contain llvm"
347 + fi
348 +}
349 +
350 +python_check_deps() {
351 + has_version -b ">=dev-python/mako-0.8.0[${PYTHON_USEDEP}]"
352 +}
353 +
354 +pkg_setup() {
355 + # warning message for bug 459306
356 + if use llvm && has_version sys-devel/llvm[!debug=]; then
357 + ewarn "Mismatch between debug USE flags in media-libs/mesa and sys-devel/llvm"
358 + ewarn "detected! This can cause problems. For details, see bug 459306."
359 + fi
360 +
361 + if use llvm; then
362 + llvm_pkg_setup
363 + fi
364 + python-any-r1_pkg_setup
365 +}
366 +
367 +multilib_src_configure() {
368 + local emesonargs=()
369 +
370 + if use classic; then
371 + # Intel code
372 + dri_driver_enable video_cards_i915 i915
373 + dri_driver_enable video_cards_i965 i965
374 + if ! use video_cards_i915 && \
375 + ! use video_cards_i965; then
376 + dri_driver_enable video_cards_intel i915 i965
377 + fi
378 +
379 + # Nouveau code
380 + dri_driver_enable video_cards_nouveau nouveau
381 +
382 + # ATI code
383 + dri_driver_enable video_cards_r100 r100
384 + dri_driver_enable video_cards_r200 r200
385 + if ! use video_cards_r100 && \
386 + ! use video_cards_r200; then
387 + dri_driver_enable video_cards_radeon r100 r200
388 + fi
389 + fi
390 +
391 + emesonargs+=( -Dplatforms=surfaceless$(use X && echo ",x11")$(use wayland && echo ",wayland")$(use gbm && echo ",drm") )
392 +
393 + if use gallium; then
394 + emesonargs+=(
395 + $(meson_use llvm)
396 + $(meson_use lm-sensors lmsensors)
397 + $(meson_use unwind libunwind)
398 + )
399 +
400 + if use video_cards_iris ||
401 + use video_cards_r300 ||
402 + use video_cards_r600 ||
403 + use video_cards_radeonsi ||
404 + use video_cards_nouveau ||
405 + use video_cards_vmware; then
406 + emesonargs+=($(meson_use d3d9 gallium-nine))
407 + else
408 + emesonargs+=(-Dgallium-nine=false)
409 + fi
410 +
411 + if use video_cards_r600 ||
412 + use video_cards_radeonsi ||
413 + use video_cards_nouveau; then
414 + emesonargs+=($(meson_use vaapi gallium-va))
415 + use vaapi && emesonargs+=( -Dva-libs-path="${EPREFIX}"/usr/$(get_libdir)/va/drivers )
416 + else
417 + emesonargs+=(-Dgallium-va=false)
418 + fi
419 +
420 + if use video_cards_r300 ||
421 + use video_cards_r600 ||
422 + use video_cards_radeonsi ||
423 + use video_cards_nouveau; then
424 + emesonargs+=($(meson_use vdpau gallium-vdpau))
425 + else
426 + emesonargs+=(-Dgallium-vdpau=false)
427 + fi
428 +
429 + if use video_cards_freedreno ||
430 + use video_cards_nouveau ||
431 + use video_cards_vmware; then
432 + emesonargs+=($(meson_use xa gallium-xa))
433 + else
434 + emesonargs+=(-Dgallium-xa=false)
435 + fi
436 +
437 + if use video_cards_r600 ||
438 + use video_cards_nouveau; then
439 + emesonargs+=($(meson_use xvmc gallium-xvmc))
440 + else
441 + emesonargs+=(-Dgallium-xvmc=false)
442 + fi
443 +
444 + if use video_cards_freedreno ||
445 + use video_cards_lima ||
446 + use video_cards_panfrost ||
447 + use video_cards_vc4 ||
448 + use video_cards_vivante; then
449 + gallium_enable -- kmsro
450 + fi
451 +
452 + gallium_enable video_cards_lima lima
453 + gallium_enable video_cards_panfrost panfrost
454 + gallium_enable video_cards_vc4 vc4
455 + gallium_enable video_cards_vivante etnaviv
456 + gallium_enable video_cards_vmware svga
457 + gallium_enable video_cards_nouveau nouveau
458 +
459 + # Only one i915 driver (classic vs gallium). Default to classic.
460 + if ! use classic; then
461 + gallium_enable video_cards_i915 i915
462 + if ! use video_cards_i915 && \
463 + ! use video_cards_i965; then
464 + gallium_enable video_cards_intel i915
465 + fi
466 + fi
467 +
468 + gallium_enable video_cards_iris iris
469 +
470 + gallium_enable video_cards_r300 r300
471 + gallium_enable video_cards_r600 r600
472 + gallium_enable video_cards_radeonsi radeonsi
473 + if ! use video_cards_r300 && \
474 + ! use video_cards_r600; then
475 + gallium_enable video_cards_radeon r300 r600
476 + fi
477 +
478 + gallium_enable video_cards_freedreno freedreno
479 + gallium_enable video_cards_virgl virgl
480 +
481 + # opencl stuff
482 + emesonargs+=(
483 + -Dgallium-opencl="$(usex opencl icd disabled)"
484 + )
485 + fi
486 +
487 + if use vulkan; then
488 + vulkan_enable video_cards_i965 intel
489 + vulkan_enable video_cards_iris intel
490 + vulkan_enable video_cards_radeonsi amd
491 + fi
492 +
493 + # x86 hardened pax_kernel needs glx-rts, bug 240956
494 + if [[ ${ABI} == x86 ]]; then
495 + emesonargs+=( $(meson_use pax_kernel glx-read-only-text) )
496 + fi
497 +
498 + if use gallium; then
499 + gallium_enable -- swrast
500 + emesonargs+=( -Dosmesa=$(usex osmesa gallium none) )
501 + else
502 + dri_driver_enable -- swrast
503 + emesonargs+=( -Dosmesa=$(usex osmesa classic none) )
504 + fi
505 +
506 + driver_list() {
507 + local drivers="$(sort -u <<< "${1// /$'\n'}")"
508 + echo "${drivers//$'\n'/,}"
509 + }
510 +
511 + emesonargs+=(
512 + $(meson_use test build-tests)
513 + -Dglx=$(usex X dri disabled)
514 + -Dshared-glapi=true
515 + $(meson_use dri3)
516 + $(meson_use egl)
517 + $(meson_use gbm)
518 + $(meson_use gles1)
519 + $(meson_use gles2)
520 + $(meson_use libglvnd glvnd)
521 + $(meson_use selinux)
522 + -Dvalgrind=$(usex valgrind auto false)
523 + -Ddri-drivers=$(driver_list "${DRI_DRIVERS[*]}")
524 + -Dgallium-drivers=$(driver_list "${GALLIUM_DRIVERS[*]}")
525 + -Dvulkan-drivers=$(driver_list "${VULKAN_DRIVERS[*]}")
526 + $(meson_use vulkan-overlay vulkan-overlay-layer)
527 + --buildtype $(usex debug debug plain)
528 + -Db_ndebug=$(usex debug false true)
529 + )
530 + meson_src_configure
531 +}
532 +
533 +multilib_src_compile() {
534 + meson_src_compile
535 +}
536 +
537 +multilib_src_install() {
538 + meson_src_install
539 +
540 + use libglvnd && rm -f "${D}"/usr/$(get_libdir)/pkgconfig/{egl,gl}.pc
541 +}
542 +
543 +multilib_src_install_all() {
544 + einstalldocs
545 +}
546 +
547 +multilib_src_test() {
548 + meson test -v -C "${BUILD_DIR}" -t 100
549 +}
550 +
551 +pkg_postinst() {
552 + if ! use libglvnd; then
553 + # Switch to the xorg implementation.
554 + echo
555 + eselect opengl set --use-old ${OPENGL_DIR}
556 + fi
557 +}
558 +
559 +# $1 - VIDEO_CARDS flag (check skipped for "--")
560 +# other args - names of DRI drivers to enable
561 +dri_driver_enable() {
562 + if [[ $1 == -- ]] || use $1; then
563 + shift
564 + DRI_DRIVERS+=("$@")
565 + fi
566 +}
567 +
568 +gallium_enable() {
569 + if [[ $1 == -- ]] || use $1; then
570 + shift
571 + GALLIUM_DRIVERS+=("$@")
572 + fi
573 +}
574 +
575 +vulkan_enable() {
576 + if [[ $1 == -- ]] || use $1; then
577 + shift
578 + VULKAN_DRIVERS+=("$@")
579 + fi
580 +}