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, 12 May 2018 00:10:34
Message-Id: 1526083794.caedef144303306ae1f5308c52a36842e610ed2e.mattst88@gentoo
1 commit: caedef144303306ae1f5308c52a36842e610ed2e
2 Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
3 AuthorDate: Sat May 12 00:09:32 2018 +0000
4 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
5 CommitDate: Sat May 12 00:09:54 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=caedef14
7
8 media-libs/mesa: Version bump to 18.1.0_rc4
9
10 media-libs/mesa/Manifest | 1 +
11 media-libs/mesa/mesa-18.1.0_rc4.ebuild | 572 +++++++++++++++++++++++++++++++++
12 2 files changed, 573 insertions(+)
13
14 diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
15 index 3094d906a23..1c7a0e86077 100644
16 --- a/media-libs/mesa/Manifest
17 +++ b/media-libs/mesa/Manifest
18 @@ -2,3 +2,4 @@ DIST mesa-17.3.9.tar.xz 10660456 BLAKE2B 54f4a75f9040e50e9eea8f5c52a276578379d25
19 DIST mesa-18.0.2.tar.xz 10949364 BLAKE2B 8b0557db70f61ac39df96e923383e41008f483ae2f89b3723e94e644cb2ced81a7996d61009acaebaf7813843742a24351a573c80f1173615e6c0302552cf621 SHA512 77d24d01c4c22596d28421aeb74932ff232730a4f556ae1a2e8777ece2876e4e352679575385c065505df4a2a83d2c1cf30db92dcf88038417e36a2768332d7e
20 DIST mesa-18.0.3.tar.xz 10922936 BLAKE2B 7281579b39b3fcff7fbe56576c1345954f47f42edaceea2ee02d99f3fd704704bfdcfd698ae78c4756df16acac9f0a297a3248e46e2c2aca61d7291df7b0b521 SHA512 decd050bab049d17bcde3f832d4da0ffdb80f147c99377a162739bbe72fd6fd32b51e56e6fc66895b8c30fc19a1815bae164b21aa557816c3998ad18c1ffca2d
21 DIST mesa-18.1.0-rc3.tar.xz 11121648 BLAKE2B ad36da5de124cf1d7d785e26a3b9ac6cad492313d342e011d29b2c6bbb96e3af2fe377f0f6857743696ef056e7e80ec9eb4bde60a8510dfbdaa060802d5b4aff SHA512 aae834672ce2ce28c9223626019b7ade5908919e9c2423ded070b215248b502dc1cc24e5c12527e28ae23ddce0b37e69c5d777ff923143c273f0a775ee215fc0
22 +DIST mesa-18.1.0-rc4.tar.xz 11118452 BLAKE2B 4f38f8b77650077244f91ab688a93eb4827961e1b34e6376c63fce43be2b73239e77086dc9fb91c7cbc9f748287402463b24bd2b4da841e905452e34d7da6f84 SHA512 5a00e12cf588a7ea165b096d67d36d53899d6fea9922e6c09eb6fc3acc99a004e0baf3af06277c920e14f4c9685af7d5e4ee6096d9a8c1bc3a6456775af57d23
23
24 diff --git a/media-libs/mesa/mesa-18.1.0_rc4.ebuild b/media-libs/mesa/mesa-18.1.0_rc4.ebuild
25 new file mode 100644
26 index 00000000000..cf00b47b8bc
27 --- /dev/null
28 +++ b/media-libs/mesa/mesa-18.1.0_rc4.ebuild
29 @@ -0,0 +1,572 @@
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://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/ 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 )
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 + classic? ( app-eselect/eselect-mesa )
110 + gallium? ( app-eselect/eselect-mesa )
111 + >=app-eselect/eselect-opengl-1.3.0
112 + >=dev-libs/expat-2.1.0-r3:=[${MULTILIB_USEDEP}]
113 + >=sys-libs/zlib-1.2.8[${MULTILIB_USEDEP}]
114 + >=x11-libs/libX11-1.6.2:=[${MULTILIB_USEDEP}]
115 + >=x11-libs/libxshmfence-1.1:=[${MULTILIB_USEDEP}]
116 + >=x11-libs/libXdamage-1.1.4-r1:=[${MULTILIB_USEDEP}]
117 + >=x11-libs/libXext-1.3.2:=[${MULTILIB_USEDEP}]
118 + >=x11-libs/libXxf86vm-1.1.3:=[${MULTILIB_USEDEP}]
119 + >=x11-libs/libxcb-1.13:=[${MULTILIB_USEDEP}]
120 + x11-libs/libXfixes:=[${MULTILIB_USEDEP}]
121 + unwind? ( sys-libs/libunwind[${MULTILIB_USEDEP}] )
122 + llvm? (
123 + video_cards_radeonsi? (
124 + virtual/libelf:0=[${MULTILIB_USEDEP}]
125 + )
126 + video_cards_r600? (
127 + virtual/libelf:0=[${MULTILIB_USEDEP}]
128 + )
129 + video_cards_radeon? (
130 + virtual/libelf:0=[${MULTILIB_USEDEP}]
131 + )
132 + )
133 + opencl? (
134 + app-eselect/eselect-opencl
135 + dev-libs/libclc
136 + virtual/libelf:0=[${MULTILIB_USEDEP}]
137 + )
138 + openmax? (
139 + >=media-libs/libomxil-bellagio-0.9.3:=[${MULTILIB_USEDEP}]
140 + x11-misc/xdg-utils
141 + )
142 + vaapi? (
143 + >=x11-libs/libva-1.7.3:=[${MULTILIB_USEDEP}]
144 + video_cards_nouveau? ( !<=x11-libs/libva-vdpau-driver-0.7.4-r3 )
145 + )
146 + vdpau? ( >=x11-libs/libvdpau-1.1:=[${MULTILIB_USEDEP}] )
147 + wayland? (
148 + >=dev-libs/wayland-1.11.0:=[${MULTILIB_USEDEP}]
149 + >=dev-libs/wayland-protocols-1.8
150 + )
151 + xvmc? ( >=x11-libs/libXvMC-1.0.8:=[${MULTILIB_USEDEP}] )
152 + ${LIBDRM_DEPSTRING}[video_cards_freedreno?,video_cards_nouveau?,video_cards_vc4?,video_cards_vivante?,video_cards_vmware?,${MULTILIB_USEDEP}]
153 +
154 + video_cards_intel? (
155 + !video_cards_i965? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
156 + )
157 + video_cards_i915? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
158 +"
159 +for card in ${RADEON_CARDS}; do
160 + RDEPEND="${RDEPEND}
161 + video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_radeon] )
162 + "
163 +done
164 +RDEPEND="${RDEPEND}
165 + video_cards_radeonsi? ( ${LIBDRM_DEPSTRING}[video_cards_amdgpu] )
166 +"
167 +
168 +# Please keep the LLVM dependency block separate. Since LLVM is slotted,
169 +# we need to *really* make sure we're not pulling one than more slot
170 +# simultaneously.
171 +#
172 +# How to use it:
173 +# 1. List all the working slots (with min versions) in ||, newest first.
174 +# 2. Update the := to specify *max* version, e.g. < 7.
175 +# 3. Specify LLVM_MAX_SLOT, e.g. 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_user
304 + [[ ${PV} == 9999 ]] && eautoreconf
305 +}
306 +
307 +multilib_src_configure() {
308 + local myconf
309 +
310 + if use classic; then
311 + # Configurable DRI drivers
312 + driver_enable swrast
313 +
314 + # Intel code
315 + driver_enable video_cards_i915 i915
316 + driver_enable video_cards_i965 i965
317 + if ! use video_cards_i915 && \
318 + ! use video_cards_i965; then
319 + driver_enable video_cards_intel i915 i965
320 + fi
321 +
322 + # Nouveau code
323 + driver_enable video_cards_nouveau nouveau
324 +
325 + # ATI code
326 + driver_enable video_cards_r100 radeon
327 + driver_enable video_cards_r200 r200
328 + if ! use video_cards_r100 && \
329 + ! use video_cards_r200; then
330 + driver_enable video_cards_radeon radeon r200
331 + fi
332 + fi
333 +
334 + if use egl; then
335 + myconf+=" --with-platforms=x11,surfaceless$(use wayland && echo ",wayland")$(use gbm && echo ",drm")"
336 + fi
337 +
338 + if use gallium; then
339 + myconf+="
340 + $(use_enable d3d9 nine)
341 + $(use_enable llvm)
342 + $(use_enable openmax omx-bellagio)
343 + $(use_enable vaapi va)
344 + $(use_enable vdpau)
345 + $(use_enable xa)
346 + $(use_enable xvmc)
347 + "
348 + use vaapi && myconf+=" --with-va-libdir=/usr/$(get_libdir)/va/drivers"
349 +
350 + gallium_enable swrast
351 + gallium_enable video_cards_vc4 vc4
352 + gallium_enable video_cards_vivante etnaviv
353 + gallium_enable video_cards_vmware svga
354 + gallium_enable video_cards_nouveau nouveau
355 + gallium_enable video_cards_i915 i915
356 + gallium_enable video_cards_imx imx
357 + if ! use video_cards_i915 && \
358 + ! use video_cards_i965; then
359 + gallium_enable video_cards_intel i915
360 + fi
361 +
362 + gallium_enable video_cards_r300 r300
363 + gallium_enable video_cards_r600 r600
364 + gallium_enable video_cards_radeonsi radeonsi
365 + if ! use video_cards_r300 && \
366 + ! use video_cards_r600; then
367 + gallium_enable video_cards_radeon r300 r600
368 + fi
369 +
370 + gallium_enable video_cards_freedreno freedreno
371 + # opencl stuff
372 + if use opencl; then
373 + myconf+="
374 + $(use_enable opencl)
375 + --with-clang-libdir="${EPREFIX}/usr/lib"
376 + "
377 + fi
378 +
379 + gallium_enable video_cards_virgl virgl
380 + fi
381 +
382 + if use vulkan; then
383 + vulkan_enable video_cards_i965 intel
384 + vulkan_enable video_cards_radeonsi radeon
385 + fi
386 +
387 + # x86 hardened pax_kernel needs glx-rts, bug 240956
388 + if [[ ${ABI} == x86 ]]; then
389 + myconf+=" $(use_enable pax_kernel glx-read-only-text)"
390 + fi
391 +
392 + # on abi_x86_32 hardened we need to have asm disable
393 + if [[ ${ABI} == x86* ]] && use pic; then
394 + myconf+=" --disable-asm"
395 + fi
396 +
397 + if use gallium; then
398 + myconf+=" $(use_enable osmesa gallium-osmesa)"
399 + else
400 + myconf+=" $(use_enable osmesa)"
401 + fi
402 +
403 + # build fails with BSD indent, bug #428112
404 + use userland_GNU || export INDENT=cat
405 +
406 + ECONF_SOURCE="${S}" \
407 + econf \
408 + --enable-dri \
409 + --enable-glx \
410 + --enable-shared-glapi \
411 + $(use_enable !bindist texture-float) \
412 + $(use_enable d3d9 nine) \
413 + $(use_enable debug) \
414 + $(use_enable dri3) \
415 + $(use_enable egl) \
416 + $(use_enable gbm) \
417 + $(use_enable gles1) \
418 + $(use_enable gles2) \
419 + $(use_enable nptl glx-tls) \
420 + $(use_enable unwind libunwind) \
421 + --enable-valgrind=$(usex valgrind auto no) \
422 + --enable-llvm-shared-libs \
423 + --disable-opencl-icd \
424 + --with-dri-drivers=${DRI_DRIVERS} \
425 + --with-gallium-drivers=${GALLIUM_DRIVERS} \
426 + --with-vulkan-drivers=${VULKAN_DRIVERS} \
427 + PYTHON2="${PYTHON}" \
428 + ${myconf}
429 +}
430 +
431 +multilib_src_install() {
432 + emake install DESTDIR="${D}"
433 +
434 + if use classic || use gallium; then
435 + ebegin "Moving DRI/Gallium drivers for dynamic switching"
436 + local gallium_drivers=( i915_dri.so i965_dri.so r300_dri.so r600_dri.so swrast_dri.so )
437 + keepdir /usr/$(get_libdir)/dri
438 + dodir /usr/$(get_libdir)/mesa
439 + for x in ${gallium_drivers[@]}; do
440 + if [ -f "$(get_libdir)/gallium/${x}" ]; then
441 + mv -f "${ED}/usr/$(get_libdir)/dri/${x}" "${ED}/usr/$(get_libdir)/dri/${x/_dri.so/g_dri.so}" \
442 + || die "Failed to move ${x}"
443 + fi
444 + done
445 + if use classic; then
446 + emake -C "${BUILD_DIR}/src/mesa/drivers/dri" DESTDIR="${D}" install
447 + fi
448 + for x in "${ED}"/usr/$(get_libdir)/dri/*.so; do
449 + if [ -f ${x} -o -L ${x} ]; then
450 + mv -f "${x}" "${x/dri/mesa}" \
451 + || die "Failed to move ${x}"
452 + fi
453 + done
454 + pushd "${ED}"/usr/$(get_libdir)/dri || die "pushd failed"
455 + ln -s ../mesa/*.so . || die "Creating symlink failed"
456 + # remove symlinks to drivers known to eselect
457 + for x in ${gallium_drivers[@]}; do
458 + if [ -f ${x} -o -L ${x} ]; then
459 + rm "${x}" || die "Failed to remove ${x}"
460 + fi
461 + done
462 + popd
463 + eend $?
464 + fi
465 + if use opencl; then
466 + ebegin "Moving Gallium/Clover OpenCL implementation for dynamic switching"
467 + local cl_dir="/usr/$(get_libdir)/OpenCL/vendors/mesa"
468 + dodir ${cl_dir}/{lib,include}
469 + if [ -f "${ED}/usr/$(get_libdir)/libOpenCL.so" ]; then
470 + mv -f "${ED}"/usr/$(get_libdir)/libOpenCL.so* \
471 + "${ED}"${cl_dir}
472 + fi
473 + if [ -f "${ED}/usr/include/CL/opencl.h" ]; then
474 + mv -f "${ED}"/usr/include/CL \
475 + "${ED}"${cl_dir}/include
476 + fi
477 + eend $?
478 + fi
479 +
480 + if use openmax; then
481 + echo "XDG_DATA_DIRS=\"${EPREFIX}/usr/share/mesa/xdg\"" > "${T}/99mesaxdgomx"
482 + doenvd "${T}"/99mesaxdgomx
483 + keepdir /usr/share/mesa/xdg
484 + fi
485 +}
486 +
487 +multilib_src_install_all() {
488 + find "${ED}" -name '*.la' -delete
489 + einstalldocs
490 +
491 + if use !bindist; then
492 + dodoc docs/patents.txt
493 + fi
494 +
495 + # Install config file for eselect mesa
496 + insinto /usr/share/mesa
497 + newins "${FILESDIR}/eselect-mesa.conf.9.2" eselect-mesa.conf
498 +}
499 +
500 +multilib_src_test() {
501 + if use llvm; then
502 + 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'
503 + pushd src/gallium/drivers/llvmpipe >/dev/null || die
504 + emake ${llvm_tests}
505 + pax-mark m ${llvm_tests}
506 + popd >/dev/null || die
507 + fi
508 + emake check
509 +}
510 +
511 +pkg_postinst() {
512 + # Switch to the xorg implementation.
513 + echo
514 + eselect opengl set --use-old ${OPENGL_DIR}
515 +
516 + # Select classic/gallium drivers
517 + if use classic || use gallium; then
518 + eselect mesa set --auto
519 + fi
520 +
521 + # Switch to mesa opencl
522 + if use opencl; then
523 + eselect opencl set --use-old ${PN}
524 + fi
525 +
526 + # run omxregister-bellagio to make the OpenMAX drivers known system-wide
527 + if use openmax; then
528 + ebegin "Registering OpenMAX drivers"
529 + BELLAGIO_SEARCH_PATH="${EPREFIX}/usr/$(get_libdir)/libomxil-bellagio0" \
530 + OMX_BELLAGIO_REGISTRY=${EPREFIX}/usr/share/mesa/xdg/.omxregister \
531 + omxregister-bellagio
532 + eend $?
533 + fi
534 +
535 + # warn about patent encumbered texture-float
536 + if use !bindist; then
537 + elog "USE=\"bindist\" was not set. Potentially patent encumbered code was"
538 + elog "enabled. Please see /usr/share/doc/${P}/patents.txt.bz2 for an"
539 + elog "explanation."
540 + fi
541 +}
542 +
543 +pkg_prerm() {
544 + if use openmax; then
545 + rm "${EPREFIX}"/usr/share/mesa/xdg/.omxregister
546 + fi
547 +}
548 +
549 +# $1 - VIDEO_CARDS flag
550 +# other args - names of DRI drivers to enable
551 +# TODO: avoid code duplication for a more elegant implementation
552 +driver_enable() {
553 + case $# in
554 + # for enabling unconditionally
555 + 1)
556 + DRI_DRIVERS+=",$1"
557 + ;;
558 + *)
559 + if use $1; then
560 + shift
561 + for i in $@; do
562 + DRI_DRIVERS+=",${i}"
563 + done
564 + fi
565 + ;;
566 + esac
567 +}
568 +
569 +gallium_enable() {
570 + case $# in
571 + # for enabling unconditionally
572 + 1)
573 + GALLIUM_DRIVERS+=",$1"
574 + ;;
575 + *)
576 + if use $1; then
577 + shift
578 + for i in $@; do
579 + GALLIUM_DRIVERS+=",${i}"
580 + done
581 + fi
582 + ;;
583 + esac
584 +}
585 +
586 +vulkan_enable() {
587 + case $# in
588 + # for enabling unconditionally
589 + 1)
590 + VULKAN_DRIVERS+=",$1"
591 + ;;
592 + *)
593 + if use $1; then
594 + shift
595 + for i in $@; do
596 + VULKAN_DRIVERS+=",${i}"
597 + done
598 + fi
599 + ;;
600 + esac
601 +}