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