Gentoo Archives: gentoo-commits

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