Gentoo Archives: gentoo-commits

From: Jory Pratt <anarchy@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/musl:master commit in: media-libs/mesa/
Date: Wed, 04 Jul 2018 23:31:52
Message-Id: 1530747062.466167bceff7108604768c11f8e042478bf8eae9.anarchy@gentoo
1 commit: 466167bceff7108604768c11f8e042478bf8eae9
2 Author: Jory A. Pratt <anarchy <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jul 4 23:30:17 2018 +0000
4 Commit: Jory Pratt <anarchy <AT> gentoo <DOT> org>
5 CommitDate: Wed Jul 4 23:31:02 2018 +0000
6 URL: https://gitweb.gentoo.org/proj/musl.git/commit/?id=466167bc
7
8 media-libs/mesa: Version bump, sync with changes in main tree
9
10 media-libs/mesa/Manifest | 1 +
11 media-libs/mesa/mesa-18.1.3.ebuild | 548 +++++++++++++++++++++++++++++++++++++
12 2 files changed, 549 insertions(+)
13
14 diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
15 index 79b3374..efa415e 100644
16 --- a/media-libs/mesa/Manifest
17 +++ b/media-libs/mesa/Manifest
18 @@ -1,3 +1,4 @@
19 DIST mesa-17.3.9.tar.xz 10660456 BLAKE2B 54f4a75f9040e50e9eea8f5c52a276578379d25d2a01ac4767ab12bee85fe5dae1492d5bb1df06b6e8c6b0fe960bbd5ea38691c75d08a6b4302c64377ce58e54 SHA512 83deffbc6b9823b8e93cccf57d7952106f3d55fea881e3924f9f9586f0e9347a6e3a1a36cc19c24af819f2fde3af9496652a6ff56132511a5618d5774404f63f
20 DIST mesa-18.0.5.tar.xz 10952996 BLAKE2B 708cdb2ef95a618430cd4e7eb45bcab0f6575774065b61f53787aa378385fe0dfa0b04f9c80c5426f9581851edc545a75c137777dc304ac8ba57465d365fcd50 SHA512 63b47cdca7f8282aab7aaa66233411f02918e5c4804b7a0010de2b1867fe90171e492ff031dfc4aa20968dfc99bd7dceb5d35fd44c709e54a2ece61175a60f3d
21 DIST mesa-18.1.1.tar.xz 11110892 BLAKE2B 05d48379109c1c3800d3d07b9f52e96b2cd4bc087517711ee752f89619afce0a0e09b7a9ede8b5d1807ceae3e2b506518657a0760c947f466121e2252f7eada3 SHA512 7783adc1ec7a1c3d092acfcca6b4ba19450c15a7f0d7f41fbf25e482236615d79ce24afe60959066ea7aa851df4f74fa3c569fa6d847ea79e6bfe046b8c65e90
22 +DIST mesa-18.1.3.tar.xz 11126236 BLAKE2B 2315cdc95130ef604a86e3886abf9b15e6c7944fab3b3cc020358dd08a76f2b876904516e5c081d549b16240ae4dedd647402dd7bd8de4c91015bb601c0c2923 SHA512 f6e5b81a80a309a36a04759d18364d3c71c48d1cb88f87b2f5432ef003092a22046e88ce2082031d5d52b60ba36f585d8df52e06ecc7a5158079936236f36887
23
24 diff --git a/media-libs/mesa/mesa-18.1.3.ebuild b/media-libs/mesa/mesa-18.1.3.ebuild
25 new file mode 100644
26 index 0000000..256a07b
27 --- /dev/null
28 +++ b/media-libs/mesa/mesa-18.1.3.ebuild
29 @@ -0,0 +1,548 @@
30 +# Copyright 1999-2018 Gentoo Foundation
31 +# Distributed under the terms of the GNU General Public License v2
32 +
33 +EAPI=6
34 +
35 +EGIT_REPO_URI="https://gitlab.freedesktop.org/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/ https://mesa.freedesktop.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 +RADEON_CARDS="r100 r200 r300 r600 radeon radeonsi"
65 +VIDEO_CARDS="${RADEON_CARDS} freedreno i915 i965 imx intel nouveau vc4 virgl vivante vmware"
66 +for card in ${VIDEO_CARDS}; do
67 + IUSE_VIDEO_CARDS+=" video_cards_${card}"
68 +done
69 +
70 +IUSE="${IUSE_VIDEO_CARDS}
71 + bindist +classic d3d9 debug +dri3 +egl +gallium +gbm gles1 gles2 unwind
72 + +llvm +nptl opencl osmesa pax_kernel openmax pic selinux vaapi valgrind
73 + vdpau vulkan wayland xvmc xa"
74 +
75 +REQUIRED_USE="
76 + d3d9? ( dri3 gallium )
77 + llvm? ( gallium )
78 + opencl? ( gallium llvm || ( video_cards_r600 video_cards_radeonsi ) )
79 + openmax? ( gallium )
80 + gles1? ( egl )
81 + gles2? ( egl )
82 + vaapi? ( gallium )
83 + vdpau? ( gallium )
84 + vulkan? ( || ( video_cards_i965 video_cards_radeonsi )
85 + video_cards_radeonsi? ( llvm ) )
86 + wayland? ( egl gbm )
87 + xa? ( gallium )
88 + video_cards_freedreno? ( gallium )
89 + video_cards_intel? ( classic )
90 + video_cards_i915? ( || ( classic gallium ) )
91 + video_cards_i965? ( classic )
92 + video_cards_imx? ( gallium video_cards_vivante )
93 + video_cards_nouveau? ( || ( classic gallium ) )
94 + video_cards_radeon? ( || ( classic gallium )
95 + gallium? ( x86? ( llvm ) amd64? ( llvm ) ) )
96 + video_cards_r100? ( classic )
97 + video_cards_r200? ( classic )
98 + video_cards_r300? ( gallium x86? ( llvm ) amd64? ( llvm ) )
99 + video_cards_r600? ( gallium )
100 + video_cards_radeonsi? ( gallium llvm )
101 + video_cards_vc4? ( gallium )
102 + video_cards_virgl? ( gallium )
103 + video_cards_vivante? ( gallium gbm )
104 + video_cards_vmware? ( gallium )
105 +"
106 +
107 +LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.91"
108 +RDEPEND="
109 + !app-eselect/eselect-mesa
110 + >=app-eselect/eselect-opengl-1.3.0
111 + >=dev-libs/expat-2.1.0-r3:=[${MULTILIB_USEDEP}]
112 + >=sys-libs/zlib-1.2.8[${MULTILIB_USEDEP}]
113 + >=x11-libs/libX11-1.6.2:=[${MULTILIB_USEDEP}]
114 + >=x11-libs/libxshmfence-1.1:=[${MULTILIB_USEDEP}]
115 + >=x11-libs/libXdamage-1.1.4-r1:=[${MULTILIB_USEDEP}]
116 + >=x11-libs/libXext-1.3.2:=[${MULTILIB_USEDEP}]
117 + >=x11-libs/libXxf86vm-1.1.3:=[${MULTILIB_USEDEP}]
118 + >=x11-libs/libxcb-1.13:=[${MULTILIB_USEDEP}]
119 + x11-libs/libXfixes:=[${MULTILIB_USEDEP}]
120 + unwind? ( sys-libs/libunwind[${MULTILIB_USEDEP}] )
121 + llvm? (
122 + video_cards_radeonsi? (
123 + virtual/libelf:0=[${MULTILIB_USEDEP}]
124 + )
125 + video_cards_r600? (
126 + virtual/libelf:0=[${MULTILIB_USEDEP}]
127 + )
128 + video_cards_radeon? (
129 + virtual/libelf:0=[${MULTILIB_USEDEP}]
130 + )
131 + )
132 + opencl? (
133 + app-eselect/eselect-opencl
134 + dev-libs/libclc
135 + virtual/libelf:0=[${MULTILIB_USEDEP}]
136 + )
137 + openmax? (
138 + >=media-libs/libomxil-bellagio-0.9.3:=[${MULTILIB_USEDEP}]
139 + x11-misc/xdg-utils
140 + )
141 + vaapi? (
142 + >=x11-libs/libva-1.7.3:=[${MULTILIB_USEDEP}]
143 + video_cards_nouveau? ( !<=x11-libs/libva-vdpau-driver-0.7.4-r3 )
144 + )
145 + vdpau? ( >=x11-libs/libvdpau-1.1:=[${MULTILIB_USEDEP}] )
146 + wayland? (
147 + >=dev-libs/wayland-1.15.0:=[${MULTILIB_USEDEP}]
148 + >=dev-libs/wayland-protocols-1.8
149 + )
150 + xvmc? ( >=x11-libs/libXvMC-1.0.8:=[${MULTILIB_USEDEP}] )
151 + ${LIBDRM_DEPSTRING}[video_cards_freedreno?,video_cards_nouveau?,video_cards_vc4?,video_cards_vivante?,video_cards_vmware?,${MULTILIB_USEDEP}]
152 +
153 + video_cards_intel? (
154 + !video_cards_i965? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
155 + )
156 + video_cards_i915? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
157 +"
158 +for card in ${RADEON_CARDS}; do
159 + RDEPEND="${RDEPEND}
160 + video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_radeon] )
161 + "
162 +done
163 +RDEPEND="${RDEPEND}
164 + video_cards_radeonsi? ( ${LIBDRM_DEPSTRING}[video_cards_amdgpu] )
165 +"
166 +
167 +# Please keep the LLVM dependency block separate. Since LLVM is slotted,
168 +# we need to *really* make sure we're not pulling one than more slot
169 +# simultaneously.
170 +#
171 +# How to use it:
172 +# 1. List all the working slots (with min versions) in ||, newest first.
173 +# 2. Update the := to specify *max* version, e.g. < 7.
174 +# 3. Specify LLVM_MAX_SLOT, e.g. 6.
175 +LLVM_MAX_SLOT="6"
176 +LLVM_DEPSTR="
177 + || (
178 + sys-devel/llvm:7[${MULTILIB_USEDEP}]
179 + sys-devel/llvm:6[${MULTILIB_USEDEP}]
180 + sys-devel/llvm:5[${MULTILIB_USEDEP}]
181 + sys-devel/llvm:4[${MULTILIB_USEDEP}]
182 + >=sys-devel/llvm-3.9.0:0[${MULTILIB_USEDEP}]
183 + )
184 + sys-devel/llvm:=[${MULTILIB_USEDEP}]
185 +"
186 +LLVM_DEPSTR_AMDGPU=${LLVM_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
187 +CLANG_DEPSTR=${LLVM_DEPSTR//llvm/clang}
188 +CLANG_DEPSTR_AMDGPU=${CLANG_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
189 +RDEPEND="${RDEPEND}
190 + llvm? (
191 + opencl? (
192 + video_cards_r600? (
193 + ${CLANG_DEPSTR_AMDGPU}
194 + )
195 + !video_cards_r600? (
196 + video_cards_radeonsi? (
197 + ${CLANG_DEPSTR_AMDGPU}
198 + )
199 + )
200 + !video_cards_r600? (
201 + !video_cards_radeonsi? (
202 + video_cards_radeon? (
203 + ${CLANG_DEPSTR_AMDGPU}
204 + )
205 + )
206 + )
207 + !video_cards_r600? (
208 + !video_cards_radeon? (
209 + !video_cards_radeonsi? (
210 + ${CLANG_DEPSTR}
211 + )
212 + )
213 + )
214 + )
215 + !opencl? (
216 + video_cards_r600? (
217 + ${LLVM_DEPSTR_AMDGPU}
218 + )
219 + !video_cards_r600? (
220 + video_cards_radeonsi? (
221 + ${LLVM_DEPSTR_AMDGPU}
222 + )
223 + )
224 + !video_cards_r600? (
225 + !video_cards_radeonsi? (
226 + video_cards_radeon? (
227 + ${LLVM_DEPSTR_AMDGPU}
228 + )
229 + )
230 + )
231 + !video_cards_r600? (
232 + !video_cards_radeon? (
233 + !video_cards_radeonsi? (
234 + ${LLVM_DEPSTR}
235 + )
236 + )
237 + )
238 + )
239 + )
240 +"
241 +unset {LLVM,CLANG}_DEPSTR{,_AMDGPU}
242 +
243 +DEPEND="${RDEPEND}
244 + ${PYTHON_DEPS}
245 + opencl? (
246 + >=sys-devel/gcc-4.6
247 + )
248 + sys-devel/gettext
249 + virtual/pkgconfig
250 + valgrind? ( dev-util/valgrind )
251 + x11-base/xorg-proto
252 + vulkan? (
253 + $(python_gen_any_dep ">=dev-python/mako-0.7.3[\${PYTHON_USEDEP}]")
254 + )
255 +"
256 +[[ ${PV} == 9999 ]] && DEPEND+="
257 + sys-devel/bison
258 + sys-devel/flex
259 + $(python_gen_any_dep ">=dev-python/mako-0.7.3[\${PYTHON_USEDEP}]")
260 +"
261 +
262 +S="${WORKDIR}/${MY_P}"
263 +EGIT_CHECKOUT_DIR=${S}
264 +
265 +QA_WX_LOAD="
266 +x86? (
267 + !pic? (
268 + usr/lib*/libglapi.so.0.0.0
269 + usr/lib*/libGLESv1_CM.so.1.1.0
270 + usr/lib*/libGLESv2.so.2.0.0
271 + usr/lib*/libGL.so.1.2.0
272 + usr/lib*/libOSMesa.so.8.0.0
273 + )
274 +)"
275 +
276 +llvm_check_deps() {
277 + local flags=${MULTILIB_USEDEP}
278 + if use video_cards_r600 || use video_cards_radeon || use video_cards_radeonsi
279 + then
280 + flags+=",llvm_targets_AMDGPU(-)"
281 + fi
282 +
283 + if use opencl; then
284 + has_version "sys-devel/clang[${flags}]" || return 1
285 + fi
286 + has_version "sys-devel/llvm[${flags}]"
287 +}
288 +
289 +pkg_setup() {
290 + # warning message for bug 459306
291 + if use llvm && has_version sys-devel/llvm[!debug=]; then
292 + ewarn "Mismatch between debug USE flags in media-libs/mesa and sys-devel/llvm"
293 + ewarn "detected! This can cause problems. For details, see bug 459306."
294 + fi
295 +
296 + if use llvm; then
297 + llvm_pkg_setup
298 + fi
299 + python-any-r1_pkg_setup
300 +}
301 +
302 +src_prepare() {
303 + eapply "${FILESDIR}"/${PN}-17-execinfo.patch
304 + eapply "${FILESDIR}"/${PN}-17-musl-string_h.patch
305 + eapply "${FILESDIR}"/${PN}-17-musl-invocation_name.patch
306 + eapply "${FILESDIR}"/${PN}-18-musl-pthread.patch
307 + eapply "${FILESDIR}"/${PN}-18-intel-missing-time_t.patch
308 +
309 + eapply_user
310 + [[ ${PV} == 9999 ]] && eautoreconf
311 +
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 +}