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, 04 Jul 2018 14:29:39
Message-Id: 1530714379.2fc92501f8f282184845bbb319db985fcdb47772.mattst88@gentoo
1 commit: 2fc92501f8f282184845bbb319db985fcdb47772
2 Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jul 4 14:25:57 2018 +0000
4 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
5 CommitDate: Wed Jul 4 14:26:19 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2fc92501
7
8 media-libs/mesa: Version bump 18.1.3
9
10 Closes: https://bugs.gentoo.org/660260
11
12 media-libs/mesa/Manifest | 1 +
13 media-libs/mesa/mesa-18.1.3.ebuild | 539 +++++++++++++++++++++++++++++++++++++
14 2 files changed, 540 insertions(+)
15
16 diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
17 index a847bdd85a2..4e497ae1854 100644
18 --- a/media-libs/mesa/Manifest
19 +++ b/media-libs/mesa/Manifest
20 @@ -2,3 +2,4 @@ DIST mesa-17.3.9.tar.xz 10660456 BLAKE2B 54f4a75f9040e50e9eea8f5c52a276578379d25
21 DIST mesa-18.0.5.tar.xz 10952996 BLAKE2B 708cdb2ef95a618430cd4e7eb45bcab0f6575774065b61f53787aa378385fe0dfa0b04f9c80c5426f9581851edc545a75c137777dc304ac8ba57465d365fcd50 SHA512 63b47cdca7f8282aab7aaa66233411f02918e5c4804b7a0010de2b1867fe90171e492ff031dfc4aa20968dfc99bd7dceb5d35fd44c709e54a2ece61175a60f3d
22 DIST mesa-18.1.1.tar.xz 11110892 BLAKE2B 05d48379109c1c3800d3d07b9f52e96b2cd4bc087517711ee752f89619afce0a0e09b7a9ede8b5d1807ceae3e2b506518657a0760c947f466121e2252f7eada3 SHA512 7783adc1ec7a1c3d092acfcca6b4ba19450c15a7f0d7f41fbf25e482236615d79ce24afe60959066ea7aa851df4f74fa3c569fa6d847ea79e6bfe046b8c65e90
23 DIST mesa-18.1.2.tar.xz 11124408 BLAKE2B 8327f16f41d59e6ec8d4145a8399503cf04799d437e336714760e4bdc563c483583363e32d41affc2365e977b96494156300910b1834bc9957504b6c0cf168fa SHA512 1b896ecc42c2f81813d551a2b14d271d274a948fa10bf5b7a567417690316c2ab7e7fdd52fe004732cd1a47661ba91acf7d5b21e3b3f28e21b50aadbfa96a5d5
24 +DIST mesa-18.1.3.tar.xz 11126236 BLAKE2B 2315cdc95130ef604a86e3886abf9b15e6c7944fab3b3cc020358dd08a76f2b876904516e5c081d549b16240ae4dedd647402dd7bd8de4c91015bb601c0c2923 SHA512 f6e5b81a80a309a36a04759d18364d3c71c48d1cb88f87b2f5432ef003092a22046e88ce2082031d5d52b60ba36f585d8df52e06ecc7a5158079936236f36887
25
26 diff --git a/media-libs/mesa/mesa-18.1.3.ebuild b/media-libs/mesa/mesa-18.1.3.ebuild
27 new file mode 100644
28 index 00000000000..174ef6902cf
29 --- /dev/null
30 +++ b/media-libs/mesa/mesa-18.1.3.ebuild
31 @@ -0,0 +1,539 @@
32 +# Copyright 1999-2018 Gentoo Foundation
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=6
36 +
37 +EGIT_REPO_URI="https://gitlab.freedesktop.org/mesa/mesa.git"
38 +
39 +if [[ ${PV} = 9999 ]]; then
40 + GIT_ECLASS="git-r3"
41 + EXPERIMENTAL="true"
42 +fi
43 +
44 +PYTHON_COMPAT=( python2_7 )
45 +
46 +inherit autotools llvm multilib-minimal python-any-r1 pax-utils ${GIT_ECLASS}
47 +
48 +OPENGL_DIR="xorg-x11"
49 +
50 +MY_P="${P/_/-}"
51 +
52 +DESCRIPTION="OpenGL-like graphic library for Linux"
53 +HOMEPAGE="https://www.mesa3d.org/ https://mesa.freedesktop.org/"
54 +
55 +if [[ $PV == 9999 ]]; then
56 + SRC_URI=""
57 +else
58 + SRC_URI="https://mesa.freedesktop.org/archive/${MY_P}.tar.xz"
59 + 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"
60 +fi
61 +
62 +LICENSE="MIT"
63 +SLOT="0"
64 +RESTRICT="!bindist? ( bindist )"
65 +
66 +RADEON_CARDS="r100 r200 r300 r600 radeon radeonsi"
67 +VIDEO_CARDS="${RADEON_CARDS} freedreno i915 i965 imx intel 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 + bindist +classic d3d9 debug +dri3 +egl +gallium +gbm gles1 gles2 unwind
74 + +llvm +nptl opencl osmesa pax_kernel openmax pic selinux vaapi valgrind
75 + vdpau vulkan wayland xvmc xa"
76 +
77 +REQUIRED_USE="
78 + d3d9? ( dri3 gallium )
79 + llvm? ( gallium )
80 + opencl? ( gallium llvm || ( video_cards_r600 video_cards_radeonsi ) )
81 + openmax? ( gallium )
82 + gles1? ( egl )
83 + gles2? ( egl )
84 + vaapi? ( gallium )
85 + vdpau? ( gallium )
86 + vulkan? ( || ( video_cards_i965 video_cards_radeonsi )
87 + video_cards_radeonsi? ( llvm ) )
88 + wayland? ( egl gbm )
89 + xa? ( gallium )
90 + video_cards_freedreno? ( gallium )
91 + video_cards_intel? ( classic )
92 + video_cards_i915? ( || ( classic gallium ) )
93 + video_cards_i965? ( classic )
94 + video_cards_imx? ( gallium video_cards_vivante )
95 + video_cards_nouveau? ( || ( classic gallium ) )
96 + video_cards_radeon? ( || ( classic gallium )
97 + gallium? ( x86? ( llvm ) amd64? ( llvm ) ) )
98 + video_cards_r100? ( classic )
99 + video_cards_r200? ( classic )
100 + video_cards_r300? ( gallium x86? ( llvm ) amd64? ( llvm ) )
101 + video_cards_r600? ( gallium )
102 + video_cards_radeonsi? ( gallium llvm )
103 + video_cards_vc4? ( gallium )
104 + video_cards_virgl? ( gallium )
105 + video_cards_vivante? ( gallium gbm )
106 + video_cards_vmware? ( gallium )
107 +"
108 +
109 +LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.91"
110 +RDEPEND="
111 + !app-eselect/eselect-mesa
112 + >=app-eselect/eselect-opengl-1.3.0
113 + >=dev-libs/expat-2.1.0-r3:=[${MULTILIB_USEDEP}]
114 + >=sys-libs/zlib-1.2.8[${MULTILIB_USEDEP}]
115 + >=x11-libs/libX11-1.6.2:=[${MULTILIB_USEDEP}]
116 + >=x11-libs/libxshmfence-1.1:=[${MULTILIB_USEDEP}]
117 + >=x11-libs/libXdamage-1.1.4-r1:=[${MULTILIB_USEDEP}]
118 + >=x11-libs/libXext-1.3.2:=[${MULTILIB_USEDEP}]
119 + >=x11-libs/libXxf86vm-1.1.3:=[${MULTILIB_USEDEP}]
120 + >=x11-libs/libxcb-1.13:=[${MULTILIB_USEDEP}]
121 + x11-libs/libXfixes:=[${MULTILIB_USEDEP}]
122 + unwind? ( sys-libs/libunwind[${MULTILIB_USEDEP}] )
123 + llvm? (
124 + video_cards_radeonsi? (
125 + virtual/libelf:0=[${MULTILIB_USEDEP}]
126 + )
127 + video_cards_r600? (
128 + virtual/libelf:0=[${MULTILIB_USEDEP}]
129 + )
130 + video_cards_radeon? (
131 + virtual/libelf:0=[${MULTILIB_USEDEP}]
132 + )
133 + )
134 + opencl? (
135 + app-eselect/eselect-opencl
136 + dev-libs/libclc
137 + virtual/libelf:0=[${MULTILIB_USEDEP}]
138 + )
139 + openmax? (
140 + >=media-libs/libomxil-bellagio-0.9.3:=[${MULTILIB_USEDEP}]
141 + x11-misc/xdg-utils
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 + wayland? (
149 + >=dev-libs/wayland-1.15.0:=[${MULTILIB_USEDEP}]
150 + >=dev-libs/wayland-protocols-1.8
151 + )
152 + xvmc? ( >=x11-libs/libXvMC-1.0.8:=[${MULTILIB_USEDEP}] )
153 + ${LIBDRM_DEPSTRING}[video_cards_freedreno?,video_cards_nouveau?,video_cards_vc4?,video_cards_vivante?,video_cards_vmware?,${MULTILIB_USEDEP}]
154 +
155 + video_cards_intel? (
156 + !video_cards_i965? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
157 + )
158 + video_cards_i915? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
159 +"
160 +for card in ${RADEON_CARDS}; do
161 + RDEPEND="${RDEPEND}
162 + video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_radeon] )
163 + "
164 +done
165 +RDEPEND="${RDEPEND}
166 + video_cards_radeonsi? ( ${LIBDRM_DEPSTRING}[video_cards_amdgpu] )
167 +"
168 +
169 +# Please keep the LLVM dependency block separate. Since LLVM is slotted,
170 +# we need to *really* make sure we're not pulling one than more slot
171 +# simultaneously.
172 +#
173 +# How to use it:
174 +# 1. List all the working slots (with min versions) in ||, newest first.
175 +# 2. Update the := to specify *max* version, e.g. < 7.
176 +# 3. Specify LLVM_MAX_SLOT, e.g. 6.
177 +LLVM_DEPSTR="
178 + || (
179 + sys-devel/llvm:7[${MULTILIB_USEDEP}]
180 + sys-devel/llvm:6[${MULTILIB_USEDEP}]
181 + sys-devel/llvm:5[${MULTILIB_USEDEP}]
182 + sys-devel/llvm:4[${MULTILIB_USEDEP}]
183 + >=sys-devel/llvm-3.9.0:0[${MULTILIB_USEDEP}]
184 + )
185 + sys-devel/llvm:=[${MULTILIB_USEDEP}]
186 +"
187 +LLVM_DEPSTR_AMDGPU=${LLVM_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
188 +CLANG_DEPSTR=${LLVM_DEPSTR//llvm/clang}
189 +CLANG_DEPSTR_AMDGPU=${CLANG_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
190 +RDEPEND="${RDEPEND}
191 + llvm? (
192 + opencl? (
193 + video_cards_r600? (
194 + ${CLANG_DEPSTR_AMDGPU}
195 + )
196 + !video_cards_r600? (
197 + video_cards_radeonsi? (
198 + ${CLANG_DEPSTR_AMDGPU}
199 + )
200 + )
201 + !video_cards_r600? (
202 + !video_cards_radeonsi? (
203 + video_cards_radeon? (
204 + ${CLANG_DEPSTR_AMDGPU}
205 + )
206 + )
207 + )
208 + !video_cards_r600? (
209 + !video_cards_radeon? (
210 + !video_cards_radeonsi? (
211 + ${CLANG_DEPSTR}
212 + )
213 + )
214 + )
215 + )
216 + !opencl? (
217 + video_cards_r600? (
218 + ${LLVM_DEPSTR_AMDGPU}
219 + )
220 + !video_cards_r600? (
221 + video_cards_radeonsi? (
222 + ${LLVM_DEPSTR_AMDGPU}
223 + )
224 + )
225 + !video_cards_r600? (
226 + !video_cards_radeonsi? (
227 + video_cards_radeon? (
228 + ${LLVM_DEPSTR_AMDGPU}
229 + )
230 + )
231 + )
232 + !video_cards_r600? (
233 + !video_cards_radeon? (
234 + !video_cards_radeonsi? (
235 + ${LLVM_DEPSTR}
236 + )
237 + )
238 + )
239 + )
240 + )
241 +"
242 +unset {LLVM,CLANG}_DEPSTR{,_AMDGPU}
243 +
244 +DEPEND="${RDEPEND}
245 + ${PYTHON_DEPS}
246 + opencl? (
247 + >=sys-devel/gcc-4.6
248 + )
249 + sys-devel/gettext
250 + virtual/pkgconfig
251 + valgrind? ( dev-util/valgrind )
252 + x11-base/xorg-proto
253 + vulkan? (
254 + $(python_gen_any_dep ">=dev-python/mako-0.7.3[\${PYTHON_USEDEP}]")
255 + )
256 +"
257 +[[ ${PV} == 9999 ]] && DEPEND+="
258 + sys-devel/bison
259 + sys-devel/flex
260 + $(python_gen_any_dep ">=dev-python/mako-0.7.3[\${PYTHON_USEDEP}]")
261 +"
262 +
263 +S="${WORKDIR}/${MY_P}"
264 +EGIT_CHECKOUT_DIR=${S}
265 +
266 +QA_WX_LOAD="
267 +x86? (
268 + !pic? (
269 + usr/lib*/libglapi.so.0.0.0
270 + usr/lib*/libGLESv1_CM.so.1.1.0
271 + usr/lib*/libGLESv2.so.2.0.0
272 + usr/lib*/libGL.so.1.2.0
273 + usr/lib*/libOSMesa.so.8.0.0
274 + )
275 +)"
276 +
277 +llvm_check_deps() {
278 + local flags=${MULTILIB_USEDEP}
279 + if use video_cards_r600 || use video_cards_radeon || use video_cards_radeonsi
280 + then
281 + flags+=",llvm_targets_AMDGPU(-)"
282 + fi
283 +
284 + if use opencl; then
285 + has_version "sys-devel/clang[${flags}]" || return 1
286 + fi
287 + has_version "sys-devel/llvm[${flags}]"
288 +}
289 +
290 +pkg_setup() {
291 + # warning message for bug 459306
292 + if use llvm && has_version sys-devel/llvm[!debug=]; then
293 + ewarn "Mismatch between debug USE flags in media-libs/mesa and sys-devel/llvm"
294 + ewarn "detected! This can cause problems. For details, see bug 459306."
295 + fi
296 +
297 + if use llvm; then
298 + llvm_pkg_setup
299 + fi
300 + python-any-r1_pkg_setup
301 +}
302 +
303 +src_prepare() {
304 + eapply_user
305 + [[ ${PV} == 9999 ]] && eautoreconf
306 +}
307 +
308 +multilib_src_configure() {
309 + local myconf
310 +
311 + if use classic; then
312 + # Configurable DRI drivers
313 + driver_enable swrast
314 +
315 + # Intel code
316 + driver_enable video_cards_i915 i915
317 + driver_enable video_cards_i965 i965
318 + if ! use video_cards_i915 && \
319 + ! use video_cards_i965; then
320 + driver_enable video_cards_intel i915 i965
321 + fi
322 +
323 + # Nouveau code
324 + driver_enable video_cards_nouveau nouveau
325 +
326 + # ATI code
327 + driver_enable video_cards_r100 radeon
328 + driver_enable video_cards_r200 r200
329 + if ! use video_cards_r100 && \
330 + ! use video_cards_r200; then
331 + driver_enable video_cards_radeon radeon r200
332 + fi
333 + fi
334 +
335 + if use egl; then
336 + myconf+=" --with-platforms=x11,surfaceless$(use wayland && echo ",wayland")$(use gbm && echo ",drm")"
337 + fi
338 +
339 + if use gallium; then
340 + myconf+="
341 + $(use_enable d3d9 nine)
342 + $(use_enable llvm)
343 + $(use_enable openmax omx-bellagio)
344 + $(use_enable vaapi va)
345 + $(use_enable vdpau)
346 + $(use_enable xa)
347 + $(use_enable xvmc)
348 + "
349 + use vaapi && myconf+=" --with-va-libdir=/usr/$(get_libdir)/va/drivers"
350 +
351 + gallium_enable swrast
352 + gallium_enable video_cards_vc4 vc4
353 + gallium_enable video_cards_vivante etnaviv
354 + gallium_enable video_cards_vmware svga
355 + gallium_enable video_cards_nouveau nouveau
356 + gallium_enable video_cards_i915 i915
357 + gallium_enable video_cards_imx imx
358 + if ! use video_cards_i915 && \
359 + ! use video_cards_i965; then
360 + gallium_enable video_cards_intel i915
361 + fi
362 +
363 + gallium_enable video_cards_r300 r300
364 + gallium_enable video_cards_r600 r600
365 + gallium_enable video_cards_radeonsi radeonsi
366 + if ! use video_cards_r300 && \
367 + ! use video_cards_r600; then
368 + gallium_enable video_cards_radeon r300 r600
369 + fi
370 +
371 + gallium_enable video_cards_freedreno freedreno
372 + # opencl stuff
373 + if use opencl; then
374 + myconf+="
375 + $(use_enable opencl)
376 + --with-clang-libdir="${EPREFIX}/usr/lib"
377 + "
378 + fi
379 +
380 + gallium_enable video_cards_virgl virgl
381 + fi
382 +
383 + if use vulkan; then
384 + vulkan_enable video_cards_i965 intel
385 + vulkan_enable video_cards_radeonsi radeon
386 + fi
387 +
388 + # x86 hardened pax_kernel needs glx-rts, bug 240956
389 + if [[ ${ABI} == x86 ]]; then
390 + myconf+=" $(use_enable pax_kernel glx-read-only-text)"
391 + fi
392 +
393 + # on abi_x86_32 hardened we need to have asm disable
394 + if [[ ${ABI} == x86* ]] && use pic; then
395 + myconf+=" --disable-asm"
396 + fi
397 +
398 + if use gallium; then
399 + myconf+=" $(use_enable osmesa gallium-osmesa)"
400 + else
401 + myconf+=" $(use_enable osmesa)"
402 + fi
403 +
404 + # build fails with BSD indent, bug #428112
405 + use userland_GNU || export INDENT=cat
406 +
407 + ECONF_SOURCE="${S}" \
408 + econf \
409 + --enable-dri \
410 + --enable-glx \
411 + --enable-shared-glapi \
412 + $(use_enable !bindist texture-float) \
413 + $(use_enable d3d9 nine) \
414 + $(use_enable debug) \
415 + $(use_enable dri3) \
416 + $(use_enable egl) \
417 + $(use_enable gbm) \
418 + $(use_enable gles1) \
419 + $(use_enable gles2) \
420 + $(use_enable nptl glx-tls) \
421 + $(use_enable unwind libunwind) \
422 + --enable-valgrind=$(usex valgrind auto no) \
423 + --enable-llvm-shared-libs \
424 + --disable-opencl-icd \
425 + --with-dri-drivers=${DRI_DRIVERS} \
426 + --with-gallium-drivers=${GALLIUM_DRIVERS} \
427 + --with-vulkan-drivers=${VULKAN_DRIVERS} \
428 + PYTHON2="${PYTHON}" \
429 + ${myconf}
430 +}
431 +
432 +multilib_src_install() {
433 + emake install DESTDIR="${D}"
434 +
435 + if use wayland; then
436 + # These files are now provided by >=dev-libs/wayland-1.15.0
437 + rm "${ED}/usr/$(get_libdir)/libwayland-egl.so" || die
438 + rm "${ED}/usr/$(get_libdir)/libwayland-egl.so.1" || die
439 + rm "${ED}/usr/$(get_libdir)/libwayland-egl.so.1.0.0" || die
440 + rm "${ED}/usr/$(get_libdir)/pkgconfig/wayland-egl.pc" || die
441 + fi
442 +
443 + if use opencl; then
444 + ebegin "Moving Gallium/Clover OpenCL implementation for dynamic switching"
445 + local cl_dir="/usr/$(get_libdir)/OpenCL/vendors/mesa"
446 + dodir ${cl_dir}/{lib,include}
447 + if [ -f "${ED}/usr/$(get_libdir)/libOpenCL.so" ]; then
448 + mv -f "${ED}"/usr/$(get_libdir)/libOpenCL.so* \
449 + "${ED}"${cl_dir}
450 + fi
451 + if [ -f "${ED}/usr/include/CL/opencl.h" ]; then
452 + mv -f "${ED}"/usr/include/CL \
453 + "${ED}"${cl_dir}/include
454 + fi
455 + eend $?
456 + fi
457 +
458 + if use openmax; then
459 + echo "XDG_DATA_DIRS=\"${EPREFIX}/usr/share/mesa/xdg\"" > "${T}/99mesaxdgomx"
460 + doenvd "${T}"/99mesaxdgomx
461 + keepdir /usr/share/mesa/xdg
462 + fi
463 +}
464 +
465 +multilib_src_install_all() {
466 + find "${ED}" -name '*.la' -delete
467 + einstalldocs
468 +
469 + if use !bindist; then
470 + dodoc docs/patents.txt
471 + fi
472 +}
473 +
474 +multilib_src_test() {
475 + if use llvm; then
476 + local llvm_tests='lp_test_arit lp_test_arit lp_test_blend lp_test_blend lp_test_conv lp_test_conv lp_test_format lp_test_format lp_test_printf lp_test_printf'
477 + pushd src/gallium/drivers/llvmpipe >/dev/null || die
478 + emake ${llvm_tests}
479 + pax-mark m ${llvm_tests}
480 + popd >/dev/null || die
481 + fi
482 + emake check
483 +}
484 +
485 +pkg_postinst() {
486 + # Switch to the xorg implementation.
487 + echo
488 + eselect opengl set --use-old ${OPENGL_DIR}
489 +
490 + # Switch to mesa opencl
491 + if use opencl; then
492 + eselect opencl set --use-old ${PN}
493 + fi
494 +
495 + # run omxregister-bellagio to make the OpenMAX drivers known system-wide
496 + if use openmax; then
497 + ebegin "Registering OpenMAX drivers"
498 + BELLAGIO_SEARCH_PATH="${EPREFIX}/usr/$(get_libdir)/libomxil-bellagio0" \
499 + OMX_BELLAGIO_REGISTRY=${EPREFIX}/usr/share/mesa/xdg/.omxregister \
500 + omxregister-bellagio
501 + eend $?
502 + fi
503 +
504 + # warn about patent encumbered texture-float
505 + if use !bindist; then
506 + elog "USE=\"bindist\" was not set. Potentially patent encumbered code was"
507 + elog "enabled. Please see /usr/share/doc/${P}/patents.txt.bz2 for an"
508 + elog "explanation."
509 + fi
510 +}
511 +
512 +pkg_prerm() {
513 + if use openmax; then
514 + rm "${EPREFIX}"/usr/share/mesa/xdg/.omxregister
515 + fi
516 +}
517 +
518 +# $1 - VIDEO_CARDS flag
519 +# other args - names of DRI drivers to enable
520 +# TODO: avoid code duplication for a more elegant implementation
521 +driver_enable() {
522 + case $# in
523 + # for enabling unconditionally
524 + 1)
525 + DRI_DRIVERS+=",$1"
526 + ;;
527 + *)
528 + if use $1; then
529 + shift
530 + for i in $@; do
531 + DRI_DRIVERS+=",${i}"
532 + done
533 + fi
534 + ;;
535 + esac
536 +}
537 +
538 +gallium_enable() {
539 + case $# in
540 + # for enabling unconditionally
541 + 1)
542 + GALLIUM_DRIVERS+=",$1"
543 + ;;
544 + *)
545 + if use $1; then
546 + shift
547 + for i in $@; do
548 + GALLIUM_DRIVERS+=",${i}"
549 + done
550 + fi
551 + ;;
552 + esac
553 +}
554 +
555 +vulkan_enable() {
556 + case $# in
557 + # for enabling unconditionally
558 + 1)
559 + VULKAN_DRIVERS+=",$1"
560 + ;;
561 + *)
562 + if use $1; then
563 + shift
564 + for i in $@; do
565 + VULKAN_DRIVERS+=",${i}"
566 + done
567 + fi
568 + ;;
569 + esac
570 +}