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, 10 Nov 2017 23:56:55
Message-Id: 1510358195.8e896275265ff2d9810318aec2674879632e3c7e.mattst88@gentoo
1 commit: 8e896275265ff2d9810318aec2674879632e3c7e
2 Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
3 AuthorDate: Fri Nov 10 23:56:35 2017 +0000
4 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
5 CommitDate: Fri Nov 10 23:56:35 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8e896275
7
8 media-libs/mesa: Version bump to 17.2.5
9
10 Package-Manager: Portage-2.3.8, Repoman-2.3.3
11
12 media-libs/mesa/Manifest | 1 +
13 media-libs/mesa/mesa-17.2.5.ebuild | 582 +++++++++++++++++++++++++++++++++++++
14 2 files changed, 583 insertions(+)
15
16 diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
17 index 23d2500718e..0293e1af113 100644
18 --- a/media-libs/mesa/Manifest
19 +++ b/media-libs/mesa/Manifest
20 @@ -9,5 +9,6 @@ DIST mesa-17.2.1.tar.xz 10414776 SHA256 77385d17827cff24a3bae134342234f2efe7f7f9
21 DIST mesa-17.2.2.tar.xz 10359156 SHA256 cf522244d6a5a1ecde3fc00e7c96935253fe22f808f064cab98be6f3faa65782 SHA512 641342c68989b8d801c37e668b012d3b7c4ad43d8ca01b74f8cbb3a1ec25b7390f69fe7ebc84b29dab1c6a4ac01c882ec9fd4a6b331505629461bdbbe6aa3f7e WHIRLPOOL 74271721fb38a0c62f6f35d84ba9196e000f2fe2a32e75120288e77649a87e225464572d347fc149190b573d22c32dfee3e174d6a2578b3c649c4b72375a94ec
22 DIST mesa-17.2.3.tar.xz 10344180 SHA256 a0b0ec8f7b24dd044d7ab30a8c7e6d3767521e245f88d4ed5dd93315dc56f837 SHA512 749a0a46b772974633e405804ace7f509afb79f47811dbbdd390333721d744f2ac64f985ff1fd6c5aa3019b700be70bc1f75f60745ed9f4c5b08a9a8f77dfc76 WHIRLPOOL 333bdb9dd15726a4a19fa7a87d2044aba6ebaea2eb83dd436f916020221a8bc46d667e8710a701c52930217292ecdfd468b654a7846357aa8881356987f394c0
23 DIST mesa-17.2.4.tar.xz 10381984 SHA256 5ba408fecd6e1132e5490eec1a2f04466214e4c65c8b89b331be844768c2e550 SHA512 665b63aab6af3f8f263f182d85d9ad71db7a23bcbaf67d62fe53c258cb0f600266ac82e72d681ec20cf7c66b47d4076aad5c3f553519f19110ee577da2707085 WHIRLPOOL 29750c50a496cb27e0b4466bf0d1496434330a96259616dd7c368adc3d9478aa6ba1facf11ec4ff231a244f890781c12637327b1675c423786693c40f787945d
24 +DIST mesa-17.2.5.tar.xz 10386312 SHA256 7f7f914b7b9ea0b15f2d9d01a4375e311b0e90e55683b8e8a67ce8691eb1070f SHA512 c4b0f7f48b0b57fdf610de3d61e127774f8223e755acfde6cf2649818eec985e8f925abf8a15d530ecdb882cb8d7268fd01e5d94c8ac6934551b8a74272353c7 WHIRLPOOL 51d066640824964acebc69e78ec368753c18833b0c0cdb940e6afb8326edc2a75c657d81c043d728ca66968608e59a128295e3f4863980c2dcaf6716f55d14d3
25 DIST mesa-17.3.0-rc2.tar.xz 10658696 SHA256 13b2c085a54836465a3b6814ad4bc2dae0a502f43405e75ced67789d5afc18cd SHA512 749cca3e0875dbff7b6fab4d646974ecbcc7659ec82ad025bc386372d6e0e050d84d5e05fb68c5099e685557d85daf55c6a5db7bd89a7323778ae7e87e01215e WHIRLPOOL 4007e6641de55145b9bf8bf7aa567c284d3a4b29ea6b83fb5ba3324abf757cf72cf1f1bc0cd3011e58b3d0c6cc6fa7f7c03b1affb7f0ba7c4a5e7ade398bf2f3
26 DIST mesa-17.3.0-rc3.tar.xz 10664384 SHA256 1f3677429018f6ef4167b31db9eef558827a649239aa685f54c1a400ff5462d9 SHA512 403da79ac87325f2f0962e9be406edf4d009b6f5d479c2943be5bc1a26ad201d96072461a0d041b5a59abe327829eeba0dfb44abce217074079c47811729b058 WHIRLPOOL 91a5f65bc1dc9dc27bcd8492d82c80d2827d2408030890fdcaa653993d9a1deec983b00cb48c0675f3234d36512396c03cc7659bd30cadd6e536f5bef90d65d9
27
28 diff --git a/media-libs/mesa/mesa-17.2.5.ebuild b/media-libs/mesa/mesa-17.2.5.ebuild
29 new file mode 100644
30 index 00000000000..12be4d77969
31 --- /dev/null
32 +++ b/media-libs/mesa/mesa-17.2.5.ebuild
33 @@ -0,0 +1,582 @@
34 +# Copyright 1999-2017 Gentoo Foundation
35 +# Distributed under the terms of the GNU General Public License v2
36 +
37 +EAPI=6
38 +
39 +EGIT_REPO_URI="https://anongit.freedesktop.org/git/mesa/mesa.git"
40 +
41 +if [[ ${PV} = 9999 ]]; then
42 + GIT_ECLASS="git-r3"
43 + EXPERIMENTAL="true"
44 +fi
45 +
46 +PYTHON_COMPAT=( python2_7 )
47 +
48 +inherit autotools llvm multilib-minimal python-any-r1 pax-utils ${GIT_ECLASS}
49 +
50 +OPENGL_DIR="xorg-x11"
51 +
52 +MY_P="${P/_/-}"
53 +
54 +DESCRIPTION="OpenGL-like graphic library for Linux"
55 +HOMEPAGE="https://www.mesa3d.org/"
56 +
57 +if [[ $PV == 9999 ]]; then
58 + SRC_URI=""
59 +else
60 + SRC_URI="https://mesa.freedesktop.org/archive/${MY_P}.tar.xz"
61 + 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"
62 +fi
63 +
64 +LICENSE="MIT"
65 +SLOT="0"
66 +RESTRICT="!bindist? ( bindist )"
67 +
68 +RADEON_CARDS="r100 r200 r300 r600 radeon radeonsi"
69 +VIDEO_CARDS="${RADEON_CARDS} freedreno i915 i965 imx intel nouveau vc4 virgl vivante vmware"
70 +for card in ${VIDEO_CARDS}; do
71 + IUSE_VIDEO_CARDS+=" video_cards_${card}"
72 +done
73 +
74 +IUSE="${IUSE_VIDEO_CARDS}
75 + bindist +classic d3d9 debug +dri3 +egl +gallium +gbm gles1 gles2 unwind
76 + +llvm +nptl opencl osmesa pax_kernel openmax pic selinux vaapi valgrind
77 + vdpau vulkan wayland xvmc xa"
78 +
79 +REQUIRED_USE="
80 + d3d9? ( dri3 gallium )
81 + llvm? ( gallium )
82 + opencl? ( gallium llvm )
83 + openmax? ( gallium )
84 + gles1? ( egl )
85 + gles2? ( egl )
86 + vaapi? ( gallium )
87 + vdpau? ( gallium )
88 + vulkan? ( || ( video_cards_i965 video_cards_radeonsi )
89 + video_cards_radeonsi? ( llvm ) )
90 + wayland? ( egl gbm )
91 + xa? ( gallium )
92 + video_cards_freedreno? ( gallium )
93 + video_cards_intel? ( classic )
94 + video_cards_i915? ( || ( classic gallium ) )
95 + video_cards_i965? ( classic )
96 + video_cards_imx? ( gallium )
97 + video_cards_nouveau? ( || ( classic gallium ) )
98 + video_cards_radeon? ( || ( classic gallium )
99 + gallium? ( x86? ( llvm ) amd64? ( llvm ) ) )
100 + video_cards_r100? ( classic )
101 + video_cards_r200? ( classic )
102 + video_cards_r300? ( gallium x86? ( llvm ) amd64? ( llvm ) )
103 + video_cards_r600? ( gallium )
104 + video_cards_radeonsi? ( gallium llvm )
105 + video_cards_vc4? ( gallium )
106 + video_cards_virgl? ( gallium )
107 + video_cards_vivante? ( gallium gbm )
108 + video_cards_vmware? ( gallium )
109 +"
110 +
111 +LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.82"
112 +# keep correct libdrm and dri2proto dep
113 +# keep blocks in rdepend for binpkg
114 +RDEPEND="
115 + !<x11-base/xorg-server-1.7
116 + !<=x11-proto/xf86driproto-2.0.3
117 + abi_x86_32? ( !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)] )
118 + classic? ( app-eselect/eselect-mesa )
119 + gallium? ( app-eselect/eselect-mesa )
120 + >=app-eselect/eselect-opengl-1.3.0
121 + >=dev-libs/expat-2.1.0-r3:=[${MULTILIB_USEDEP}]
122 + >=sys-libs/zlib-1.2.8[${MULTILIB_USEDEP}]
123 + >=x11-libs/libX11-1.6.2:=[${MULTILIB_USEDEP}]
124 + >=x11-libs/libxshmfence-1.1:=[${MULTILIB_USEDEP}]
125 + >=x11-libs/libXdamage-1.1.4-r1:=[${MULTILIB_USEDEP}]
126 + >=x11-libs/libXext-1.3.2:=[${MULTILIB_USEDEP}]
127 + >=x11-libs/libXxf86vm-1.1.3:=[${MULTILIB_USEDEP}]
128 + >=x11-libs/libxcb-1.9.3:=[${MULTILIB_USEDEP}]
129 + x11-libs/libXfixes:=[${MULTILIB_USEDEP}]
130 + unwind? ( sys-libs/libunwind[${MULTILIB_USEDEP}] )
131 + llvm? (
132 + video_cards_radeonsi? (
133 + virtual/libelf:0=[${MULTILIB_USEDEP}]
134 + )
135 + video_cards_r600? (
136 + virtual/libelf:0=[${MULTILIB_USEDEP}]
137 + )
138 + video_cards_radeon? (
139 + virtual/libelf:0=[${MULTILIB_USEDEP}]
140 + )
141 + )
142 + opencl? (
143 + app-eselect/eselect-opencl
144 + dev-libs/libclc
145 + virtual/libelf:0=[${MULTILIB_USEDEP}]
146 + )
147 + openmax? ( >=media-libs/libomxil-bellagio-0.9.3:=[${MULTILIB_USEDEP}] )
148 + vaapi? (
149 + >=x11-libs/libva-1.7.3:=[${MULTILIB_USEDEP}]
150 + video_cards_nouveau? ( !<=x11-libs/libva-vdpau-driver-0.7.4-r3 )
151 + )
152 + vdpau? ( >=x11-libs/libvdpau-1.1:=[${MULTILIB_USEDEP}] )
153 + wayland? (
154 + >=dev-libs/wayland-1.11.0:=[${MULTILIB_USEDEP}]
155 + >=dev-libs/wayland-protocols-1.8
156 + )
157 + xvmc? ( >=x11-libs/libXvMC-1.0.8:=[${MULTILIB_USEDEP}] )
158 + ${LIBDRM_DEPSTRING}[video_cards_freedreno?,video_cards_nouveau?,video_cards_vc4?,video_cards_vivante?,video_cards_vmware?,${MULTILIB_USEDEP}]
159 +
160 + video_cards_intel? (
161 + !video_cards_i965? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
162 + )
163 + video_cards_i915? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
164 +"
165 +for card in ${RADEON_CARDS}; do
166 + RDEPEND="${RDEPEND}
167 + video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_radeon] )
168 + "
169 +done
170 +RDEPEND="${RDEPEND}
171 + video_cards_radeonsi? ( ${LIBDRM_DEPSTRING}[video_cards_amdgpu] )
172 +"
173 +
174 +# Please keep the LLVM dependency block separate. Since LLVM is slotted,
175 +# we need to *really* make sure we're not pulling one than more slot
176 +# simultaneously.
177 +#
178 +# How to use it:
179 +# 1. List all the working slots (with min versions) in ||, newest first.
180 +# 2. Update the := to specify *max* version, e.g. < 7.
181 +# 3. Specify LLVM_MAX_SLOT, e.g. 6.
182 +LLVM_MAX_SLOT="5"
183 +LLVM_DEPSTR="
184 + || (
185 + sys-devel/llvm:5[${MULTILIB_USEDEP}]
186 + sys-devel/llvm:4[${MULTILIB_USEDEP}]
187 + >=sys-devel/llvm-3.9.0:0[${MULTILIB_USEDEP}]
188 + )
189 + sys-devel/llvm:=[${MULTILIB_USEDEP}]
190 +"
191 +LLVM_DEPSTR_AMDGPU=${LLVM_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
192 +CLANG_DEPSTR=${LLVM_DEPSTR//llvm/clang}
193 +CLANG_DEPSTR_AMDGPU=${CLANG_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
194 +RDEPEND="${RDEPEND}
195 + llvm? (
196 + opencl? (
197 + video_cards_r600? (
198 + ${CLANG_DEPSTR_AMDGPU}
199 + )
200 + !video_cards_r600? (
201 + video_cards_radeonsi? (
202 + ${CLANG_DEPSTR_AMDGPU}
203 + )
204 + )
205 + !video_cards_r600? (
206 + !video_cards_radeonsi? (
207 + video_cards_radeon? (
208 + ${CLANG_DEPSTR_AMDGPU}
209 + )
210 + )
211 + )
212 + !video_cards_r600? (
213 + !video_cards_radeon? (
214 + !video_cards_radeonsi? (
215 + ${CLANG_DEPSTR}
216 + )
217 + )
218 + )
219 + )
220 + !opencl? (
221 + video_cards_r600? (
222 + ${LLVM_DEPSTR_AMDGPU}
223 + )
224 + !video_cards_r600? (
225 + video_cards_radeonsi? (
226 + ${LLVM_DEPSTR_AMDGPU}
227 + )
228 + )
229 + !video_cards_r600? (
230 + !video_cards_radeonsi? (
231 + video_cards_radeon? (
232 + ${LLVM_DEPSTR_AMDGPU}
233 + )
234 + )
235 + )
236 + !video_cards_r600? (
237 + !video_cards_radeon? (
238 + !video_cards_radeonsi? (
239 + ${LLVM_DEPSTR}
240 + )
241 + )
242 + )
243 + )
244 + )
245 +"
246 +unset {LLVM,CLANG}_DEPSTR{,_AMDGPU}
247 +
248 +DEPEND="${RDEPEND}
249 + ${PYTHON_DEPS}
250 + opencl? (
251 + >=sys-devel/gcc-4.6
252 + )
253 + sys-devel/gettext
254 + virtual/pkgconfig
255 + valgrind? ( dev-util/valgrind )
256 + >=x11-proto/dri2proto-2.8-r1:=[${MULTILIB_USEDEP}]
257 + dri3? (
258 + >=x11-proto/dri3proto-1.0:=[${MULTILIB_USEDEP}]
259 + >=x11-proto/presentproto-1.0:=[${MULTILIB_USEDEP}]
260 + )
261 + >=x11-proto/glproto-1.4.17-r1:=[${MULTILIB_USEDEP}]
262 + >=x11-proto/xextproto-7.2.1-r1:=[${MULTILIB_USEDEP}]
263 + >=x11-proto/xf86driproto-2.1.1-r1:=[${MULTILIB_USEDEP}]
264 + >=x11-proto/xf86vidmodeproto-2.3.1-r1:=[${MULTILIB_USEDEP}]
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)
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 + --with-dri-drivers=${DRI_DRIVERS} \
434 + --with-gallium-drivers=${GALLIUM_DRIVERS} \
435 + --with-vulkan-drivers=${VULKAN_DRIVERS} \
436 + PYTHON2="${PYTHON}" \
437 + ${myconf}
438 +}
439 +
440 +multilib_src_install() {
441 + emake install DESTDIR="${D}"
442 +
443 + if use classic || use gallium; then
444 + ebegin "Moving DRI/Gallium drivers for dynamic switching"
445 + local gallium_drivers=( i915_dri.so i965_dri.so r300_dri.so r600_dri.so swrast_dri.so )
446 + keepdir /usr/$(get_libdir)/dri
447 + dodir /usr/$(get_libdir)/mesa
448 + for x in ${gallium_drivers[@]}; do
449 + if [ -f "$(get_libdir)/gallium/${x}" ]; then
450 + mv -f "${ED}/usr/$(get_libdir)/dri/${x}" "${ED}/usr/$(get_libdir)/dri/${x/_dri.so/g_dri.so}" \
451 + || die "Failed to move ${x}"
452 + fi
453 + done
454 + if use classic; then
455 + emake -C "${BUILD_DIR}/src/mesa/drivers/dri" DESTDIR="${D}" install
456 + fi
457 + for x in "${ED}"/usr/$(get_libdir)/dri/*.so; do
458 + if [ -f ${x} -o -L ${x} ]; then
459 + mv -f "${x}" "${x/dri/mesa}" \
460 + || die "Failed to move ${x}"
461 + fi
462 + done
463 + pushd "${ED}"/usr/$(get_libdir)/dri || die "pushd failed"
464 + ln -s ../mesa/*.so . || die "Creating symlink failed"
465 + # remove symlinks to drivers known to eselect
466 + for x in ${gallium_drivers[@]}; do
467 + if [ -f ${x} -o -L ${x} ]; then
468 + rm "${x}" || die "Failed to remove ${x}"
469 + fi
470 + done
471 + popd
472 + eend $?
473 + fi
474 + if use opencl; then
475 + ebegin "Moving Gallium/Clover OpenCL implementation for dynamic switching"
476 + local cl_dir="/usr/$(get_libdir)/OpenCL/vendors/mesa"
477 + dodir ${cl_dir}/{lib,include}
478 + if [ -f "${ED}/usr/$(get_libdir)/libOpenCL.so" ]; then
479 + mv -f "${ED}"/usr/$(get_libdir)/libOpenCL.so* \
480 + "${ED}"${cl_dir}
481 + fi
482 + if [ -f "${ED}/usr/include/CL/opencl.h" ]; then
483 + mv -f "${ED}"/usr/include/CL \
484 + "${ED}"${cl_dir}/include
485 + fi
486 + eend $?
487 + fi
488 +
489 + if use openmax; then
490 + echo "XDG_DATA_DIRS=\"${EPREFIX}/usr/share/mesa/xdg\"" > "${T}/99mesaxdgomx"
491 + doenvd "${T}"/99mesaxdgomx
492 + keepdir /usr/share/mesa/xdg
493 + fi
494 +}
495 +
496 +multilib_src_install_all() {
497 + find "${ED}" -name '*.la' -delete
498 + einstalldocs
499 +
500 + if use !bindist; then
501 + dodoc docs/patents.txt
502 + fi
503 +
504 + # Install config file for eselect mesa
505 + insinto /usr/share/mesa
506 + newins "${FILESDIR}/eselect-mesa.conf.9.2" eselect-mesa.conf
507 +}
508 +
509 +multilib_src_test() {
510 + if use llvm; then
511 + 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'
512 + pushd src/gallium/drivers/llvmpipe >/dev/null || die
513 + emake ${llvm_tests}
514 + pax-mark m ${llvm_tests}
515 + popd >/dev/null || die
516 + fi
517 + emake check
518 +}
519 +
520 +pkg_postinst() {
521 + # Switch to the xorg implementation.
522 + echo
523 + eselect opengl set --use-old ${OPENGL_DIR}
524 +
525 + # Select classic/gallium drivers
526 + if use classic || use gallium; then
527 + eselect mesa set --auto
528 + fi
529 +
530 + # Switch to mesa opencl
531 + if use opencl; then
532 + eselect opencl set --use-old ${PN}
533 + fi
534 +
535 + # run omxregister-bellagio to make the OpenMAX drivers known system-wide
536 + if use openmax; then
537 + ebegin "Registering OpenMAX drivers"
538 + BELLAGIO_SEARCH_PATH="${EPREFIX}/usr/$(get_libdir)/libomxil-bellagio0" \
539 + OMX_BELLAGIO_REGISTRY=${EPREFIX}/usr/share/mesa/xdg/.omxregister \
540 + omxregister-bellagio
541 + eend $?
542 + fi
543 +
544 + # warn about patent encumbered texture-float
545 + if use !bindist; then
546 + elog "USE=\"bindist\" was not set. Potentially patent encumbered code was"
547 + elog "enabled. Please see patents.txt for an explanation."
548 + fi
549 +
550 + if ! has_version media-libs/libtxc_dxtn; then
551 + elog "Note that in order to have full S3TC support, it is necessary to install"
552 + elog "media-libs/libtxc_dxtn as well. This may be necessary to get nice"
553 + elog "textures in some apps, and some others even require this to run."
554 + fi
555 +}
556 +
557 +pkg_prerm() {
558 + if use openmax; then
559 + rm "${EPREFIX}"/usr/share/mesa/xdg/.omxregister
560 + fi
561 +}
562 +
563 +# $1 - VIDEO_CARDS flag
564 +# other args - names of DRI drivers to enable
565 +# TODO: avoid code duplication for a more elegant implementation
566 +driver_enable() {
567 + case $# in
568 + # for enabling unconditionally
569 + 1)
570 + DRI_DRIVERS+=",$1"
571 + ;;
572 + *)
573 + if use $1; then
574 + shift
575 + for i in $@; do
576 + DRI_DRIVERS+=",${i}"
577 + done
578 + fi
579 + ;;
580 + esac
581 +}
582 +
583 +gallium_enable() {
584 + case $# in
585 + # for enabling unconditionally
586 + 1)
587 + GALLIUM_DRIVERS+=",$1"
588 + ;;
589 + *)
590 + if use $1; then
591 + shift
592 + for i in $@; do
593 + GALLIUM_DRIVERS+=",${i}"
594 + done
595 + fi
596 + ;;
597 + esac
598 +}
599 +
600 +vulkan_enable() {
601 + case $# in
602 + # for enabling unconditionally
603 + 1)
604 + VULKAN_DRIVERS+=",$1"
605 + ;;
606 + *)
607 + if use $1; then
608 + shift
609 + for i in $@; do
610 + VULKAN_DRIVERS+=",${i}"
611 + done
612 + fi
613 + ;;
614 + esac
615 +}