Gentoo Archives: gentoo-commits

From: Aric Belsito <lluixhi@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/musl:master commit in: media-libs/mesa/
Date: Mon, 29 Jan 2018 19:54:16
Message-Id: 1517255621.e4b35f88c927dfb184b66287de9215a2b8cce366.lluixhi@gentoo
1 commit: e4b35f88c927dfb184b66287de9215a2b8cce366
2 Author: Aric Belsito <lluixhi <AT> gmail <DOT> com>
3 AuthorDate: Mon Jan 29 19:53:41 2018 +0000
4 Commit: Aric Belsito <lluixhi <AT> gmail <DOT> com>
5 CommitDate: Mon Jan 29 19:53:41 2018 +0000
6 URL: https://gitweb.gentoo.org/proj/musl.git/commit/?id=e4b35f88
7
8 media-libs/mesa: bump to 18.0.0_rc3
9
10 media-libs/mesa/Manifest | 1 +
11 media-libs/mesa/mesa-18.0.0_rc3.ebuild | 589 +++++++++++++++++++++++++++++++++
12 2 files changed, 590 insertions(+)
13
14 diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
15 index d4d62f7..a2275f9 100644
16 --- a/media-libs/mesa/Manifest
17 +++ b/media-libs/mesa/Manifest
18 @@ -2,3 +2,4 @@ DIST mesa-17.1.10.tar.xz 9872168 BLAKE2B 205ece7b016fcc1de5bb72711775cd8f4b90f5d
19 DIST mesa-17.2.8.tar.xz 10393304 BLAKE2B 558321eefc6d599aaedfe468f03c2f1f99b5c96c253637db00b7da3265ec38e031d15f77623db1f4408f15912c93347e0f5769b01d92329be7f55e45f6f6bf75 SHA512 ce05ad2d3e1b55ffe9c8ef65023a840c04b29014c7876b23182a6a6dd0b768f248ec21bc5b738d21b846f59f4b73501a9fe834d6a87e7dba16c6f821008e0f01
20 DIST mesa-17.3.3.tar.xz 10637708 BLAKE2B a2cec4abc58eb71c1ec92d073ac3a128e1f993f69b163c9f6e474fef4520fe074d84ca8d972a7822a76226e132230f6e7fac320b940ea3462553d398ef6bcfce SHA512 7ac8ecdcf3b2b43239835bc2c5da7f2730f80a2db945fe00df03d1548920fbc074dd4806ddd345a1ce682fd29d75b2209ef81b6b06e657f9c8ae8622a34a03c1
21 DIST mesa-18.0.0-rc2.tar.xz 10962300 BLAKE2B 89444a46261d837bd5c7bc54898ebdafe58e863d3532bd80f6592432d2925317fc0ac144dd55862a249d6390efc3955942dc2980ce87e589b9360de61a1f6148 SHA512 aada4caf4c2021bc1e7c071b32ed0ccbbbfe415bc1cb5a80eee3911b1b11a2bd87a10e99c5a152790709488afbdb60e87b4b66c2ca22c0cf89c029fb10c6e8b3
22 +DIST mesa-18.0.0-rc3.tar.xz 10964880 BLAKE2B 4887e2962b3d1c328734af9effe33cac7fd69c888b3c500d28423c62bae0a26fe58396c8371b1e0861e68a90c03be0029d5a32019efa920f40908b0b054d7c6c SHA512 62e7491cdd5a6651c2bb7c0268685654d5376a68135c1904c684f716805695840c0a16fcff324c75f3ec000bebfa835b3da9a13c479b612da715b171fe68bc0b
23
24 diff --git a/media-libs/mesa/mesa-18.0.0_rc3.ebuild b/media-libs/mesa/mesa-18.0.0_rc3.ebuild
25 new file mode 100644
26 index 0000000..626b7c5
27 --- /dev/null
28 +++ b/media-libs/mesa/mesa-18.0.0_rc3.ebuild
29 @@ -0,0 +1,589 @@
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="~amd64 ~arm ~ia64 ~mips ~ppc ~sh ~sparc ~x86"
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.89"
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: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-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 + eapply "${FILESDIR}"/${PN}-17-musl_endian.patch
314 + eapply "${FILESDIR}"/${PN}-17-execinfo.patch
315 + eapply "${FILESDIR}"/${PN}-17-musl-string_h.patch
316 + eapply "${FILESDIR}"/${PN}-17-musl-invocation_name.patch
317 + eapply "${FILESDIR}"/${PN}-18-musl-pthread.patch
318 +
319 + eautoreconf
320 +
321 + eapply_user
322 +}
323 +
324 +multilib_src_configure() {
325 + local myconf
326 +
327 + if use classic; then
328 + # Configurable DRI drivers
329 + driver_enable swrast
330 +
331 + # Intel code
332 + driver_enable video_cards_i915 i915
333 + driver_enable video_cards_i965 i965
334 + if ! use video_cards_i915 && \
335 + ! use video_cards_i965; then
336 + driver_enable video_cards_intel i915 i965
337 + fi
338 +
339 + # Nouveau code
340 + driver_enable video_cards_nouveau nouveau
341 +
342 + # ATI code
343 + driver_enable video_cards_r100 radeon
344 + driver_enable video_cards_r200 r200
345 + if ! use video_cards_r100 && \
346 + ! use video_cards_r200; then
347 + driver_enable video_cards_radeon radeon r200
348 + fi
349 + fi
350 +
351 + if use egl; then
352 + myconf+=" --with-platforms=x11,surfaceless$(use wayland && echo ",wayland")$(use gbm && echo ",drm")"
353 + fi
354 +
355 + if use gallium; then
356 + myconf+="
357 + $(use_enable d3d9 nine)
358 + $(use_enable llvm)
359 + $(use_enable openmax omx-bellagio)
360 + $(use_enable vaapi va)
361 + $(use_enable vdpau)
362 + $(use_enable xa)
363 + $(use_enable xvmc)
364 + "
365 + use vaapi && myconf+=" --with-va-libdir=/usr/$(get_libdir)/va/drivers"
366 +
367 + gallium_enable swrast
368 + gallium_enable video_cards_vc4 vc4
369 + gallium_enable video_cards_vivante etnaviv
370 + gallium_enable video_cards_vmware svga
371 + gallium_enable video_cards_nouveau nouveau
372 + gallium_enable video_cards_i915 i915
373 + gallium_enable video_cards_imx imx
374 + if ! use video_cards_i915 && \
375 + ! use video_cards_i965; then
376 + gallium_enable video_cards_intel i915
377 + fi
378 +
379 + gallium_enable video_cards_r300 r300
380 + gallium_enable video_cards_r600 r600
381 + gallium_enable video_cards_radeonsi radeonsi
382 + if ! use video_cards_r300 && \
383 + ! use video_cards_r600; then
384 + gallium_enable video_cards_radeon r300 r600
385 + fi
386 +
387 + gallium_enable video_cards_freedreno freedreno
388 + # opencl stuff
389 + if use opencl; then
390 + myconf+="
391 + $(use_enable opencl)
392 + --with-clang-libdir="${EPREFIX}/usr/lib"
393 + "
394 + fi
395 +
396 + gallium_enable video_cards_virgl virgl
397 + fi
398 +
399 + if use vulkan; then
400 + vulkan_enable video_cards_i965 intel
401 + vulkan_enable video_cards_radeonsi radeon
402 + fi
403 +
404 + # x86 hardened pax_kernel needs glx-rts, bug 240956
405 + if [[ ${ABI} == x86 ]]; then
406 + myconf+=" $(use_enable pax_kernel glx-read-only-text)"
407 + fi
408 +
409 + # on abi_x86_32 hardened we need to have asm disable
410 + if [[ ${ABI} == x86* ]] && use pic; then
411 + myconf+=" --disable-asm"
412 + fi
413 +
414 + if use gallium; then
415 + myconf+=" $(use_enable osmesa gallium-osmesa)"
416 + else
417 + myconf+=" $(use_enable osmesa)"
418 + fi
419 +
420 + # build fails with BSD indent, bug #428112
421 + use userland_GNU || export INDENT=cat
422 +
423 + ECONF_SOURCE="${S}" \
424 + econf \
425 + --enable-dri \
426 + --enable-glx \
427 + --enable-shared-glapi \
428 + $(use_enable !bindist texture-float) \
429 + $(use_enable d3d9 nine) \
430 + $(use_enable debug) \
431 + $(use_enable dri3) \
432 + $(use_enable egl) \
433 + $(use_enable gbm) \
434 + $(use_enable gles1) \
435 + $(use_enable gles2) \
436 + $(use_enable nptl glx-tls) \
437 + $(use_enable unwind libunwind) \
438 + --enable-valgrind=$(usex valgrind auto no) \
439 + --enable-llvm-shared-libs \
440 + --disable-opencl-icd \
441 + --with-dri-drivers=${DRI_DRIVERS} \
442 + --with-gallium-drivers=${GALLIUM_DRIVERS} \
443 + --with-vulkan-drivers=${VULKAN_DRIVERS} \
444 + PYTHON2="${PYTHON}" \
445 + ${myconf}
446 +}
447 +
448 +multilib_src_install() {
449 + emake install DESTDIR="${D}"
450 +
451 + if use classic || use gallium; then
452 + ebegin "Moving DRI/Gallium drivers for dynamic switching"
453 + local gallium_drivers=( i915_dri.so i965_dri.so r300_dri.so r600_dri.so swrast_dri.so )
454 + keepdir /usr/$(get_libdir)/dri
455 + dodir /usr/$(get_libdir)/mesa
456 + for x in ${gallium_drivers[@]}; do
457 + if [ -f "$(get_libdir)/gallium/${x}" ]; then
458 + mv -f "${ED}/usr/$(get_libdir)/dri/${x}" "${ED}/usr/$(get_libdir)/dri/${x/_dri.so/g_dri.so}" \
459 + || die "Failed to move ${x}"
460 + fi
461 + done
462 + if use classic; then
463 + emake -C "${BUILD_DIR}/src/mesa/drivers/dri" DESTDIR="${D}" install
464 + fi
465 + for x in "${ED}"/usr/$(get_libdir)/dri/*.so; do
466 + if [ -f ${x} -o -L ${x} ]; then
467 + mv -f "${x}" "${x/dri/mesa}" \
468 + || die "Failed to move ${x}"
469 + fi
470 + done
471 + pushd "${ED}"/usr/$(get_libdir)/dri || die "pushd failed"
472 + ln -s ../mesa/*.so . || die "Creating symlink failed"
473 + # remove symlinks to drivers known to eselect
474 + for x in ${gallium_drivers[@]}; do
475 + if [ -f ${x} -o -L ${x} ]; then
476 + rm "${x}" || die "Failed to remove ${x}"
477 + fi
478 + done
479 + popd
480 + eend $?
481 + fi
482 + if use opencl; then
483 + ebegin "Moving Gallium/Clover OpenCL implementation for dynamic switching"
484 + local cl_dir="/usr/$(get_libdir)/OpenCL/vendors/mesa"
485 + dodir ${cl_dir}/{lib,include}
486 + if [ -f "${ED}/usr/$(get_libdir)/libOpenCL.so" ]; then
487 + mv -f "${ED}"/usr/$(get_libdir)/libOpenCL.so* \
488 + "${ED}"${cl_dir}
489 + fi
490 + if [ -f "${ED}/usr/include/CL/opencl.h" ]; then
491 + mv -f "${ED}"/usr/include/CL \
492 + "${ED}"${cl_dir}/include
493 + fi
494 + eend $?
495 + fi
496 +
497 + if use openmax; then
498 + echo "XDG_DATA_DIRS=\"${EPREFIX}/usr/share/mesa/xdg\"" > "${T}/99mesaxdgomx"
499 + doenvd "${T}"/99mesaxdgomx
500 + keepdir /usr/share/mesa/xdg
501 + fi
502 +}
503 +
504 +multilib_src_install_all() {
505 + find "${ED}" -name '*.la' -delete
506 + einstalldocs
507 +
508 + if use !bindist; then
509 + dodoc docs/patents.txt
510 + fi
511 +
512 + # Install config file for eselect mesa
513 + insinto /usr/share/mesa
514 + newins "${FILESDIR}/eselect-mesa.conf.9.2" eselect-mesa.conf
515 +}
516 +
517 +multilib_src_test() {
518 + if use llvm; then
519 + 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'
520 + pushd src/gallium/drivers/llvmpipe >/dev/null || die
521 + emake ${llvm_tests}
522 + pax-mark m ${llvm_tests}
523 + popd >/dev/null || die
524 + fi
525 + emake check
526 +}
527 +
528 +pkg_postinst() {
529 + # Switch to the xorg implementation.
530 + echo
531 + eselect opengl set --use-old ${OPENGL_DIR}
532 +
533 + # Select classic/gallium drivers
534 + if use classic || use gallium; then
535 + eselect mesa set --auto
536 + fi
537 +
538 + # Switch to mesa opencl
539 + if use opencl; then
540 + eselect opencl set --use-old ${PN}
541 + fi
542 +
543 + # run omxregister-bellagio to make the OpenMAX drivers known system-wide
544 + if use openmax; then
545 + ebegin "Registering OpenMAX drivers"
546 + BELLAGIO_SEARCH_PATH="${EPREFIX}/usr/$(get_libdir)/libomxil-bellagio0" \
547 + OMX_BELLAGIO_REGISTRY=${EPREFIX}/usr/share/mesa/xdg/.omxregister \
548 + omxregister-bellagio
549 + eend $?
550 + fi
551 +
552 + # warn about patent encumbered texture-float
553 + if use !bindist; then
554 + elog "USE=\"bindist\" was not set. Potentially patent encumbered code was"
555 + elog "enabled. Please see /usr/share/doc/${P}/patents.txt.bz2 for an"
556 + elog "explanation."
557 + fi
558 +}
559 +
560 +pkg_prerm() {
561 + if use openmax; then
562 + rm "${EPREFIX}"/usr/share/mesa/xdg/.omxregister
563 + fi
564 +}
565 +
566 +# $1 - VIDEO_CARDS flag
567 +# other args - names of DRI drivers to enable
568 +# TODO: avoid code duplication for a more elegant implementation
569 +driver_enable() {
570 + case $# in
571 + # for enabling unconditionally
572 + 1)
573 + DRI_DRIVERS+=",$1"
574 + ;;
575 + *)
576 + if use $1; then
577 + shift
578 + for i in $@; do
579 + DRI_DRIVERS+=",${i}"
580 + done
581 + fi
582 + ;;
583 + esac
584 +}
585 +
586 +gallium_enable() {
587 + case $# in
588 + # for enabling unconditionally
589 + 1)
590 + GALLIUM_DRIVERS+=",$1"
591 + ;;
592 + *)
593 + if use $1; then
594 + shift
595 + for i in $@; do
596 + GALLIUM_DRIVERS+=",${i}"
597 + done
598 + fi
599 + ;;
600 + esac
601 +}
602 +
603 +vulkan_enable() {
604 + case $# in
605 + # for enabling unconditionally
606 + 1)
607 + VULKAN_DRIVERS+=",$1"
608 + ;;
609 + *)
610 + if use $1; then
611 + shift
612 + for i in $@; do
613 + VULKAN_DRIVERS+=",${i}"
614 + done
615 + fi
616 + ;;
617 + esac
618 +}