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: Mon, 29 Jan 2018 17:43:12
Message-Id: 1517247768.6f9a0cf995fb88ac7519662393a9e8fb747486f2.mattst88@gentoo
1 commit: 6f9a0cf995fb88ac7519662393a9e8fb747486f2
2 Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jan 29 17:42:29 2018 +0000
4 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
5 CommitDate: Mon Jan 29 17:42:48 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6f9a0cf9
7
8 media-libs/mesa: Version bump to 18.0.0_rc3
9
10 media-libs/mesa/Manifest | 1 +
11 media-libs/mesa/mesa-18.0.0_rc3.ebuild | 582 +++++++++++++++++++++++++++++++++
12 2 files changed, 583 insertions(+)
13
14 diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
15 index d4d62f70f38..a2275f96feb 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 00000000000..e2f425d49ac
27 --- /dev/null
28 +++ b/media-libs/mesa/mesa-18.0.0_rc3.ebuild
29 @@ -0,0 +1,582 @@
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="~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.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 + [[ ${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 + --disable-opencl-icd \
434 + --with-dri-drivers=${DRI_DRIVERS} \
435 + --with-gallium-drivers=${GALLIUM_DRIVERS} \
436 + --with-vulkan-drivers=${VULKAN_DRIVERS} \
437 + PYTHON2="${PYTHON}" \
438 + ${myconf}
439 +}
440 +
441 +multilib_src_install() {
442 + emake install DESTDIR="${D}"
443 +
444 + if use classic || use gallium; then
445 + ebegin "Moving DRI/Gallium drivers for dynamic switching"
446 + local gallium_drivers=( i915_dri.so i965_dri.so r300_dri.so r600_dri.so swrast_dri.so )
447 + keepdir /usr/$(get_libdir)/dri
448 + dodir /usr/$(get_libdir)/mesa
449 + for x in ${gallium_drivers[@]}; do
450 + if [ -f "$(get_libdir)/gallium/${x}" ]; then
451 + mv -f "${ED}/usr/$(get_libdir)/dri/${x}" "${ED}/usr/$(get_libdir)/dri/${x/_dri.so/g_dri.so}" \
452 + || die "Failed to move ${x}"
453 + fi
454 + done
455 + if use classic; then
456 + emake -C "${BUILD_DIR}/src/mesa/drivers/dri" DESTDIR="${D}" install
457 + fi
458 + for x in "${ED}"/usr/$(get_libdir)/dri/*.so; do
459 + if [ -f ${x} -o -L ${x} ]; then
460 + mv -f "${x}" "${x/dri/mesa}" \
461 + || die "Failed to move ${x}"
462 + fi
463 + done
464 + pushd "${ED}"/usr/$(get_libdir)/dri || die "pushd failed"
465 + ln -s ../mesa/*.so . || die "Creating symlink failed"
466 + # remove symlinks to drivers known to eselect
467 + for x in ${gallium_drivers[@]}; do
468 + if [ -f ${x} -o -L ${x} ]; then
469 + rm "${x}" || die "Failed to remove ${x}"
470 + fi
471 + done
472 + popd
473 + eend $?
474 + fi
475 + if use opencl; then
476 + ebegin "Moving Gallium/Clover OpenCL implementation for dynamic switching"
477 + local cl_dir="/usr/$(get_libdir)/OpenCL/vendors/mesa"
478 + dodir ${cl_dir}/{lib,include}
479 + if [ -f "${ED}/usr/$(get_libdir)/libOpenCL.so" ]; then
480 + mv -f "${ED}"/usr/$(get_libdir)/libOpenCL.so* \
481 + "${ED}"${cl_dir}
482 + fi
483 + if [ -f "${ED}/usr/include/CL/opencl.h" ]; then
484 + mv -f "${ED}"/usr/include/CL \
485 + "${ED}"${cl_dir}/include
486 + fi
487 + eend $?
488 + fi
489 +
490 + if use openmax; then
491 + echo "XDG_DATA_DIRS=\"${EPREFIX}/usr/share/mesa/xdg\"" > "${T}/99mesaxdgomx"
492 + doenvd "${T}"/99mesaxdgomx
493 + keepdir /usr/share/mesa/xdg
494 + fi
495 +}
496 +
497 +multilib_src_install_all() {
498 + find "${ED}" -name '*.la' -delete
499 + einstalldocs
500 +
501 + if use !bindist; then
502 + dodoc docs/patents.txt
503 + fi
504 +
505 + # Install config file for eselect mesa
506 + insinto /usr/share/mesa
507 + newins "${FILESDIR}/eselect-mesa.conf.9.2" eselect-mesa.conf
508 +}
509 +
510 +multilib_src_test() {
511 + if use llvm; then
512 + 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'
513 + pushd src/gallium/drivers/llvmpipe >/dev/null || die
514 + emake ${llvm_tests}
515 + pax-mark m ${llvm_tests}
516 + popd >/dev/null || die
517 + fi
518 + emake check
519 +}
520 +
521 +pkg_postinst() {
522 + # Switch to the xorg implementation.
523 + echo
524 + eselect opengl set --use-old ${OPENGL_DIR}
525 +
526 + # Select classic/gallium drivers
527 + if use classic || use gallium; then
528 + eselect mesa set --auto
529 + fi
530 +
531 + # Switch to mesa opencl
532 + if use opencl; then
533 + eselect opencl set --use-old ${PN}
534 + fi
535 +
536 + # run omxregister-bellagio to make the OpenMAX drivers known system-wide
537 + if use openmax; then
538 + ebegin "Registering OpenMAX drivers"
539 + BELLAGIO_SEARCH_PATH="${EPREFIX}/usr/$(get_libdir)/libomxil-bellagio0" \
540 + OMX_BELLAGIO_REGISTRY=${EPREFIX}/usr/share/mesa/xdg/.omxregister \
541 + omxregister-bellagio
542 + eend $?
543 + fi
544 +
545 + # warn about patent encumbered texture-float
546 + if use !bindist; then
547 + elog "USE=\"bindist\" was not set. Potentially patent encumbered code was"
548 + elog "enabled. Please see /usr/share/doc/${P}/patents.txt.bz2 for an"
549 + elog "explanation."
550 + fi
551 +}
552 +
553 +pkg_prerm() {
554 + if use openmax; then
555 + rm "${EPREFIX}"/usr/share/mesa/xdg/.omxregister
556 + fi
557 +}
558 +
559 +# $1 - VIDEO_CARDS flag
560 +# other args - names of DRI drivers to enable
561 +# TODO: avoid code duplication for a more elegant implementation
562 +driver_enable() {
563 + case $# in
564 + # for enabling unconditionally
565 + 1)
566 + DRI_DRIVERS+=",$1"
567 + ;;
568 + *)
569 + if use $1; then
570 + shift
571 + for i in $@; do
572 + DRI_DRIVERS+=",${i}"
573 + done
574 + fi
575 + ;;
576 + esac
577 +}
578 +
579 +gallium_enable() {
580 + case $# in
581 + # for enabling unconditionally
582 + 1)
583 + GALLIUM_DRIVERS+=",$1"
584 + ;;
585 + *)
586 + if use $1; then
587 + shift
588 + for i in $@; do
589 + GALLIUM_DRIVERS+=",${i}"
590 + done
591 + fi
592 + ;;
593 + esac
594 +}
595 +
596 +vulkan_enable() {
597 + case $# in
598 + # for enabling unconditionally
599 + 1)
600 + VULKAN_DRIVERS+=",$1"
601 + ;;
602 + *)
603 + if use $1; then
604 + shift
605 + for i in $@; do
606 + VULKAN_DRIVERS+=",${i}"
607 + done
608 + fi
609 + ;;
610 + esac
611 +}