Gentoo Archives: gentoo-commits

From: Aric Belsito <lluixhi@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/musl:master commit in: media-libs/mesa/
Date: Tue, 14 Nov 2017 21:29:27
Message-Id: 1510694910.58b5c03f149c408dd4946520239b57d3c11baae9.lluixhi@gentoo
1 commit: 58b5c03f149c408dd4946520239b57d3c11baae9
2 Author: Aric Belsito <lluixhi <AT> gmail <DOT> com>
3 AuthorDate: Tue Nov 14 21:28:30 2017 +0000
4 Commit: Aric Belsito <lluixhi <AT> gmail <DOT> com>
5 CommitDate: Tue Nov 14 21:28:30 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/musl.git/commit/?id=58b5c03f
7
8 media-libs/mesa: version bump to 17.2.5/17.3.0_rc4
9
10 media-libs/mesa/Manifest | 2 +
11 media-libs/mesa/mesa-17.2.5.ebuild | 586 ++++++++++++++++++++++++++++++++
12 media-libs/mesa/mesa-17.3.0_rc4.ebuild | 589 +++++++++++++++++++++++++++++++++
13 3 files changed, 1177 insertions(+)
14
15 diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
16 index 23d2500..df335c5 100644
17 --- a/media-libs/mesa/Manifest
18 +++ b/media-libs/mesa/Manifest
19 @@ -9,5 +9,7 @@ DIST mesa-17.2.1.tar.xz 10414776 SHA256 77385d17827cff24a3bae134342234f2efe7f7f9
20 DIST mesa-17.2.2.tar.xz 10359156 SHA256 cf522244d6a5a1ecde3fc00e7c96935253fe22f808f064cab98be6f3faa65782 SHA512 641342c68989b8d801c37e668b012d3b7c4ad43d8ca01b74f8cbb3a1ec25b7390f69fe7ebc84b29dab1c6a4ac01c882ec9fd4a6b331505629461bdbbe6aa3f7e WHIRLPOOL 74271721fb38a0c62f6f35d84ba9196e000f2fe2a32e75120288e77649a87e225464572d347fc149190b573d22c32dfee3e174d6a2578b3c649c4b72375a94ec
21 DIST mesa-17.2.3.tar.xz 10344180 SHA256 a0b0ec8f7b24dd044d7ab30a8c7e6d3767521e245f88d4ed5dd93315dc56f837 SHA512 749a0a46b772974633e405804ace7f509afb79f47811dbbdd390333721d744f2ac64f985ff1fd6c5aa3019b700be70bc1f75f60745ed9f4c5b08a9a8f77dfc76 WHIRLPOOL 333bdb9dd15726a4a19fa7a87d2044aba6ebaea2eb83dd436f916020221a8bc46d667e8710a701c52930217292ecdfd468b654a7846357aa8881356987f394c0
22 DIST mesa-17.2.4.tar.xz 10381984 SHA256 5ba408fecd6e1132e5490eec1a2f04466214e4c65c8b89b331be844768c2e550 SHA512 665b63aab6af3f8f263f182d85d9ad71db7a23bcbaf67d62fe53c258cb0f600266ac82e72d681ec20cf7c66b47d4076aad5c3f553519f19110ee577da2707085 WHIRLPOOL 29750c50a496cb27e0b4466bf0d1496434330a96259616dd7c368adc3d9478aa6ba1facf11ec4ff231a244f890781c12637327b1675c423786693c40f787945d
23 +DIST mesa-17.2.5.tar.xz 10386312 SHA256 7f7f914b7b9ea0b15f2d9d01a4375e311b0e90e55683b8e8a67ce8691eb1070f SHA512 c4b0f7f48b0b57fdf610de3d61e127774f8223e755acfde6cf2649818eec985e8f925abf8a15d530ecdb882cb8d7268fd01e5d94c8ac6934551b8a74272353c7 WHIRLPOOL 51d066640824964acebc69e78ec368753c18833b0c0cdb940e6afb8326edc2a75c657d81c043d728ca66968608e59a128295e3f4863980c2dcaf6716f55d14d3
24 DIST mesa-17.3.0-rc2.tar.xz 10658696 SHA256 13b2c085a54836465a3b6814ad4bc2dae0a502f43405e75ced67789d5afc18cd SHA512 749cca3e0875dbff7b6fab4d646974ecbcc7659ec82ad025bc386372d6e0e050d84d5e05fb68c5099e685557d85daf55c6a5db7bd89a7323778ae7e87e01215e WHIRLPOOL 4007e6641de55145b9bf8bf7aa567c284d3a4b29ea6b83fb5ba3324abf757cf72cf1f1bc0cd3011e58b3d0c6cc6fa7f7c03b1affb7f0ba7c4a5e7ade398bf2f3
25 DIST mesa-17.3.0-rc3.tar.xz 10664384 SHA256 1f3677429018f6ef4167b31db9eef558827a649239aa685f54c1a400ff5462d9 SHA512 403da79ac87325f2f0962e9be406edf4d009b6f5d479c2943be5bc1a26ad201d96072461a0d041b5a59abe327829eeba0dfb44abce217074079c47811729b058 WHIRLPOOL 91a5f65bc1dc9dc27bcd8492d82c80d2827d2408030890fdcaa653993d9a1deec983b00cb48c0675f3234d36512396c03cc7659bd30cadd6e536f5bef90d65d9
26 +DIST mesa-17.3.0-rc4.tar.xz 10662396 SHA256 90c9283caa21c047aef013395776ca44037662450bbed188b4eea679084239be SHA512 410a43852944899fbc9d7ab887510dffda3cb98330d7acd5d529cb01abafe1886b353d050c918cd63ecb1b7afb9350e5ceddf8eabf6e8fd6bd4e6f87343f68cb WHIRLPOOL 43fa0b83683526abec04744a418f932d08ee2a566950ae0473c4795ec7905ff5edf6e7f75a64e1fb52ba7865a7b0b46de0c00eefd84715424b68a01eecb8e577
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 0000000..827ebae
31 --- /dev/null
32 +++ b/media-libs/mesa/mesa-17.2.5.ebuild
33 @@ -0,0 +1,586 @@
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 + eapply "${FILESDIR}"/${PN}-11-execinfo.patch
314 + eapply "${FILESDIR}"/${PN}-13-musl_endian.patch
315 +
316 + eautoreconf
317 +
318 + eapply_user
319 +}
320 +
321 +multilib_src_configure() {
322 + local myconf
323 +
324 + if use classic; then
325 + # Configurable DRI drivers
326 + driver_enable swrast
327 +
328 + # Intel code
329 + driver_enable video_cards_i915 i915
330 + driver_enable video_cards_i965 i965
331 + if ! use video_cards_i915 && \
332 + ! use video_cards_i965; then
333 + driver_enable video_cards_intel i915 i965
334 + fi
335 +
336 + # Nouveau code
337 + driver_enable video_cards_nouveau nouveau
338 +
339 + # ATI code
340 + driver_enable video_cards_r100 radeon
341 + driver_enable video_cards_r200 r200
342 + if ! use video_cards_r100 && \
343 + ! use video_cards_r200; then
344 + driver_enable video_cards_radeon radeon r200
345 + fi
346 + fi
347 +
348 + if use egl; then
349 + myconf+=" --with-platforms=x11,surfaceless$(use wayland && echo ",wayland")$(use gbm && echo ",drm")"
350 + fi
351 +
352 + if use gallium; then
353 + myconf+="
354 + $(use_enable d3d9 nine)
355 + $(use_enable llvm)
356 + $(use_enable openmax omx)
357 + $(use_enable vaapi va)
358 + $(use_enable vdpau)
359 + $(use_enable xa)
360 + $(use_enable xvmc)
361 + "
362 + use vaapi && myconf+=" --with-va-libdir=/usr/$(get_libdir)/va/drivers"
363 +
364 + gallium_enable swrast
365 + gallium_enable video_cards_vc4 vc4
366 + gallium_enable video_cards_vivante etnaviv
367 + gallium_enable video_cards_vmware svga
368 + gallium_enable video_cards_nouveau nouveau
369 + gallium_enable video_cards_i915 i915
370 + gallium_enable video_cards_imx imx
371 + if ! use video_cards_i915 && \
372 + ! use video_cards_i965; then
373 + gallium_enable video_cards_intel i915
374 + fi
375 +
376 + gallium_enable video_cards_r300 r300
377 + gallium_enable video_cards_r600 r600
378 + gallium_enable video_cards_radeonsi radeonsi
379 + if ! use video_cards_r300 && \
380 + ! use video_cards_r600; then
381 + gallium_enable video_cards_radeon r300 r600
382 + fi
383 +
384 + gallium_enable video_cards_freedreno freedreno
385 + # opencl stuff
386 + if use opencl; then
387 + myconf+="
388 + $(use_enable opencl)
389 + --with-clang-libdir="${EPREFIX}/usr/lib"
390 + "
391 + fi
392 +
393 + gallium_enable video_cards_virgl virgl
394 + fi
395 +
396 + if use vulkan; then
397 + vulkan_enable video_cards_i965 intel
398 + vulkan_enable video_cards_radeonsi radeon
399 + fi
400 +
401 + # x86 hardened pax_kernel needs glx-rts, bug 240956
402 + if [[ ${ABI} == x86 ]]; then
403 + myconf+=" $(use_enable pax_kernel glx-read-only-text)"
404 + fi
405 +
406 + # on abi_x86_32 hardened we need to have asm disable
407 + if [[ ${ABI} == x86* ]] && use pic; then
408 + myconf+=" --disable-asm"
409 + fi
410 +
411 + if use gallium; then
412 + myconf+=" $(use_enable osmesa gallium-osmesa)"
413 + else
414 + myconf+=" $(use_enable osmesa)"
415 + fi
416 +
417 + # build fails with BSD indent, bug #428112
418 + use userland_GNU || export INDENT=cat
419 +
420 + ECONF_SOURCE="${S}" \
421 + econf \
422 + --enable-dri \
423 + --enable-glx \
424 + --enable-shared-glapi \
425 + $(use_enable !bindist texture-float) \
426 + $(use_enable d3d9 nine) \
427 + $(use_enable debug) \
428 + $(use_enable dri3) \
429 + $(use_enable egl) \
430 + $(use_enable gbm) \
431 + $(use_enable gles1) \
432 + $(use_enable gles2) \
433 + $(use_enable nptl glx-tls) \
434 + $(use_enable unwind libunwind) \
435 + --enable-valgrind=$(usex valgrind auto no) \
436 + --enable-llvm-shared-libs \
437 + --with-dri-drivers=${DRI_DRIVERS} \
438 + --with-gallium-drivers=${GALLIUM_DRIVERS} \
439 + --with-vulkan-drivers=${VULKAN_DRIVERS} \
440 + PYTHON2="${PYTHON}" \
441 + ${myconf}
442 +}
443 +
444 +multilib_src_install() {
445 + emake install DESTDIR="${D}"
446 +
447 + if use classic || use gallium; then
448 + ebegin "Moving DRI/Gallium drivers for dynamic switching"
449 + local gallium_drivers=( i915_dri.so i965_dri.so r300_dri.so r600_dri.so swrast_dri.so )
450 + keepdir /usr/$(get_libdir)/dri
451 + dodir /usr/$(get_libdir)/mesa
452 + for x in ${gallium_drivers[@]}; do
453 + if [ -f "$(get_libdir)/gallium/${x}" ]; then
454 + mv -f "${ED}/usr/$(get_libdir)/dri/${x}" "${ED}/usr/$(get_libdir)/dri/${x/_dri.so/g_dri.so}" \
455 + || die "Failed to move ${x}"
456 + fi
457 + done
458 + if use classic; then
459 + emake -C "${BUILD_DIR}/src/mesa/drivers/dri" DESTDIR="${D}" install
460 + fi
461 + for x in "${ED}"/usr/$(get_libdir)/dri/*.so; do
462 + if [ -f ${x} -o -L ${x} ]; then
463 + mv -f "${x}" "${x/dri/mesa}" \
464 + || die "Failed to move ${x}"
465 + fi
466 + done
467 + pushd "${ED}"/usr/$(get_libdir)/dri || die "pushd failed"
468 + ln -s ../mesa/*.so . || die "Creating symlink failed"
469 + # remove symlinks to drivers known to eselect
470 + for x in ${gallium_drivers[@]}; do
471 + if [ -f ${x} -o -L ${x} ]; then
472 + rm "${x}" || die "Failed to remove ${x}"
473 + fi
474 + done
475 + popd
476 + eend $?
477 + fi
478 + if use opencl; then
479 + ebegin "Moving Gallium/Clover OpenCL implementation for dynamic switching"
480 + local cl_dir="/usr/$(get_libdir)/OpenCL/vendors/mesa"
481 + dodir ${cl_dir}/{lib,include}
482 + if [ -f "${ED}/usr/$(get_libdir)/libOpenCL.so" ]; then
483 + mv -f "${ED}"/usr/$(get_libdir)/libOpenCL.so* \
484 + "${ED}"${cl_dir}
485 + fi
486 + if [ -f "${ED}/usr/include/CL/opencl.h" ]; then
487 + mv -f "${ED}"/usr/include/CL \
488 + "${ED}"${cl_dir}/include
489 + fi
490 + eend $?
491 + fi
492 +
493 + if use openmax; then
494 + echo "XDG_DATA_DIRS=\"${EPREFIX}/usr/share/mesa/xdg\"" > "${T}/99mesaxdgomx"
495 + doenvd "${T}"/99mesaxdgomx
496 + keepdir /usr/share/mesa/xdg
497 + fi
498 +}
499 +
500 +multilib_src_install_all() {
501 + find "${ED}" -name '*.la' -delete
502 + einstalldocs
503 +
504 + if use !bindist; then
505 + dodoc docs/patents.txt
506 + fi
507 +
508 + # Install config file for eselect mesa
509 + insinto /usr/share/mesa
510 + newins "${FILESDIR}/eselect-mesa.conf.9.2" eselect-mesa.conf
511 +}
512 +
513 +multilib_src_test() {
514 + if use llvm; then
515 + 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'
516 + pushd src/gallium/drivers/llvmpipe >/dev/null || die
517 + emake ${llvm_tests}
518 + pax-mark m ${llvm_tests}
519 + popd >/dev/null || die
520 + fi
521 + emake check
522 +}
523 +
524 +pkg_postinst() {
525 + # Switch to the xorg implementation.
526 + echo
527 + eselect opengl set --use-old ${OPENGL_DIR}
528 +
529 + # Select classic/gallium drivers
530 + if use classic || use gallium; then
531 + eselect mesa set --auto
532 + fi
533 +
534 + # Switch to mesa opencl
535 + if use opencl; then
536 + eselect opencl set --use-old ${PN}
537 + fi
538 +
539 + # run omxregister-bellagio to make the OpenMAX drivers known system-wide
540 + if use openmax; then
541 + ebegin "Registering OpenMAX drivers"
542 + BELLAGIO_SEARCH_PATH="${EPREFIX}/usr/$(get_libdir)/libomxil-bellagio0" \
543 + OMX_BELLAGIO_REGISTRY=${EPREFIX}/usr/share/mesa/xdg/.omxregister \
544 + omxregister-bellagio
545 + eend $?
546 + fi
547 +
548 + # warn about patent encumbered texture-float
549 + if use !bindist; then
550 + elog "USE=\"bindist\" was not set. Potentially patent encumbered code was"
551 + elog "enabled. Please see patents.txt for an explanation."
552 + fi
553 +
554 + if ! has_version media-libs/libtxc_dxtn; then
555 + elog "Note that in order to have full S3TC support, it is necessary to install"
556 + elog "media-libs/libtxc_dxtn as well. This may be necessary to get nice"
557 + elog "textures in some apps, and some others even require this to run."
558 + fi
559 +}
560 +
561 +pkg_prerm() {
562 + if use openmax; then
563 + rm "${EPREFIX}"/usr/share/mesa/xdg/.omxregister
564 + fi
565 +}
566 +
567 +# $1 - VIDEO_CARDS flag
568 +# other args - names of DRI drivers to enable
569 +# TODO: avoid code duplication for a more elegant implementation
570 +driver_enable() {
571 + case $# in
572 + # for enabling unconditionally
573 + 1)
574 + DRI_DRIVERS+=",$1"
575 + ;;
576 + *)
577 + if use $1; then
578 + shift
579 + for i in $@; do
580 + DRI_DRIVERS+=",${i}"
581 + done
582 + fi
583 + ;;
584 + esac
585 +}
586 +
587 +gallium_enable() {
588 + case $# in
589 + # for enabling unconditionally
590 + 1)
591 + GALLIUM_DRIVERS+=",$1"
592 + ;;
593 + *)
594 + if use $1; then
595 + shift
596 + for i in $@; do
597 + GALLIUM_DRIVERS+=",${i}"
598 + done
599 + fi
600 + ;;
601 + esac
602 +}
603 +
604 +vulkan_enable() {
605 + case $# in
606 + # for enabling unconditionally
607 + 1)
608 + VULKAN_DRIVERS+=",$1"
609 + ;;
610 + *)
611 + if use $1; then
612 + shift
613 + for i in $@; do
614 + VULKAN_DRIVERS+=",${i}"
615 + done
616 + fi
617 + ;;
618 + esac
619 +}
620
621 diff --git a/media-libs/mesa/mesa-17.3.0_rc4.ebuild b/media-libs/mesa/mesa-17.3.0_rc4.ebuild
622 new file mode 100644
623 index 0000000..1887909
624 --- /dev/null
625 +++ b/media-libs/mesa/mesa-17.3.0_rc4.ebuild
626 @@ -0,0 +1,589 @@
627 +# Copyright 1999-2017 Gentoo Foundation
628 +# Distributed under the terms of the GNU General Public License v2
629 +
630 +EAPI=6
631 +
632 +EGIT_REPO_URI="https://anongit.freedesktop.org/git/mesa/mesa.git"
633 +
634 +if [[ ${PV} = 9999 ]]; then
635 + GIT_ECLASS="git-r3"
636 + EXPERIMENTAL="true"
637 +fi
638 +
639 +PYTHON_COMPAT=( python2_7 )
640 +
641 +inherit autotools llvm multilib-minimal python-any-r1 pax-utils ${GIT_ECLASS}
642 +
643 +OPENGL_DIR="xorg-x11"
644 +
645 +MY_P="${P/_/-}"
646 +
647 +DESCRIPTION="OpenGL-like graphic library for Linux"
648 +HOMEPAGE="https://www.mesa3d.org/ https://mesa.freedesktop.org/"
649 +
650 +if [[ $PV == 9999 ]]; then
651 + SRC_URI=""
652 +else
653 + SRC_URI="https://mesa.freedesktop.org/archive/${MY_P}.tar.xz"
654 + 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"
655 +fi
656 +
657 +LICENSE="MIT"
658 +SLOT="0"
659 +RESTRICT="!bindist? ( bindist )"
660 +
661 +RADEON_CARDS="r100 r200 r300 r600 radeon radeonsi"
662 +VIDEO_CARDS="${RADEON_CARDS} freedreno i915 i965 imx intel nouveau vc4 virgl vivante vmware"
663 +for card in ${VIDEO_CARDS}; do
664 + IUSE_VIDEO_CARDS+=" video_cards_${card}"
665 +done
666 +
667 +IUSE="${IUSE_VIDEO_CARDS}
668 + bindist +classic d3d9 debug +dri3 +egl +gallium +gbm gles1 gles2 unwind
669 + +llvm +nptl opencl osmesa pax_kernel openmax pic selinux vaapi valgrind
670 + vdpau vulkan wayland xvmc xa"
671 +
672 +REQUIRED_USE="
673 + d3d9? ( dri3 gallium )
674 + llvm? ( gallium )
675 + opencl? ( gallium llvm )
676 + openmax? ( gallium )
677 + gles1? ( egl )
678 + gles2? ( egl )
679 + vaapi? ( gallium )
680 + vdpau? ( gallium )
681 + vulkan? ( || ( video_cards_i965 video_cards_radeonsi )
682 + video_cards_radeonsi? ( llvm ) )
683 + wayland? ( egl gbm )
684 + xa? ( gallium )
685 + video_cards_freedreno? ( gallium )
686 + video_cards_intel? ( classic )
687 + video_cards_i915? ( || ( classic gallium ) )
688 + video_cards_i965? ( classic )
689 + video_cards_imx? ( gallium video_cards_vivante )
690 + video_cards_nouveau? ( || ( classic gallium ) )
691 + video_cards_radeon? ( || ( classic gallium )
692 + gallium? ( x86? ( llvm ) amd64? ( llvm ) ) )
693 + video_cards_r100? ( classic )
694 + video_cards_r200? ( classic )
695 + video_cards_r300? ( gallium x86? ( llvm ) amd64? ( llvm ) )
696 + video_cards_r600? ( gallium )
697 + video_cards_radeonsi? ( gallium llvm )
698 + video_cards_vc4? ( gallium )
699 + video_cards_virgl? ( gallium )
700 + video_cards_vivante? ( gallium gbm )
701 + video_cards_vmware? ( gallium )
702 +"
703 +
704 +LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.85"
705 +# keep correct libdrm and dri2proto dep
706 +# keep blocks in rdepend for binpkg
707 +RDEPEND="
708 + !<x11-base/xorg-server-1.7
709 + !<=x11-proto/xf86driproto-2.0.3
710 + abi_x86_32? ( !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)] )
711 + classic? ( app-eselect/eselect-mesa )
712 + gallium? ( app-eselect/eselect-mesa )
713 + >=app-eselect/eselect-opengl-1.3.0
714 + >=dev-libs/expat-2.1.0-r3:=[${MULTILIB_USEDEP}]
715 + >=sys-libs/zlib-1.2.8[${MULTILIB_USEDEP}]
716 + >=x11-libs/libX11-1.6.2:=[${MULTILIB_USEDEP}]
717 + >=x11-libs/libxshmfence-1.1:=[${MULTILIB_USEDEP}]
718 + >=x11-libs/libXdamage-1.1.4-r1:=[${MULTILIB_USEDEP}]
719 + >=x11-libs/libXext-1.3.2:=[${MULTILIB_USEDEP}]
720 + >=x11-libs/libXxf86vm-1.1.3:=[${MULTILIB_USEDEP}]
721 + >=x11-libs/libxcb-1.9.3:=[${MULTILIB_USEDEP}]
722 + x11-libs/libXfixes:=[${MULTILIB_USEDEP}]
723 + unwind? ( sys-libs/libunwind[${MULTILIB_USEDEP}] )
724 + llvm? (
725 + video_cards_radeonsi? (
726 + virtual/libelf:0=[${MULTILIB_USEDEP}]
727 + )
728 + video_cards_r600? (
729 + virtual/libelf:0=[${MULTILIB_USEDEP}]
730 + )
731 + video_cards_radeon? (
732 + virtual/libelf:0=[${MULTILIB_USEDEP}]
733 + )
734 + )
735 + opencl? (
736 + app-eselect/eselect-opencl
737 + dev-libs/libclc
738 + virtual/libelf:0=[${MULTILIB_USEDEP}]
739 + )
740 + openmax? ( >=media-libs/libomxil-bellagio-0.9.3:=[${MULTILIB_USEDEP}] )
741 + vaapi? (
742 + >=x11-libs/libva-1.7.3:=[${MULTILIB_USEDEP}]
743 + video_cards_nouveau? ( !<=x11-libs/libva-vdpau-driver-0.7.4-r3 )
744 + )
745 + vdpau? ( >=x11-libs/libvdpau-1.1:=[${MULTILIB_USEDEP}] )
746 + wayland? (
747 + >=dev-libs/wayland-1.11.0:=[${MULTILIB_USEDEP}]
748 + >=dev-libs/wayland-protocols-1.8
749 + )
750 + xvmc? ( >=x11-libs/libXvMC-1.0.8:=[${MULTILIB_USEDEP}] )
751 + ${LIBDRM_DEPSTRING}[video_cards_freedreno?,video_cards_nouveau?,video_cards_vc4?,video_cards_vivante?,video_cards_vmware?,${MULTILIB_USEDEP}]
752 +
753 + video_cards_intel? (
754 + !video_cards_i965? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
755 + )
756 + video_cards_i915? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
757 +"
758 +for card in ${RADEON_CARDS}; do
759 + RDEPEND="${RDEPEND}
760 + video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_radeon] )
761 + "
762 +done
763 +RDEPEND="${RDEPEND}
764 + video_cards_radeonsi? ( ${LIBDRM_DEPSTRING}[video_cards_amdgpu] )
765 +"
766 +
767 +# Please keep the LLVM dependency block separate. Since LLVM is slotted,
768 +# we need to *really* make sure we're not pulling one than more slot
769 +# simultaneously.
770 +#
771 +# How to use it:
772 +# 1. List all the working slots (with min versions) in ||, newest first.
773 +# 2. Update the := to specify *max* version, e.g. < 7.
774 +# 3. Specify LLVM_MAX_SLOT, e.g. 6.
775 +LLVM_DEPSTR="
776 + || (
777 + sys-devel/llvm:6[${MULTILIB_USEDEP}]
778 + sys-devel/llvm:5[${MULTILIB_USEDEP}]
779 + sys-devel/llvm:4[${MULTILIB_USEDEP}]
780 + >=sys-devel/llvm-3.9.0:0[${MULTILIB_USEDEP}]
781 + )
782 + sys-devel/llvm:=[${MULTILIB_USEDEP}]
783 +"
784 +LLVM_DEPSTR_AMDGPU=${LLVM_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
785 +CLANG_DEPSTR=${LLVM_DEPSTR//llvm/clang}
786 +CLANG_DEPSTR_AMDGPU=${CLANG_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
787 +RDEPEND="${RDEPEND}
788 + llvm? (
789 + opencl? (
790 + video_cards_r600? (
791 + ${CLANG_DEPSTR_AMDGPU}
792 + )
793 + !video_cards_r600? (
794 + video_cards_radeonsi? (
795 + ${CLANG_DEPSTR_AMDGPU}
796 + )
797 + )
798 + !video_cards_r600? (
799 + !video_cards_radeonsi? (
800 + video_cards_radeon? (
801 + ${CLANG_DEPSTR_AMDGPU}
802 + )
803 + )
804 + )
805 + !video_cards_r600? (
806 + !video_cards_radeon? (
807 + !video_cards_radeonsi? (
808 + ${CLANG_DEPSTR}
809 + )
810 + )
811 + )
812 + )
813 + !opencl? (
814 + video_cards_r600? (
815 + ${LLVM_DEPSTR_AMDGPU}
816 + )
817 + !video_cards_r600? (
818 + video_cards_radeonsi? (
819 + ${LLVM_DEPSTR_AMDGPU}
820 + )
821 + )
822 + !video_cards_r600? (
823 + !video_cards_radeonsi? (
824 + video_cards_radeon? (
825 + ${LLVM_DEPSTR_AMDGPU}
826 + )
827 + )
828 + )
829 + !video_cards_r600? (
830 + !video_cards_radeon? (
831 + !video_cards_radeonsi? (
832 + ${LLVM_DEPSTR}
833 + )
834 + )
835 + )
836 + )
837 + )
838 +"
839 +unset {LLVM,CLANG}_DEPSTR{,_AMDGPU}
840 +
841 +DEPEND="${RDEPEND}
842 + ${PYTHON_DEPS}
843 + opencl? (
844 + >=sys-devel/gcc-4.6
845 + )
846 + sys-devel/gettext
847 + virtual/pkgconfig
848 + valgrind? ( dev-util/valgrind )
849 + >=x11-proto/dri2proto-2.8-r1:=[${MULTILIB_USEDEP}]
850 + dri3? (
851 + >=x11-proto/dri3proto-1.0:=[${MULTILIB_USEDEP}]
852 + >=x11-proto/presentproto-1.0:=[${MULTILIB_USEDEP}]
853 + )
854 + >=x11-proto/glproto-1.4.17-r1:=[${MULTILIB_USEDEP}]
855 + >=x11-proto/xextproto-7.2.1-r1:=[${MULTILIB_USEDEP}]
856 + >=x11-proto/xf86driproto-2.1.1-r1:=[${MULTILIB_USEDEP}]
857 + >=x11-proto/xf86vidmodeproto-2.3.1-r1:=[${MULTILIB_USEDEP}]
858 + vulkan? (
859 + $(python_gen_any_dep ">=dev-python/mako-0.7.3[\${PYTHON_USEDEP}]")
860 + )
861 +"
862 +[[ ${PV} == 9999 ]] && DEPEND+="
863 + sys-devel/bison
864 + sys-devel/flex
865 + $(python_gen_any_dep ">=dev-python/mako-0.7.3[\${PYTHON_USEDEP}]")
866 +"
867 +
868 +S="${WORKDIR}/${MY_P}"
869 +EGIT_CHECKOUT_DIR=${S}
870 +
871 +QA_WX_LOAD="
872 +x86? (
873 + !pic? (
874 + usr/lib*/libglapi.so.0.0.0
875 + usr/lib*/libGLESv1_CM.so.1.1.0
876 + usr/lib*/libGLESv2.so.2.0.0
877 + usr/lib*/libGL.so.1.2.0
878 + usr/lib*/libOSMesa.so.8.0.0
879 + )
880 +)"
881 +
882 +llvm_check_deps() {
883 + local flags=${MULTILIB_USEDEP}
884 + if use video_cards_r600 || use video_cards_radeon || use video_cards_radeonsi
885 + then
886 + flags+=",llvm_targets_AMDGPU(-)"
887 + fi
888 +
889 + if use opencl; then
890 + has_version "sys-devel/clang[${flags}]" || return 1
891 + fi
892 + has_version "sys-devel/llvm[${flags}]"
893 +}
894 +
895 +pkg_setup() {
896 + # warning message for bug 459306
897 + if use llvm && has_version sys-devel/llvm[!debug=]; then
898 + ewarn "Mismatch between debug USE flags in media-libs/mesa and sys-devel/llvm"
899 + ewarn "detected! This can cause problems. For details, see bug 459306."
900 + fi
901 +
902 + if use llvm; then
903 + llvm_pkg_setup
904 + fi
905 + python-any-r1_pkg_setup
906 +}
907 +
908 +src_prepare() {
909 + eapply "${FILESDIR}"/${PN}-11-execinfo.patch
910 + eapply "${FILESDIR}"/${PN}-13-musl_endian.patch
911 +
912 + eautoreconf
913 +
914 + eapply_user
915 +}
916 +
917 +multilib_src_configure() {
918 + local myconf
919 +
920 + if use classic; then
921 + # Configurable DRI drivers
922 + driver_enable swrast
923 +
924 + # Intel code
925 + driver_enable video_cards_i915 i915
926 + driver_enable video_cards_i965 i965
927 + if ! use video_cards_i915 && \
928 + ! use video_cards_i965; then
929 + driver_enable video_cards_intel i915 i965
930 + fi
931 +
932 + # Nouveau code
933 + driver_enable video_cards_nouveau nouveau
934 +
935 + # ATI code
936 + driver_enable video_cards_r100 radeon
937 + driver_enable video_cards_r200 r200
938 + if ! use video_cards_r100 && \
939 + ! use video_cards_r200; then
940 + driver_enable video_cards_radeon radeon r200
941 + fi
942 + fi
943 +
944 + if use egl; then
945 + myconf+=" --with-platforms=x11,surfaceless$(use wayland && echo ",wayland")$(use gbm && echo ",drm")"
946 + fi
947 +
948 + if use gallium; then
949 + myconf+="
950 + $(use_enable d3d9 nine)
951 + $(use_enable llvm)
952 + $(use_enable openmax omx-bellagio)
953 + $(use_enable vaapi va)
954 + $(use_enable vdpau)
955 + $(use_enable xa)
956 + $(use_enable xvmc)
957 + "
958 + use vaapi && myconf+=" --with-va-libdir=/usr/$(get_libdir)/va/drivers"
959 +
960 + gallium_enable swrast
961 + gallium_enable video_cards_vc4 vc4
962 + gallium_enable video_cards_vivante etnaviv
963 + gallium_enable video_cards_vmware svga
964 + gallium_enable video_cards_nouveau nouveau
965 + gallium_enable video_cards_i915 i915
966 + gallium_enable video_cards_imx imx
967 + if ! use video_cards_i915 && \
968 + ! use video_cards_i965; then
969 + gallium_enable video_cards_intel i915
970 + fi
971 +
972 + gallium_enable video_cards_r300 r300
973 + gallium_enable video_cards_r600 r600
974 + gallium_enable video_cards_radeonsi radeonsi
975 + if ! use video_cards_r300 && \
976 + ! use video_cards_r600; then
977 + gallium_enable video_cards_radeon r300 r600
978 + fi
979 +
980 + gallium_enable video_cards_freedreno freedreno
981 + # opencl stuff
982 + if use opencl; then
983 + myconf+="
984 + $(use_enable opencl)
985 + --with-clang-libdir="${EPREFIX}/usr/lib"
986 + "
987 + fi
988 +
989 + gallium_enable video_cards_virgl virgl
990 + fi
991 +
992 + if use vulkan; then
993 + vulkan_enable video_cards_i965 intel
994 + vulkan_enable video_cards_radeonsi radeon
995 + fi
996 +
997 + # x86 hardened pax_kernel needs glx-rts, bug 240956
998 + if [[ ${ABI} == x86 ]]; then
999 + myconf+=" $(use_enable pax_kernel glx-read-only-text)"
1000 + fi
1001 +
1002 + # on abi_x86_32 hardened we need to have asm disable
1003 + if [[ ${ABI} == x86* ]] && use pic; then
1004 + myconf+=" --disable-asm"
1005 + fi
1006 +
1007 + if use gallium; then
1008 + myconf+=" $(use_enable osmesa gallium-osmesa)"
1009 + else
1010 + myconf+=" $(use_enable osmesa)"
1011 + fi
1012 +
1013 + # build fails with BSD indent, bug #428112
1014 + use userland_GNU || export INDENT=cat
1015 +
1016 + ECONF_SOURCE="${S}" \
1017 + econf \
1018 + --enable-dri \
1019 + --enable-glx \
1020 + --enable-shared-glapi \
1021 + $(use_enable !bindist texture-float) \
1022 + $(use_enable d3d9 nine) \
1023 + $(use_enable debug) \
1024 + $(use_enable dri3) \
1025 + $(use_enable egl) \
1026 + $(use_enable gbm) \
1027 + $(use_enable gles1) \
1028 + $(use_enable gles2) \
1029 + $(use_enable nptl glx-tls) \
1030 + $(use_enable unwind libunwind) \
1031 + --enable-valgrind=$(usex valgrind auto no) \
1032 + --enable-llvm-shared-libs \
1033 + --with-dri-drivers=${DRI_DRIVERS} \
1034 + --with-gallium-drivers=${GALLIUM_DRIVERS} \
1035 + --with-vulkan-drivers=${VULKAN_DRIVERS} \
1036 + PYTHON2="${PYTHON}" \
1037 + ${myconf}
1038 +}
1039 +
1040 +multilib_src_install() {
1041 + emake install DESTDIR="${D}"
1042 +
1043 + if use classic || use gallium; then
1044 + ebegin "Moving DRI/Gallium drivers for dynamic switching"
1045 + local gallium_drivers=( i915_dri.so i965_dri.so r300_dri.so r600_dri.so swrast_dri.so )
1046 + keepdir /usr/$(get_libdir)/dri
1047 + dodir /usr/$(get_libdir)/mesa
1048 + for x in ${gallium_drivers[@]}; do
1049 + if [ -f "$(get_libdir)/gallium/${x}" ]; then
1050 + mv -f "${ED}/usr/$(get_libdir)/dri/${x}" "${ED}/usr/$(get_libdir)/dri/${x/_dri.so/g_dri.so}" \
1051 + || die "Failed to move ${x}"
1052 + fi
1053 + done
1054 + if use classic; then
1055 + emake -C "${BUILD_DIR}/src/mesa/drivers/dri" DESTDIR="${D}" install
1056 + fi
1057 + for x in "${ED}"/usr/$(get_libdir)/dri/*.so; do
1058 + if [ -f ${x} -o -L ${x} ]; then
1059 + mv -f "${x}" "${x/dri/mesa}" \
1060 + || die "Failed to move ${x}"
1061 + fi
1062 + done
1063 + pushd "${ED}"/usr/$(get_libdir)/dri || die "pushd failed"
1064 + ln -s ../mesa/*.so . || die "Creating symlink failed"
1065 + # remove symlinks to drivers known to eselect
1066 + for x in ${gallium_drivers[@]}; do
1067 + if [ -f ${x} -o -L ${x} ]; then
1068 + rm "${x}" || die "Failed to remove ${x}"
1069 + fi
1070 + done
1071 + popd
1072 + eend $?
1073 + fi
1074 + if use opencl; then
1075 + ebegin "Moving Gallium/Clover OpenCL implementation for dynamic switching"
1076 + local cl_dir="/usr/$(get_libdir)/OpenCL/vendors/mesa"
1077 + dodir ${cl_dir}/{lib,include}
1078 + if [ -f "${ED}/usr/$(get_libdir)/libOpenCL.so" ]; then
1079 + mv -f "${ED}"/usr/$(get_libdir)/libOpenCL.so* \
1080 + "${ED}"${cl_dir}
1081 + fi
1082 + if [ -f "${ED}/usr/include/CL/opencl.h" ]; then
1083 + mv -f "${ED}"/usr/include/CL \
1084 + "${ED}"${cl_dir}/include
1085 + fi
1086 + eend $?
1087 + fi
1088 +
1089 + if use openmax; then
1090 + echo "XDG_DATA_DIRS=\"${EPREFIX}/usr/share/mesa/xdg\"" > "${T}/99mesaxdgomx"
1091 + doenvd "${T}"/99mesaxdgomx
1092 + keepdir /usr/share/mesa/xdg
1093 + fi
1094 +}
1095 +
1096 +multilib_src_install_all() {
1097 + find "${ED}" -name '*.la' -delete
1098 + einstalldocs
1099 +
1100 + if use !bindist; then
1101 + dodoc docs/patents.txt
1102 + fi
1103 +
1104 + # Install config file for eselect mesa
1105 + insinto /usr/share/mesa
1106 + newins "${FILESDIR}/eselect-mesa.conf.9.2" eselect-mesa.conf
1107 +}
1108 +
1109 +multilib_src_test() {
1110 + if use llvm; then
1111 + 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'
1112 + pushd src/gallium/drivers/llvmpipe >/dev/null || die
1113 + emake ${llvm_tests}
1114 + pax-mark m ${llvm_tests}
1115 + popd >/dev/null || die
1116 + fi
1117 + emake check
1118 +}
1119 +
1120 +pkg_postinst() {
1121 + # Switch to the xorg implementation.
1122 + echo
1123 + eselect opengl set --use-old ${OPENGL_DIR}
1124 +
1125 + # Select classic/gallium drivers
1126 + if use classic || use gallium; then
1127 + eselect mesa set --auto
1128 + fi
1129 +
1130 + # Switch to mesa opencl
1131 + if use opencl; then
1132 + eselect opencl set --use-old ${PN}
1133 + fi
1134 +
1135 + # run omxregister-bellagio to make the OpenMAX drivers known system-wide
1136 + if use openmax; then
1137 + ebegin "Registering OpenMAX drivers"
1138 + BELLAGIO_SEARCH_PATH="${EPREFIX}/usr/$(get_libdir)/libomxil-bellagio0" \
1139 + OMX_BELLAGIO_REGISTRY=${EPREFIX}/usr/share/mesa/xdg/.omxregister \
1140 + omxregister-bellagio
1141 + eend $?
1142 + fi
1143 +
1144 + # warn about patent encumbered texture-float
1145 + if use !bindist; then
1146 + elog "USE=\"bindist\" was not set. Potentially patent encumbered code was"
1147 + elog "enabled. Please see patents.txt for an explanation."
1148 + fi
1149 +
1150 + if ! has_version media-libs/libtxc_dxtn; then
1151 + elog "Note that in order to have full S3TC support, it is necessary to install"
1152 + elog "media-libs/libtxc_dxtn as well. This may be necessary to get nice"
1153 + elog "textures in some apps, and some others even require this to run."
1154 + fi
1155 +}
1156 +
1157 +pkg_prerm() {
1158 + if use openmax; then
1159 + rm "${EPREFIX}"/usr/share/mesa/xdg/.omxregister
1160 + fi
1161 +}
1162 +
1163 +# $1 - VIDEO_CARDS flag
1164 +# other args - names of DRI drivers to enable
1165 +# TODO: avoid code duplication for a more elegant implementation
1166 +driver_enable() {
1167 + case $# in
1168 + # for enabling unconditionally
1169 + 1)
1170 + DRI_DRIVERS+=",$1"
1171 + ;;
1172 + *)
1173 + if use $1; then
1174 + shift
1175 + for i in $@; do
1176 + DRI_DRIVERS+=",${i}"
1177 + done
1178 + fi
1179 + ;;
1180 + esac
1181 +}
1182 +
1183 +gallium_enable() {
1184 + case $# in
1185 + # for enabling unconditionally
1186 + 1)
1187 + GALLIUM_DRIVERS+=",$1"
1188 + ;;
1189 + *)
1190 + if use $1; then
1191 + shift
1192 + for i in $@; do
1193 + GALLIUM_DRIVERS+=",${i}"
1194 + done
1195 + fi
1196 + ;;
1197 + esac
1198 +}
1199 +
1200 +vulkan_enable() {
1201 + case $# in
1202 + # for enabling unconditionally
1203 + 1)
1204 + VULKAN_DRIVERS+=",$1"
1205 + ;;
1206 + *)
1207 + if use $1; then
1208 + shift
1209 + for i in $@; do
1210 + VULKAN_DRIVERS+=",${i}"
1211 + done
1212 + fi
1213 + ;;
1214 + esac
1215 +}