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