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, 30 Aug 2018 17:50:20
Message-Id: 1535651380.db575938b51e42529386076acdb0bba5f54bc28e.mattst88@gentoo
1 commit: db575938b51e42529386076acdb0bba5f54bc28e
2 Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
3 AuthorDate: Thu Aug 30 17:41:30 2018 +0000
4 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
5 CommitDate: Thu Aug 30 17:49:40 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=db575938
7
8 media-libs/mesa: Version bump to 18.2.0_rc5
9
10 media-libs/mesa/Manifest | 1 +
11 media-libs/mesa/mesa-18.2.0_rc5.ebuild | 547 +++++++++++++++++++++++++++++++++
12 2 files changed, 548 insertions(+)
13
14 diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
15 index 7df5796edd6..54aa12a82f9 100644
16 --- a/media-libs/mesa/Manifest
17 +++ b/media-libs/mesa/Manifest
18 @@ -4,3 +4,4 @@ DIST mesa-18.1.6.tar.xz 11142884 BLAKE2B fdd156fe7debf5223285dfa238070a2bd7d8ec6
19 DIST mesa-18.1.7.tar.xz 11136580 BLAKE2B a3076803dce9264e1b2138614398f046cef945a2658a13bc0447a712a45e7177291071884378a4c969e793a98680b90921c272991594957e5ef04c1087b1fb5f SHA512 697c4f441ae52bc867d9d73b103094a29102168c248a502c4ea0fc48f51bcb86b2e741da39e882f24131326d460cdb1416415604c6994d1b8c09fb8a153a5c77
20 DIST mesa-18.2.0-rc3.tar.xz 11327960 BLAKE2B 7ce236d6a308904a8f76b2fda86af181ae4e422d637caffb45ffd5ce0ed427fdfbd107f44c52825bff173ec8aaf4e3a3dbae939167da9f6a1a719b7366914526 SHA512 175dbdffdcdf61c7ac0e4e1fae021daba80311fac02074ad6dea208971ab50c68bc43ba8d7b36ecf82b7081c051d301cb562f66785446973b88657d48f7bb663
21 DIST mesa-18.2.0-rc4.tar.xz 11320208 BLAKE2B bf99295f462ec8162bced6ff6d8496f3d2246ef85b5b6512f1b2d6c6ac63c04a2677b0e0368e857e0becd0ea08d96c53c557a4a103bbee8e169d3e1f80dd9092 SHA512 8aa5c75567c23228c80174c36f1cbc30bea79e5a5cf93804a9ca6c6142c428c55ea256b0a76d83493a52d60d4c4ace96ae81434f01fcdfc1971151bf3900f655
22 +DIST mesa-18.2.0-rc5.tar.xz 11325840 BLAKE2B ec0a0ad0b480b4f8b092e80cb25a8f3544d9568976d7878c1c052921bdf5b8065677d512d08907798621bc91d63aa1f30c3b1fe21446d7b320aeb6b7e8ae05b5 SHA512 156f6ae7fd42b33cfcc0a402afbd7e0d4560c114a82b6d99d9e47c0deebdeb3430550cf5c06a64e19ab01e324ab28f2475b746037552d87563c2a92a24aa203a
23
24 diff --git a/media-libs/mesa/mesa-18.2.0_rc5.ebuild b/media-libs/mesa/mesa-18.2.0_rc5.ebuild
25 new file mode 100644
26 index 00000000000..ce53ca4e9ad
27 --- /dev/null
28 +++ b/media-libs/mesa/mesa-18.2.0_rc5.ebuild
29 @@ -0,0 +1,547 @@
30 +# Copyright 1999-2018 Gentoo Foundation
31 +# Distributed under the terms of the GNU General Public License v2
32 +
33 +EAPI=6
34 +
35 +PYTHON_COMPAT=( python2_7 )
36 +
37 +inherit llvm meson multilib-minimal pax-utils python-any-r1
38 +
39 +OPENGL_DIR="xorg-x11"
40 +
41 +MY_P="${P/_/-}"
42 +
43 +DESCRIPTION="OpenGL-like graphic library for Linux"
44 +HOMEPAGE="https://www.mesa3d.org/ https://mesa.freedesktop.org/"
45 +
46 +if [[ ${PV} == 9999 ]]; then
47 + EGIT_REPO_URI="https://gitlab.freedesktop.org/mesa/mesa.git"
48 + EXPERIMENTAL="true"
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-fbsd ~x86-fbsd ~amd64-linux ~arm-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 imx intel nouveau 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 +llvm lm_sensors
69 + opencl osmesa pax_kernel pic selinux test unwind vaapi valgrind vdpau
70 + vulkan wayland xa xvmc"
71 +
72 +REQUIRED_USE="
73 + d3d9? ( dri3 )
74 + gles1? ( egl )
75 + gles2? ( egl )
76 + vulkan? ( dri3
77 + || ( video_cards_i965 video_cards_radeonsi )
78 + video_cards_radeonsi? ( llvm ) )
79 + wayland? ( egl gbm )
80 + video_cards_freedreno? ( gallium )
81 + video_cards_intel? ( classic )
82 + video_cards_i915? ( || ( classic gallium ) )
83 + video_cards_i965? ( classic )
84 + video_cards_imx? ( gallium video_cards_vivante )
85 + video_cards_nouveau? ( || ( classic gallium ) )
86 + video_cards_radeon? ( || ( classic gallium )
87 + gallium? ( x86? ( llvm ) amd64? ( llvm ) ) )
88 + video_cards_r100? ( classic )
89 + video_cards_r200? ( classic )
90 + video_cards_r300? ( gallium x86? ( llvm ) amd64? ( llvm ) )
91 + video_cards_r600? ( gallium )
92 + video_cards_radeonsi? ( gallium llvm )
93 + video_cards_vc4? ( gallium )
94 + video_cards_virgl? ( gallium )
95 + video_cards_vivante? ( gallium gbm )
96 + video_cards_vmware? ( gallium )
97 +"
98 +
99 +LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.93"
100 +RDEPEND="
101 + !app-eselect/eselect-mesa
102 + >=app-eselect/eselect-opengl-1.3.0
103 + >=dev-libs/expat-2.1.0-r3:=[${MULTILIB_USEDEP}]
104 + >=sys-libs/zlib-1.2.8[${MULTILIB_USEDEP}]
105 + >=x11-libs/libX11-1.6.2:=[${MULTILIB_USEDEP}]
106 + >=x11-libs/libxshmfence-1.1:=[${MULTILIB_USEDEP}]
107 + >=x11-libs/libXdamage-1.1.4-r1:=[${MULTILIB_USEDEP}]
108 + >=x11-libs/libXext-1.3.2:=[${MULTILIB_USEDEP}]
109 + >=x11-libs/libXxf86vm-1.1.3:=[${MULTILIB_USEDEP}]
110 + >=x11-libs/libxcb-1.13:=[${MULTILIB_USEDEP}]
111 + x11-libs/libXfixes:=[${MULTILIB_USEDEP}]
112 + gallium? (
113 + unwind? ( sys-libs/libunwind[${MULTILIB_USEDEP}] )
114 + llvm? (
115 + video_cards_radeonsi? (
116 + virtual/libelf:0=[${MULTILIB_USEDEP}]
117 + )
118 + video_cards_r600? (
119 + virtual/libelf:0=[${MULTILIB_USEDEP}]
120 + )
121 + video_cards_radeon? (
122 + virtual/libelf:0=[${MULTILIB_USEDEP}]
123 + )
124 + )
125 + lm_sensors? ( sys-apps/lm_sensors:=[${MULTILIB_USEDEP}] )
126 + opencl? (
127 + app-eselect/eselect-opencl
128 + dev-libs/libclc
129 + virtual/libelf:0=[${MULTILIB_USEDEP}]
130 + )
131 + vaapi? (
132 + >=x11-libs/libva-1.7.3:=[${MULTILIB_USEDEP}]
133 + video_cards_nouveau? ( !<=x11-libs/libva-vdpau-driver-0.7.4-r3 )
134 + )
135 + vdpau? ( >=x11-libs/libvdpau-1.1:=[${MULTILIB_USEDEP}] )
136 + xvmc? ( >=x11-libs/libXvMC-1.0.8:=[${MULTILIB_USEDEP}] )
137 + )
138 + wayland? (
139 + >=dev-libs/wayland-1.15.0:=[${MULTILIB_USEDEP}]
140 + >=dev-libs/wayland-protocols-1.8
141 + )
142 + ${LIBDRM_DEPSTRING}[video_cards_freedreno?,video_cards_nouveau?,video_cards_vc4?,video_cards_vivante?,video_cards_vmware?,${MULTILIB_USEDEP}]
143 +
144 + video_cards_intel? (
145 + !video_cards_i965? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
146 + )
147 + video_cards_i915? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
148 +"
149 +for card in ${RADEON_CARDS}; do
150 + RDEPEND="${RDEPEND}
151 + video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_radeon] )
152 + "
153 +done
154 +RDEPEND="${RDEPEND}
155 + video_cards_radeonsi? ( ${LIBDRM_DEPSTRING}[video_cards_amdgpu] )
156 +"
157 +
158 +# Please keep the LLVM dependency block separate. Since LLVM is slotted,
159 +# we need to *really* make sure we're not pulling one than more slot
160 +# simultaneously.
161 +#
162 +# How to use it:
163 +# 1. List all the working slots (with min versions) in ||, newest first.
164 +# 2. Update the := to specify *max* version, e.g. < 7.
165 +# 3. Specify LLVM_MAX_SLOT, e.g. 6.
166 +LLVM_MAX_SLOT="7"
167 +LLVM_DEPSTR="
168 + || (
169 + sys-devel/llvm:7[${MULTILIB_USEDEP}]
170 + sys-devel/llvm:6[${MULTILIB_USEDEP}]
171 + sys-devel/llvm:5[${MULTILIB_USEDEP}]
172 + sys-devel/llvm:4[${MULTILIB_USEDEP}]
173 + >=sys-devel/llvm-3.9.0:0[${MULTILIB_USEDEP}]
174 + )
175 + sys-devel/llvm:=[${MULTILIB_USEDEP}]
176 +"
177 +LLVM_DEPSTR_AMDGPU=${LLVM_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
178 +CLANG_DEPSTR=${LLVM_DEPSTR//llvm/clang}
179 +CLANG_DEPSTR_AMDGPU=${CLANG_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
180 +RDEPEND="${RDEPEND}
181 + llvm? (
182 + opencl? (
183 + video_cards_r600? (
184 + ${CLANG_DEPSTR_AMDGPU}
185 + )
186 + !video_cards_r600? (
187 + video_cards_radeonsi? (
188 + ${CLANG_DEPSTR_AMDGPU}
189 + )
190 + )
191 + !video_cards_r600? (
192 + !video_cards_radeonsi? (
193 + video_cards_radeon? (
194 + ${CLANG_DEPSTR_AMDGPU}
195 + )
196 + )
197 + )
198 + !video_cards_r600? (
199 + !video_cards_radeon? (
200 + !video_cards_radeonsi? (
201 + ${CLANG_DEPSTR}
202 + )
203 + )
204 + )
205 + )
206 + !opencl? (
207 + video_cards_r600? (
208 + ${LLVM_DEPSTR_AMDGPU}
209 + )
210 + !video_cards_r600? (
211 + video_cards_radeonsi? (
212 + ${LLVM_DEPSTR_AMDGPU}
213 + )
214 + )
215 + !video_cards_r600? (
216 + !video_cards_radeonsi? (
217 + video_cards_radeon? (
218 + ${LLVM_DEPSTR_AMDGPU}
219 + )
220 + )
221 + )
222 + !video_cards_r600? (
223 + !video_cards_radeon? (
224 + !video_cards_radeonsi? (
225 + ${LLVM_DEPSTR}
226 + )
227 + )
228 + )
229 + )
230 + )
231 +"
232 +unset {LLVM,CLANG}_DEPSTR{,_AMDGPU}
233 +
234 +DEPEND="${RDEPEND}
235 + ${PYTHON_DEPS}
236 + opencl? (
237 + >=sys-devel/gcc-4.6
238 + )
239 + sys-devel/bison
240 + sys-devel/flex
241 + sys-devel/gettext
242 + virtual/pkgconfig
243 + valgrind? ( dev-util/valgrind )
244 + x11-base/xorg-proto
245 + x11-libs/libXrandr[${MULTILIB_USEDEP}]
246 + $(python_gen_any_dep ">=dev-python/mako-0.8.0[\${PYTHON_USEDEP}]")
247 +"
248 +
249 +S="${WORKDIR}/${MY_P}"
250 +EGIT_CHECKOUT_DIR=${S}
251 +
252 +QA_WX_LOAD="
253 +x86? (
254 + !pic? (
255 + usr/lib*/libglapi.so.0.0.0
256 + usr/lib*/libGLESv1_CM.so.1.0.0
257 + usr/lib*/libGLESv2.so.2.0.0
258 + usr/lib*/libGL.so.1.2.0
259 + usr/lib*/libOSMesa.so.8.0.0
260 + )
261 +)"
262 +
263 +llvm_check_deps() {
264 + local flags=${MULTILIB_USEDEP}
265 + if use video_cards_r600 || use video_cards_radeon || use video_cards_radeonsi
266 + then
267 + flags+=",llvm_targets_AMDGPU(-)"
268 + fi
269 +
270 + if use opencl; then
271 + has_version "sys-devel/clang[${flags}]" || return 1
272 + fi
273 + has_version "sys-devel/llvm[${flags}]"
274 +}
275 +
276 +pkg_pretend() {
277 + if use d3d9; then
278 + if ! use video_cards_r300 &&
279 + ! use video_cards_r600 &&
280 + ! use video_cards_radeonsi &&
281 + ! use video_cards_nouveau &&
282 + ! use video_cards_vmware; then
283 + ewarn "Ignoring USE=d3d9 since VIDEO_CARDS does not contain r300, r600, radeonsi, nouveau, or vmware"
284 + fi
285 + fi
286 +
287 + if use opencl; then
288 + if ! use video_cards_r600 &&
289 + ! use video_cards_radeonsi; then
290 + ewarn "Ignoring USE=opencl since VIDEO_CARDS does not contain r600 or radeonsi"
291 + fi
292 + fi
293 +
294 + if use vaapi; then
295 + if ! use video_cards_r600 &&
296 + ! use video_cards_radeonsi &&
297 + ! use video_cards_nouveau; then
298 + ewarn "Ignoring USE=vaapi since VIDEO_CARDS does not contain r600, radeonsi, or nouveau"
299 + fi
300 + fi
301 +
302 + if use vdpau; then
303 + if ! use video_cards_r300 &&
304 + ! use video_cards_r600 &&
305 + ! use video_cards_radeonsi &&
306 + ! use video_cards_nouveau; then
307 + ewarn "Ignoring USE=vdpau since VIDEO_CARDS does not contain r300, r600, radeonsi, or nouveau"
308 + fi
309 + fi
310 +
311 + if use xa; then
312 + if ! use video_cards_freedreno &&
313 + ! use video_cards_nouveau &&
314 + ! use video_cards_vmware; then
315 + ewarn "Ignoring USE=xa since VIDEO_CARDS does not contain freedreno, nouveau, or vmware"
316 + fi
317 + fi
318 +
319 + if use xvmc; then
320 + if ! use video_cards_r600 &&
321 + ! use video_cards_nouveau; then
322 + ewarn "Ignoring USE=xvmc since VIDEO_CARDS does not contain r600 or nouveau"
323 + fi
324 + fi
325 +
326 + if ! use gallium; then
327 + use d3d9 && ewarn "Ignoring USE=d3d9 since USE does not contain gallium"
328 + use lm_sensors && ewarn "Ignoring USE=lm_sensors since USE does not contain gallium"
329 + use llvm && ewarn "Ignoring USE=llvm since USE does not contain gallium"
330 + use opencl && ewarn "Ignoring USE=opencl since USE does not contain gallium"
331 + use vaapi && ewarn "Ignoring USE=vaapi since USE does not contain gallium"
332 + use vdpau && ewarn "Ignoring USE=vdpau since USE does not contain gallium"
333 + use unwind && ewarn "Ignoring USE=unwind since USE does not contain gallium"
334 + use xa && ewarn "Ignoring USE=xa since USE does not contain gallium"
335 + use xvmc && ewarn "Ignoring USE=xvmc since USE does not contain gallium"
336 + fi
337 +
338 + if ! use llvm; then
339 + use opencl && ewarn "Ignoring USE=opencl since USE does not contain llvm"
340 + fi
341 +}
342 +
343 +pkg_setup() {
344 + # warning message for bug 459306
345 + if use llvm && has_version sys-devel/llvm[!debug=]; then
346 + ewarn "Mismatch between debug USE flags in media-libs/mesa and sys-devel/llvm"
347 + ewarn "detected! This can cause problems. For details, see bug 459306."
348 + fi
349 +
350 + if use llvm; then
351 + llvm_pkg_setup
352 + fi
353 + python-any-r1_pkg_setup
354 +}
355 +
356 +multilib_src_configure() {
357 + local emesonargs=()
358 +
359 + if use classic; then
360 + # Intel code
361 + dri_driver_enable video_cards_i915 i915
362 + dri_driver_enable video_cards_i965 i965
363 + if ! use video_cards_i915 && \
364 + ! use video_cards_i965; then
365 + dri_driver_enable video_cards_intel i915 i965
366 + fi
367 +
368 + # Nouveau code
369 + dri_driver_enable video_cards_nouveau nouveau
370 +
371 + # ATI code
372 + dri_driver_enable video_cards_r100 r100
373 + dri_driver_enable video_cards_r200 r200
374 + if ! use video_cards_r100 && \
375 + ! use video_cards_r200; then
376 + dri_driver_enable video_cards_radeon r100 r200
377 + fi
378 + fi
379 +
380 + emesonargs+=( -Dplatforms=x11,surfaceless$(use wayland && echo ",wayland")$(use gbm && echo ",drm") )
381 +
382 + if use gallium; then
383 + emesonargs+=(
384 + $(meson_use llvm)
385 + $(meson_use lm_sensors lmsensors)
386 + $(meson_use unwind libunwind)
387 + )
388 +
389 + if use video_cards_r300 ||
390 + use video_cards_r600 ||
391 + use video_cards_radeonsi ||
392 + use video_cards_nouveau ||
393 + use video_cards_vmware; then
394 + emesonargs+=($(meson_use d3d9 gallium-nine))
395 + else
396 + emesonargs+=(-Dgallium-nine=false)
397 + fi
398 +
399 + if use video_cards_r600 ||
400 + use video_cards_radeonsi ||
401 + use video_cards_nouveau; then
402 + emesonargs+=($(meson_use vaapi gallium-va))
403 + use vaapi && emesonargs+=( -Dva-libs-path=/usr/$(get_libdir)/va/drivers )
404 + else
405 + emesonargs+=(-Dgallium-va=false)
406 + fi
407 +
408 + if use video_cards_r300 ||
409 + use video_cards_r600 ||
410 + use video_cards_radeonsi ||
411 + use video_cards_nouveau; then
412 + emesonargs+=($(meson_use vdpau gallium-vdpau))
413 + else
414 + emesonargs+=(-Dgallium-vdpau=false)
415 + fi
416 +
417 + if use video_cards_freedreno ||
418 + use video_cards_nouveau ||
419 + use video_cards_vmware; then
420 + emesonargs+=($(meson_use xa gallium-xa))
421 + else
422 + emesonargs+=(-Dgallium-xa=false)
423 + fi
424 +
425 + if use video_cards_r600 ||
426 + use video_cards_nouveau; then
427 + emesonargs+=($(meson_use xvmc gallium-xvmc))
428 + else
429 + emesonargs+=(-Dgallium-xvmc=false)
430 + fi
431 +
432 + gallium_enable video_cards_vc4 vc4
433 + gallium_enable video_cards_vivante etnaviv
434 + gallium_enable video_cards_vmware svga
435 + gallium_enable video_cards_nouveau nouveau
436 + gallium_enable video_cards_imx imx
437 +
438 + # Only one i915 driver (classic vs gallium). Default to classic.
439 + if ! use classic; then
440 + gallium_enable video_cards_i915 i915
441 + if ! use video_cards_i915 && \
442 + ! use video_cards_i965; then
443 + gallium_enable video_cards_intel i915
444 + fi
445 + fi
446 +
447 + gallium_enable video_cards_r300 r300
448 + gallium_enable video_cards_r600 r600
449 + gallium_enable video_cards_radeonsi radeonsi
450 + if ! use video_cards_r300 && \
451 + ! use video_cards_r600; then
452 + gallium_enable video_cards_radeon r300 r600
453 + fi
454 +
455 + gallium_enable video_cards_freedreno freedreno
456 + # opencl stuff
457 + if use opencl; then
458 + emesonargs+=(
459 + -Dgallium-opencl="$(usex opencl standalone disabled)"
460 + )
461 + fi
462 +
463 + gallium_enable video_cards_virgl virgl
464 + fi
465 +
466 + if use vulkan; then
467 + vulkan_enable video_cards_i965 intel
468 + vulkan_enable video_cards_radeonsi amd
469 + fi
470 +
471 + # x86 hardened pax_kernel needs glx-rts, bug 240956
472 + if [[ ${ABI} == x86 ]]; then
473 + emesonargs+=( $(meson_use pax_kernel glx-read-only-text) )
474 + fi
475 +
476 + # on abi_x86_32 hardened we need to have asm disable
477 + if [[ ${ABI} == x86* ]] && use pic; then
478 + emesonargs+=( -Dasm=false )
479 + fi
480 +
481 + if use gallium; then
482 + gallium_enable -- swrast
483 + emesonargs+=( -Dosmesa=$(usex osmesa gallium none) )
484 + else
485 + dri_driver_enable -- swrast
486 + emesonargs+=( -Dosmesa=$(usex osmesa classic none) )
487 + fi
488 +
489 + driver_list() {
490 + local drivers="$(sort -u <<< "${1// /$'\n'}")"
491 + echo "${drivers//$'\n'/,}"
492 + }
493 +
494 + emesonargs+=(
495 + $(meson_use test build-tests)
496 + -Dglx=dri
497 + -Dshared-glapi=true
498 + $(meson_use dri3)
499 + $(meson_use egl)
500 + $(meson_use gbm)
501 + $(meson_use gles1)
502 + $(meson_use gles2)
503 + $(meson_use selinux)
504 + -Dvalgrind=$(usex valgrind auto false)
505 + -Ddri-drivers=$(driver_list "${DRI_DRIVERS[*]}")
506 + -Dgallium-drivers=$(driver_list "${GALLIUM_DRIVERS[*]}")
507 + -Dvulkan-drivers=$(driver_list "${VULKAN_DRIVERS[*]}")
508 + --buildtype $(usex debug debug plain)
509 + )
510 + meson_src_configure
511 +}
512 +
513 +multilib_src_compile() {
514 + meson_src_compile
515 +}
516 +
517 +multilib_src_install() {
518 + meson_src_install
519 +
520 + if use opencl; then
521 + ebegin "Moving Gallium/Clover OpenCL implementation for dynamic switching"
522 + local cl_dir="/usr/$(get_libdir)/OpenCL/vendors/mesa"
523 + dodir ${cl_dir}/{lib,include}
524 + if [ -f "${ED}/usr/$(get_libdir)/libOpenCL.so" ]; then
525 + mv -f "${ED}"/usr/$(get_libdir)/libOpenCL.so* \
526 + "${ED}"${cl_dir}
527 + fi
528 + if [ -f "${ED}/usr/include/CL/opencl.h" ]; then
529 + mv -f "${ED}"/usr/include/CL \
530 + "${ED}"${cl_dir}/include
531 + fi
532 + eend $?
533 + fi
534 +}
535 +
536 +multilib_src_install_all() {
537 + einstalldocs
538 +}
539 +
540 +multilib_src_test() {
541 + meson_src_test
542 +}
543 +
544 +pkg_postinst() {
545 + # Switch to the xorg implementation.
546 + echo
547 + eselect opengl set --use-old ${OPENGL_DIR}
548 +
549 + # Switch to mesa opencl
550 + if use opencl; then
551 + eselect opencl set --use-old ${PN}
552 + fi
553 +}
554 +
555 +# $1 - VIDEO_CARDS flag (check skipped for "--")
556 +# other args - names of DRI drivers to enable
557 +dri_driver_enable() {
558 + if [[ $1 == -- ]] || use $1; then
559 + shift
560 + DRI_DRIVERS+=("$@")
561 + fi
562 +}
563 +
564 +gallium_enable() {
565 + if [[ $1 == -- ]] || use $1; then
566 + shift
567 + GALLIUM_DRIVERS+=("$@")
568 + fi
569 +}
570 +
571 +vulkan_enable() {
572 + if [[ $1 == -- ]] || use $1; then
573 + shift
574 + VULKAN_DRIVERS+=("$@")
575 + fi
576 +}