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, 24 Sep 2018 16:41:24
Message-Id: 1537807266.b175fde8e4c76df474c4c854e575ee8770073508.mattst88@gentoo
1 commit: b175fde8e4c76df474c4c854e575ee8770073508
2 Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
3 AuthorDate: Mon Sep 24 16:24:51 2018 +0000
4 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
5 CommitDate: Mon Sep 24 16:41:06 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b175fde8
7
8 media-libs/mesa: Version bump to 18.2.1
9
10 media-libs/mesa/Manifest | 1 +
11 media-libs/mesa/mesa-18.2.1.ebuild | 548 +++++++++++++++++++++++++++++++++++++
12 2 files changed, 549 insertions(+)
13
14 diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
15 index 06df0681db5..067fcc6fc50 100644
16 --- a/media-libs/mesa/Manifest
17 +++ b/media-libs/mesa/Manifest
18 @@ -2,3 +2,4 @@ DIST mesa-17.3.9.tar.xz 10660456 BLAKE2B 54f4a75f9040e50e9eea8f5c52a276578379d25
19 DIST mesa-18.1.6.tar.xz 11142884 BLAKE2B fdd156fe7debf5223285dfa238070a2bd7d8ec684dec168afab78b9d2d38d53c10d939aaa64f34c2910e542dce3869adfca6383fca6a854c6dd03287a044b0e3 SHA512 2966210800215f5ced2720691063a8519b51ebeab9fb1e99bde4b1bd7ccc719d6395a1c29f25c88efe62d1592cf14ceafc163aca349490b1f8cee81070d46fcc
20 DIST mesa-18.1.8.tar.xz 11139864 BLAKE2B bdbd6c186f79b708656a44177b352e9188b8b846c816f8457c99ff76607019f856e19f5eba1c2473d998cd020aa03e732f25f9253f1acdd7f3d9b1470f42ec9e SHA512 ab89c6d27b765d3efdf61b24dc56d863ae590d83003d2eae4bfe25ecfbeda5bee0227f21d057523bb4eceeaf3d9955df48087ffb472c41b123c100e593056cb9
21 DIST mesa-18.2.0.tar.xz 11331164 BLAKE2B e4e7c65a0c3c0716451157f7d026df8836399b5a25ca7ce77746b34f82e0c14d0bfcb965732f67c979190c2c2db68f272ffafa51b49613a510f186e9e8a01c93 SHA512 e6e997e166845009f6b97da204384758c797c870b56332652c0a2636734638f9180b7e4dbad144495645308ae4d77981a2493a22d57973723338b658e0655557
22 +DIST mesa-18.2.1.tar.xz 11374476 BLAKE2B f0f3b766d68550f8c395a1b1d1ffc7a9e532c22ee6b91d698db33a270c152e03ab656d4219301bc2e0e95ba6f0583017c4361add928ad8ab26378a1ec6958f36 SHA512 d249bdf79aad36db9a8d291b3a1a100d283893ac741f58f85ae7e5c90ca25c37f80a5fa6fc57945ffeb0b67b788e7ea146543ec790b22f144578fc4c1525b84d
23
24 diff --git a/media-libs/mesa/mesa-18.2.1.ebuild b/media-libs/mesa/mesa-18.2.1.ebuild
25 new file mode 100644
26 index 00000000000..df9403207de
27 --- /dev/null
28 +++ b/media-libs/mesa/mesa-18.2.1.ebuild
29 @@ -0,0 +1,548 @@
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 ~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 + -Db_ndebug=$(usex debug false true)
510 + )
511 + meson_src_configure
512 +}
513 +
514 +multilib_src_compile() {
515 + meson_src_compile
516 +}
517 +
518 +multilib_src_install() {
519 + meson_src_install
520 +
521 + if use opencl; then
522 + ebegin "Moving Gallium/Clover OpenCL implementation for dynamic switching"
523 + local cl_dir="/usr/$(get_libdir)/OpenCL/vendors/mesa"
524 + dodir ${cl_dir}/{lib,include}
525 + if [ -f "${ED}/usr/$(get_libdir)/libOpenCL.so" ]; then
526 + mv -f "${ED}"/usr/$(get_libdir)/libOpenCL.so* \
527 + "${ED}"${cl_dir}
528 + fi
529 + if [ -f "${ED}/usr/include/CL/opencl.h" ]; then
530 + mv -f "${ED}"/usr/include/CL \
531 + "${ED}"${cl_dir}/include
532 + fi
533 + eend $?
534 + fi
535 +}
536 +
537 +multilib_src_install_all() {
538 + einstalldocs
539 +}
540 +
541 +multilib_src_test() {
542 + meson_src_test
543 +}
544 +
545 +pkg_postinst() {
546 + # Switch to the xorg implementation.
547 + echo
548 + eselect opengl set --use-old ${OPENGL_DIR}
549 +
550 + # Switch to mesa opencl
551 + if use opencl; then
552 + eselect opencl set --use-old ${PN}
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 +}