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, 20 Aug 2020 00:00:47
Message-Id: 1597881561.94ccf7db5d32461b1674b17418b36e78ab4e4811.mattst88@gentoo
1 commit: 94ccf7db5d32461b1674b17418b36e78ab4e4811
2 Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
3 AuthorDate: Wed Aug 19 23:57:59 2020 +0000
4 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
5 CommitDate: Wed Aug 19 23:59:21 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=94ccf7db
7
8 media-libs/mesa: Version bump to 20.1.6
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.6.ebuild | 557 +++++++++++++++++++++++++++++++++++++
14 2 files changed, 558 insertions(+)
15
16 diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
17 index e16cc7bd92d..a96a4157ff5 100644
18 --- a/media-libs/mesa/Manifest
19 +++ b/media-libs/mesa/Manifest
20 @@ -1,5 +1,6 @@
21 DIST mesa-20.0.8.tar.xz 12360736 BLAKE2B 19e3f8a40b34b5f17ed76077c5d92f728a134b2479c43d86674ed1818ab99639a9b732041f67488251df808564f6abe5b587d756ef9c7c13dcada87cd0fc05de SHA512 d906330c412899907dd05a84034a929107fccaf3044814c4b1f30ba5690cbcf1587b5f17534c6345111f3cb7cf292afd5984a60486643ff6f534b57cec615374
22 DIST mesa-20.1.4.tar.xz 12758452 BLAKE2B 2f4e4563382a455f7fd6ac0bb32c91901c4ca4fa297da7769b40722713316ba9a6b8acc7bd5ae9df46b9ffea6bee13cdf2a8dd4fe747ac61dc052391aeae18d9 SHA512 f4d79694cda8531e7560147caf5d18bce5c685cd6c61264dced5adaa9043be9c83d3a2bd623ebffedc8d4258b9b1f97d84d9aeea307aa77cf99d0bc47c987155
23 DIST mesa-20.1.5.tar.xz 12783368 BLAKE2B f452832b3ed3468d01b7129cd782f3b58752a6de511679c9bd7eca7a5728630202a185e61f435c172f84d4ef6ffd05bbf7873e5f8c4cc64572d3b5a38e5ebf28 SHA512 47796bf2cccfd054ff25f571747754e0ab9b42fe87644ea320b3d9497d63b3013e9b7e59ea0516bbd1a38b5594e0d185bf5a36230ea5c5974e7ff889cee2601e
24 +DIST mesa-20.1.6.tar.xz 12805724 BLAKE2B d652b59e4987436d2e05de9138f2e2fb4a8bf435c24d9c7ad08bcb82a3bf7c9c64bc71b15b4b6d334f8b574341719f372aa1b893283abc21191a4d71d9d30fee SHA512 5ef28334ecb7effaaf597ea3efe0406af62419e6fa629e835d843161ab8d83515626ec0f0495c4cc66af9e5669398ac96c16ca626e4965a9831e1704c995fb09
25 DIST mesa-20.2.0-rc1.tar.xz 13521940 BLAKE2B 6e9fdc8fa9d2b0f9bd72b033d710b0cbc10d4434adc5d702576cc08559ad32f83983cb3ba44f96a1f740c626429cc386a4e14ee4fa5549c2f3dbb942243b1641 SHA512 d86e52a985d94e3d5b5ef7799acf4fced72df6cd68b29e1fef2c7755144d9633d74f648d8434699497d38b50f0d1a12d12a135a45ea5bc4cf22f2033a3651aac
26 DIST mesa-20.2.0-rc2.tar.xz 13528208 BLAKE2B 6505446829ec2c01c0de7a7d9c1187db874111402da5ffe2f9f5872df7b6a5e53a3b628c190172bb9a806851b3b85aa0e3b53a4fcfb40f99adfc48cc3876c9f5 SHA512 36d9a74db50335bd31a8d5c47f7c657f05eeda044530fe123c06c472ed27c9b5dff19716d11d95256449223e82dde38895547cf6ae60b7460d3b1e9ed440704a
27
28 diff --git a/media-libs/mesa/mesa-20.1.6.ebuild b/media-libs/mesa/mesa-20.1.6.ebuild
29 new file mode 100644
30 index 00000000000..f50ead67947
31 --- /dev/null
32 +++ b/media-libs/mesa/mesa-20.1.6.ebuild
33 @@ -0,0 +1,557 @@
34 +# Copyright 1999-2020 Gentoo Authors
35 +# Distributed under the terms of the GNU General Public License v2
36 +
37 +EAPI=7
38 +
39 +PYTHON_COMPAT=( python3_{6,7,8} )
40 +
41 +inherit llvm meson multilib-minimal python-any-r1 linux-info
42 +
43 +OPENGL_DIR="xorg-x11"
44 +
45 +MY_P="${P/_/-}"
46 +
47 +DESCRIPTION="OpenGL-like graphic library for Linux"
48 +HOMEPAGE="https://www.mesa3d.org/ https://mesa.freedesktop.org/"
49 +
50 +if [[ ${PV} == 9999 ]]; then
51 + EGIT_REPO_URI="https://gitlab.freedesktop.org/mesa/mesa.git"
52 + inherit git-r3
53 +else
54 + SRC_URI="https://mesa.freedesktop.org/archive/${MY_P}.tar.xz"
55 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris"
56 +fi
57 +
58 +LICENSE="MIT"
59 +SLOT="0"
60 +RESTRICT="
61 + !test? ( test )
62 +"
63 +
64 +RADEON_CARDS="r100 r200 r300 r600 radeon radeonsi"
65 +VIDEO_CARDS="${RADEON_CARDS} freedreno i915 i965 intel iris lima nouveau panfrost vc4 virgl vivante vmware"
66 +for card in ${VIDEO_CARDS}; do
67 + IUSE_VIDEO_CARDS+=" video_cards_${card}"
68 +done
69 +
70 +IUSE="${IUSE_VIDEO_CARDS}
71 + +classic d3d9 debug +dri3 +egl +gallium +gbm gles1 +gles2 +libglvnd +llvm
72 + lm-sensors opencl osmesa selinux test unwind vaapi valgrind vdpau vulkan
73 + vulkan-overlay wayland +X xa xvmc +zstd"
74 +
75 +REQUIRED_USE="
76 + d3d9? ( dri3 || ( video_cards_iris video_cards_r300 video_cards_r600 video_cards_radeonsi video_cards_nouveau video_cards_vmware ) )
77 + gles1? ( egl )
78 + gles2? ( egl )
79 + vulkan? ( dri3
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.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.2.0-r1[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 + zstd? ( app-arch/zstd:=[${MULTILIB_USEDEP}] )
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 + )
188 + <sys-devel/llvm-$((LLVM_MAX_SLOT + 1)):=[${MULTILIB_USEDEP}]
189 +"
190 +LLVM_DEPSTR_AMDGPU=${LLVM_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
191 +CLANG_DEPSTR=${LLVM_DEPSTR//llvm/clang}
192 +CLANG_DEPSTR_AMDGPU=${CLANG_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
193 +RDEPEND="${RDEPEND}
194 + gallium? (
195 + llvm? (
196 + opencl? (
197 + video_cards_r600? (
198 + ${CLANG_DEPSTR_AMDGPU}
199 + )
200 + !video_cards_r600? (
201 + video_cards_radeonsi? (
202 + ${CLANG_DEPSTR_AMDGPU}
203 + )
204 + )
205 + !video_cards_r600? (
206 + !video_cards_radeonsi? (
207 + video_cards_radeon? (
208 + ${CLANG_DEPSTR_AMDGPU}
209 + )
210 + )
211 + )
212 + !video_cards_r600? (
213 + !video_cards_radeon? (
214 + !video_cards_radeonsi? (
215 + ${CLANG_DEPSTR}
216 + )
217 + )
218 + )
219 + )
220 + !opencl? (
221 + video_cards_r600? (
222 + ${LLVM_DEPSTR_AMDGPU}
223 + )
224 + !video_cards_r600? (
225 + video_cards_radeonsi? (
226 + ${LLVM_DEPSTR_AMDGPU}
227 + )
228 + )
229 + !video_cards_r600? (
230 + !video_cards_radeonsi? (
231 + video_cards_radeon? (
232 + ${LLVM_DEPSTR_AMDGPU}
233 + )
234 + )
235 + )
236 + !video_cards_r600? (
237 + !video_cards_radeon? (
238 + !video_cards_radeonsi? (
239 + ${LLVM_DEPSTR}
240 + )
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 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 + emesonargs+=( -Dplatforms=$(use X && echo "x11,")$(use wayland && echo "wayland,")$(use gbm && echo "drm,")surfaceless )
407 +
408 + if use gallium; then
409 + emesonargs+=(
410 + $(meson_use llvm)
411 + $(meson_use lm-sensors lmsensors)
412 + $(meson_use unwind libunwind)
413 + )
414 +
415 + if use video_cards_iris ||
416 + use video_cards_r300 ||
417 + use video_cards_r600 ||
418 + use video_cards_radeonsi ||
419 + use video_cards_nouveau ||
420 + use video_cards_vmware; then
421 + emesonargs+=($(meson_use d3d9 gallium-nine))
422 + else
423 + emesonargs+=(-Dgallium-nine=false)
424 + fi
425 +
426 + if use video_cards_r600 ||
427 + use video_cards_radeonsi ||
428 + use video_cards_nouveau; then
429 + emesonargs+=($(meson_use vaapi gallium-va))
430 + use vaapi && emesonargs+=( -Dva-libs-path="${EPREFIX}"/usr/$(get_libdir)/va/drivers )
431 + else
432 + emesonargs+=(-Dgallium-va=false)
433 + fi
434 +
435 + if use video_cards_r300 ||
436 + use video_cards_r600 ||
437 + use video_cards_radeonsi ||
438 + use video_cards_nouveau; then
439 + emesonargs+=($(meson_use vdpau gallium-vdpau))
440 + else
441 + emesonargs+=(-Dgallium-vdpau=false)
442 + fi
443 +
444 + if use video_cards_freedreno ||
445 + use video_cards_nouveau ||
446 + use video_cards_vmware; then
447 + emesonargs+=($(meson_use xa gallium-xa))
448 + else
449 + emesonargs+=(-Dgallium-xa=false)
450 + fi
451 +
452 + if use video_cards_r600 ||
453 + use video_cards_nouveau; then
454 + emesonargs+=($(meson_use xvmc gallium-xvmc))
455 + else
456 + emesonargs+=(-Dgallium-xvmc=false)
457 + fi
458 +
459 + if use video_cards_freedreno ||
460 + use video_cards_lima ||
461 + use video_cards_panfrost ||
462 + use video_cards_vc4 ||
463 + use video_cards_vivante; then
464 + gallium_enable -- kmsro
465 + fi
466 +
467 + gallium_enable video_cards_lima lima
468 + gallium_enable video_cards_panfrost panfrost
469 + gallium_enable video_cards_vc4 vc4
470 + gallium_enable video_cards_vivante etnaviv
471 + gallium_enable video_cards_vmware svga
472 + gallium_enable video_cards_nouveau nouveau
473 +
474 + # Only one i915 driver (classic vs gallium). Default to classic.
475 + if ! use classic; then
476 + gallium_enable video_cards_i915 i915
477 + if ! use video_cards_i915 && \
478 + ! use video_cards_i965; then
479 + gallium_enable video_cards_intel i915
480 + fi
481 + fi
482 +
483 + gallium_enable video_cards_iris iris
484 +
485 + gallium_enable video_cards_r300 r300
486 + gallium_enable video_cards_r600 r600
487 + gallium_enable video_cards_radeonsi radeonsi
488 + if ! use video_cards_r300 && \
489 + ! use video_cards_r600; then
490 + gallium_enable video_cards_radeon r300 r600
491 + fi
492 +
493 + gallium_enable video_cards_freedreno freedreno
494 + gallium_enable video_cards_virgl virgl
495 +
496 + # opencl stuff
497 + emesonargs+=(
498 + -Dgallium-opencl="$(usex opencl icd disabled)"
499 + )
500 + fi
501 +
502 + if use vulkan; then
503 + vulkan_enable video_cards_i965 intel
504 + vulkan_enable video_cards_iris intel
505 + vulkan_enable video_cards_radeonsi amd
506 + fi
507 +
508 + if use gallium; then
509 + gallium_enable -- swrast
510 + emesonargs+=( -Dosmesa=$(usex osmesa gallium none) )
511 + else
512 + dri_driver_enable -- swrast
513 + emesonargs+=( -Dosmesa=$(usex osmesa classic none) )
514 + fi
515 +
516 + driver_list() {
517 + local drivers="$(sort -u <<< "${1// /$'\n'}")"
518 + echo "${drivers//$'\n'/,}"
519 + }
520 +
521 + emesonargs+=(
522 + $(meson_use test build-tests)
523 + -Dglx=$(usex X dri disabled)
524 + -Dshared-glapi=true
525 + $(meson_use dri3)
526 + $(meson_use egl)
527 + $(meson_use gbm)
528 + $(meson_use gles1)
529 + $(meson_use gles2)
530 + $(meson_use libglvnd glvnd)
531 + $(meson_use selinux)
532 + $(meson_use zstd)
533 + -Dvalgrind=$(usex valgrind auto false)
534 + -Ddri-drivers=$(driver_list "${DRI_DRIVERS[*]}")
535 + -Dgallium-drivers=$(driver_list "${GALLIUM_DRIVERS[*]}")
536 + -Dvulkan-drivers=$(driver_list "${VULKAN_DRIVERS[*]}")
537 + $(meson_use vulkan vulkan-device-select-layer)
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 +}