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