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