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: Sun, 10 Dec 2017 22:08:17
Message-Id: 1512943686.0536f07db5267b66e2ca8608224b4d9a5987dff7.mattst88@gentoo
1 commit: 0536f07db5267b66e2ca8608224b4d9a5987dff7
2 Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
3 AuthorDate: Sun Dec 10 22:06:00 2017 +0000
4 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
5 CommitDate: Sun Dec 10 22:08:06 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0536f07d
7
8 media-libs/mesa: Version bump to 17.3.0
9
10 media-libs/mesa/Manifest | 1 +
11 media-libs/mesa/mesa-17.3.0.ebuild | 580 +++++++++++++++++++++++++++++++++++++
12 2 files changed, 581 insertions(+)
13
14 diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
15 index e37a7345f30..7761807445a 100644
16 --- a/media-libs/mesa/Manifest
17 +++ b/media-libs/mesa/Manifest
18 @@ -2,3 +2,4 @@ DIST mesa-17.0.6.tar.xz 9494872 BLAKE2B 1e83b0d40bb911c26880f25b281ba6e065dbf475
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.3.0-rc5.tar.xz 10663464 BLAKE2B 0706e3175358f43ce70707e9f18c22df60c387d1260c4dfae13a55f9278a266d9885483c6e794d913c8ad5f4b9dd3d852f309e0ef3f042b9ae62b371d9dfba84 SHA512 b53e40f39850067e97dcf9d1eb10d1f5d3a8729933057bacf3648b86ef55c43d7b2f2f5444ae8c6f1b8677c2c3fd12f7484ee08139bd388dc4cebd8dbaf28c83
22 +DIST mesa-17.3.0.tar.xz 10667896 BLAKE2B 4786f1ac3fa2d2f07895c829f2c0770861d64f606d72635eb206cb9f0a1e84c061950fbf33b2c7b27055399da43d705ed9abd5d8f46c7bb3e3d9a6497f4bd71d SHA512 b0a616ce9a534a19c42eb0a626a178c6a7171aae1989351ea7c2a9e775a7478758b805dbfb754056720b1ef0454c3d3beb64aa59543be27f249ce97efae8e47e
23
24 diff --git a/media-libs/mesa/mesa-17.3.0.ebuild b/media-libs/mesa/mesa-17.3.0.ebuild
25 new file mode 100644
26 index 00000000000..14e934a1321
27 --- /dev/null
28 +++ b/media-libs/mesa/mesa-17.3.0.ebuild
29 @@ -0,0 +1,580 @@
30 +# Copyright 1999-2017 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.85"
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_MAX_SLOT="5"
179 +LLVM_DEPSTR="
180 + || (
181 + sys-devel/llvm:5[${MULTILIB_USEDEP}]
182 + sys-devel/llvm:4[${MULTILIB_USEDEP}]
183 + >=sys-devel/llvm-3.9.0:0[${MULTILIB_USEDEP}]
184 + )
185 + <sys-devel/llvm-6:=[${MULTILIB_USEDEP}]
186 +"
187 +LLVM_DEPSTR_AMDGPU=${LLVM_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
188 +CLANG_DEPSTR=${LLVM_DEPSTR//llvm/clang}
189 +CLANG_DEPSTR_AMDGPU=${CLANG_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
190 +RDEPEND="${RDEPEND}
191 + llvm? (
192 + opencl? (
193 + video_cards_r600? (
194 + ${CLANG_DEPSTR_AMDGPU}
195 + )
196 + !video_cards_r600? (
197 + video_cards_radeonsi? (
198 + ${CLANG_DEPSTR_AMDGPU}
199 + )
200 + )
201 + !video_cards_r600? (
202 + !video_cards_radeonsi? (
203 + video_cards_radeon? (
204 + ${CLANG_DEPSTR_AMDGPU}
205 + )
206 + )
207 + )
208 + !video_cards_r600? (
209 + !video_cards_radeon? (
210 + !video_cards_radeonsi? (
211 + ${CLANG_DEPSTR}
212 + )
213 + )
214 + )
215 + )
216 + !opencl? (
217 + video_cards_r600? (
218 + ${LLVM_DEPSTR_AMDGPU}
219 + )
220 + !video_cards_r600? (
221 + video_cards_radeonsi? (
222 + ${LLVM_DEPSTR_AMDGPU}
223 + )
224 + )
225 + !video_cards_r600? (
226 + !video_cards_radeonsi? (
227 + video_cards_radeon? (
228 + ${LLVM_DEPSTR_AMDGPU}
229 + )
230 + )
231 + )
232 + !video_cards_r600? (
233 + !video_cards_radeon? (
234 + !video_cards_radeonsi? (
235 + ${LLVM_DEPSTR}
236 + )
237 + )
238 + )
239 + )
240 + )
241 +"
242 +unset {LLVM,CLANG}_DEPSTR{,_AMDGPU}
243 +
244 +DEPEND="${RDEPEND}
245 + ${PYTHON_DEPS}
246 + opencl? (
247 + >=sys-devel/gcc-4.6
248 + )
249 + sys-devel/gettext
250 + virtual/pkgconfig
251 + valgrind? ( dev-util/valgrind )
252 + >=x11-proto/dri2proto-2.8-r1:=[${MULTILIB_USEDEP}]
253 + dri3? (
254 + >=x11-proto/dri3proto-1.0:=[${MULTILIB_USEDEP}]
255 + >=x11-proto/presentproto-1.0:=[${MULTILIB_USEDEP}]
256 + )
257 + >=x11-proto/glproto-1.4.17-r1:=[${MULTILIB_USEDEP}]
258 + >=x11-proto/xextproto-7.2.1-r1:=[${MULTILIB_USEDEP}]
259 + >=x11-proto/xf86driproto-2.1.1-r1:=[${MULTILIB_USEDEP}]
260 + >=x11-proto/xf86vidmodeproto-2.3.1-r1:=[${MULTILIB_USEDEP}]
261 + vulkan? (
262 + $(python_gen_any_dep ">=dev-python/mako-0.7.3[\${PYTHON_USEDEP}]")
263 + )
264 +"
265 +[[ ${PV} == 9999 ]] && DEPEND+="
266 + sys-devel/bison
267 + sys-devel/flex
268 + $(python_gen_any_dep ">=dev-python/mako-0.7.3[\${PYTHON_USEDEP}]")
269 +"
270 +
271 +S="${WORKDIR}/${MY_P}"
272 +EGIT_CHECKOUT_DIR=${S}
273 +
274 +QA_WX_LOAD="
275 +x86? (
276 + !pic? (
277 + usr/lib*/libglapi.so.0.0.0
278 + usr/lib*/libGLESv1_CM.so.1.1.0
279 + usr/lib*/libGLESv2.so.2.0.0
280 + usr/lib*/libGL.so.1.2.0
281 + usr/lib*/libOSMesa.so.8.0.0
282 + )
283 +)"
284 +
285 +llvm_check_deps() {
286 + local flags=${MULTILIB_USEDEP}
287 + if use video_cards_r600 || use video_cards_radeon || use video_cards_radeonsi
288 + then
289 + flags+=",llvm_targets_AMDGPU(-)"
290 + fi
291 +
292 + if use opencl; then
293 + has_version "sys-devel/clang[${flags}]" || return 1
294 + fi
295 + has_version "sys-devel/llvm[${flags}]"
296 +}
297 +
298 +pkg_setup() {
299 + # warning message for bug 459306
300 + if use llvm && has_version sys-devel/llvm[!debug=]; then
301 + ewarn "Mismatch between debug USE flags in media-libs/mesa and sys-devel/llvm"
302 + ewarn "detected! This can cause problems. For details, see bug 459306."
303 + fi
304 +
305 + if use llvm; then
306 + llvm_pkg_setup
307 + fi
308 + python-any-r1_pkg_setup
309 +}
310 +
311 +src_prepare() {
312 + [[ ${PV} == 9999 ]] && eautoreconf
313 + eapply_user
314 +}
315 +
316 +multilib_src_configure() {
317 + local myconf
318 +
319 + if use classic; then
320 + # Configurable DRI drivers
321 + driver_enable swrast
322 +
323 + # Intel code
324 + driver_enable video_cards_i915 i915
325 + driver_enable video_cards_i965 i965
326 + if ! use video_cards_i915 && \
327 + ! use video_cards_i965; then
328 + driver_enable video_cards_intel i915 i965
329 + fi
330 +
331 + # Nouveau code
332 + driver_enable video_cards_nouveau nouveau
333 +
334 + # ATI code
335 + driver_enable video_cards_r100 radeon
336 + driver_enable video_cards_r200 r200
337 + if ! use video_cards_r100 && \
338 + ! use video_cards_r200; then
339 + driver_enable video_cards_radeon radeon r200
340 + fi
341 + fi
342 +
343 + if use egl; then
344 + myconf+=" --with-platforms=x11,surfaceless$(use wayland && echo ",wayland")$(use gbm && echo ",drm")"
345 + fi
346 +
347 + if use gallium; then
348 + myconf+="
349 + $(use_enable d3d9 nine)
350 + $(use_enable llvm)
351 + $(use_enable openmax omx-bellagio)
352 + $(use_enable vaapi va)
353 + $(use_enable vdpau)
354 + $(use_enable xa)
355 + $(use_enable xvmc)
356 + "
357 + use vaapi && myconf+=" --with-va-libdir=/usr/$(get_libdir)/va/drivers"
358 +
359 + gallium_enable swrast
360 + gallium_enable video_cards_vc4 vc4
361 + gallium_enable video_cards_vivante etnaviv
362 + gallium_enable video_cards_vmware svga
363 + gallium_enable video_cards_nouveau nouveau
364 + gallium_enable video_cards_i915 i915
365 + gallium_enable video_cards_imx imx
366 + if ! use video_cards_i915 && \
367 + ! use video_cards_i965; then
368 + gallium_enable video_cards_intel i915
369 + fi
370 +
371 + gallium_enable video_cards_r300 r300
372 + gallium_enable video_cards_r600 r600
373 + gallium_enable video_cards_radeonsi radeonsi
374 + if ! use video_cards_r300 && \
375 + ! use video_cards_r600; then
376 + gallium_enable video_cards_radeon r300 r600
377 + fi
378 +
379 + gallium_enable video_cards_freedreno freedreno
380 + # opencl stuff
381 + if use opencl; then
382 + myconf+="
383 + $(use_enable opencl)
384 + --with-clang-libdir="${EPREFIX}/usr/lib"
385 + "
386 + fi
387 +
388 + gallium_enable video_cards_virgl virgl
389 + fi
390 +
391 + if use vulkan; then
392 + vulkan_enable video_cards_i965 intel
393 + vulkan_enable video_cards_radeonsi radeon
394 + fi
395 +
396 + # x86 hardened pax_kernel needs glx-rts, bug 240956
397 + if [[ ${ABI} == x86 ]]; then
398 + myconf+=" $(use_enable pax_kernel glx-read-only-text)"
399 + fi
400 +
401 + # on abi_x86_32 hardened we need to have asm disable
402 + if [[ ${ABI} == x86* ]] && use pic; then
403 + myconf+=" --disable-asm"
404 + fi
405 +
406 + if use gallium; then
407 + myconf+=" $(use_enable osmesa gallium-osmesa)"
408 + else
409 + myconf+=" $(use_enable osmesa)"
410 + fi
411 +
412 + # build fails with BSD indent, bug #428112
413 + use userland_GNU || export INDENT=cat
414 +
415 + ECONF_SOURCE="${S}" \
416 + econf \
417 + --enable-dri \
418 + --enable-glx \
419 + --enable-shared-glapi \
420 + $(use_enable !bindist texture-float) \
421 + $(use_enable d3d9 nine) \
422 + $(use_enable debug) \
423 + $(use_enable dri3) \
424 + $(use_enable egl) \
425 + $(use_enable gbm) \
426 + $(use_enable gles1) \
427 + $(use_enable gles2) \
428 + $(use_enable nptl glx-tls) \
429 + $(use_enable unwind libunwind) \
430 + --enable-valgrind=$(usex valgrind auto no) \
431 + --enable-llvm-shared-libs \
432 + --with-dri-drivers=${DRI_DRIVERS} \
433 + --with-gallium-drivers=${GALLIUM_DRIVERS} \
434 + --with-vulkan-drivers=${VULKAN_DRIVERS} \
435 + PYTHON2="${PYTHON}" \
436 + ${myconf}
437 +}
438 +
439 +multilib_src_install() {
440 + emake install DESTDIR="${D}"
441 +
442 + if use classic || use gallium; then
443 + ebegin "Moving DRI/Gallium drivers for dynamic switching"
444 + local gallium_drivers=( i915_dri.so i965_dri.so r300_dri.so r600_dri.so swrast_dri.so )
445 + keepdir /usr/$(get_libdir)/dri
446 + dodir /usr/$(get_libdir)/mesa
447 + for x in ${gallium_drivers[@]}; do
448 + if [ -f "$(get_libdir)/gallium/${x}" ]; then
449 + mv -f "${ED}/usr/$(get_libdir)/dri/${x}" "${ED}/usr/$(get_libdir)/dri/${x/_dri.so/g_dri.so}" \
450 + || die "Failed to move ${x}"
451 + fi
452 + done
453 + if use classic; then
454 + emake -C "${BUILD_DIR}/src/mesa/drivers/dri" DESTDIR="${D}" install
455 + fi
456 + for x in "${ED}"/usr/$(get_libdir)/dri/*.so; do
457 + if [ -f ${x} -o -L ${x} ]; then
458 + mv -f "${x}" "${x/dri/mesa}" \
459 + || die "Failed to move ${x}"
460 + fi
461 + done
462 + pushd "${ED}"/usr/$(get_libdir)/dri || die "pushd failed"
463 + ln -s ../mesa/*.so . || die "Creating symlink failed"
464 + # remove symlinks to drivers known to eselect
465 + for x in ${gallium_drivers[@]}; do
466 + if [ -f ${x} -o -L ${x} ]; then
467 + rm "${x}" || die "Failed to remove ${x}"
468 + fi
469 + done
470 + popd
471 + eend $?
472 + fi
473 + if use opencl; then
474 + ebegin "Moving Gallium/Clover OpenCL implementation for dynamic switching"
475 + local cl_dir="/usr/$(get_libdir)/OpenCL/vendors/mesa"
476 + dodir ${cl_dir}/{lib,include}
477 + if [ -f "${ED}/usr/$(get_libdir)/libOpenCL.so" ]; then
478 + mv -f "${ED}"/usr/$(get_libdir)/libOpenCL.so* \
479 + "${ED}"${cl_dir}
480 + fi
481 + if [ -f "${ED}/usr/include/CL/opencl.h" ]; then
482 + mv -f "${ED}"/usr/include/CL \
483 + "${ED}"${cl_dir}/include
484 + fi
485 + eend $?
486 + fi
487 +
488 + if use openmax; then
489 + echo "XDG_DATA_DIRS=\"${EPREFIX}/usr/share/mesa/xdg\"" > "${T}/99mesaxdgomx"
490 + doenvd "${T}"/99mesaxdgomx
491 + keepdir /usr/share/mesa/xdg
492 + fi
493 +}
494 +
495 +multilib_src_install_all() {
496 + find "${ED}" -name '*.la' -delete
497 + einstalldocs
498 +
499 + if use !bindist; then
500 + dodoc docs/patents.txt
501 + fi
502 +
503 + # Install config file for eselect mesa
504 + insinto /usr/share/mesa
505 + newins "${FILESDIR}/eselect-mesa.conf.9.2" eselect-mesa.conf
506 +}
507 +
508 +multilib_src_test() {
509 + if use llvm; then
510 + 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'
511 + pushd src/gallium/drivers/llvmpipe >/dev/null || die
512 + emake ${llvm_tests}
513 + pax-mark m ${llvm_tests}
514 + popd >/dev/null || die
515 + fi
516 + emake check
517 +}
518 +
519 +pkg_postinst() {
520 + # Switch to the xorg implementation.
521 + echo
522 + eselect opengl set --use-old ${OPENGL_DIR}
523 +
524 + # Select classic/gallium drivers
525 + if use classic || use gallium; then
526 + eselect mesa set --auto
527 + fi
528 +
529 + # Switch to mesa opencl
530 + if use opencl; then
531 + eselect opencl set --use-old ${PN}
532 + fi
533 +
534 + # run omxregister-bellagio to make the OpenMAX drivers known system-wide
535 + if use openmax; then
536 + ebegin "Registering OpenMAX drivers"
537 + BELLAGIO_SEARCH_PATH="${EPREFIX}/usr/$(get_libdir)/libomxil-bellagio0" \
538 + OMX_BELLAGIO_REGISTRY=${EPREFIX}/usr/share/mesa/xdg/.omxregister \
539 + omxregister-bellagio
540 + eend $?
541 + fi
542 +
543 + # warn about patent encumbered texture-float
544 + if use !bindist; then
545 + elog "USE=\"bindist\" was not set. Potentially patent encumbered code was"
546 + elog "enabled. Please see /usr/share/doc/${P}/patents.txt.bz2 for an"
547 + elog "explanation."
548 + fi
549 +}
550 +
551 +pkg_prerm() {
552 + if use openmax; then
553 + rm "${EPREFIX}"/usr/share/mesa/xdg/.omxregister
554 + fi
555 +}
556 +
557 +# $1 - VIDEO_CARDS flag
558 +# other args - names of DRI drivers to enable
559 +# TODO: avoid code duplication for a more elegant implementation
560 +driver_enable() {
561 + case $# in
562 + # for enabling unconditionally
563 + 1)
564 + DRI_DRIVERS+=",$1"
565 + ;;
566 + *)
567 + if use $1; then
568 + shift
569 + for i in $@; do
570 + DRI_DRIVERS+=",${i}"
571 + done
572 + fi
573 + ;;
574 + esac
575 +}
576 +
577 +gallium_enable() {
578 + case $# in
579 + # for enabling unconditionally
580 + 1)
581 + GALLIUM_DRIVERS+=",$1"
582 + ;;
583 + *)
584 + if use $1; then
585 + shift
586 + for i in $@; do
587 + GALLIUM_DRIVERS+=",${i}"
588 + done
589 + fi
590 + ;;
591 + esac
592 +}
593 +
594 +vulkan_enable() {
595 + case $# in
596 + # for enabling unconditionally
597 + 1)
598 + VULKAN_DRIVERS+=",$1"
599 + ;;
600 + *)
601 + if use $1; then
602 + shift
603 + for i in $@; do
604 + VULKAN_DRIVERS+=",${i}"
605 + done
606 + fi
607 + ;;
608 + esac
609 +}