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: Wed, 21 Mar 2018 16:59:50
Message-Id: 1521651506.2382f5cebcf5795a833ff14cb054b97b3fa977fc.mattst88@gentoo
1 commit: 2382f5cebcf5795a833ff14cb054b97b3fa977fc
2 Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
3 AuthorDate: Wed Mar 21 16:57:48 2018 +0000
4 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
5 CommitDate: Wed Mar 21 16:58:26 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2382f5ce
7
8 media-libs/mesa: Version bump to 18.0.0_rc5
9
10 media-libs/mesa/Manifest | 1 +
11 media-libs/mesa/mesa-18.0.0_rc5.ebuild | 584 +++++++++++++++++++++++++++++++++
12 2 files changed, 585 insertions(+)
13
14 diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
15 index 279976d3b37..74f636cd62d 100644
16 --- a/media-libs/mesa/Manifest
17 +++ b/media-libs/mesa/Manifest
18 @@ -3,3 +3,4 @@ DIST mesa-17.2.8.tar.xz 10393304 BLAKE2B 558321eefc6d599aaedfe468f03c2f1f99b5c96
19 DIST mesa-17.3.6.tar.xz 10679396 BLAKE2B 53b74401b9cb40018b3e2c921c4fd39b81809e8485b632c2fe40e7ebd55fbf3a10f4cb8fe2f1a3d6d181f609e8ac8f36d795eca9e0eda7fd5db96b08d2105094 SHA512 5164ed5a1d3d25031b712a9f443f0e467a29b2bca0a1aa11324ed5c10279411979c9c7482825053926a813e76c58b78a3439c7c81fcd51a7808f53977080828f
20 DIST mesa-17.3.7.tar.xz 10654684 BLAKE2B 520b045f7ab4b60ab372960ca933e60229dc38075d28c9e0f144d0a2dc222d6c2830e4739962008319bed27fe9a83bae7c38609d0135c3d5918d35dff6c0381d SHA512 ec48565556aa4281056cee5dbef140553651fdfbb76ce32397de048db1cf65f5e18787c72b998de7da2de795d27e7040bde84651ade4726fc3a69a23b166ba4e
21 DIST mesa-18.0.0-rc4.tar.xz 11027596 BLAKE2B 96554acd69636b91d1b79e7fefa4ba6e3f701ef7ef6c16718493070d62ab41c7bbd66e2f4d4a97fac8c236ac4c9150b2ce41e4e57b865fff6122b3f60b047e25 SHA512 91dd0a4396715a7896fc47aabf38c4b486df3b50c9764795805550ef01724d2e2281ba9b000e82760ea0e199c58d8c9943dbc732b2adab46554ff5c2f9e2ece1
22 +DIST mesa-18.0.0-rc5.tar.xz 10970572 BLAKE2B 5415bf4a2b33d813c3987be2aa3648ffa0ec345a109f80c3f6d5af51d06104e3af1a8d8a0763af2c419a8e30ed46c316347449ce016293281c87484a678205bd SHA512 90c68c0bf9e689992626b593ad53d4f7fb402e556ac70672b618abd3a224e637fc6a26fb197bb3b692a8363117de09e01fd524f9de181359eba0879226e3e5a6
23
24 diff --git a/media-libs/mesa/mesa-18.0.0_rc5.ebuild b/media-libs/mesa/mesa-18.0.0_rc5.ebuild
25 new file mode 100644
26 index 00000000000..4fb4344b03a
27 --- /dev/null
28 +++ b/media-libs/mesa/mesa-18.0.0_rc5.ebuild
29 @@ -0,0 +1,584 @@
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? (
144 + >=media-libs/libomxil-bellagio-0.9.3:=[${MULTILIB_USEDEP}]
145 + x11-misc/xdg-utils
146 + )
147 + vaapi? (
148 + >=x11-libs/libva-1.7.3:=[${MULTILIB_USEDEP}]
149 + video_cards_nouveau? ( !<=x11-libs/libva-vdpau-driver-0.7.4-r3 )
150 + )
151 + vdpau? ( >=x11-libs/libvdpau-1.1:=[${MULTILIB_USEDEP}] )
152 + wayland? (
153 + >=dev-libs/wayland-1.11.0:=[${MULTILIB_USEDEP}]
154 + >=dev-libs/wayland-protocols-1.8
155 + )
156 + xvmc? ( >=x11-libs/libXvMC-1.0.8:=[${MULTILIB_USEDEP}] )
157 + ${LIBDRM_DEPSTRING}[video_cards_freedreno?,video_cards_nouveau?,video_cards_vc4?,video_cards_vivante?,video_cards_vmware?,${MULTILIB_USEDEP}]
158 +
159 + video_cards_intel? (
160 + !video_cards_i965? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
161 + )
162 + video_cards_i915? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
163 +"
164 +for card in ${RADEON_CARDS}; do
165 + RDEPEND="${RDEPEND}
166 + video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_radeon] )
167 + "
168 +done
169 +RDEPEND="${RDEPEND}
170 + video_cards_radeonsi? ( ${LIBDRM_DEPSTRING}[video_cards_amdgpu] )
171 +"
172 +
173 +# Please keep the LLVM dependency block separate. Since LLVM is slotted,
174 +# we need to *really* make sure we're not pulling one than more slot
175 +# simultaneously.
176 +#
177 +# How to use it:
178 +# 1. List all the working slots (with min versions) in ||, newest first.
179 +# 2. Update the := to specify *max* version, e.g. < 7.
180 +# 3. Specify LLVM_MAX_SLOT, e.g. 6.
181 +LLVM_DEPSTR="
182 + || (
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 + [[ ${PV} == 9999 ]] && eautoreconf
316 + eapply_user
317 +}
318 +
319 +multilib_src_configure() {
320 + local myconf
321 +
322 + if use classic; then
323 + # Configurable DRI drivers
324 + driver_enable swrast
325 +
326 + # Intel code
327 + driver_enable video_cards_i915 i915
328 + driver_enable video_cards_i965 i965
329 + if ! use video_cards_i915 && \
330 + ! use video_cards_i965; then
331 + driver_enable video_cards_intel i915 i965
332 + fi
333 +
334 + # Nouveau code
335 + driver_enable video_cards_nouveau nouveau
336 +
337 + # ATI code
338 + driver_enable video_cards_r100 radeon
339 + driver_enable video_cards_r200 r200
340 + if ! use video_cards_r100 && \
341 + ! use video_cards_r200; then
342 + driver_enable video_cards_radeon radeon r200
343 + fi
344 + fi
345 +
346 + if use egl; then
347 + myconf+=" --with-platforms=x11,surfaceless$(use wayland && echo ",wayland")$(use gbm && echo ",drm")"
348 + fi
349 +
350 + if use gallium; then
351 + myconf+="
352 + $(use_enable d3d9 nine)
353 + $(use_enable llvm)
354 + $(use_enable openmax omx-bellagio)
355 + $(use_enable vaapi va)
356 + $(use_enable vdpau)
357 + $(use_enable xa)
358 + $(use_enable xvmc)
359 + "
360 + use vaapi && myconf+=" --with-va-libdir=/usr/$(get_libdir)/va/drivers"
361 +
362 + gallium_enable swrast
363 + gallium_enable video_cards_vc4 vc4
364 + gallium_enable video_cards_vivante etnaviv
365 + gallium_enable video_cards_vmware svga
366 + gallium_enable video_cards_nouveau nouveau
367 + gallium_enable video_cards_i915 i915
368 + gallium_enable video_cards_imx imx
369 + if ! use video_cards_i915 && \
370 + ! use video_cards_i965; then
371 + gallium_enable video_cards_intel i915
372 + fi
373 +
374 + gallium_enable video_cards_r300 r300
375 + gallium_enable video_cards_r600 r600
376 + gallium_enable video_cards_radeonsi radeonsi
377 + if ! use video_cards_r300 && \
378 + ! use video_cards_r600; then
379 + gallium_enable video_cards_radeon r300 r600
380 + fi
381 +
382 + gallium_enable video_cards_freedreno freedreno
383 + # opencl stuff
384 + if use opencl; then
385 + myconf+="
386 + $(use_enable opencl)
387 + --with-clang-libdir="${EPREFIX}/usr/lib"
388 + "
389 + fi
390 +
391 + gallium_enable video_cards_virgl virgl
392 + fi
393 +
394 + if use vulkan; then
395 + vulkan_enable video_cards_i965 intel
396 + vulkan_enable video_cards_radeonsi radeon
397 + fi
398 +
399 + # x86 hardened pax_kernel needs glx-rts, bug 240956
400 + if [[ ${ABI} == x86 ]]; then
401 + myconf+=" $(use_enable pax_kernel glx-read-only-text)"
402 + fi
403 +
404 + # on abi_x86_32 hardened we need to have asm disable
405 + if [[ ${ABI} == x86* ]] && use pic; then
406 + myconf+=" --disable-asm"
407 + fi
408 +
409 + if use gallium; then
410 + myconf+=" $(use_enable osmesa gallium-osmesa)"
411 + else
412 + myconf+=" $(use_enable osmesa)"
413 + fi
414 +
415 + # build fails with BSD indent, bug #428112
416 + use userland_GNU || export INDENT=cat
417 +
418 + ECONF_SOURCE="${S}" \
419 + econf \
420 + --enable-dri \
421 + --enable-glx \
422 + --enable-shared-glapi \
423 + $(use_enable !bindist texture-float) \
424 + $(use_enable d3d9 nine) \
425 + $(use_enable debug) \
426 + $(use_enable dri3) \
427 + $(use_enable egl) \
428 + $(use_enable gbm) \
429 + $(use_enable gles1) \
430 + $(use_enable gles2) \
431 + $(use_enable nptl glx-tls) \
432 + $(use_enable unwind libunwind) \
433 + --enable-valgrind=$(usex valgrind auto no) \
434 + --enable-llvm-shared-libs \
435 + --disable-opencl-icd \
436 + --with-dri-drivers=${DRI_DRIVERS} \
437 + --with-gallium-drivers=${GALLIUM_DRIVERS} \
438 + --with-vulkan-drivers=${VULKAN_DRIVERS} \
439 + PYTHON2="${PYTHON}" \
440 + ${myconf}
441 +}
442 +
443 +multilib_src_install() {
444 + emake install DESTDIR="${D}"
445 +
446 + if use classic || use gallium; then
447 + ebegin "Moving DRI/Gallium drivers for dynamic switching"
448 + local gallium_drivers=( i915_dri.so i965_dri.so r300_dri.so r600_dri.so swrast_dri.so )
449 + keepdir /usr/$(get_libdir)/dri
450 + dodir /usr/$(get_libdir)/mesa
451 + for x in ${gallium_drivers[@]}; do
452 + if [ -f "$(get_libdir)/gallium/${x}" ]; then
453 + mv -f "${ED}/usr/$(get_libdir)/dri/${x}" "${ED}/usr/$(get_libdir)/dri/${x/_dri.so/g_dri.so}" \
454 + || die "Failed to move ${x}"
455 + fi
456 + done
457 + if use classic; then
458 + emake -C "${BUILD_DIR}/src/mesa/drivers/dri" DESTDIR="${D}" install
459 + fi
460 + for x in "${ED}"/usr/$(get_libdir)/dri/*.so; do
461 + if [ -f ${x} -o -L ${x} ]; then
462 + mv -f "${x}" "${x/dri/mesa}" \
463 + || die "Failed to move ${x}"
464 + fi
465 + done
466 + pushd "${ED}"/usr/$(get_libdir)/dri || die "pushd failed"
467 + ln -s ../mesa/*.so . || die "Creating symlink failed"
468 + # remove symlinks to drivers known to eselect
469 + for x in ${gallium_drivers[@]}; do
470 + if [ -f ${x} -o -L ${x} ]; then
471 + rm "${x}" || die "Failed to remove ${x}"
472 + fi
473 + done
474 + popd
475 + eend $?
476 + fi
477 + if use opencl; then
478 + ebegin "Moving Gallium/Clover OpenCL implementation for dynamic switching"
479 + local cl_dir="/usr/$(get_libdir)/OpenCL/vendors/mesa"
480 + dodir ${cl_dir}/{lib,include}
481 + if [ -f "${ED}/usr/$(get_libdir)/libOpenCL.so" ]; then
482 + mv -f "${ED}"/usr/$(get_libdir)/libOpenCL.so* \
483 + "${ED}"${cl_dir}
484 + fi
485 + if [ -f "${ED}/usr/include/CL/opencl.h" ]; then
486 + mv -f "${ED}"/usr/include/CL \
487 + "${ED}"${cl_dir}/include
488 + fi
489 + eend $?
490 + fi
491 +
492 + if use openmax; then
493 + echo "XDG_DATA_DIRS=\"${EPREFIX}/usr/share/mesa/xdg\"" > "${T}/99mesaxdgomx"
494 + doenvd "${T}"/99mesaxdgomx
495 + keepdir /usr/share/mesa/xdg
496 + fi
497 +}
498 +
499 +multilib_src_install_all() {
500 + find "${ED}" -name '*.la' -delete
501 + einstalldocs
502 +
503 + if use !bindist; then
504 + dodoc docs/patents.txt
505 + fi
506 +
507 + # Install config file for eselect mesa
508 + insinto /usr/share/mesa
509 + newins "${FILESDIR}/eselect-mesa.conf.9.2" eselect-mesa.conf
510 +}
511 +
512 +multilib_src_test() {
513 + if use llvm; then
514 + 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'
515 + pushd src/gallium/drivers/llvmpipe >/dev/null || die
516 + emake ${llvm_tests}
517 + pax-mark m ${llvm_tests}
518 + popd >/dev/null || die
519 + fi
520 + emake check
521 +}
522 +
523 +pkg_postinst() {
524 + # Switch to the xorg implementation.
525 + echo
526 + eselect opengl set --use-old ${OPENGL_DIR}
527 +
528 + # Select classic/gallium drivers
529 + if use classic || use gallium; then
530 + eselect mesa set --auto
531 + fi
532 +
533 + # Switch to mesa opencl
534 + if use opencl; then
535 + eselect opencl set --use-old ${PN}
536 + fi
537 +
538 + # run omxregister-bellagio to make the OpenMAX drivers known system-wide
539 + if use openmax; then
540 + ebegin "Registering OpenMAX drivers"
541 + BELLAGIO_SEARCH_PATH="${EPREFIX}/usr/$(get_libdir)/libomxil-bellagio0" \
542 + OMX_BELLAGIO_REGISTRY=${EPREFIX}/usr/share/mesa/xdg/.omxregister \
543 + omxregister-bellagio
544 + eend $?
545 + fi
546 +
547 + # warn about patent encumbered texture-float
548 + if use !bindist; then
549 + elog "USE=\"bindist\" was not set. Potentially patent encumbered code was"
550 + elog "enabled. Please see /usr/share/doc/${P}/patents.txt.bz2 for an"
551 + elog "explanation."
552 + fi
553 +}
554 +
555 +pkg_prerm() {
556 + if use openmax; then
557 + rm "${EPREFIX}"/usr/share/mesa/xdg/.omxregister
558 + fi
559 +}
560 +
561 +# $1 - VIDEO_CARDS flag
562 +# other args - names of DRI drivers to enable
563 +# TODO: avoid code duplication for a more elegant implementation
564 +driver_enable() {
565 + case $# in
566 + # for enabling unconditionally
567 + 1)
568 + DRI_DRIVERS+=",$1"
569 + ;;
570 + *)
571 + if use $1; then
572 + shift
573 + for i in $@; do
574 + DRI_DRIVERS+=",${i}"
575 + done
576 + fi
577 + ;;
578 + esac
579 +}
580 +
581 +gallium_enable() {
582 + case $# in
583 + # for enabling unconditionally
584 + 1)
585 + GALLIUM_DRIVERS+=",$1"
586 + ;;
587 + *)
588 + if use $1; then
589 + shift
590 + for i in $@; do
591 + GALLIUM_DRIVERS+=",${i}"
592 + done
593 + fi
594 + ;;
595 + esac
596 +}
597 +
598 +vulkan_enable() {
599 + case $# in
600 + # for enabling unconditionally
601 + 1)
602 + VULKAN_DRIVERS+=",$1"
603 + ;;
604 + *)
605 + if use $1; then
606 + shift
607 + for i in $@; do
608 + VULKAN_DRIVERS+=",${i}"
609 + done
610 + fi
611 + ;;
612 + esac
613 +}