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, 29 May 2017 04:10:54
Message-Id: 1496031005.6eeef284f6016410df4de620baa138d685456c9d.mattst88@gentoo
1 commit: 6eeef284f6016410df4de620baa138d685456c9d
2 Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
3 AuthorDate: Mon May 29 04:10:05 2017 +0000
4 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
5 CommitDate: Mon May 29 04:10:05 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6eeef284
7
8 media-libs/mesa: Version bump to 17.1.1
9
10 media-libs/mesa/Manifest | 1 +
11 media-libs/mesa/mesa-17.1.1.ebuild | 502 +++++++++++++++++++++++++++++++++++++
12 2 files changed, 503 insertions(+)
13
14 diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
15 index 68f541c65ce..44ba06c4f71 100644
16 --- a/media-libs/mesa/Manifest
17 +++ b/media-libs/mesa/Manifest
18 @@ -2,3 +2,4 @@ DIST mesa-13.0.5.tar.xz 9171480 SHA256 bfcea7e2c801525a60895c8aff11aa68457ee9aa3
19 DIST mesa-13.0.6.tar.xz 9179236 SHA256 29ef104a7fc082d352b1599bd6cb1d040be424ccd22f5e0eb7ee9b0e9acd3597 SHA512 2455e044647f674c2f1dd524143b61b8630713fa929bbf6fe1c981436a9c08dc933553d638a22b32d2799afb77be746355b48b1b20af172141c5b63891e94441 WHIRLPOOL 1fdaaf29de96225cf41a3bdeb559a35cf20fda524f80985b2bfdc52095dcb7f6b320704b7ccf754a6f80555925a6a80dfa2b1115a4bdd9bdc1ebb672f115208a
20 DIST mesa-17.0.6.tar.xz 9494872 SHA256 89ecf3bcd0f18dcca5aaa42bf36bb52a2df33be89889f94aaaad91f7a504a69d SHA512 537d28aa694c2d48811d2467e33b3adc841067d5f1cdb7e0809ba100f71869090285bbb246e57e5f0177401a539b44cc32b1ccfcb32a1855c14b011b92d32eaf WHIRLPOOL f3ee87377e87cbd23bd9009d840e6c0ae50ccbbb30cfa7be61f3023cbe9519f5b50f22c59dbcc207a106a6e357d77074fcaee63916ee091b920cbc3d511ec2ab
21 DIST mesa-17.1.0.tar.xz 9849580 SHA256 cf234a6ed4764673886b6661553b54675776ef0898f774716173cec890ac3b17 SHA512 9730e989ec2731e9b1df7515104d585af3fb7234f40fa13e8974910784db24c25e06d0c546af85de6a9c562212b6784932510c607f5f4b8061194a6429a64af3 WHIRLPOOL f7ed68bd0888f58012aa9505cf078d0670e90aa3983e45cc3c60dc55594a19096edead339872d5a2111d563b195f11aba99caba60197a7b02bec58f0ff23d754
22 +DIST mesa-17.1.1.tar.xz 9854480 SHA256 aed503f94c0c1630a162a3e276f4ee12a86764cee4cb92338ea2dea99a04e7ef SHA512 4679b8c1a957e515e9f7a6658f2264d4c458379a37fa8f64c9ef03e817857a683fc527a8172d3ae68ca5ebc84a1a78264e18807704c5130c95efdf0431502bc7 WHIRLPOOL e34aef05bc9f6256a717de1d47f445fedbe5981836724b31e6d0ee801a26b23da9c70acdbfc86d2b676f494ba2c47bf24d8ed0c5c8fb3774fba28443d47578d4
23
24 diff --git a/media-libs/mesa/mesa-17.1.1.ebuild b/media-libs/mesa/mesa-17.1.1.ebuild
25 new file mode 100644
26 index 00000000000..ef15690a372
27 --- /dev/null
28 +++ b/media-libs/mesa/mesa-17.1.1.ebuild
29 @@ -0,0 +1,502 @@
30 +# Copyright 1999-2017 Gentoo Foundation
31 +# Distributed under the terms of the GNU General Public License v2
32 +
33 +EAPI=6
34 +
35 +EGIT_REPO_URI="https://anongit.freedesktop.org/git/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/"
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 +INTEL_CARDS="i915 i965 intel"
65 +RADEON_CARDS="r100 r200 r300 r600 radeon radeonsi"
66 +VIDEO_CARDS="${INTEL_CARDS} ${RADEON_CARDS} freedreno imx nouveau vc4 vivante vmware"
67 +for card in ${VIDEO_CARDS}; do
68 + IUSE_VIDEO_CARDS+=" video_cards_${card}"
69 +done
70 +
71 +IUSE="${IUSE_VIDEO_CARDS}
72 + bindist +classic d3d9 debug +dri3 +egl +gallium +gbm gles1 gles2 unwind
73 + +llvm +nptl opencl osmesa pax_kernel openmax pic selinux vaapi valgrind
74 + vdpau vulkan wayland xvmc xa"
75 +
76 +REQUIRED_USE="
77 + d3d9? ( dri3 gallium )
78 + llvm? ( gallium )
79 + opencl? ( gallium llvm )
80 + openmax? ( gallium )
81 + gles1? ( egl )
82 + gles2? ( egl )
83 + vaapi? ( gallium )
84 + vdpau? ( gallium )
85 + vulkan? ( || ( video_cards_i965 video_cards_radeonsi )
86 + video_cards_radeonsi? ( llvm ) )
87 + wayland? ( egl gbm )
88 + xa? ( gallium )
89 + video_cards_freedreno? ( gallium )
90 + video_cards_intel? ( classic )
91 + video_cards_i915? ( || ( classic gallium ) )
92 + video_cards_i965? ( classic )
93 + video_cards_imx? ( gallium )
94 + video_cards_nouveau? ( || ( classic gallium ) )
95 + video_cards_radeon? ( || ( classic gallium )
96 + gallium? ( x86? ( llvm ) amd64? ( llvm ) ) )
97 + video_cards_r100? ( classic )
98 + video_cards_r200? ( classic )
99 + video_cards_r300? ( gallium x86? ( llvm ) amd64? ( llvm ) )
100 + video_cards_r600? ( gallium )
101 + video_cards_radeonsi? ( gallium llvm )
102 + video_cards_vivante? ( gallium gbm )
103 + video_cards_vmware? ( gallium )
104 +"
105 +
106 +LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.77"
107 +# keep correct libdrm and dri2proto dep
108 +# keep blocks in rdepend for binpkg
109 +RDEPEND="
110 + !<x11-base/xorg-server-1.7
111 + !<=x11-proto/xf86driproto-2.0.3
112 + abi_x86_32? ( !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)] )
113 + classic? ( app-eselect/eselect-mesa )
114 + gallium? ( app-eselect/eselect-mesa )
115 + >=app-eselect/eselect-opengl-1.3.0
116 + >=dev-libs/expat-2.1.0-r3:=[${MULTILIB_USEDEP}]
117 + >=sys-libs/zlib-1.2.8[${MULTILIB_USEDEP}]
118 + >=x11-libs/libX11-1.6.2:=[${MULTILIB_USEDEP}]
119 + >=x11-libs/libxshmfence-1.1:=[${MULTILIB_USEDEP}]
120 + >=x11-libs/libXdamage-1.1.4-r1:=[${MULTILIB_USEDEP}]
121 + >=x11-libs/libXext-1.3.2:=[${MULTILIB_USEDEP}]
122 + >=x11-libs/libXxf86vm-1.1.3:=[${MULTILIB_USEDEP}]
123 + >=x11-libs/libxcb-1.9.3:=[${MULTILIB_USEDEP}]
124 + x11-libs/libXfixes:=[${MULTILIB_USEDEP}]
125 + unwind? ( sys-libs/libunwind[${MULTILIB_USEDEP}] )
126 + llvm? (
127 + video_cards_radeonsi? (
128 + virtual/libelf:0=[${MULTILIB_USEDEP}]
129 + vulkan? ( >=sys-devel/llvm-3.9.0:=[${MULTILIB_USEDEP}] )
130 + )
131 + video_cards_r600? (
132 + virtual/libelf:0=[${MULTILIB_USEDEP}]
133 + )
134 + video_cards_radeon? (
135 + virtual/libelf:0=[${MULTILIB_USEDEP}]
136 + )
137 + >=sys-devel/llvm-3.6.0:=[${MULTILIB_USEDEP}]
138 + )
139 + opencl? (
140 + app-eselect/eselect-opencl
141 + dev-libs/libclc
142 + virtual/libelf:0=[${MULTILIB_USEDEP}]
143 + )
144 + openmax? ( >=media-libs/libomxil-bellagio-0.9.3:=[${MULTILIB_USEDEP}] )
145 + vaapi? (
146 + >=x11-libs/libva-1.6.0:=[${MULTILIB_USEDEP}]
147 + video_cards_nouveau? ( !<=x11-libs/libva-vdpau-driver-0.7.4-r3 )
148 + )
149 + vdpau? ( >=x11-libs/libvdpau-1.1:=[${MULTILIB_USEDEP}] )
150 + wayland? ( >=dev-libs/wayland-1.11.0:=[${MULTILIB_USEDEP}] )
151 + xvmc? ( >=x11-libs/libXvMC-1.0.8:=[${MULTILIB_USEDEP}] )
152 + ${LIBDRM_DEPSTRING}[video_cards_freedreno?,video_cards_nouveau?,video_cards_vc4?,video_cards_vivante?,video_cards_vmware?,${MULTILIB_USEDEP}]
153 +"
154 +for card in ${INTEL_CARDS}; do
155 + RDEPEND="${RDEPEND}
156 + video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
157 + "
158 +done
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 +# FIXME: kill the sys-devel/llvm[video_cards_radeon] compat once
170 +# LLVM < 3.9 is out of the game
171 +DEPEND="${RDEPEND}
172 + ${PYTHON_DEPS}
173 + llvm? (
174 + video_cards_radeonsi? ( || (
175 + sys-devel/llvm[llvm_targets_AMDGPU]
176 + sys-devel/llvm[video_cards_radeon]
177 + ) )
178 + )
179 + opencl? (
180 + >=sys-devel/llvm-3.6.0:=[${MULTILIB_USEDEP}]
181 + >=sys-devel/clang-3.6.0:=[${MULTILIB_USEDEP}]
182 + >=sys-devel/gcc-4.6
183 + )
184 + sys-devel/gettext
185 + virtual/pkgconfig
186 + valgrind? ( dev-util/valgrind )
187 + >=x11-proto/dri2proto-2.8-r1:=[${MULTILIB_USEDEP}]
188 + dri3? (
189 + >=x11-proto/dri3proto-1.0:=[${MULTILIB_USEDEP}]
190 + >=x11-proto/presentproto-1.0:=[${MULTILIB_USEDEP}]
191 + )
192 + >=x11-proto/glproto-1.4.17-r1:=[${MULTILIB_USEDEP}]
193 + >=x11-proto/xextproto-7.2.1-r1:=[${MULTILIB_USEDEP}]
194 + >=x11-proto/xf86driproto-2.1.1-r1:=[${MULTILIB_USEDEP}]
195 + >=x11-proto/xf86vidmodeproto-2.3.1-r1:=[${MULTILIB_USEDEP}]
196 +"
197 +[[ ${PV} == 9999 ]] && DEPEND+="
198 + sys-devel/bison
199 + sys-devel/flex
200 + $(python_gen_any_dep ">=dev-python/mako-0.7.3[\${PYTHON_USEDEP}]")
201 +"
202 +
203 +S="${WORKDIR}/${MY_P}"
204 +EGIT_CHECKOUT_DIR=${S}
205 +
206 +QA_WX_LOAD="
207 +x86? (
208 + !pic? (
209 + usr/lib*/libglapi.so.0.0.0
210 + usr/lib*/libGLESv1_CM.so.1.1.0
211 + usr/lib*/libGLESv2.so.2.0.0
212 + usr/lib*/libGL.so.1.2.0
213 + usr/lib*/libOSMesa.so.8.0.0
214 + )
215 +)"
216 +
217 +pkg_setup() {
218 + # warning message for bug 459306
219 + if use llvm && has_version sys-devel/llvm[!debug=]; then
220 + ewarn "Mismatch between debug USE flags in media-libs/mesa and sys-devel/llvm"
221 + ewarn "detected! This can cause problems. For details, see bug 459306."
222 + fi
223 +
224 + if use llvm || use opencl; then
225 + llvm_pkg_setup
226 + fi
227 + python-any-r1_pkg_setup
228 +}
229 +
230 +src_prepare() {
231 + [[ ${PV} == 9999 ]] && eautoreconf
232 + eapply_user
233 +}
234 +
235 +multilib_src_configure() {
236 + local myconf
237 +
238 + if use classic; then
239 + # Configurable DRI drivers
240 + driver_enable swrast
241 +
242 + # Intel code
243 + driver_enable video_cards_i915 i915
244 + driver_enable video_cards_i965 i965
245 + if ! use video_cards_i915 && \
246 + ! use video_cards_i965; then
247 + driver_enable video_cards_intel i915 i965
248 + fi
249 +
250 + # Nouveau code
251 + driver_enable video_cards_nouveau nouveau
252 +
253 + # ATI code
254 + driver_enable video_cards_r100 radeon
255 + driver_enable video_cards_r200 r200
256 + if ! use video_cards_r100 && \
257 + ! use video_cards_r200; then
258 + driver_enable video_cards_radeon radeon r200
259 + fi
260 + fi
261 +
262 + if use egl; then
263 + myconf+=" --with-egl-platforms=x11$(use wayland && echo ",wayland")$(use gbm && echo ",drm")"
264 + fi
265 +
266 + if use gallium; then
267 + myconf+="
268 + $(use_enable d3d9 nine)
269 + $(use_enable llvm)
270 + $(use_enable openmax omx)
271 + $(use_enable vaapi va)
272 + $(use_enable vdpau)
273 + $(use_enable xa)
274 + $(use_enable xvmc)
275 + "
276 + use vaapi && myconf+=" --with-va-libdir=/usr/$(get_libdir)/va/drivers"
277 +
278 + gallium_enable swrast
279 + gallium_enable video_cards_vc4 vc4
280 + gallium_enable video_cards_vivante etnaviv
281 + gallium_enable video_cards_vmware svga
282 + gallium_enable video_cards_nouveau nouveau
283 + gallium_enable video_cards_i915 i915
284 + gallium_enable video_cards_imx imx
285 + if ! use video_cards_i915 && \
286 + ! use video_cards_i965; then
287 + gallium_enable video_cards_intel i915
288 + fi
289 +
290 + gallium_enable video_cards_r300 r300
291 + gallium_enable video_cards_r600 r600
292 + gallium_enable video_cards_radeonsi radeonsi
293 + if ! use video_cards_r300 && \
294 + ! use video_cards_r600; then
295 + gallium_enable video_cards_radeon r300 r600
296 + fi
297 +
298 + gallium_enable video_cards_freedreno freedreno
299 + # opencl stuff
300 + if use opencl; then
301 + myconf+="
302 + $(use_enable opencl)
303 + --with-clang-libdir="${EPREFIX}/usr/lib"
304 + "
305 + fi
306 + fi
307 +
308 + if use vulkan; then
309 + vulkan_enable video_cards_i965 intel
310 + vulkan_enable video_cards_radeonsi radeon
311 + fi
312 +
313 + # x86 hardened pax_kernel needs glx-rts, bug 240956
314 + if [[ ${ABI} == x86 ]]; then
315 + myconf+=" $(use_enable pax_kernel glx-read-only-text)"
316 + fi
317 +
318 + # on abi_x86_32 hardened we need to have asm disable
319 + if [[ ${ABI} == x86* ]] && use pic; then
320 + myconf+=" --disable-asm"
321 + fi
322 +
323 + if use gallium; then
324 + myconf+=" $(use_enable osmesa gallium-osmesa)"
325 + else
326 + myconf+=" $(use_enable osmesa)"
327 + fi
328 +
329 + # build fails with BSD indent, bug #428112
330 + use userland_GNU || export INDENT=cat
331 +
332 + ECONF_SOURCE="${S}" \
333 + econf \
334 + --enable-dri \
335 + --enable-glx \
336 + --enable-shared-glapi \
337 + $(use_enable !bindist texture-float) \
338 + $(use_enable d3d9 nine) \
339 + $(use_enable debug) \
340 + $(use_enable dri3) \
341 + $(use_enable egl) \
342 + $(use_enable gbm) \
343 + $(use_enable gles1) \
344 + $(use_enable gles2) \
345 + $(use_enable nptl glx-tls) \
346 + $(use_enable unwind libunwind) \
347 + --enable-valgrind=$(usex valgrind auto no) \
348 + --enable-llvm-shared-libs \
349 + --with-dri-drivers=${DRI_DRIVERS} \
350 + --with-gallium-drivers=${GALLIUM_DRIVERS} \
351 + --with-vulkan-drivers=${VULKAN_DRIVERS} \
352 + PYTHON2="${PYTHON}" \
353 + ${myconf}
354 +}
355 +
356 +multilib_src_install() {
357 + emake install DESTDIR="${D}"
358 +
359 + if use classic || use gallium; then
360 + ebegin "Moving DRI/Gallium drivers for dynamic switching"
361 + local gallium_drivers=( i915_dri.so i965_dri.so r300_dri.so r600_dri.so swrast_dri.so )
362 + keepdir /usr/$(get_libdir)/dri
363 + dodir /usr/$(get_libdir)/mesa
364 + for x in ${gallium_drivers[@]}; do
365 + if [ -f "$(get_libdir)/gallium/${x}" ]; then
366 + mv -f "${ED}/usr/$(get_libdir)/dri/${x}" "${ED}/usr/$(get_libdir)/dri/${x/_dri.so/g_dri.so}" \
367 + || die "Failed to move ${x}"
368 + fi
369 + done
370 + if use classic; then
371 + emake -C "${BUILD_DIR}/src/mesa/drivers/dri" DESTDIR="${D}" install
372 + fi
373 + for x in "${ED}"/usr/$(get_libdir)/dri/*.so; do
374 + if [ -f ${x} -o -L ${x} ]; then
375 + mv -f "${x}" "${x/dri/mesa}" \
376 + || die "Failed to move ${x}"
377 + fi
378 + done
379 + pushd "${ED}"/usr/$(get_libdir)/dri || die "pushd failed"
380 + ln -s ../mesa/*.so . || die "Creating symlink failed"
381 + # remove symlinks to drivers known to eselect
382 + for x in ${gallium_drivers[@]}; do
383 + if [ -f ${x} -o -L ${x} ]; then
384 + rm "${x}" || die "Failed to remove ${x}"
385 + fi
386 + done
387 + popd
388 + eend $?
389 + fi
390 + if use opencl; then
391 + ebegin "Moving Gallium/Clover OpenCL implementation for dynamic switching"
392 + local cl_dir="/usr/$(get_libdir)/OpenCL/vendors/mesa"
393 + dodir ${cl_dir}/{lib,include}
394 + if [ -f "${ED}/usr/$(get_libdir)/libOpenCL.so" ]; then
395 + mv -f "${ED}"/usr/$(get_libdir)/libOpenCL.so* \
396 + "${ED}"${cl_dir}
397 + fi
398 + if [ -f "${ED}/usr/include/CL/opencl.h" ]; then
399 + mv -f "${ED}"/usr/include/CL \
400 + "${ED}"${cl_dir}/include
401 + fi
402 + eend $?
403 + fi
404 +
405 + if use openmax; then
406 + echo "XDG_DATA_DIRS=\"${EPREFIX}/usr/share/mesa/xdg\"" > "${T}/99mesaxdgomx"
407 + doenvd "${T}"/99mesaxdgomx
408 + keepdir /usr/share/mesa/xdg
409 + fi
410 +}
411 +
412 +multilib_src_install_all() {
413 + find "${ED}" -name '*.la' -delete
414 + einstalldocs
415 +
416 + if use !bindist; then
417 + dodoc docs/patents.txt
418 + fi
419 +
420 + # Install config file for eselect mesa
421 + insinto /usr/share/mesa
422 + newins "${FILESDIR}/eselect-mesa.conf.9.2" eselect-mesa.conf
423 +}
424 +
425 +multilib_src_test() {
426 + if use llvm; then
427 + 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'
428 + pushd src/gallium/drivers/llvmpipe >/dev/null || die
429 + emake ${llvm_tests}
430 + pax-mark m ${llvm_tests}
431 + popd >/dev/null || die
432 + fi
433 + emake check
434 +}
435 +
436 +pkg_postinst() {
437 + # Switch to the xorg implementation.
438 + echo
439 + eselect opengl set --use-old ${OPENGL_DIR}
440 +
441 + # Select classic/gallium drivers
442 + if use classic || use gallium; then
443 + eselect mesa set --auto
444 + fi
445 +
446 + # Switch to mesa opencl
447 + if use opencl; then
448 + eselect opencl set --use-old ${PN}
449 + fi
450 +
451 + # run omxregister-bellagio to make the OpenMAX drivers known system-wide
452 + if use openmax; then
453 + ebegin "Registering OpenMAX drivers"
454 + BELLAGIO_SEARCH_PATH="${EPREFIX}/usr/$(get_libdir)/libomxil-bellagio0" \
455 + OMX_BELLAGIO_REGISTRY=${EPREFIX}/usr/share/mesa/xdg/.omxregister \
456 + omxregister-bellagio
457 + eend $?
458 + fi
459 +
460 + # warn about patent encumbered texture-float
461 + if use !bindist; then
462 + elog "USE=\"bindist\" was not set. Potentially patent encumbered code was"
463 + elog "enabled. Please see patents.txt for an explanation."
464 + fi
465 +
466 + if ! has_version media-libs/libtxc_dxtn; then
467 + elog "Note that in order to have full S3TC support, it is necessary to install"
468 + elog "media-libs/libtxc_dxtn as well. This may be necessary to get nice"
469 + elog "textures in some apps, and some others even require this to run."
470 + fi
471 +}
472 +
473 +pkg_prerm() {
474 + if use openmax; then
475 + rm "${EPREFIX}"/usr/share/mesa/xdg/.omxregister
476 + fi
477 +}
478 +
479 +# $1 - VIDEO_CARDS flag
480 +# other args - names of DRI drivers to enable
481 +# TODO: avoid code duplication for a more elegant implementation
482 +driver_enable() {
483 + case $# in
484 + # for enabling unconditionally
485 + 1)
486 + DRI_DRIVERS+=",$1"
487 + ;;
488 + *)
489 + if use $1; then
490 + shift
491 + for i in $@; do
492 + DRI_DRIVERS+=",${i}"
493 + done
494 + fi
495 + ;;
496 + esac
497 +}
498 +
499 +gallium_enable() {
500 + case $# in
501 + # for enabling unconditionally
502 + 1)
503 + GALLIUM_DRIVERS+=",$1"
504 + ;;
505 + *)
506 + if use $1; then
507 + shift
508 + for i in $@; do
509 + GALLIUM_DRIVERS+=",${i}"
510 + done
511 + fi
512 + ;;
513 + esac
514 +}
515 +
516 +vulkan_enable() {
517 + case $# in
518 + # for enabling unconditionally
519 + 1)
520 + VULKAN_DRIVERS+=",$1"
521 + ;;
522 + *)
523 + if use $1; then
524 + shift
525 + for i in $@; do
526 + VULKAN_DRIVERS+=",${i}"
527 + done
528 + fi
529 + ;;
530 + esac
531 +}