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: Fri, 05 Jan 2018 18:19:46
Message-Id: 1515176362.5a36fab102b7698d79ce7543d606240b3f265b1e.mattst88@gentoo
1 commit: 5a36fab102b7698d79ce7543d606240b3f265b1e
2 Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jan 5 18:19:19 2018 +0000
4 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
5 CommitDate: Fri Jan 5 18:19:22 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5a36fab1
7
8 media-libs/mesa: Version bump to 17.2.8
9
10 media-libs/mesa/Manifest | 1 +
11 media-libs/mesa/mesa-17.2.8.ebuild | 582 +++++++++++++++++++++++++++++++++++++
12 2 files changed, 583 insertions(+)
13
14 diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
15 index c465862943f..02a5edb8842 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.6.tar.xz 10387604 BLAKE2B 43bd60f9e61bb04e3a2afe4bc6e18099a524cdec3c7948d9ccfffa5bfe50eb3e0625ba6da7bb3b32959ef4a5e3db982daf2f90d3ee555cf65084d70849b3ca12 SHA512 739645d963da2ff79fa0f2bfcc4948516c4f0a768f9d21f98eff049edc88218847afd3786003ccf7b10deec585f4f1d7f70fcc5e5f6e33186ebbb86cd8cb0202
21 DIST mesa-17.2.7.tar.xz 10353448 BLAKE2B cb116d7d7f8ace7769c348f04c0db194312553fd2b307471240dce5f971798e73c13cb7e2af6ed96a1109ea405207c3d7e8c910a1bc6197fcf37bdf4921d10b2 SHA512 f7cd06aa3ffb8ab80358304fa6a554f75c66105371072dae3a6f8f8e2a13891c8ac9eaf13c5defa74fa1236fed386ccd8c8b107e5fe80f9384237c9b1e726898
22 +DIST mesa-17.2.8.tar.xz 10393304 BLAKE2B 558321eefc6d599aaedfe468f03c2f1f99b5c96c253637db00b7da3265ec38e031d15f77623db1f4408f15912c93347e0f5769b01d92329be7f55e45f6f6bf75 SHA512 ce05ad2d3e1b55ffe9c8ef65023a840c04b29014c7876b23182a6a6dd0b768f248ec21bc5b738d21b846f59f4b73501a9fe834d6a87e7dba16c6f821008e0f01
23 DIST mesa-17.3.1.tar.xz 10669392 BLAKE2B 8e7a1299f79b47e9a4bc4d27123fda4e0effcb192f031c26942fd9eb056e751524c8d3f6e9f70c5871818b8c9972071e030f47ca73c112854d67695c53490597 SHA512 a2bd0123bf2df0db03197001a9e001b25f2609f3c6bf1bae66f3bc50c51d2558b5b77e232e81c1658c3a4dec88eda32a8b5a85c1fedc937a7441476228ef8238
24
25 diff --git a/media-libs/mesa/mesa-17.2.8.ebuild b/media-libs/mesa/mesa-17.2.8.ebuild
26 new file mode 100644
27 index 00000000000..6540d5ea3f9
28 --- /dev/null
29 +++ b/media-libs/mesa/mesa-17.2.8.ebuild
30 @@ -0,0 +1,582 @@
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/"
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 )
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.82"
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 +"
263 +[[ ${PV} == 9999 ]] && DEPEND+="
264 + sys-devel/bison
265 + sys-devel/flex
266 + $(python_gen_any_dep ">=dev-python/mako-0.7.3[\${PYTHON_USEDEP}]")
267 +"
268 +
269 +S="${WORKDIR}/${MY_P}"
270 +EGIT_CHECKOUT_DIR=${S}
271 +
272 +QA_WX_LOAD="
273 +x86? (
274 + !pic? (
275 + usr/lib*/libglapi.so.0.0.0
276 + usr/lib*/libGLESv1_CM.so.1.1.0
277 + usr/lib*/libGLESv2.so.2.0.0
278 + usr/lib*/libGL.so.1.2.0
279 + usr/lib*/libOSMesa.so.8.0.0
280 + )
281 +)"
282 +
283 +llvm_check_deps() {
284 + local flags=${MULTILIB_USEDEP}
285 + if use video_cards_r600 || use video_cards_radeon || use video_cards_radeonsi
286 + then
287 + flags+=",llvm_targets_AMDGPU(-)"
288 + fi
289 +
290 + if use opencl; then
291 + has_version "sys-devel/clang[${flags}]" || return 1
292 + fi
293 + has_version "sys-devel/llvm[${flags}]"
294 +}
295 +
296 +pkg_setup() {
297 + # warning message for bug 459306
298 + if use llvm && has_version sys-devel/llvm[!debug=]; then
299 + ewarn "Mismatch between debug USE flags in media-libs/mesa and sys-devel/llvm"
300 + ewarn "detected! This can cause problems. For details, see bug 459306."
301 + fi
302 +
303 + if use llvm; then
304 + llvm_pkg_setup
305 + fi
306 + python-any-r1_pkg_setup
307 +}
308 +
309 +src_prepare() {
310 + [[ ${PV} == 9999 ]] && eautoreconf
311 + eapply_user
312 +}
313 +
314 +multilib_src_configure() {
315 + local myconf
316 +
317 + if use classic; then
318 + # Configurable DRI drivers
319 + driver_enable swrast
320 +
321 + # Intel code
322 + driver_enable video_cards_i915 i915
323 + driver_enable video_cards_i965 i965
324 + if ! use video_cards_i915 && \
325 + ! use video_cards_i965; then
326 + driver_enable video_cards_intel i915 i965
327 + fi
328 +
329 + # Nouveau code
330 + driver_enable video_cards_nouveau nouveau
331 +
332 + # ATI code
333 + driver_enable video_cards_r100 radeon
334 + driver_enable video_cards_r200 r200
335 + if ! use video_cards_r100 && \
336 + ! use video_cards_r200; then
337 + driver_enable video_cards_radeon radeon r200
338 + fi
339 + fi
340 +
341 + if use egl; then
342 + myconf+=" --with-platforms=x11,surfaceless$(use wayland && echo ",wayland")$(use gbm && echo ",drm")"
343 + fi
344 +
345 + if use gallium; then
346 + myconf+="
347 + $(use_enable d3d9 nine)
348 + $(use_enable llvm)
349 + $(use_enable openmax omx)
350 + $(use_enable vaapi va)
351 + $(use_enable vdpau)
352 + $(use_enable xa)
353 + $(use_enable xvmc)
354 + "
355 + use vaapi && myconf+=" --with-va-libdir=/usr/$(get_libdir)/va/drivers"
356 +
357 + gallium_enable swrast
358 + gallium_enable video_cards_vc4 vc4
359 + gallium_enable video_cards_vivante etnaviv
360 + gallium_enable video_cards_vmware svga
361 + gallium_enable video_cards_nouveau nouveau
362 + gallium_enable video_cards_i915 i915
363 + gallium_enable video_cards_imx imx
364 + if ! use video_cards_i915 && \
365 + ! use video_cards_i965; then
366 + gallium_enable video_cards_intel i915
367 + fi
368 +
369 + gallium_enable video_cards_r300 r300
370 + gallium_enable video_cards_r600 r600
371 + gallium_enable video_cards_radeonsi radeonsi
372 + if ! use video_cards_r300 && \
373 + ! use video_cards_r600; then
374 + gallium_enable video_cards_radeon r300 r600
375 + fi
376 +
377 + gallium_enable video_cards_freedreno freedreno
378 + # opencl stuff
379 + if use opencl; then
380 + myconf+="
381 + $(use_enable opencl)
382 + --with-clang-libdir="${EPREFIX}/usr/lib"
383 + "
384 + fi
385 +
386 + gallium_enable video_cards_virgl virgl
387 + fi
388 +
389 + if use vulkan; then
390 + vulkan_enable video_cards_i965 intel
391 + vulkan_enable video_cards_radeonsi radeon
392 + fi
393 +
394 + # x86 hardened pax_kernel needs glx-rts, bug 240956
395 + if [[ ${ABI} == x86 ]]; then
396 + myconf+=" $(use_enable pax_kernel glx-read-only-text)"
397 + fi
398 +
399 + # on abi_x86_32 hardened we need to have asm disable
400 + if [[ ${ABI} == x86* ]] && use pic; then
401 + myconf+=" --disable-asm"
402 + fi
403 +
404 + if use gallium; then
405 + myconf+=" $(use_enable osmesa gallium-osmesa)"
406 + else
407 + myconf+=" $(use_enable osmesa)"
408 + fi
409 +
410 + # build fails with BSD indent, bug #428112
411 + use userland_GNU || export INDENT=cat
412 +
413 + ECONF_SOURCE="${S}" \
414 + econf \
415 + --enable-dri \
416 + --enable-glx \
417 + --enable-shared-glapi \
418 + $(use_enable !bindist texture-float) \
419 + $(use_enable d3d9 nine) \
420 + $(use_enable debug) \
421 + $(use_enable dri3) \
422 + $(use_enable egl) \
423 + $(use_enable gbm) \
424 + $(use_enable gles1) \
425 + $(use_enable gles2) \
426 + $(use_enable nptl glx-tls) \
427 + $(use_enable unwind libunwind) \
428 + --enable-valgrind=$(usex valgrind auto no) \
429 + --enable-llvm-shared-libs \
430 + --with-dri-drivers=${DRI_DRIVERS} \
431 + --with-gallium-drivers=${GALLIUM_DRIVERS} \
432 + --with-vulkan-drivers=${VULKAN_DRIVERS} \
433 + PYTHON2="${PYTHON}" \
434 + ${myconf}
435 +}
436 +
437 +multilib_src_install() {
438 + emake install DESTDIR="${D}"
439 +
440 + if use classic || use gallium; then
441 + ebegin "Moving DRI/Gallium drivers for dynamic switching"
442 + local gallium_drivers=( i915_dri.so i965_dri.so r300_dri.so r600_dri.so swrast_dri.so )
443 + keepdir /usr/$(get_libdir)/dri
444 + dodir /usr/$(get_libdir)/mesa
445 + for x in ${gallium_drivers[@]}; do
446 + if [ -f "$(get_libdir)/gallium/${x}" ]; then
447 + mv -f "${ED}/usr/$(get_libdir)/dri/${x}" "${ED}/usr/$(get_libdir)/dri/${x/_dri.so/g_dri.so}" \
448 + || die "Failed to move ${x}"
449 + fi
450 + done
451 + if use classic; then
452 + emake -C "${BUILD_DIR}/src/mesa/drivers/dri" DESTDIR="${D}" install
453 + fi
454 + for x in "${ED}"/usr/$(get_libdir)/dri/*.so; do
455 + if [ -f ${x} -o -L ${x} ]; then
456 + mv -f "${x}" "${x/dri/mesa}" \
457 + || die "Failed to move ${x}"
458 + fi
459 + done
460 + pushd "${ED}"/usr/$(get_libdir)/dri || die "pushd failed"
461 + ln -s ../mesa/*.so . || die "Creating symlink failed"
462 + # remove symlinks to drivers known to eselect
463 + for x in ${gallium_drivers[@]}; do
464 + if [ -f ${x} -o -L ${x} ]; then
465 + rm "${x}" || die "Failed to remove ${x}"
466 + fi
467 + done
468 + popd
469 + eend $?
470 + fi
471 + if use opencl; then
472 + ebegin "Moving Gallium/Clover OpenCL implementation for dynamic switching"
473 + local cl_dir="/usr/$(get_libdir)/OpenCL/vendors/mesa"
474 + dodir ${cl_dir}/{lib,include}
475 + if [ -f "${ED}/usr/$(get_libdir)/libOpenCL.so" ]; then
476 + mv -f "${ED}"/usr/$(get_libdir)/libOpenCL.so* \
477 + "${ED}"${cl_dir}
478 + fi
479 + if [ -f "${ED}/usr/include/CL/opencl.h" ]; then
480 + mv -f "${ED}"/usr/include/CL \
481 + "${ED}"${cl_dir}/include
482 + fi
483 + eend $?
484 + fi
485 +
486 + if use openmax; then
487 + echo "XDG_DATA_DIRS=\"${EPREFIX}/usr/share/mesa/xdg\"" > "${T}/99mesaxdgomx"
488 + doenvd "${T}"/99mesaxdgomx
489 + keepdir /usr/share/mesa/xdg
490 + fi
491 +}
492 +
493 +multilib_src_install_all() {
494 + find "${ED}" -name '*.la' -delete
495 + einstalldocs
496 +
497 + if use !bindist; then
498 + dodoc docs/patents.txt
499 + fi
500 +
501 + # Install config file for eselect mesa
502 + insinto /usr/share/mesa
503 + newins "${FILESDIR}/eselect-mesa.conf.9.2" eselect-mesa.conf
504 +}
505 +
506 +multilib_src_test() {
507 + if use llvm; then
508 + 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'
509 + pushd src/gallium/drivers/llvmpipe >/dev/null || die
510 + emake ${llvm_tests}
511 + pax-mark m ${llvm_tests}
512 + popd >/dev/null || die
513 + fi
514 + emake check
515 +}
516 +
517 +pkg_postinst() {
518 + # Switch to the xorg implementation.
519 + echo
520 + eselect opengl set --use-old ${OPENGL_DIR}
521 +
522 + # Select classic/gallium drivers
523 + if use classic || use gallium; then
524 + eselect mesa set --auto
525 + fi
526 +
527 + # Switch to mesa opencl
528 + if use opencl; then
529 + eselect opencl set --use-old ${PN}
530 + fi
531 +
532 + # run omxregister-bellagio to make the OpenMAX drivers known system-wide
533 + if use openmax; then
534 + ebegin "Registering OpenMAX drivers"
535 + BELLAGIO_SEARCH_PATH="${EPREFIX}/usr/$(get_libdir)/libomxil-bellagio0" \
536 + OMX_BELLAGIO_REGISTRY=${EPREFIX}/usr/share/mesa/xdg/.omxregister \
537 + omxregister-bellagio
538 + eend $?
539 + fi
540 +
541 + # warn about patent encumbered texture-float
542 + if use !bindist; then
543 + elog "USE=\"bindist\" was not set. Potentially patent encumbered code was"
544 + elog "enabled. Please see patents.txt for an explanation."
545 + fi
546 +
547 + if ! has_version media-libs/libtxc_dxtn; then
548 + elog "Note that in order to have full S3TC support, it is necessary to install"
549 + elog "media-libs/libtxc_dxtn as well. This may be necessary to get nice"
550 + elog "textures in some apps, and some others even require this to run."
551 + fi
552 +}
553 +
554 +pkg_prerm() {
555 + if use openmax; then
556 + rm "${EPREFIX}"/usr/share/mesa/xdg/.omxregister
557 + fi
558 +}
559 +
560 +# $1 - VIDEO_CARDS flag
561 +# other args - names of DRI drivers to enable
562 +# TODO: avoid code duplication for a more elegant implementation
563 +driver_enable() {
564 + case $# in
565 + # for enabling unconditionally
566 + 1)
567 + DRI_DRIVERS+=",$1"
568 + ;;
569 + *)
570 + if use $1; then
571 + shift
572 + for i in $@; do
573 + DRI_DRIVERS+=",${i}"
574 + done
575 + fi
576 + ;;
577 + esac
578 +}
579 +
580 +gallium_enable() {
581 + case $# in
582 + # for enabling unconditionally
583 + 1)
584 + GALLIUM_DRIVERS+=",$1"
585 + ;;
586 + *)
587 + if use $1; then
588 + shift
589 + for i in $@; do
590 + GALLIUM_DRIVERS+=",${i}"
591 + done
592 + fi
593 + ;;
594 + esac
595 +}
596 +
597 +vulkan_enable() {
598 + case $# in
599 + # for enabling unconditionally
600 + 1)
601 + VULKAN_DRIVERS+=",$1"
602 + ;;
603 + *)
604 + if use $1; then
605 + shift
606 + for i in $@; do
607 + VULKAN_DRIVERS+=",${i}"
608 + done
609 + fi
610 + ;;
611 + esac
612 +}