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: Sat, 28 Apr 2018 19:33:12
Message-Id: 1524943973.08662137e4aa042143061c5efc1e3321227f1c11.mattst88@gentoo
1 commit: 08662137e4aa042143061c5efc1e3321227f1c11
2 Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
3 AuthorDate: Sat Apr 28 19:32:07 2018 +0000
4 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
5 CommitDate: Sat Apr 28 19:32:53 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=08662137
7
8 media-libs/mesa: Version bump to 18.0.2
9
10 media-libs/mesa/Manifest | 1 +
11 media-libs/mesa/mesa-18.0.2.ebuild | 583 +++++++++++++++++++++++++++++++++++++
12 2 files changed, 584 insertions(+)
13
14 diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
15 index 224ce72509e..d8673e6d07b 100644
16 --- a/media-libs/mesa/Manifest
17 +++ b/media-libs/mesa/Manifest
18 @@ -4,5 +4,6 @@ DIST mesa-17.3.8.tar.xz 10660896 BLAKE2B 432deefad4b0a42914efc24c558d5c766443f55
19 DIST mesa-17.3.9.tar.xz 10660456 BLAKE2B 54f4a75f9040e50e9eea8f5c52a276578379d25d2a01ac4767ab12bee85fe5dae1492d5bb1df06b6e8c6b0fe960bbd5ea38691c75d08a6b4302c64377ce58e54 SHA512 83deffbc6b9823b8e93cccf57d7952106f3d55fea881e3924f9f9586f0e9347a6e3a1a36cc19c24af819f2fde3af9496652a6ff56132511a5618d5774404f63f
20 DIST mesa-18.0.0.tar.xz 11056544 BLAKE2B 467c100bcbc0a60e3868e718331192255fd16394c21b08c128a054e066740cd071e0b272aba011873fe239821f53442e9a07ae860d94b425275bd68c3db3b7fc SHA512 1494bb09357896a2505b3dcfec772268e28c765804f21e144948a314f1d79d99ff9f21062ef5860eb5a5a568b305a9c954585924a7ac8890fe1ebd8df3bcc396
21 DIST mesa-18.0.1.tar.xz 10945308 BLAKE2B 03dad0961aafeb954a50f1db305288682e6b0dc58631b66de2f331dc95756b881bf7f73b5e2fa4ec04640054c27aab236acdf6b89bd7cd89ca1dbe9134a6a2d0 SHA512 b0d610904b6f179a27b42aee5f479339e341926915cdc6adb08ac999a4a12539abc3776577e86af83e10381d9703ef1bca70bab81b43daf2c000622c9c3612d2
22 +DIST mesa-18.0.2.tar.xz 10949364 BLAKE2B 8b0557db70f61ac39df96e923383e41008f483ae2f89b3723e94e644cb2ced81a7996d61009acaebaf7813843742a24351a573c80f1173615e6c0302552cf621 SHA512 77d24d01c4c22596d28421aeb74932ff232730a4f556ae1a2e8777ece2876e4e352679575385c065505df4a2a83d2c1cf30db92dcf88038417e36a2768332d7e
23 DIST mesa-18.1.0-rc1.tar.xz 11118324 BLAKE2B e5a89c8469b6716463c9efb0e7059022bc986da83d55a020156a3466cb44c283828bacb340ef4dceda9e14a82f737b6809f742b49a8b38d7e871ff1864e8bb3e SHA512 5b179b4ece6fd0e04ef00744d975607b6678c4c333c47fdd7442768ac15b375c7faeb8472b0dba19c0b8755067effd6243803ce17739a50c17efc8e69e6ae401
24 DIST mesa-18.1.0-rc2.tar.xz 11117872 BLAKE2B a95096ed573031eed17b880f725d68af062e0f7d9513d391d83c51e996fa238add93e05ae98ad4ed77d731f7521736b73566687be798029293d88f8b4b75db1c SHA512 43ddb27c436ab6ad08c4f5f764855e0681c10995e5279146c01e03e6e8af98dd23d96a20d3ac50107a6ca89cc3dd094bc472ddd70d290d0357cef3059ae34cfc
25
26 diff --git a/media-libs/mesa/mesa-18.0.2.ebuild b/media-libs/mesa/mesa-18.0.2.ebuild
27 new file mode 100644
28 index 00000000000..6cdc82a5cc3
29 --- /dev/null
30 +++ b/media-libs/mesa/mesa-18.0.2.ebuild
31 @@ -0,0 +1,583 @@
32 +# Copyright 1999-2018 Gentoo Foundation
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=6
36 +
37 +EGIT_REPO_URI="https://anongit.freedesktop.org/git/mesa/mesa.git"
38 +
39 +if [[ ${PV} = 9999 ]]; then
40 + GIT_ECLASS="git-r3"
41 + EXPERIMENTAL="true"
42 +fi
43 +
44 +PYTHON_COMPAT=( python2_7 )
45 +
46 +inherit autotools llvm multilib-minimal python-any-r1 pax-utils ${GIT_ECLASS}
47 +
48 +OPENGL_DIR="xorg-x11"
49 +
50 +MY_P="${P/_/-}"
51 +
52 +DESCRIPTION="OpenGL-like graphic library for Linux"
53 +HOMEPAGE="https://www.mesa3d.org/ https://mesa.freedesktop.org/"
54 +
55 +if [[ $PV == 9999 ]]; then
56 + SRC_URI=""
57 +else
58 + SRC_URI="https://mesa.freedesktop.org/archive/${MY_P}.tar.xz"
59 + 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"
60 +fi
61 +
62 +LICENSE="MIT"
63 +SLOT="0"
64 +RESTRICT="!bindist? ( bindist )"
65 +
66 +RADEON_CARDS="r100 r200 r300 r600 radeon radeonsi"
67 +VIDEO_CARDS="${RADEON_CARDS} freedreno i915 i965 imx intel nouveau vc4 virgl vivante vmware"
68 +for card in ${VIDEO_CARDS}; do
69 + IUSE_VIDEO_CARDS+=" video_cards_${card}"
70 +done
71 +
72 +IUSE="${IUSE_VIDEO_CARDS}
73 + bindist +classic d3d9 debug +dri3 +egl +gallium +gbm gles1 gles2 unwind
74 + +llvm +nptl opencl osmesa pax_kernel openmax pic selinux vaapi valgrind
75 + vdpau vulkan wayland xvmc xa"
76 +
77 +REQUIRED_USE="
78 + d3d9? ( dri3 gallium )
79 + llvm? ( gallium )
80 + opencl? ( gallium llvm )
81 + openmax? ( gallium )
82 + gles1? ( egl )
83 + gles2? ( egl )
84 + vaapi? ( gallium )
85 + vdpau? ( gallium )
86 + vulkan? ( || ( video_cards_i965 video_cards_radeonsi )
87 + video_cards_radeonsi? ( llvm ) )
88 + wayland? ( egl gbm )
89 + xa? ( gallium )
90 + video_cards_freedreno? ( gallium )
91 + video_cards_intel? ( classic )
92 + video_cards_i915? ( || ( classic gallium ) )
93 + video_cards_i965? ( classic )
94 + video_cards_imx? ( gallium video_cards_vivante )
95 + video_cards_nouveau? ( || ( classic gallium ) )
96 + video_cards_radeon? ( || ( classic gallium )
97 + gallium? ( x86? ( llvm ) amd64? ( llvm ) ) )
98 + video_cards_r100? ( classic )
99 + video_cards_r200? ( classic )
100 + video_cards_r300? ( gallium x86? ( llvm ) amd64? ( llvm ) )
101 + video_cards_r600? ( gallium )
102 + video_cards_radeonsi? ( gallium llvm )
103 + video_cards_vc4? ( gallium )
104 + video_cards_virgl? ( gallium )
105 + video_cards_vivante? ( gallium gbm )
106 + video_cards_vmware? ( gallium )
107 +"
108 +
109 +LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.89"
110 +# keep correct libdrm and dri2proto dep
111 +# keep blocks in rdepend for binpkg
112 +RDEPEND="
113 + !<x11-base/xorg-server-1.7
114 + !<=x11-proto/xf86driproto-2.0.3
115 + classic? ( app-eselect/eselect-mesa )
116 + gallium? ( app-eselect/eselect-mesa )
117 + >=app-eselect/eselect-opengl-1.3.0
118 + >=dev-libs/expat-2.1.0-r3:=[${MULTILIB_USEDEP}]
119 + >=sys-libs/zlib-1.2.8[${MULTILIB_USEDEP}]
120 + >=x11-libs/libX11-1.6.2:=[${MULTILIB_USEDEP}]
121 + >=x11-libs/libxshmfence-1.1:=[${MULTILIB_USEDEP}]
122 + >=x11-libs/libXdamage-1.1.4-r1:=[${MULTILIB_USEDEP}]
123 + >=x11-libs/libXext-1.3.2:=[${MULTILIB_USEDEP}]
124 + >=x11-libs/libXxf86vm-1.1.3:=[${MULTILIB_USEDEP}]
125 + >=x11-libs/libxcb-1.9.3:=[${MULTILIB_USEDEP}]
126 + x11-libs/libXfixes:=[${MULTILIB_USEDEP}]
127 + unwind? ( sys-libs/libunwind[${MULTILIB_USEDEP}] )
128 + llvm? (
129 + video_cards_radeonsi? (
130 + virtual/libelf:0=[${MULTILIB_USEDEP}]
131 + )
132 + video_cards_r600? (
133 + virtual/libelf:0=[${MULTILIB_USEDEP}]
134 + )
135 + video_cards_radeon? (
136 + virtual/libelf:0=[${MULTILIB_USEDEP}]
137 + )
138 + )
139 + opencl? (
140 + app-eselect/eselect-opencl
141 + dev-libs/libclc
142 + virtual/libelf:0=[${MULTILIB_USEDEP}]
143 + )
144 + openmax? (
145 + >=media-libs/libomxil-bellagio-0.9.3:=[${MULTILIB_USEDEP}]
146 + x11-misc/xdg-utils
147 + )
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_DEPSTR="
183 + || (
184 + sys-devel/llvm:6[${MULTILIB_USEDEP}]
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 + vulkan? (
266 + $(python_gen_any_dep ">=dev-python/mako-0.7.3[\${PYTHON_USEDEP}]")
267 + )
268 +"
269 +[[ ${PV} == 9999 ]] && DEPEND+="
270 + sys-devel/bison
271 + sys-devel/flex
272 + $(python_gen_any_dep ">=dev-python/mako-0.7.3[\${PYTHON_USEDEP}]")
273 +"
274 +
275 +S="${WORKDIR}/${MY_P}"
276 +EGIT_CHECKOUT_DIR=${S}
277 +
278 +QA_WX_LOAD="
279 +x86? (
280 + !pic? (
281 + usr/lib*/libglapi.so.0.0.0
282 + usr/lib*/libGLESv1_CM.so.1.1.0
283 + usr/lib*/libGLESv2.so.2.0.0
284 + usr/lib*/libGL.so.1.2.0
285 + usr/lib*/libOSMesa.so.8.0.0
286 + )
287 +)"
288 +
289 +llvm_check_deps() {
290 + local flags=${MULTILIB_USEDEP}
291 + if use video_cards_r600 || use video_cards_radeon || use video_cards_radeonsi
292 + then
293 + flags+=",llvm_targets_AMDGPU(-)"
294 + fi
295 +
296 + if use opencl; then
297 + has_version "sys-devel/clang[${flags}]" || return 1
298 + fi
299 + has_version "sys-devel/llvm[${flags}]"
300 +}
301 +
302 +pkg_setup() {
303 + # warning message for bug 459306
304 + if use llvm && has_version sys-devel/llvm[!debug=]; then
305 + ewarn "Mismatch between debug USE flags in media-libs/mesa and sys-devel/llvm"
306 + ewarn "detected! This can cause problems. For details, see bug 459306."
307 + fi
308 +
309 + if use llvm; then
310 + llvm_pkg_setup
311 + fi
312 + python-any-r1_pkg_setup
313 +}
314 +
315 +src_prepare() {
316 + [[ ${PV} == 9999 ]] && eautoreconf
317 + eapply_user
318 +}
319 +
320 +multilib_src_configure() {
321 + local myconf
322 +
323 + if use classic; then
324 + # Configurable DRI drivers
325 + driver_enable swrast
326 +
327 + # Intel code
328 + driver_enable video_cards_i915 i915
329 + driver_enable video_cards_i965 i965
330 + if ! use video_cards_i915 && \
331 + ! use video_cards_i965; then
332 + driver_enable video_cards_intel i915 i965
333 + fi
334 +
335 + # Nouveau code
336 + driver_enable video_cards_nouveau nouveau
337 +
338 + # ATI code
339 + driver_enable video_cards_r100 radeon
340 + driver_enable video_cards_r200 r200
341 + if ! use video_cards_r100 && \
342 + ! use video_cards_r200; then
343 + driver_enable video_cards_radeon radeon r200
344 + fi
345 + fi
346 +
347 + if use egl; then
348 + myconf+=" --with-platforms=x11,surfaceless$(use wayland && echo ",wayland")$(use gbm && echo ",drm")"
349 + fi
350 +
351 + if use gallium; then
352 + myconf+="
353 + $(use_enable d3d9 nine)
354 + $(use_enable llvm)
355 + $(use_enable openmax omx-bellagio)
356 + $(use_enable vaapi va)
357 + $(use_enable vdpau)
358 + $(use_enable xa)
359 + $(use_enable xvmc)
360 + "
361 + use vaapi && myconf+=" --with-va-libdir=/usr/$(get_libdir)/va/drivers"
362 +
363 + gallium_enable swrast
364 + gallium_enable video_cards_vc4 vc4
365 + gallium_enable video_cards_vivante etnaviv
366 + gallium_enable video_cards_vmware svga
367 + gallium_enable video_cards_nouveau nouveau
368 + gallium_enable video_cards_i915 i915
369 + gallium_enable video_cards_imx imx
370 + if ! use video_cards_i915 && \
371 + ! use video_cards_i965; then
372 + gallium_enable video_cards_intel i915
373 + fi
374 +
375 + gallium_enable video_cards_r300 r300
376 + gallium_enable video_cards_r600 r600
377 + gallium_enable video_cards_radeonsi radeonsi
378 + if ! use video_cards_r300 && \
379 + ! use video_cards_r600; then
380 + gallium_enable video_cards_radeon r300 r600
381 + fi
382 +
383 + gallium_enable video_cards_freedreno freedreno
384 + # opencl stuff
385 + if use opencl; then
386 + myconf+="
387 + $(use_enable opencl)
388 + --with-clang-libdir="${EPREFIX}/usr/lib"
389 + "
390 + fi
391 +
392 + gallium_enable video_cards_virgl virgl
393 + fi
394 +
395 + if use vulkan; then
396 + vulkan_enable video_cards_i965 intel
397 + vulkan_enable video_cards_radeonsi radeon
398 + fi
399 +
400 + # x86 hardened pax_kernel needs glx-rts, bug 240956
401 + if [[ ${ABI} == x86 ]]; then
402 + myconf+=" $(use_enable pax_kernel glx-read-only-text)"
403 + fi
404 +
405 + # on abi_x86_32 hardened we need to have asm disable
406 + if [[ ${ABI} == x86* ]] && use pic; then
407 + myconf+=" --disable-asm"
408 + fi
409 +
410 + if use gallium; then
411 + myconf+=" $(use_enable osmesa gallium-osmesa)"
412 + else
413 + myconf+=" $(use_enable osmesa)"
414 + fi
415 +
416 + # build fails with BSD indent, bug #428112
417 + use userland_GNU || export INDENT=cat
418 +
419 + ECONF_SOURCE="${S}" \
420 + econf \
421 + --enable-dri \
422 + --enable-glx \
423 + --enable-shared-glapi \
424 + $(use_enable !bindist texture-float) \
425 + $(use_enable d3d9 nine) \
426 + $(use_enable debug) \
427 + $(use_enable dri3) \
428 + $(use_enable egl) \
429 + $(use_enable gbm) \
430 + $(use_enable gles1) \
431 + $(use_enable gles2) \
432 + $(use_enable nptl glx-tls) \
433 + $(use_enable unwind libunwind) \
434 + --enable-valgrind=$(usex valgrind auto no) \
435 + --enable-llvm-shared-libs \
436 + --disable-opencl-icd \
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 /usr/share/doc/${P}/patents.txt.bz2 for an"
552 + elog "explanation."
553 + fi
554 +}
555 +
556 +pkg_prerm() {
557 + if use openmax; then
558 + rm "${EPREFIX}"/usr/share/mesa/xdg/.omxregister
559 + fi
560 +}
561 +
562 +# $1 - VIDEO_CARDS flag
563 +# other args - names of DRI drivers to enable
564 +# TODO: avoid code duplication for a more elegant implementation
565 +driver_enable() {
566 + case $# in
567 + # for enabling unconditionally
568 + 1)
569 + DRI_DRIVERS+=",$1"
570 + ;;
571 + *)
572 + if use $1; then
573 + shift
574 + for i in $@; do
575 + DRI_DRIVERS+=",${i}"
576 + done
577 + fi
578 + ;;
579 + esac
580 +}
581 +
582 +gallium_enable() {
583 + case $# in
584 + # for enabling unconditionally
585 + 1)
586 + GALLIUM_DRIVERS+=",$1"
587 + ;;
588 + *)
589 + if use $1; then
590 + shift
591 + for i in $@; do
592 + GALLIUM_DRIVERS+=",${i}"
593 + done
594 + fi
595 + ;;
596 + esac
597 +}
598 +
599 +vulkan_enable() {
600 + case $# in
601 + # for enabling unconditionally
602 + 1)
603 + VULKAN_DRIVERS+=",$1"
604 + ;;
605 + *)
606 + if use $1; then
607 + shift
608 + for i in $@; do
609 + VULKAN_DRIVERS+=",${i}"
610 + done
611 + fi
612 + ;;
613 + esac
614 +}