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: Tue, 17 Sep 2019 15:11:46
Message-Id: 1568733093.7e7046e9dc06ecb080183493631bdf13ef5eda1b.mattst88@gentoo
1 commit: 7e7046e9dc06ecb080183493631bdf13ef5eda1b
2 Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
3 AuthorDate: Tue Sep 17 15:11:16 2019 +0000
4 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
5 CommitDate: Tue Sep 17 15:11:33 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7e7046e9
7
8 media-libs/mesa: Version bump to 19.1.7
9
10 Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>
11
12 media-libs/mesa/Manifest | 1 +
13 media-libs/mesa/mesa-19.1.7.ebuild | 540 +++++++++++++++++++++++++++++++++++++
14 2 files changed, 541 insertions(+)
15
16 diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
17 index a0de666dd99..50710b4a86e 100644
18 --- a/media-libs/mesa/Manifest
19 +++ b/media-libs/mesa/Manifest
20 @@ -3,6 +3,7 @@ DIST mesa-19.1.3.tar.xz 10935604 BLAKE2B 4dfda4b3ef7a2d53b20a7a0c81b08901d6b8843
21 DIST mesa-19.1.4.tar.xz 10938008 BLAKE2B 4745fc7e844397378fe1adf61bcd5b54aad11ec0b375ced85fd80ced01227432b491ad8b7ba7d9013190cfbb451bc11cdb7c8af0e1f298dd5d793d3ce43aa92b SHA512 234032d917c9b378c3f6ceb921677b64e549344c3957331810b50fd73e0dccd2f4f62e2bd39e619590f389bc58fdab10fab4b88f7c117557cbeb1dda049b9fc5
22 DIST mesa-19.1.5.tar.xz 10938452 BLAKE2B 7d21cad04c8172006e73d84148cfeb785b3d5f90f63d8474e4d0d6ec8658142bc2b6a639415d90b0c8d541f004c374603ae1230dfddd293118ed584c6ca74818 SHA512 4d4b3733c13e5c9b3172127f2565b827dc46aab69bdc86791c457ad137a5571c51e3c3a26d5a99e11fe552829a1220028a3968f3086959e038c615f2d75675a4
23 DIST mesa-19.1.6.tar.xz 10939908 BLAKE2B cd7204614898621f3b242788667fc64e0ca00f3a5650e60cb8e74ef2760300245734741355874e05c97d482f3bd06a1755fc5e9cee804a6d5a050f20c8bc70a9 SHA512 399ce97a293769893ef9a4a6af1f77c7d835f5405bdbc03bbf9b73e052e4ff3b43dec5dafd6b9fedaaf2c59531aeccaa0f685a8bfdc5719a26c3815fc7f68024
24 +DIST mesa-19.1.7.tar.xz 10941152 BLAKE2B 6be14ddac404668bdd8b7b8756388019c3610ac41b65a7723a419b97b7eccbca666ad6d904f4cde186c4b171e056636a8a6a5727e30963c8fa177d7861bd6cfb SHA512 0865b5f91e5daa00e1da2b3d8b65fe5d2ff6332372bf8fec7d671d05d8d64ec5a7abea1858cdfc506c76b7226d2bea0af3426565f156b796d8e0f949ea33dc15
25 DIST mesa-19.2.0-rc1.tar.xz 11452972 BLAKE2B 64a844a06110c64f4badd8d64a63cee4fbb25c6e2bb17062277e54094c8a5342eac7058ae7ba7b0aefc4e0795aac371caac26e54cc3612afaf54d41b94e09b18 SHA512 babafb6ec668834e041a62e966452fe315e4f5afef8e1f7d35e038993c73b32ea6ad9929399edae4686f44cd11704fd9a8801821befc1d1767bc0662d4c39fac
26 DIST mesa-19.2.0-rc2.tar.xz 11456920 BLAKE2B 673ff105395731ca65cc99bee1f73c582b40e05983bd08c46f07384e579c8d449e7f5371461542ebbcfc32022382f206adf7dcc43ed8713cb35e37c1cc69e03c SHA512 a42f7add01afd327838bd57ea4086ad4b9de669c6caf443129e325171bc53e3321c898d8d0075c7e50c4e0fdd094d66a60e35a0620e25e6c52648c5ac0008dcc
27 DIST mesa-19.2.0-rc3.tar.xz 11458088 BLAKE2B 35fac57dbf0d13f62f32695235ecc7c47b505b4eff55e7b06f61e1cd7a9977675ff9e5e2131e20dae3a666ad13b1f52a9ad36405731885c84cfa66a90fc8232e SHA512 378bb27073d99032c489a0fcc44157017d27d01c24c3bb7e3e32f59b298cf0c7409351d18fbbfb1ccfb799e02f9166450dc73390e98a026f60a4ab0583944d68
28
29 diff --git a/media-libs/mesa/mesa-19.1.7.ebuild b/media-libs/mesa/mesa-19.1.7.ebuild
30 new file mode 100644
31 index 00000000000..b5c1ff6540f
32 --- /dev/null
33 +++ b/media-libs/mesa/mesa-19.1.7.ebuild
34 @@ -0,0 +1,540 @@
35 +# Copyright 1999-2019 Gentoo Authors
36 +# Distributed under the terms of the GNU General Public License v2
37 +
38 +EAPI=7
39 +
40 +PYTHON_COMPAT=( python3_5 python3_6 python3_7 )
41 +
42 +inherit llvm meson multilib-minimal pax-utils python-any-r1
43 +
44 +OPENGL_DIR="xorg-x11"
45 +
46 +MY_P="${P/_/-}"
47 +
48 +DESCRIPTION="OpenGL-like graphic library for Linux"
49 +HOMEPAGE="https://www.mesa3d.org/ https://mesa.freedesktop.org/"
50 +
51 +if [[ ${PV} == 9999 ]]; then
52 + EGIT_REPO_URI="https://gitlab.freedesktop.org/mesa/mesa.git"
53 + EXPERIMENTAL="true"
54 + inherit git-r3
55 +else
56 + SRC_URI="https://mesa.freedesktop.org/archive/${MY_P}.tar.xz"
57 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris"
58 +fi
59 +
60 +LICENSE="MIT"
61 +SLOT="0"
62 +RESTRICT="
63 + !test? ( test )
64 +"
65 +
66 +RADEON_CARDS="r100 r200 r300 r600 radeon radeonsi"
67 +VIDEO_CARDS="${RADEON_CARDS} freedreno i915 i965 intel iris nouveau vc4 virgl vivante vmware"
68 +for card in ${VIDEO_CARDS}; do
69 + IUSE_VIDEO_CARDS+=" video_cards_${card}"
70 +done
71 +
72 +IUSE="${IUSE_VIDEO_CARDS}
73 + +classic d3d9 debug +dri3 +egl +gallium +gbm gles1 +gles2 +libglvnd +llvm
74 + lm-sensors opencl osmesa pax_kernel pic selinux test unwind vaapi valgrind
75 + vdpau vulkan vulkan-overlay wayland xa xvmc"
76 +
77 +REQUIRED_USE="
78 + d3d9? ( dri3 || ( video_cards_iris video_cards_r300 video_cards_r600 video_cards_radeonsi video_cards_nouveau video_cards_vmware ) )
79 + gles1? ( egl )
80 + gles2? ( egl )
81 + vulkan? ( dri3
82 + || ( video_cards_i965 video_cards_iris video_cards_radeonsi )
83 + video_cards_radeonsi? ( llvm ) )
84 + vulkan-overlay? ( vulkan )
85 + wayland? ( egl gbm )
86 + video_cards_freedreno? ( gallium )
87 + video_cards_intel? ( classic )
88 + video_cards_i915? ( || ( classic gallium ) )
89 + video_cards_i965? ( classic )
90 + video_cards_iris? ( gallium )
91 + video_cards_nouveau? ( || ( classic gallium ) )
92 + video_cards_radeon? ( || ( classic gallium )
93 + gallium? ( x86? ( llvm ) amd64? ( llvm ) ) )
94 + video_cards_r100? ( classic )
95 + video_cards_r200? ( classic )
96 + video_cards_r300? ( gallium x86? ( llvm ) amd64? ( llvm ) )
97 + video_cards_r600? ( gallium )
98 + video_cards_radeonsi? ( gallium llvm )
99 + video_cards_vc4? ( gallium )
100 + video_cards_virgl? ( gallium )
101 + video_cards_vivante? ( gallium gbm )
102 + video_cards_vmware? ( gallium )
103 +"
104 +
105 +LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.97"
106 +RDEPEND="
107 + !app-eselect/eselect-mesa
108 + >=dev-libs/expat-2.1.0-r3:=[${MULTILIB_USEDEP}]
109 + >=sys-libs/zlib-1.2.8[${MULTILIB_USEDEP}]
110 + >=x11-libs/libX11-1.6.2:=[${MULTILIB_USEDEP}]
111 + >=x11-libs/libxshmfence-1.1:=[${MULTILIB_USEDEP}]
112 + >=x11-libs/libXdamage-1.1.4-r1:=[${MULTILIB_USEDEP}]
113 + >=x11-libs/libXext-1.3.2:=[${MULTILIB_USEDEP}]
114 + >=x11-libs/libXxf86vm-1.1.3:=[${MULTILIB_USEDEP}]
115 + >=x11-libs/libxcb-1.13:=[${MULTILIB_USEDEP}]
116 + x11-libs/libXfixes:=[${MULTILIB_USEDEP}]
117 + libglvnd? (
118 + media-libs/libglvnd[${MULTILIB_USEDEP}]
119 + !app-eselect/eselect-opengl
120 + )
121 + !libglvnd? (
122 + >=app-eselect/eselect-opengl-1.3.0
123 + )
124 + gallium? (
125 + unwind? ( sys-libs/libunwind[${MULTILIB_USEDEP}] )
126 + llvm? (
127 + video_cards_radeonsi? (
128 + virtual/libelf:0=[${MULTILIB_USEDEP}]
129 + )
130 + video_cards_r600? (
131 + virtual/libelf:0=[${MULTILIB_USEDEP}]
132 + )
133 + video_cards_radeon? (
134 + virtual/libelf:0=[${MULTILIB_USEDEP}]
135 + )
136 + )
137 + lm-sensors? ( sys-apps/lm-sensors:=[${MULTILIB_USEDEP}] )
138 + opencl? (
139 + dev-libs/ocl-icd[khronos-headers,${MULTILIB_USEDEP}]
140 + dev-libs/libclc
141 + virtual/libelf:0=[${MULTILIB_USEDEP}]
142 + )
143 + vaapi? (
144 + >=x11-libs/libva-1.7.3:=[${MULTILIB_USEDEP}]
145 + video_cards_nouveau? ( !<=x11-libs/libva-vdpau-driver-0.7.4-r3 )
146 + )
147 + vdpau? ( >=x11-libs/libvdpau-1.1:=[${MULTILIB_USEDEP}] )
148 + xvmc? ( >=x11-libs/libXvMC-1.0.8:=[${MULTILIB_USEDEP}] )
149 + )
150 + wayland? (
151 + >=dev-libs/wayland-1.15.0:=[${MULTILIB_USEDEP}]
152 + >=dev-libs/wayland-protocols-1.8
153 + )
154 + ${LIBDRM_DEPSTRING}[video_cards_freedreno?,video_cards_nouveau?,video_cards_vc4?,video_cards_vivante?,video_cards_vmware?,${MULTILIB_USEDEP}]
155 +
156 + video_cards_intel? (
157 + !video_cards_i965? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
158 + )
159 + video_cards_i915? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
160 + vulkan-overlay? ( dev-util/glslang:0=[${MULTILIB_USEDEP}] )
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 + sys-devel/llvm:7[${MULTILIB_USEDEP}]
185 + )
186 + sys-devel/llvm:=[${MULTILIB_USEDEP}]
187 +"
188 +LLVM_DEPSTR_AMDGPU=${LLVM_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
189 +CLANG_DEPSTR=${LLVM_DEPSTR//llvm/clang}
190 +CLANG_DEPSTR_AMDGPU=${CLANG_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
191 +RDEPEND="${RDEPEND}
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 +unset {LLVM,CLANG}_DEPSTR{,_AMDGPU}
244 +
245 +DEPEND="${RDEPEND}
246 + valgrind? ( dev-util/valgrind )
247 + x11-libs/libXrandr[${MULTILIB_USEDEP}]
248 + x11-base/xorg-proto
249 +"
250 +BDEPEND="
251 + ${PYTHON_DEPS}
252 + opencl? (
253 + >=sys-devel/gcc-4.6
254 + )
255 + sys-devel/bison
256 + sys-devel/flex
257 + sys-devel/gettext
258 + virtual/pkgconfig
259 + $(python_gen_any_dep ">=dev-python/mako-0.8.0[\${PYTHON_USEDEP}]")
260 +"
261 +
262 +S="${WORKDIR}/${MY_P}"
263 +EGIT_CHECKOUT_DIR=${S}
264 +
265 +QA_WX_LOAD="
266 +x86? (
267 + !pic? (
268 + usr/lib*/libglapi.so.0.0.0
269 + usr/lib*/libGLESv1_CM.so.1.0.0
270 + usr/lib*/libGLESv2.so.2.0.0
271 + usr/lib*/libGL.so.1.2.0
272 + usr/lib*/libOSMesa.so.8.0.0
273 + )
274 +)"
275 +
276 +llvm_check_deps() {
277 + local flags=${MULTILIB_USEDEP}
278 + if use video_cards_r600 || use video_cards_radeon || use video_cards_radeonsi
279 + then
280 + flags+=",llvm_targets_AMDGPU(-)"
281 + fi
282 +
283 + if use opencl; then
284 + has_version "sys-devel/clang:${LLVM_SLOT}[${flags}]" || return 1
285 + fi
286 + has_version "sys-devel/llvm:${LLVM_SLOT}[${flags}]"
287 +}
288 +
289 +pkg_pretend() {
290 + if use opencl; then
291 + if ! use video_cards_r600 &&
292 + ! use video_cards_radeonsi; then
293 + ewarn "Ignoring USE=opencl since VIDEO_CARDS does not contain r600 or radeonsi"
294 + fi
295 + fi
296 +
297 + if use vaapi; then
298 + if ! use video_cards_r600 &&
299 + ! use video_cards_radeonsi &&
300 + ! use video_cards_nouveau; then
301 + ewarn "Ignoring USE=vaapi since VIDEO_CARDS does not contain r600, radeonsi, or nouveau"
302 + fi
303 + fi
304 +
305 + if use vdpau; then
306 + if ! use video_cards_r300 &&
307 + ! use video_cards_r600 &&
308 + ! use video_cards_radeonsi &&
309 + ! use video_cards_nouveau; then
310 + ewarn "Ignoring USE=vdpau since VIDEO_CARDS does not contain r300, r600, radeonsi, or nouveau"
311 + fi
312 + fi
313 +
314 + if use xa; then
315 + if ! use video_cards_freedreno &&
316 + ! use video_cards_nouveau &&
317 + ! use video_cards_vmware; then
318 + ewarn "Ignoring USE=xa since VIDEO_CARDS does not contain freedreno, nouveau, or vmware"
319 + fi
320 + fi
321 +
322 + if use xvmc; then
323 + if ! use video_cards_r600 &&
324 + ! use video_cards_nouveau; then
325 + ewarn "Ignoring USE=xvmc since VIDEO_CARDS does not contain r600 or nouveau"
326 + fi
327 + fi
328 +
329 + if ! use gallium; then
330 + use lm-sensors && ewarn "Ignoring USE=lm-sensors since USE does not contain gallium"
331 + use llvm && ewarn "Ignoring USE=llvm since USE does not contain gallium"
332 + use opencl && ewarn "Ignoring USE=opencl since USE does not contain gallium"
333 + use vaapi && ewarn "Ignoring USE=vaapi since USE does not contain gallium"
334 + use vdpau && ewarn "Ignoring USE=vdpau since USE does not contain gallium"
335 + use unwind && ewarn "Ignoring USE=unwind since USE does not contain gallium"
336 + use xa && ewarn "Ignoring USE=xa since USE does not contain gallium"
337 + use xvmc && ewarn "Ignoring USE=xvmc since USE does not contain gallium"
338 + fi
339 +
340 + if ! use llvm; then
341 + use opencl && ewarn "Ignoring USE=opencl since USE does not contain llvm"
342 + fi
343 +}
344 +
345 +python_check_deps() {
346 + has_version -b ">=dev-python/mako-0.8.0[${PYTHON_USEDEP}]"
347 +}
348 +
349 +pkg_setup() {
350 + # warning message for bug 459306
351 + if use llvm && has_version sys-devel/llvm[!debug=]; then
352 + ewarn "Mismatch between debug USE flags in media-libs/mesa and sys-devel/llvm"
353 + ewarn "detected! This can cause problems. For details, see bug 459306."
354 + fi
355 +
356 + if use llvm; then
357 + llvm_pkg_setup
358 + fi
359 + python-any-r1_pkg_setup
360 +}
361 +
362 +multilib_src_configure() {
363 + local emesonargs=()
364 +
365 + if use classic; then
366 + # Intel code
367 + dri_driver_enable video_cards_i915 i915
368 + dri_driver_enable video_cards_i965 i965
369 + if ! use video_cards_i915 && \
370 + ! use video_cards_i965; then
371 + dri_driver_enable video_cards_intel i915 i965
372 + fi
373 +
374 + # Nouveau code
375 + dri_driver_enable video_cards_nouveau nouveau
376 +
377 + # ATI code
378 + dri_driver_enable video_cards_r100 r100
379 + dri_driver_enable video_cards_r200 r200
380 + if ! use video_cards_r100 && \
381 + ! use video_cards_r200; then
382 + dri_driver_enable video_cards_radeon r100 r200
383 + fi
384 + fi
385 +
386 + emesonargs+=( -Dplatforms=x11,surfaceless$(use wayland && echo ",wayland")$(use gbm && echo ",drm") )
387 +
388 + if use gallium; then
389 + emesonargs+=(
390 + $(meson_use llvm)
391 + $(meson_use lm-sensors lmsensors)
392 + $(meson_use unwind libunwind)
393 + )
394 +
395 + if use video_cards_iris ||
396 + use video_cards_r300 ||
397 + use video_cards_r600 ||
398 + use video_cards_radeonsi ||
399 + use video_cards_nouveau ||
400 + use video_cards_vmware; then
401 + emesonargs+=($(meson_use d3d9 gallium-nine))
402 + else
403 + emesonargs+=(-Dgallium-nine=false)
404 + fi
405 +
406 + if use video_cards_r600 ||
407 + use video_cards_radeonsi ||
408 + use video_cards_nouveau; then
409 + emesonargs+=($(meson_use vaapi gallium-va))
410 + use vaapi && emesonargs+=( -Dva-libs-path="${EPREFIX}"/usr/$(get_libdir)/va/drivers )
411 + else
412 + emesonargs+=(-Dgallium-va=false)
413 + fi
414 +
415 + if use video_cards_r300 ||
416 + use video_cards_r600 ||
417 + use video_cards_radeonsi ||
418 + use video_cards_nouveau; then
419 + emesonargs+=($(meson_use vdpau gallium-vdpau))
420 + else
421 + emesonargs+=(-Dgallium-vdpau=false)
422 + fi
423 +
424 + if use video_cards_freedreno ||
425 + use video_cards_nouveau ||
426 + use video_cards_vmware; then
427 + emesonargs+=($(meson_use xa gallium-xa))
428 + else
429 + emesonargs+=(-Dgallium-xa=false)
430 + fi
431 +
432 + if use video_cards_r600 ||
433 + use video_cards_nouveau; then
434 + emesonargs+=($(meson_use xvmc gallium-xvmc))
435 + else
436 + emesonargs+=(-Dgallium-xvmc=false)
437 + fi
438 +
439 + if use video_cards_freedreno ||
440 + use video_cards_vc4 ||
441 + use video_cards_vivante; then
442 + gallium_enable -- kmsro
443 + fi
444 +
445 + gallium_enable video_cards_vc4 vc4
446 + gallium_enable video_cards_vivante etnaviv
447 + gallium_enable video_cards_vmware svga
448 + gallium_enable video_cards_nouveau nouveau
449 +
450 + # Only one i915 driver (classic vs gallium). Default to classic.
451 + if ! use classic; then
452 + gallium_enable video_cards_i915 i915
453 + if ! use video_cards_i915 && \
454 + ! use video_cards_i965; then
455 + gallium_enable video_cards_intel i915
456 + fi
457 + fi
458 +
459 + gallium_enable video_cards_iris iris
460 +
461 + gallium_enable video_cards_r300 r300
462 + gallium_enable video_cards_r600 r600
463 + gallium_enable video_cards_radeonsi radeonsi
464 + if ! use video_cards_r300 && \
465 + ! use video_cards_r600; then
466 + gallium_enable video_cards_radeon r300 r600
467 + fi
468 +
469 + gallium_enable video_cards_freedreno freedreno
470 + gallium_enable video_cards_virgl virgl
471 +
472 + # opencl stuff
473 + emesonargs+=(
474 + -Dgallium-opencl="$(usex opencl icd disabled)"
475 + )
476 + fi
477 +
478 + if use vulkan; then
479 + vulkan_enable video_cards_i965 intel
480 + vulkan_enable video_cards_iris intel
481 + vulkan_enable video_cards_radeonsi amd
482 + fi
483 +
484 + # x86 hardened pax_kernel needs glx-rts, bug 240956
485 + if [[ ${ABI} == x86 ]]; then
486 + emesonargs+=( $(meson_use pax_kernel glx-read-only-text) )
487 + fi
488 +
489 + # on abi_x86_32 hardened we need to have asm disable
490 + if [[ ${ABI} == x86* ]] && use pic; then
491 + emesonargs+=( -Dasm=false )
492 + fi
493 +
494 + if use gallium; then
495 + gallium_enable -- swrast
496 + emesonargs+=( -Dosmesa=$(usex osmesa gallium none) )
497 + else
498 + dri_driver_enable -- swrast
499 + emesonargs+=( -Dosmesa=$(usex osmesa classic none) )
500 + fi
501 +
502 + driver_list() {
503 + local drivers="$(sort -u <<< "${1// /$'\n'}")"
504 + echo "${drivers//$'\n'/,}"
505 + }
506 +
507 + emesonargs+=(
508 + $(meson_use test build-tests)
509 + -Dglx=dri
510 + -Dshared-glapi=true
511 + $(meson_use dri3)
512 + $(meson_use egl)
513 + $(meson_use gbm)
514 + $(meson_use gles1)
515 + $(meson_use gles2)
516 + $(meson_use libglvnd glvnd)
517 + $(meson_use selinux)
518 + -Dvalgrind=$(usex valgrind auto false)
519 + -Ddri-drivers=$(driver_list "${DRI_DRIVERS[*]}")
520 + -Dgallium-drivers=$(driver_list "${GALLIUM_DRIVERS[*]}")
521 + -Dvulkan-drivers=$(driver_list "${VULKAN_DRIVERS[*]}")
522 + $(meson_use vulkan-overlay vulkan-overlay-layer)
523 + --buildtype $(usex debug debug plain)
524 + -Db_ndebug=$(usex debug false true)
525 + )
526 + meson_src_configure
527 +}
528 +
529 +multilib_src_compile() {
530 + meson_src_compile
531 +}
532 +
533 +multilib_src_install() {
534 + meson_src_install
535 +
536 + use libglvnd && rm -f "${D}"/usr/$(get_libdir)/libGLESv{1_CM,2}.so*
537 +}
538 +
539 +multilib_src_install_all() {
540 + einstalldocs
541 +}
542 +
543 +multilib_src_test() {
544 + meson test -v -C "${BUILD_DIR}" -t 100
545 +}
546 +
547 +pkg_postinst() {
548 + # Switch to the xorg implementation.
549 + echo
550 + eselect opengl set --use-old ${OPENGL_DIR}
551 +}
552 +
553 +# $1 - VIDEO_CARDS flag (check skipped for "--")
554 +# other args - names of DRI drivers to enable
555 +dri_driver_enable() {
556 + if [[ $1 == -- ]] || use $1; then
557 + shift
558 + DRI_DRIVERS+=("$@")
559 + fi
560 +}
561 +
562 +gallium_enable() {
563 + if [[ $1 == -- ]] || use $1; then
564 + shift
565 + GALLIUM_DRIVERS+=("$@")
566 + fi
567 +}
568 +
569 +vulkan_enable() {
570 + if [[ $1 == -- ]] || use $1; then
571 + shift
572 + VULKAN_DRIVERS+=("$@")
573 + fi
574 +}