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: Tue, 14 Nov 2017 18:04:47
Message-Id: 1510682671.ae6794d3d71cf8b94d6e3afa78308af2a4441e50.mattst88@gentoo
1 commit: ae6794d3d71cf8b94d6e3afa78308af2a4441e50
2 Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
3 AuthorDate: Tue Nov 14 18:04:28 2017 +0000
4 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
5 CommitDate: Tue Nov 14 18:04:31 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ae6794d3
7
8 media-libs/mesa: Version bump to 17.3.0_rc4
9
10 media-libs/mesa/Manifest | 1 +
11 media-libs/mesa/mesa-17.3.0_rc4.ebuild | 585 +++++++++++++++++++++++++++++++++
12 2 files changed, 586 insertions(+)
13
14 diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
15 index 0293e1af113..df335c5a885 100644
16 --- a/media-libs/mesa/Manifest
17 +++ b/media-libs/mesa/Manifest
18 @@ -12,3 +12,4 @@ DIST mesa-17.2.4.tar.xz 10381984 SHA256 5ba408fecd6e1132e5490eec1a2f04466214e4c6
19 DIST mesa-17.2.5.tar.xz 10386312 SHA256 7f7f914b7b9ea0b15f2d9d01a4375e311b0e90e55683b8e8a67ce8691eb1070f SHA512 c4b0f7f48b0b57fdf610de3d61e127774f8223e755acfde6cf2649818eec985e8f925abf8a15d530ecdb882cb8d7268fd01e5d94c8ac6934551b8a74272353c7 WHIRLPOOL 51d066640824964acebc69e78ec368753c18833b0c0cdb940e6afb8326edc2a75c657d81c043d728ca66968608e59a128295e3f4863980c2dcaf6716f55d14d3
20 DIST mesa-17.3.0-rc2.tar.xz 10658696 SHA256 13b2c085a54836465a3b6814ad4bc2dae0a502f43405e75ced67789d5afc18cd SHA512 749cca3e0875dbff7b6fab4d646974ecbcc7659ec82ad025bc386372d6e0e050d84d5e05fb68c5099e685557d85daf55c6a5db7bd89a7323778ae7e87e01215e WHIRLPOOL 4007e6641de55145b9bf8bf7aa567c284d3a4b29ea6b83fb5ba3324abf757cf72cf1f1bc0cd3011e58b3d0c6cc6fa7f7c03b1affb7f0ba7c4a5e7ade398bf2f3
21 DIST mesa-17.3.0-rc3.tar.xz 10664384 SHA256 1f3677429018f6ef4167b31db9eef558827a649239aa685f54c1a400ff5462d9 SHA512 403da79ac87325f2f0962e9be406edf4d009b6f5d479c2943be5bc1a26ad201d96072461a0d041b5a59abe327829eeba0dfb44abce217074079c47811729b058 WHIRLPOOL 91a5f65bc1dc9dc27bcd8492d82c80d2827d2408030890fdcaa653993d9a1deec983b00cb48c0675f3234d36512396c03cc7659bd30cadd6e536f5bef90d65d9
22 +DIST mesa-17.3.0-rc4.tar.xz 10662396 SHA256 90c9283caa21c047aef013395776ca44037662450bbed188b4eea679084239be SHA512 410a43852944899fbc9d7ab887510dffda3cb98330d7acd5d529cb01abafe1886b353d050c918cd63ecb1b7afb9350e5ceddf8eabf6e8fd6bd4e6f87343f68cb WHIRLPOOL 43fa0b83683526abec04744a418f932d08ee2a566950ae0473c4795ec7905ff5edf6e7f75a64e1fb52ba7865a7b0b46de0c00eefd84715424b68a01eecb8e577
23
24 diff --git a/media-libs/mesa/mesa-17.3.0_rc4.ebuild b/media-libs/mesa/mesa-17.3.0_rc4.ebuild
25 new file mode 100644
26 index 00000000000..03a35c8a2c1
27 --- /dev/null
28 +++ b/media-libs/mesa/mesa-17.3.0_rc4.ebuild
29 @@ -0,0 +1,585 @@
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/ 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.85"
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 + >=sys-libs/zlib-1.2.8[${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 + unwind? ( sys-libs/libunwind[${MULTILIB_USEDEP}] )
127 + llvm? (
128 + video_cards_radeonsi? (
129 + virtual/libelf:0=[${MULTILIB_USEDEP}]
130 + )
131 + video_cards_r600? (
132 + virtual/libelf:0=[${MULTILIB_USEDEP}]
133 + )
134 + video_cards_radeon? (
135 + virtual/libelf:0=[${MULTILIB_USEDEP}]
136 + )
137 + )
138 + opencl? (
139 + app-eselect/eselect-opencl
140 + dev-libs/libclc
141 + virtual/libelf:0=[${MULTILIB_USEDEP}]
142 + )
143 + openmax? ( >=media-libs/libomxil-bellagio-0.9.3:=[${MULTILIB_USEDEP}] )
144 + vaapi? (
145 + >=x11-libs/libva-1.7.3:=[${MULTILIB_USEDEP}]
146 + video_cards_nouveau? ( !<=x11-libs/libva-vdpau-driver-0.7.4-r3 )
147 + )
148 + vdpau? ( >=x11-libs/libvdpau-1.1:=[${MULTILIB_USEDEP}] )
149 + wayland? (
150 + >=dev-libs/wayland-1.11.0:=[${MULTILIB_USEDEP}]
151 + >=dev-libs/wayland-protocols-1.8
152 + )
153 + xvmc? ( >=x11-libs/libXvMC-1.0.8:=[${MULTILIB_USEDEP}] )
154 + ${LIBDRM_DEPSTRING}[video_cards_freedreno?,video_cards_nouveau?,video_cards_vc4?,video_cards_vivante?,video_cards_vmware?,${MULTILIB_USEDEP}]
155 +
156 + video_cards_intel? (
157 + !video_cards_i965? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
158 + )
159 + video_cards_i915? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
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 +# Please keep the LLVM dependency block separate. Since LLVM is slotted,
171 +# we need to *really* make sure we're not pulling one than more slot
172 +# simultaneously.
173 +#
174 +# How to use it:
175 +# 1. List all the working slots (with min versions) in ||, newest first.
176 +# 2. Update the := to specify *max* version, e.g. < 7.
177 +# 3. Specify LLVM_MAX_SLOT, e.g. 6.
178 +LLVM_DEPSTR="
179 + || (
180 + sys-devel/llvm:6[${MULTILIB_USEDEP}]
181 + sys-devel/llvm:5[${MULTILIB_USEDEP}]
182 + sys-devel/llvm:4[${MULTILIB_USEDEP}]
183 + >=sys-devel/llvm-3.9.0:0[${MULTILIB_USEDEP}]
184 + )
185 + sys-devel/llvm:=[${MULTILIB_USEDEP}]
186 +"
187 +LLVM_DEPSTR_AMDGPU=${LLVM_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
188 +CLANG_DEPSTR=${LLVM_DEPSTR//llvm/clang}
189 +CLANG_DEPSTR_AMDGPU=${CLANG_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
190 +RDEPEND="${RDEPEND}
191 + llvm? (
192 + opencl? (
193 + video_cards_r600? (
194 + ${CLANG_DEPSTR_AMDGPU}
195 + )
196 + !video_cards_r600? (
197 + video_cards_radeonsi? (
198 + ${CLANG_DEPSTR_AMDGPU}
199 + )
200 + )
201 + !video_cards_r600? (
202 + !video_cards_radeonsi? (
203 + video_cards_radeon? (
204 + ${CLANG_DEPSTR_AMDGPU}
205 + )
206 + )
207 + )
208 + !video_cards_r600? (
209 + !video_cards_radeon? (
210 + !video_cards_radeonsi? (
211 + ${CLANG_DEPSTR}
212 + )
213 + )
214 + )
215 + )
216 + !opencl? (
217 + video_cards_r600? (
218 + ${LLVM_DEPSTR_AMDGPU}
219 + )
220 + !video_cards_r600? (
221 + video_cards_radeonsi? (
222 + ${LLVM_DEPSTR_AMDGPU}
223 + )
224 + )
225 + !video_cards_r600? (
226 + !video_cards_radeonsi? (
227 + video_cards_radeon? (
228 + ${LLVM_DEPSTR_AMDGPU}
229 + )
230 + )
231 + )
232 + !video_cards_r600? (
233 + !video_cards_radeon? (
234 + !video_cards_radeonsi? (
235 + ${LLVM_DEPSTR}
236 + )
237 + )
238 + )
239 + )
240 + )
241 +"
242 +unset {LLVM,CLANG}_DEPSTR{,_AMDGPU}
243 +
244 +DEPEND="${RDEPEND}
245 + ${PYTHON_DEPS}
246 + opencl? (
247 + >=sys-devel/gcc-4.6
248 + )
249 + sys-devel/gettext
250 + virtual/pkgconfig
251 + valgrind? ( dev-util/valgrind )
252 + >=x11-proto/dri2proto-2.8-r1:=[${MULTILIB_USEDEP}]
253 + dri3? (
254 + >=x11-proto/dri3proto-1.0:=[${MULTILIB_USEDEP}]
255 + >=x11-proto/presentproto-1.0:=[${MULTILIB_USEDEP}]
256 + )
257 + >=x11-proto/glproto-1.4.17-r1:=[${MULTILIB_USEDEP}]
258 + >=x11-proto/xextproto-7.2.1-r1:=[${MULTILIB_USEDEP}]
259 + >=x11-proto/xf86driproto-2.1.1-r1:=[${MULTILIB_USEDEP}]
260 + >=x11-proto/xf86vidmodeproto-2.3.1-r1:=[${MULTILIB_USEDEP}]
261 + vulkan? (
262 + $(python_gen_any_dep ">=dev-python/mako-0.7.3[\${PYTHON_USEDEP}]")
263 + )
264 +"
265 +[[ ${PV} == 9999 ]] && DEPEND+="
266 + sys-devel/bison
267 + sys-devel/flex
268 + $(python_gen_any_dep ">=dev-python/mako-0.7.3[\${PYTHON_USEDEP}]")
269 +"
270 +
271 +S="${WORKDIR}/${MY_P}"
272 +EGIT_CHECKOUT_DIR=${S}
273 +
274 +QA_WX_LOAD="
275 +x86? (
276 + !pic? (
277 + usr/lib*/libglapi.so.0.0.0
278 + usr/lib*/libGLESv1_CM.so.1.1.0
279 + usr/lib*/libGLESv2.so.2.0.0
280 + usr/lib*/libGL.so.1.2.0
281 + usr/lib*/libOSMesa.so.8.0.0
282 + )
283 +)"
284 +
285 +llvm_check_deps() {
286 + local flags=${MULTILIB_USEDEP}
287 + if use video_cards_r600 || use video_cards_radeon || use video_cards_radeonsi
288 + then
289 + flags+=",llvm_targets_AMDGPU(-)"
290 + fi
291 +
292 + if use opencl; then
293 + has_version "sys-devel/clang[${flags}]" || return 1
294 + fi
295 + has_version "sys-devel/llvm[${flags}]"
296 +}
297 +
298 +pkg_setup() {
299 + # warning message for bug 459306
300 + if use llvm && has_version sys-devel/llvm[!debug=]; then
301 + ewarn "Mismatch between debug USE flags in media-libs/mesa and sys-devel/llvm"
302 + ewarn "detected! This can cause problems. For details, see bug 459306."
303 + fi
304 +
305 + if use llvm; then
306 + llvm_pkg_setup
307 + fi
308 + python-any-r1_pkg_setup
309 +}
310 +
311 +src_prepare() {
312 + [[ ${PV} == 9999 ]] && eautoreconf
313 + eapply_user
314 +}
315 +
316 +multilib_src_configure() {
317 + local myconf
318 +
319 + if use classic; then
320 + # Configurable DRI drivers
321 + driver_enable swrast
322 +
323 + # Intel code
324 + driver_enable video_cards_i915 i915
325 + driver_enable video_cards_i965 i965
326 + if ! use video_cards_i915 && \
327 + ! use video_cards_i965; then
328 + driver_enable video_cards_intel i915 i965
329 + fi
330 +
331 + # Nouveau code
332 + driver_enable video_cards_nouveau nouveau
333 +
334 + # ATI code
335 + driver_enable video_cards_r100 radeon
336 + driver_enable video_cards_r200 r200
337 + if ! use video_cards_r100 && \
338 + ! use video_cards_r200; then
339 + driver_enable video_cards_radeon radeon r200
340 + fi
341 + fi
342 +
343 + if use egl; then
344 + myconf+=" --with-platforms=x11,surfaceless$(use wayland && echo ",wayland")$(use gbm && echo ",drm")"
345 + fi
346 +
347 + if use gallium; then
348 + myconf+="
349 + $(use_enable d3d9 nine)
350 + $(use_enable llvm)
351 + $(use_enable openmax omx-bellagio)
352 + $(use_enable vaapi va)
353 + $(use_enable vdpau)
354 + $(use_enable xa)
355 + $(use_enable xvmc)
356 + "
357 + use vaapi && myconf+=" --with-va-libdir=/usr/$(get_libdir)/va/drivers"
358 +
359 + gallium_enable swrast
360 + gallium_enable video_cards_vc4 vc4
361 + gallium_enable video_cards_vivante etnaviv
362 + gallium_enable video_cards_vmware svga
363 + gallium_enable video_cards_nouveau nouveau
364 + gallium_enable video_cards_i915 i915
365 + gallium_enable video_cards_imx imx
366 + if ! use video_cards_i915 && \
367 + ! use video_cards_i965; then
368 + gallium_enable video_cards_intel i915
369 + fi
370 +
371 + gallium_enable video_cards_r300 r300
372 + gallium_enable video_cards_r600 r600
373 + gallium_enable video_cards_radeonsi radeonsi
374 + if ! use video_cards_r300 && \
375 + ! use video_cards_r600; then
376 + gallium_enable video_cards_radeon r300 r600
377 + fi
378 +
379 + gallium_enable video_cards_freedreno freedreno
380 + # opencl stuff
381 + if use opencl; then
382 + myconf+="
383 + $(use_enable opencl)
384 + --with-clang-libdir="${EPREFIX}/usr/lib"
385 + "
386 + fi
387 +
388 + gallium_enable video_cards_virgl virgl
389 + fi
390 +
391 + if use vulkan; then
392 + vulkan_enable video_cards_i965 intel
393 + vulkan_enable video_cards_radeonsi radeon
394 + fi
395 +
396 + # x86 hardened pax_kernel needs glx-rts, bug 240956
397 + if [[ ${ABI} == x86 ]]; then
398 + myconf+=" $(use_enable pax_kernel glx-read-only-text)"
399 + fi
400 +
401 + # on abi_x86_32 hardened we need to have asm disable
402 + if [[ ${ABI} == x86* ]] && use pic; then
403 + myconf+=" --disable-asm"
404 + fi
405 +
406 + if use gallium; then
407 + myconf+=" $(use_enable osmesa gallium-osmesa)"
408 + else
409 + myconf+=" $(use_enable osmesa)"
410 + fi
411 +
412 + # build fails with BSD indent, bug #428112
413 + use userland_GNU || export INDENT=cat
414 +
415 + ECONF_SOURCE="${S}" \
416 + econf \
417 + --enable-dri \
418 + --enable-glx \
419 + --enable-shared-glapi \
420 + $(use_enable !bindist texture-float) \
421 + $(use_enable d3d9 nine) \
422 + $(use_enable debug) \
423 + $(use_enable dri3) \
424 + $(use_enable egl) \
425 + $(use_enable gbm) \
426 + $(use_enable gles1) \
427 + $(use_enable gles2) \
428 + $(use_enable nptl glx-tls) \
429 + $(use_enable unwind libunwind) \
430 + --enable-valgrind=$(usex valgrind auto no) \
431 + --enable-llvm-shared-libs \
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 classic || use gallium; then
443 + ebegin "Moving DRI/Gallium drivers for dynamic switching"
444 + local gallium_drivers=( i915_dri.so i965_dri.so r300_dri.so r600_dri.so swrast_dri.so )
445 + keepdir /usr/$(get_libdir)/dri
446 + dodir /usr/$(get_libdir)/mesa
447 + for x in ${gallium_drivers[@]}; do
448 + if [ -f "$(get_libdir)/gallium/${x}" ]; then
449 + mv -f "${ED}/usr/$(get_libdir)/dri/${x}" "${ED}/usr/$(get_libdir)/dri/${x/_dri.so/g_dri.so}" \
450 + || die "Failed to move ${x}"
451 + fi
452 + done
453 + if use classic; then
454 + emake -C "${BUILD_DIR}/src/mesa/drivers/dri" DESTDIR="${D}" install
455 + fi
456 + for x in "${ED}"/usr/$(get_libdir)/dri/*.so; do
457 + if [ -f ${x} -o -L ${x} ]; then
458 + mv -f "${x}" "${x/dri/mesa}" \
459 + || die "Failed to move ${x}"
460 + fi
461 + done
462 + pushd "${ED}"/usr/$(get_libdir)/dri || die "pushd failed"
463 + ln -s ../mesa/*.so . || die "Creating symlink failed"
464 + # remove symlinks to drivers known to eselect
465 + for x in ${gallium_drivers[@]}; do
466 + if [ -f ${x} -o -L ${x} ]; then
467 + rm "${x}" || die "Failed to remove ${x}"
468 + fi
469 + done
470 + popd
471 + eend $?
472 + fi
473 + if use opencl; then
474 + ebegin "Moving Gallium/Clover OpenCL implementation for dynamic switching"
475 + local cl_dir="/usr/$(get_libdir)/OpenCL/vendors/mesa"
476 + dodir ${cl_dir}/{lib,include}
477 + if [ -f "${ED}/usr/$(get_libdir)/libOpenCL.so" ]; then
478 + mv -f "${ED}"/usr/$(get_libdir)/libOpenCL.so* \
479 + "${ED}"${cl_dir}
480 + fi
481 + if [ -f "${ED}/usr/include/CL/opencl.h" ]; then
482 + mv -f "${ED}"/usr/include/CL \
483 + "${ED}"${cl_dir}/include
484 + fi
485 + eend $?
486 + fi
487 +
488 + if use openmax; then
489 + echo "XDG_DATA_DIRS=\"${EPREFIX}/usr/share/mesa/xdg\"" > "${T}/99mesaxdgomx"
490 + doenvd "${T}"/99mesaxdgomx
491 + keepdir /usr/share/mesa/xdg
492 + fi
493 +}
494 +
495 +multilib_src_install_all() {
496 + find "${ED}" -name '*.la' -delete
497 + einstalldocs
498 +
499 + if use !bindist; then
500 + dodoc docs/patents.txt
501 + fi
502 +
503 + # Install config file for eselect mesa
504 + insinto /usr/share/mesa
505 + newins "${FILESDIR}/eselect-mesa.conf.9.2" eselect-mesa.conf
506 +}
507 +
508 +multilib_src_test() {
509 + if use llvm; then
510 + 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'
511 + pushd src/gallium/drivers/llvmpipe >/dev/null || die
512 + emake ${llvm_tests}
513 + pax-mark m ${llvm_tests}
514 + popd >/dev/null || die
515 + fi
516 + emake check
517 +}
518 +
519 +pkg_postinst() {
520 + # Switch to the xorg implementation.
521 + echo
522 + eselect opengl set --use-old ${OPENGL_DIR}
523 +
524 + # Select classic/gallium drivers
525 + if use classic || use gallium; then
526 + eselect mesa set --auto
527 + fi
528 +
529 + # Switch to mesa opencl
530 + if use opencl; then
531 + eselect opencl set --use-old ${PN}
532 + fi
533 +
534 + # run omxregister-bellagio to make the OpenMAX drivers known system-wide
535 + if use openmax; then
536 + ebegin "Registering OpenMAX drivers"
537 + BELLAGIO_SEARCH_PATH="${EPREFIX}/usr/$(get_libdir)/libomxil-bellagio0" \
538 + OMX_BELLAGIO_REGISTRY=${EPREFIX}/usr/share/mesa/xdg/.omxregister \
539 + omxregister-bellagio
540 + eend $?
541 + fi
542 +
543 + # warn about patent encumbered texture-float
544 + if use !bindist; then
545 + elog "USE=\"bindist\" was not set. Potentially patent encumbered code was"
546 + elog "enabled. Please see patents.txt for an explanation."
547 + fi
548 +
549 + if ! has_version media-libs/libtxc_dxtn; then
550 + elog "Note that in order to have full S3TC support, it is necessary to install"
551 + elog "media-libs/libtxc_dxtn as well. This may be necessary to get nice"
552 + elog "textures in some apps, and some others even require this to run."
553 + fi
554 +}
555 +
556 +pkg_prerm() {
557 + if use openmax; then
558 + rm "${EPREFIX}"/usr/share/mesa/xdg/.omxregister
559 + fi
560 +}
561 +
562 +# $1 - VIDEO_CARDS flag
563 +# other args - names of DRI drivers to enable
564 +# TODO: avoid code duplication for a more elegant implementation
565 +driver_enable() {
566 + case $# in
567 + # for enabling unconditionally
568 + 1)
569 + DRI_DRIVERS+=",$1"
570 + ;;
571 + *)
572 + if use $1; then
573 + shift
574 + for i in $@; do
575 + DRI_DRIVERS+=",${i}"
576 + done
577 + fi
578 + ;;
579 + esac
580 +}
581 +
582 +gallium_enable() {
583 + case $# in
584 + # for enabling unconditionally
585 + 1)
586 + GALLIUM_DRIVERS+=",$1"
587 + ;;
588 + *)
589 + if use $1; then
590 + shift
591 + for i in $@; do
592 + GALLIUM_DRIVERS+=",${i}"
593 + done
594 + fi
595 + ;;
596 + esac
597 +}
598 +
599 +vulkan_enable() {
600 + case $# in
601 + # for enabling unconditionally
602 + 1)
603 + VULKAN_DRIVERS+=",$1"
604 + ;;
605 + *)
606 + if use $1; then
607 + shift
608 + for i in $@; do
609 + VULKAN_DRIVERS+=",${i}"
610 + done
611 + fi
612 + ;;
613 + esac
614 +}