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: Thu, 15 Feb 2018 16:44:43
Message-Id: 1518713006.69a7096334ec5dcc8fb517495374ac315dc1595f.mattst88@gentoo
1 commit: 69a7096334ec5dcc8fb517495374ac315dc1595f
2 Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
3 AuthorDate: Thu Feb 15 16:42:59 2018 +0000
4 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
5 CommitDate: Thu Feb 15 16:43:26 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=69a70963
7
8 media-libs/mesa: Version bump to 17.3.4
9
10 media-libs/mesa/Manifest | 1 +
11 media-libs/mesa/mesa-17.3.4.ebuild | 580 +++++++++++++++++++++++++++++++++++++
12 2 files changed, 581 insertions(+)
13
14 diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
15 index 8568ef1e703..0e281459b8e 100644
16 --- a/media-libs/mesa/Manifest
17 +++ b/media-libs/mesa/Manifest
18 @@ -1,4 +1,5 @@
19 DIST mesa-17.1.10.tar.xz 9872168 BLAKE2B 205ece7b016fcc1de5bb72711775cd8f4b90f5d6c26db77d1576752fcd4a99a36cbcd902bb6ad1041d476d1c3b32479baceb4087c902ce598ede3d57851c6b9d SHA512 728dbd41f5d3a7a1c33fc18c08a8b8eb1f6d236c5f00781209f46b144dd66a27ecd723ab1635868b7ad77de3a18ad53f1a88c932f17c0be97605a2775e3b3a9b
20 DIST mesa-17.2.8.tar.xz 10393304 BLAKE2B 558321eefc6d599aaedfe468f03c2f1f99b5c96c253637db00b7da3265ec38e031d15f77623db1f4408f15912c93347e0f5769b01d92329be7f55e45f6f6bf75 SHA512 ce05ad2d3e1b55ffe9c8ef65023a840c04b29014c7876b23182a6a6dd0b768f248ec21bc5b738d21b846f59f4b73501a9fe834d6a87e7dba16c6f821008e0f01
21 DIST mesa-17.3.3.tar.xz 10637708 BLAKE2B a2cec4abc58eb71c1ec92d073ac3a128e1f993f69b163c9f6e474fef4520fe074d84ca8d972a7822a76226e132230f6e7fac320b940ea3462553d398ef6bcfce SHA512 7ac8ecdcf3b2b43239835bc2c5da7f2730f80a2db945fe00df03d1548920fbc074dd4806ddd345a1ce682fd29d75b2209ef81b6b06e657f9c8ae8622a34a03c1
22 +DIST mesa-17.3.4.tar.xz 10722704 BLAKE2B 991b9a629c30dfbfcb0ee6b7fe2e1bade7ff6fad61cb7d0f8b862c864e8b2dbbe8ae6157ea31113969dabc39bce1774d887f0d29b86464a854ccb85c6291a170 SHA512 8a077aa89b9d314188e62a215abe8e0db890afbbdd9c1ba9d214735d5304956b55723132f19e8a4ac3e3f404eca1dd9b5fbc936de9ac63d91562c0bc62708fe3
23 DIST mesa-18.0.0-rc4.tar.xz 11027596 BLAKE2B 96554acd69636b91d1b79e7fefa4ba6e3f701ef7ef6c16718493070d62ab41c7bbd66e2f4d4a97fac8c236ac4c9150b2ce41e4e57b865fff6122b3f60b047e25 SHA512 91dd0a4396715a7896fc47aabf38c4b486df3b50c9764795805550ef01724d2e2281ba9b000e82760ea0e199c58d8c9943dbc732b2adab46554ff5c2f9e2ece1
24
25 diff --git a/media-libs/mesa/mesa-17.3.4.ebuild b/media-libs/mesa/mesa-17.3.4.ebuild
26 new file mode 100644
27 index 00000000000..bf3fa77a49c
28 --- /dev/null
29 +++ b/media-libs/mesa/mesa-17.3.4.ebuild
30 @@ -0,0 +1,580 @@
31 +# Copyright 1999-2018 Gentoo Foundation
32 +# Distributed under the terms of the GNU General Public License v2
33 +
34 +EAPI=6
35 +
36 +EGIT_REPO_URI="https://anongit.freedesktop.org/git/mesa/mesa.git"
37 +
38 +if [[ ${PV} = 9999 ]]; then
39 + GIT_ECLASS="git-r3"
40 + EXPERIMENTAL="true"
41 +fi
42 +
43 +PYTHON_COMPAT=( python2_7 )
44 +
45 +inherit autotools llvm multilib-minimal python-any-r1 pax-utils ${GIT_ECLASS}
46 +
47 +OPENGL_DIR="xorg-x11"
48 +
49 +MY_P="${P/_/-}"
50 +
51 +DESCRIPTION="OpenGL-like graphic library for Linux"
52 +HOMEPAGE="https://www.mesa3d.org/ https://mesa.freedesktop.org/"
53 +
54 +if [[ $PV == 9999 ]]; then
55 + SRC_URI=""
56 +else
57 + SRC_URI="https://mesa.freedesktop.org/archive/${MY_P}.tar.xz"
58 + 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"
59 +fi
60 +
61 +LICENSE="MIT"
62 +SLOT="0"
63 +RESTRICT="!bindist? ( bindist )"
64 +
65 +RADEON_CARDS="r100 r200 r300 r600 radeon radeonsi"
66 +VIDEO_CARDS="${RADEON_CARDS} freedreno i915 i965 imx intel nouveau vc4 virgl 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 unwind
73 + +llvm +nptl opencl osmesa pax_kernel openmax pic selinux vaapi valgrind
74 + vdpau 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 video_cards_vivante )
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_vc4? ( gallium )
103 + video_cards_virgl? ( gallium )
104 + video_cards_vivante? ( gallium gbm )
105 + video_cards_vmware? ( gallium )
106 +"
107 +
108 +LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.85"
109 +# keep correct libdrm and dri2proto dep
110 +# keep blocks in rdepend for binpkg
111 +RDEPEND="
112 + !<x11-base/xorg-server-1.7
113 + !<=x11-proto/xf86driproto-2.0.3
114 + abi_x86_32? ( !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)] )
115 + classic? ( app-eselect/eselect-mesa )
116 + gallium? ( app-eselect/eselect-mesa )
117 + >=app-eselect/eselect-opengl-1.3.0
118 + >=dev-libs/expat-2.1.0-r3:=[${MULTILIB_USEDEP}]
119 + >=sys-libs/zlib-1.2.8[${MULTILIB_USEDEP}]
120 + >=x11-libs/libX11-1.6.2:=[${MULTILIB_USEDEP}]
121 + >=x11-libs/libxshmfence-1.1:=[${MULTILIB_USEDEP}]
122 + >=x11-libs/libXdamage-1.1.4-r1:=[${MULTILIB_USEDEP}]
123 + >=x11-libs/libXext-1.3.2:=[${MULTILIB_USEDEP}]
124 + >=x11-libs/libXxf86vm-1.1.3:=[${MULTILIB_USEDEP}]
125 + >=x11-libs/libxcb-1.9.3:=[${MULTILIB_USEDEP}]
126 + x11-libs/libXfixes:=[${MULTILIB_USEDEP}]
127 + unwind? ( sys-libs/libunwind[${MULTILIB_USEDEP}] )
128 + llvm? (
129 + video_cards_radeonsi? (
130 + virtual/libelf:0=[${MULTILIB_USEDEP}]
131 + )
132 + video_cards_r600? (
133 + virtual/libelf:0=[${MULTILIB_USEDEP}]
134 + )
135 + video_cards_radeon? (
136 + virtual/libelf:0=[${MULTILIB_USEDEP}]
137 + )
138 + )
139 + opencl? (
140 + app-eselect/eselect-opencl
141 + dev-libs/libclc
142 + virtual/libelf:0=[${MULTILIB_USEDEP}]
143 + )
144 + openmax? ( >=media-libs/libomxil-bellagio-0.9.3:=[${MULTILIB_USEDEP}] )
145 + vaapi? (
146 + >=x11-libs/libva-1.7.3:=[${MULTILIB_USEDEP}]
147 + video_cards_nouveau? ( !<=x11-libs/libva-vdpau-driver-0.7.4-r3 )
148 + )
149 + vdpau? ( >=x11-libs/libvdpau-1.1:=[${MULTILIB_USEDEP}] )
150 + wayland? (
151 + >=dev-libs/wayland-1.11.0:=[${MULTILIB_USEDEP}]
152 + >=dev-libs/wayland-protocols-1.8
153 + )
154 + xvmc? ( >=x11-libs/libXvMC-1.0.8:=[${MULTILIB_USEDEP}] )
155 + ${LIBDRM_DEPSTRING}[video_cards_freedreno?,video_cards_nouveau?,video_cards_vc4?,video_cards_vivante?,video_cards_vmware?,${MULTILIB_USEDEP}]
156 +
157 + video_cards_intel? (
158 + !video_cards_i965? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
159 + )
160 + video_cards_i915? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
161 +"
162 +for card in ${RADEON_CARDS}; do
163 + RDEPEND="${RDEPEND}
164 + video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_radeon] )
165 + "
166 +done
167 +RDEPEND="${RDEPEND}
168 + video_cards_radeonsi? ( ${LIBDRM_DEPSTRING}[video_cards_amdgpu] )
169 +"
170 +
171 +# Please keep the LLVM dependency block separate. Since LLVM is slotted,
172 +# we need to *really* make sure we're not pulling one than more slot
173 +# simultaneously.
174 +#
175 +# How to use it:
176 +# 1. List all the working slots (with min versions) in ||, newest first.
177 +# 2. Update the := to specify *max* version, e.g. < 7.
178 +# 3. Specify LLVM_MAX_SLOT, e.g. 6.
179 +LLVM_MAX_SLOT="5"
180 +LLVM_DEPSTR="
181 + || (
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-6:=[${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-proto/dri2proto-2.8-r1:=[${MULTILIB_USEDEP}]
254 + dri3? (
255 + >=x11-proto/dri3proto-1.0:=[${MULTILIB_USEDEP}]
256 + >=x11-proto/presentproto-1.0:=[${MULTILIB_USEDEP}]
257 + )
258 + >=x11-proto/glproto-1.4.17-r1:=[${MULTILIB_USEDEP}]
259 + >=x11-proto/xextproto-7.2.1-r1:=[${MULTILIB_USEDEP}]
260 + >=x11-proto/xf86driproto-2.1.1-r1:=[${MULTILIB_USEDEP}]
261 + >=x11-proto/xf86vidmodeproto-2.3.1-r1:=[${MULTILIB_USEDEP}]
262 + vulkan? (
263 + $(python_gen_any_dep ">=dev-python/mako-0.7.3[\${PYTHON_USEDEP}]")
264 + )
265 +"
266 +[[ ${PV} == 9999 ]] && DEPEND+="
267 + sys-devel/bison
268 + sys-devel/flex
269 + $(python_gen_any_dep ">=dev-python/mako-0.7.3[\${PYTHON_USEDEP}]")
270 +"
271 +
272 +S="${WORKDIR}/${MY_P}"
273 +EGIT_CHECKOUT_DIR=${S}
274 +
275 +QA_WX_LOAD="
276 +x86? (
277 + !pic? (
278 + usr/lib*/libglapi.so.0.0.0
279 + usr/lib*/libGLESv1_CM.so.1.1.0
280 + usr/lib*/libGLESv2.so.2.0.0
281 + usr/lib*/libGL.so.1.2.0
282 + usr/lib*/libOSMesa.so.8.0.0
283 + )
284 +)"
285 +
286 +llvm_check_deps() {
287 + local flags=${MULTILIB_USEDEP}
288 + if use video_cards_r600 || use video_cards_radeon || use video_cards_radeonsi
289 + then
290 + flags+=",llvm_targets_AMDGPU(-)"
291 + fi
292 +
293 + if use opencl; then
294 + has_version "sys-devel/clang[${flags}]" || return 1
295 + fi
296 + has_version "sys-devel/llvm[${flags}]"
297 +}
298 +
299 +pkg_setup() {
300 + # warning message for bug 459306
301 + if use llvm && has_version sys-devel/llvm[!debug=]; then
302 + ewarn "Mismatch between debug USE flags in media-libs/mesa and sys-devel/llvm"
303 + ewarn "detected! This can cause problems. For details, see bug 459306."
304 + fi
305 +
306 + if use llvm; then
307 + llvm_pkg_setup
308 + fi
309 + python-any-r1_pkg_setup
310 +}
311 +
312 +src_prepare() {
313 + [[ ${PV} == 9999 ]] && eautoreconf
314 + eapply_user
315 +}
316 +
317 +multilib_src_configure() {
318 + local myconf
319 +
320 + if use classic; then
321 + # Configurable DRI drivers
322 + driver_enable swrast
323 +
324 + # Intel code
325 + driver_enable video_cards_i915 i915
326 + driver_enable video_cards_i965 i965
327 + if ! use video_cards_i915 && \
328 + ! use video_cards_i965; then
329 + driver_enable video_cards_intel i915 i965
330 + fi
331 +
332 + # Nouveau code
333 + driver_enable video_cards_nouveau nouveau
334 +
335 + # ATI code
336 + driver_enable video_cards_r100 radeon
337 + driver_enable video_cards_r200 r200
338 + if ! use video_cards_r100 && \
339 + ! use video_cards_r200; then
340 + driver_enable video_cards_radeon radeon r200
341 + fi
342 + fi
343 +
344 + if use egl; then
345 + myconf+=" --with-platforms=x11,surfaceless$(use wayland && echo ",wayland")$(use gbm && echo ",drm")"
346 + fi
347 +
348 + if use gallium; then
349 + myconf+="
350 + $(use_enable d3d9 nine)
351 + $(use_enable llvm)
352 + $(use_enable openmax omx-bellagio)
353 + $(use_enable vaapi va)
354 + $(use_enable vdpau)
355 + $(use_enable xa)
356 + $(use_enable xvmc)
357 + "
358 + use vaapi && myconf+=" --with-va-libdir=/usr/$(get_libdir)/va/drivers"
359 +
360 + gallium_enable swrast
361 + gallium_enable video_cards_vc4 vc4
362 + gallium_enable video_cards_vivante etnaviv
363 + gallium_enable video_cards_vmware svga
364 + gallium_enable video_cards_nouveau nouveau
365 + gallium_enable video_cards_i915 i915
366 + gallium_enable video_cards_imx imx
367 + if ! use video_cards_i915 && \
368 + ! use video_cards_i965; then
369 + gallium_enable video_cards_intel i915
370 + fi
371 +
372 + gallium_enable video_cards_r300 r300
373 + gallium_enable video_cards_r600 r600
374 + gallium_enable video_cards_radeonsi radeonsi
375 + if ! use video_cards_r300 && \
376 + ! use video_cards_r600; then
377 + gallium_enable video_cards_radeon r300 r600
378 + fi
379 +
380 + gallium_enable video_cards_freedreno freedreno
381 + # opencl stuff
382 + if use opencl; then
383 + myconf+="
384 + $(use_enable opencl)
385 + --with-clang-libdir="${EPREFIX}/usr/lib"
386 + "
387 + fi
388 +
389 + gallium_enable video_cards_virgl virgl
390 + fi
391 +
392 + if use vulkan; then
393 + vulkan_enable video_cards_i965 intel
394 + vulkan_enable video_cards_radeonsi radeon
395 + fi
396 +
397 + # x86 hardened pax_kernel needs glx-rts, bug 240956
398 + if [[ ${ABI} == x86 ]]; then
399 + myconf+=" $(use_enable pax_kernel glx-read-only-text)"
400 + fi
401 +
402 + # on abi_x86_32 hardened we need to have asm disable
403 + if [[ ${ABI} == x86* ]] && use pic; then
404 + myconf+=" --disable-asm"
405 + fi
406 +
407 + if use gallium; then
408 + myconf+=" $(use_enable osmesa gallium-osmesa)"
409 + else
410 + myconf+=" $(use_enable osmesa)"
411 + fi
412 +
413 + # build fails with BSD indent, bug #428112
414 + use userland_GNU || export INDENT=cat
415 +
416 + ECONF_SOURCE="${S}" \
417 + econf \
418 + --enable-dri \
419 + --enable-glx \
420 + --enable-shared-glapi \
421 + $(use_enable !bindist texture-float) \
422 + $(use_enable d3d9 nine) \
423 + $(use_enable debug) \
424 + $(use_enable dri3) \
425 + $(use_enable egl) \
426 + $(use_enable gbm) \
427 + $(use_enable gles1) \
428 + $(use_enable gles2) \
429 + $(use_enable nptl glx-tls) \
430 + $(use_enable unwind libunwind) \
431 + --enable-valgrind=$(usex valgrind auto no) \
432 + --enable-llvm-shared-libs \
433 + --with-dri-drivers=${DRI_DRIVERS} \
434 + --with-gallium-drivers=${GALLIUM_DRIVERS} \
435 + --with-vulkan-drivers=${VULKAN_DRIVERS} \
436 + PYTHON2="${PYTHON}" \
437 + ${myconf}
438 +}
439 +
440 +multilib_src_install() {
441 + emake install DESTDIR="${D}"
442 +
443 + if use classic || use gallium; then
444 + ebegin "Moving DRI/Gallium drivers for dynamic switching"
445 + local gallium_drivers=( i915_dri.so i965_dri.so r300_dri.so r600_dri.so swrast_dri.so )
446 + keepdir /usr/$(get_libdir)/dri
447 + dodir /usr/$(get_libdir)/mesa
448 + for x in ${gallium_drivers[@]}; do
449 + if [ -f "$(get_libdir)/gallium/${x}" ]; then
450 + mv -f "${ED}/usr/$(get_libdir)/dri/${x}" "${ED}/usr/$(get_libdir)/dri/${x/_dri.so/g_dri.so}" \
451 + || die "Failed to move ${x}"
452 + fi
453 + done
454 + if use classic; then
455 + emake -C "${BUILD_DIR}/src/mesa/drivers/dri" DESTDIR="${D}" install
456 + fi
457 + for x in "${ED}"/usr/$(get_libdir)/dri/*.so; do
458 + if [ -f ${x} -o -L ${x} ]; then
459 + mv -f "${x}" "${x/dri/mesa}" \
460 + || die "Failed to move ${x}"
461 + fi
462 + done
463 + pushd "${ED}"/usr/$(get_libdir)/dri || die "pushd failed"
464 + ln -s ../mesa/*.so . || die "Creating symlink failed"
465 + # remove symlinks to drivers known to eselect
466 + for x in ${gallium_drivers[@]}; do
467 + if [ -f ${x} -o -L ${x} ]; then
468 + rm "${x}" || die "Failed to remove ${x}"
469 + fi
470 + done
471 + popd
472 + eend $?
473 + fi
474 + if use opencl; then
475 + ebegin "Moving Gallium/Clover OpenCL implementation for dynamic switching"
476 + local cl_dir="/usr/$(get_libdir)/OpenCL/vendors/mesa"
477 + dodir ${cl_dir}/{lib,include}
478 + if [ -f "${ED}/usr/$(get_libdir)/libOpenCL.so" ]; then
479 + mv -f "${ED}"/usr/$(get_libdir)/libOpenCL.so* \
480 + "${ED}"${cl_dir}
481 + fi
482 + if [ -f "${ED}/usr/include/CL/opencl.h" ]; then
483 + mv -f "${ED}"/usr/include/CL \
484 + "${ED}"${cl_dir}/include
485 + fi
486 + eend $?
487 + fi
488 +
489 + if use openmax; then
490 + echo "XDG_DATA_DIRS=\"${EPREFIX}/usr/share/mesa/xdg\"" > "${T}/99mesaxdgomx"
491 + doenvd "${T}"/99mesaxdgomx
492 + keepdir /usr/share/mesa/xdg
493 + fi
494 +}
495 +
496 +multilib_src_install_all() {
497 + find "${ED}" -name '*.la' -delete
498 + einstalldocs
499 +
500 + if use !bindist; then
501 + dodoc docs/patents.txt
502 + fi
503 +
504 + # Install config file for eselect mesa
505 + insinto /usr/share/mesa
506 + newins "${FILESDIR}/eselect-mesa.conf.9.2" eselect-mesa.conf
507 +}
508 +
509 +multilib_src_test() {
510 + if use llvm; then
511 + 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'
512 + pushd src/gallium/drivers/llvmpipe >/dev/null || die
513 + emake ${llvm_tests}
514 + pax-mark m ${llvm_tests}
515 + popd >/dev/null || die
516 + fi
517 + emake check
518 +}
519 +
520 +pkg_postinst() {
521 + # Switch to the xorg implementation.
522 + echo
523 + eselect opengl set --use-old ${OPENGL_DIR}
524 +
525 + # Select classic/gallium drivers
526 + if use classic || use gallium; then
527 + eselect mesa set --auto
528 + fi
529 +
530 + # Switch to mesa opencl
531 + if use opencl; then
532 + eselect opencl set --use-old ${PN}
533 + fi
534 +
535 + # run omxregister-bellagio to make the OpenMAX drivers known system-wide
536 + if use openmax; then
537 + ebegin "Registering OpenMAX drivers"
538 + BELLAGIO_SEARCH_PATH="${EPREFIX}/usr/$(get_libdir)/libomxil-bellagio0" \
539 + OMX_BELLAGIO_REGISTRY=${EPREFIX}/usr/share/mesa/xdg/.omxregister \
540 + omxregister-bellagio
541 + eend $?
542 + fi
543 +
544 + # warn about patent encumbered texture-float
545 + if use !bindist; then
546 + elog "USE=\"bindist\" was not set. Potentially patent encumbered code was"
547 + elog "enabled. Please see /usr/share/doc/${P}/patents.txt.bz2 for an"
548 + elog "explanation."
549 + fi
550 +}
551 +
552 +pkg_prerm() {
553 + if use openmax; then
554 + rm "${EPREFIX}"/usr/share/mesa/xdg/.omxregister
555 + fi
556 +}
557 +
558 +# $1 - VIDEO_CARDS flag
559 +# other args - names of DRI drivers to enable
560 +# TODO: avoid code duplication for a more elegant implementation
561 +driver_enable() {
562 + case $# in
563 + # for enabling unconditionally
564 + 1)
565 + DRI_DRIVERS+=",$1"
566 + ;;
567 + *)
568 + if use $1; then
569 + shift
570 + for i in $@; do
571 + DRI_DRIVERS+=",${i}"
572 + done
573 + fi
574 + ;;
575 + esac
576 +}
577 +
578 +gallium_enable() {
579 + case $# in
580 + # for enabling unconditionally
581 + 1)
582 + GALLIUM_DRIVERS+=",$1"
583 + ;;
584 + *)
585 + if use $1; then
586 + shift
587 + for i in $@; do
588 + GALLIUM_DRIVERS+=",${i}"
589 + done
590 + fi
591 + ;;
592 + esac
593 +}
594 +
595 +vulkan_enable() {
596 + case $# in
597 + # for enabling unconditionally
598 + 1)
599 + VULKAN_DRIVERS+=",$1"
600 + ;;
601 + *)
602 + if use $1; then
603 + shift
604 + for i in $@; do
605 + VULKAN_DRIVERS+=",${i}"
606 + done
607 + fi
608 + ;;
609 + esac
610 +}