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