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: Mon, 03 Apr 2017 01:52:48
Message-Id: 1491184336.7937b78da5a45b2384a89d4c3eb1a83490889377.lluixhi@gentoo
1 commit: 7937b78da5a45b2384a89d4c3eb1a83490889377
2 Author: Aric Belsito <lluixhi <AT> gmail <DOT> com>
3 AuthorDate: Mon Apr 3 01:52:16 2017 +0000
4 Commit: Aric Belsito <lluixhi <AT> gmail <DOT> com>
5 CommitDate: Mon Apr 3 01:52:16 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/musl.git/commit/?id=7937b78d
7
8 media-libs/mesa: version bump to 17.0.3
9
10 media-libs/mesa/Manifest | 2 +
11 media-libs/mesa/mesa-17.0.3.ebuild | 517 +++++++++++++++++++++++++++++++++++++
12 2 files changed, 519 insertions(+)
13
14 diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
15 index d9697c9..8496eda 100644
16 --- a/media-libs/mesa/Manifest
17 +++ b/media-libs/mesa/Manifest
18 @@ -5,7 +5,9 @@ AUX mesa-13-musl_endian.patch 417 SHA256 3686132ef3a57b607c223705a18f32da7fa7f58
19 DIST mesa-13.0.5.tar.xz 9171480 SHA256 bfcea7e2c801525a60895c8aff11aa68457ee9aa35d01a4638e1f310a3f5ef87 SHA512 db5f6a97b40ee6e45ba81280ab4543354e9f274c7112c5a43b8970244f329902a22f68d5eeddad5b64502507f462ffbcc028efc5dff93822adf95d30ba5903c1 WHIRLPOOL 164116608908331d4e8d69c4d2b92dc22e8e6d98725a20e8c2da5cc24b4e9ae9e05ee9c7209d55371b419e0f4e6c1d4752a46d149a968a6b83612aa77f7e480e
20 DIST mesa-13.0.6.tar.xz 9179236 SHA256 29ef104a7fc082d352b1599bd6cb1d040be424ccd22f5e0eb7ee9b0e9acd3597 SHA512 2455e044647f674c2f1dd524143b61b8630713fa929bbf6fe1c981436a9c08dc933553d638a22b32d2799afb77be746355b48b1b20af172141c5b63891e94441 WHIRLPOOL 1fdaaf29de96225cf41a3bdeb559a35cf20fda524f80985b2bfdc52095dcb7f6b320704b7ccf754a6f80555925a6a80dfa2b1115a4bdd9bdc1ebb672f115208a
21 DIST mesa-17.0.2.tar.xz 9451056 SHA256 f8f191f909e01e65de38d5bdea5fb057f21649a3aed20948be02348e77a689d4 SHA512 df0cb47d01dee16d1d72e0a5fd9d49ab412294761ca647cbb6b411e16892b8be503d87911591339d4630d16b7c948897bfa4321b2c5a8a4219fa58b347015471 WHIRLPOOL 3cb03a48da994202e6a39f4adc97e8b40f2bcc713f5fb859fbbdc0a068f3842a59bc916fa0e36138cf560c4bf25c3b70425d6ed9ea8096acc8bbd9ddebfd1acc
22 +DIST mesa-17.0.3.tar.xz 9485792 SHA256 ca646f5075a002d60ef9123c8a4331cede155c01712ef945a65c59a5e69fe7ed SHA512 0bcf1609b54fdabb30ec0a500b78e039bd50060c2c7f5a2e57fca29e1a311fb785dadc3cd311018ebe8020d1cc6320181ece2d2aa39d2f215b0ebf2cb0a55165 WHIRLPOOL fdb1d155e3c8aa22ccbe1403240d891381871e6b62cbd104bc83fd5cd6c3645ac58ac88ba3ff0878e7795404fde77481c3374beb60f295569fe020a1389fb853
23 EBUILD mesa-13.0.5.ebuild 13682 SHA256 c0941589335d956bff393fbd26114b2017d1f71fae94e06becaae8a1c52f0b0c SHA512 e407f73610a8d6c7e3456a051dac01bb577a4714128568f276c7e8811b9fc7ac050f29e2770861c1addb561a6828006cfb9f3f18a215448df61b6f9f03f9a7df WHIRLPOOL 71ebf88582419ef5175a04a5ea2d286fe8d2946c95ab354bc2a3a52386ba7100010d5bf92dc9c0c1f0ee4d65353636e2482ef911663b55f932547613d0520b48
24 EBUILD mesa-13.0.6.ebuild 13608 SHA256 1eec6bc2746825886f65b2ea71742a63c6a1c3822da6e380751248e5e869de2b SHA512 562514a18f7c9a0606ca358404abaaab86ed78671f0056480eaae2d70581a4ed3a96daa28316021a026f4bb7c1b35d32d8d3ec7a4b2af378d0e1e16cb08dc67d WHIRLPOOL 8856f1a7a347b517d4ba74af483c086b3fec49c8cdf62edbc161de9d3eef5e1ce805bbbac16d5ff58b8cb2095558f888d2f65562a9c45a21e15e1ff54c3ed9de
25 EBUILD mesa-17.0.2.ebuild 13635 SHA256 38045d4ddd3751f2446b74330cc416583d6c5e2cc913c2627e679940477fbca9 SHA512 8981e0da8ca573c6a4a7ef3c7fc565b208c236bfaffe9b5557f2795363f93edea9c1a4ee7fcac93e40e4286077604df6b855f934bad5af631615f3d5badd7313 WHIRLPOOL 5feb6d17ccaf72a14ac88b391b8e5996fe27bc7fb548a32258106b525318297271939743b2e619c3d8ba1e389b3a4f8323ec6c2d4ed1e47775da9068599655f8
26 +EBUILD mesa-17.0.3.ebuild 13635 SHA256 38045d4ddd3751f2446b74330cc416583d6c5e2cc913c2627e679940477fbca9 SHA512 8981e0da8ca573c6a4a7ef3c7fc565b208c236bfaffe9b5557f2795363f93edea9c1a4ee7fcac93e40e4286077604df6b855f934bad5af631615f3d5badd7313 WHIRLPOOL 5feb6d17ccaf72a14ac88b391b8e5996fe27bc7fb548a32258106b525318297271939743b2e619c3d8ba1e389b3a4f8323ec6c2d4ed1e47775da9068599655f8
27 MISC metadata.xml 2440 SHA256 98874315e8480a14f26b8395eb2573b85dbe402a8bb30a72aa2cc884bc0512a2 SHA512 47237a5fd95a9c58b1857b27da2558ecf46266630eeb7514db2f276f0a8c82a0751122d71a27b4949a1a66df75bbe9e5a833b1f12a86214614e6777849d4c5d8 WHIRLPOOL 5742264ad29f82e98a96044efb74fb230e7a8cc4d58ad569676e8ffc9a86873d5148de86e8a101a11ee465e204cae47f1ec8d50ba8a8c0d75070cb705a03eef8
28
29 diff --git a/media-libs/mesa/mesa-17.0.3.ebuild b/media-libs/mesa/mesa-17.0.3.ebuild
30 new file mode 100644
31 index 0000000..69263ea
32 --- /dev/null
33 +++ b/media-libs/mesa/mesa-17.0.3.ebuild
34 @@ -0,0 +1,517 @@
35 +# Copyright 1999-2017 Gentoo Foundation
36 +# Distributed under the terms of the GNU General Public License v2
37 +
38 +EAPI=6
39 +
40 +EGIT_REPO_URI="https://anongit.freedesktop.org/git/mesa/mesa.git"
41 +
42 +if [[ ${PV} = 9999 ]]; then
43 + GIT_ECLASS="git-r3"
44 + EXPERIMENTAL="true"
45 +fi
46 +
47 +PYTHON_COMPAT=( python2_7 )
48 +
49 +inherit autotools llvm multilib-minimal python-any-r1 pax-utils ${GIT_ECLASS}
50 +
51 +OPENGL_DIR="xorg-x11"
52 +
53 +MY_P="${P/_/-}"
54 +
55 +DESCRIPTION="OpenGL-like graphic library for Linux"
56 +HOMEPAGE="https://www.mesa3d.org/"
57 +
58 +if [[ $PV == 9999 ]]; then
59 + SRC_URI=""
60 +else
61 + SRC_URI="https://mesa.freedesktop.org/archive/${MY_P}.tar.xz"
62 + 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"
63 +fi
64 +
65 +LICENSE="MIT"
66 +SLOT="0"
67 +RESTRICT="!bindist? ( bindist )"
68 +
69 +INTEL_CARDS="i915 i965 intel"
70 +RADEON_CARDS="r100 r200 r300 r600 radeon radeonsi"
71 +VIDEO_CARDS="${INTEL_CARDS} ${RADEON_CARDS} freedreno imx nouveau vc4 vivante vmware"
72 +for card in ${VIDEO_CARDS}; do
73 + IUSE_VIDEO_CARDS+=" video_cards_${card}"
74 +done
75 +
76 +IUSE="${IUSE_VIDEO_CARDS}
77 + bindist +classic d3d9 debug +dri3 +egl +gallium +gbm gles1 gles2 +llvm
78 + +nptl opencl osmesa pax_kernel openmax pic selinux vaapi valgrind vdpau
79 + vulkan wayland xvmc xa"
80 +
81 +REQUIRED_USE="
82 + d3d9? ( dri3 gallium )
83 + llvm? ( gallium )
84 + opencl? ( gallium llvm )
85 + openmax? ( gallium )
86 + gles1? ( egl )
87 + gles2? ( egl )
88 + vaapi? ( gallium )
89 + vdpau? ( gallium )
90 + vulkan? ( || ( video_cards_i965 video_cards_radeonsi )
91 + video_cards_radeonsi? ( llvm ) )
92 + wayland? ( egl gbm )
93 + xa? ( gallium )
94 + video_cards_freedreno? ( gallium )
95 + video_cards_intel? ( classic )
96 + video_cards_i915? ( || ( classic gallium ) )
97 + video_cards_i965? ( classic )
98 + video_cards_imx? ( gallium )
99 + video_cards_nouveau? ( || ( classic gallium ) )
100 + video_cards_radeon? ( || ( classic gallium )
101 + gallium? ( x86? ( llvm ) amd64? ( llvm ) ) )
102 + video_cards_r100? ( classic )
103 + video_cards_r200? ( classic )
104 + video_cards_r300? ( gallium x86? ( llvm ) amd64? ( llvm ) )
105 + video_cards_r600? ( gallium )
106 + video_cards_radeonsi? ( gallium llvm )
107 + video_cards_vivante? ( gallium gbm )
108 + video_cards_vmware? ( gallium )
109 + ${PYTHON_REQUIRED_USE}
110 +"
111 +
112 +LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.74"
113 +# keep correct libdrm and dri2proto dep
114 +# keep blocks in rdepend for binpkg
115 +RDEPEND="
116 + !<x11-base/xorg-server-1.7
117 + !<=x11-proto/xf86driproto-2.0.3
118 + abi_x86_32? ( !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)] )
119 + classic? ( app-eselect/eselect-mesa )
120 + gallium? ( app-eselect/eselect-mesa )
121 + >=app-eselect/eselect-opengl-1.3.0
122 + >=dev-libs/expat-2.1.0-r3:=[${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 + llvm? (
131 + video_cards_radeonsi? (
132 + virtual/libelf:0=[${MULTILIB_USEDEP}]
133 + vulkan? (
134 + || (
135 + sys-devel/llvm:4[${MULTILIB_USEDEP}]
136 + >=sys-devel/llvm-3.9.0:0[${MULTILIB_USEDEP}] ) )
137 + )
138 + video_cards_r600? (
139 + virtual/libelf:0=[${MULTILIB_USEDEP}]
140 + )
141 + video_cards_radeon? (
142 + virtual/libelf:0=[${MULTILIB_USEDEP}]
143 + )
144 + || (
145 + sys-devel/llvm:4[${MULTILIB_USEDEP}]
146 + >=sys-devel/llvm-3.6.0:0[${MULTILIB_USEDEP}]
147 + )
148 + <sys-devel/llvm-5:=[${MULTILIB_USEDEP}]
149 + )
150 + opencl? (
151 + app-eselect/eselect-opencl
152 + dev-libs/libclc
153 + virtual/libelf:0=[${MULTILIB_USEDEP}]
154 + )
155 + openmax? ( >=media-libs/libomxil-bellagio-0.9.3:=[${MULTILIB_USEDEP}] )
156 + vaapi? (
157 + >=x11-libs/libva-1.6.0:=[${MULTILIB_USEDEP}]
158 + video_cards_nouveau? ( !<=x11-libs/libva-vdpau-driver-0.7.4-r3 )
159 + )
160 + vdpau? ( >=x11-libs/libvdpau-1.1:=[${MULTILIB_USEDEP}] )
161 + wayland? ( >=dev-libs/wayland-1.11.0:=[${MULTILIB_USEDEP}] )
162 + xvmc? ( >=x11-libs/libXvMC-1.0.8:=[${MULTILIB_USEDEP}] )
163 + ${LIBDRM_DEPSTRING}[video_cards_freedreno?,video_cards_nouveau?,video_cards_vc4?,video_cards_vivante?,video_cards_vmware?,${MULTILIB_USEDEP}]
164 +"
165 +for card in ${INTEL_CARDS}; do
166 + RDEPEND="${RDEPEND}
167 + video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
168 + "
169 +done
170 +
171 +for card in ${RADEON_CARDS}; do
172 + RDEPEND="${RDEPEND}
173 + video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_radeon] )
174 + "
175 +done
176 +RDEPEND="${RDEPEND}
177 + video_cards_radeonsi? ( ${LIBDRM_DEPSTRING}[video_cards_amdgpu] )
178 +"
179 +
180 +# FIXME: kill the sys-devel/llvm[video_cards_radeon] compat once
181 +# LLVM < 3.9 is out of the game
182 +DEPEND="${RDEPEND}
183 + llvm? (
184 + video_cards_radeonsi? ( || (
185 + sys-devel/llvm[llvm_targets_AMDGPU]
186 + sys-devel/llvm[video_cards_radeon]
187 + ) )
188 + )
189 + opencl? (
190 + || (
191 + sys-devel/llvm:4[${MULTILIB_USEDEP}]
192 + >=sys-devel/llvm-3.6.0:0[${MULTILIB_USEDEP}]
193 + )
194 + || (
195 + sys-devel/clang:4[${MULTILIB_USEDEP}]
196 + >=sys-devel/clang-3.6.0:0[${MULTILIB_USEDEP}]
197 + )
198 + >=sys-devel/gcc-4.6
199 + )
200 + sys-devel/gettext
201 + virtual/pkgconfig
202 + valgrind? ( dev-util/valgrind )
203 + >=x11-proto/dri2proto-2.8-r1:=[${MULTILIB_USEDEP}]
204 + dri3? (
205 + >=x11-proto/dri3proto-1.0:=[${MULTILIB_USEDEP}]
206 + >=x11-proto/presentproto-1.0:=[${MULTILIB_USEDEP}]
207 + )
208 + >=x11-proto/glproto-1.4.17-r1:=[${MULTILIB_USEDEP}]
209 + >=x11-proto/xextproto-7.2.1-r1:=[${MULTILIB_USEDEP}]
210 + >=x11-proto/xf86driproto-2.1.1-r1:=[${MULTILIB_USEDEP}]
211 + >=x11-proto/xf86vidmodeproto-2.3.1-r1:=[${MULTILIB_USEDEP}]
212 +"
213 +[[ ${PV} == 9999 ]] && DEPEND+="
214 + sys-devel/bison
215 + sys-devel/flex
216 + ${PYTHON_DEPS}
217 + $(python_gen_any_dep ">=dev-python/mako-0.7.3[\${PYTHON_USEDEP}]")
218 +"
219 +
220 +S="${WORKDIR}/${MY_P}"
221 +EGIT_CHECKOUT_DIR=${S}
222 +
223 +QA_WX_LOAD="
224 +x86? (
225 + !pic? (
226 + usr/lib*/libglapi.so.0.0.0
227 + usr/lib*/libGLESv1_CM.so.1.1.0
228 + usr/lib*/libGLESv2.so.2.0.0
229 + usr/lib*/libGL.so.1.2.0
230 + usr/lib*/libOSMesa.so.8.0.0
231 + )
232 +)"
233 +
234 +pkg_setup() {
235 + # warning message for bug 459306
236 + if use llvm && has_version sys-devel/llvm[!debug=]; then
237 + ewarn "Mismatch between debug USE flags in media-libs/mesa and sys-devel/llvm"
238 + ewarn "detected! This can cause problems. For details, see bug 459306."
239 + fi
240 +
241 + if use llvm || use opencl; then
242 + LLVM_MAX_SLOT=4 llvm_pkg_setup
243 + fi
244 + python-any-r1_pkg_setup
245 +}
246 +
247 +src_prepare() {
248 + eapply "${FILESDIR}"/${PN}-11-execinfo.patch
249 + eapply "${FILESDIR}"/${PN}-13-musl_endian.patch
250 +
251 + eautoreconf
252 +
253 + eapply_user
254 +}
255 +
256 +multilib_src_configure() {
257 + local myconf
258 +
259 + if use classic; then
260 + # Configurable DRI drivers
261 + driver_enable swrast
262 +
263 + # Intel code
264 + driver_enable video_cards_i915 i915
265 + driver_enable video_cards_i965 i965
266 + if ! use video_cards_i915 && \
267 + ! use video_cards_i965; then
268 + driver_enable video_cards_intel i915 i965
269 + fi
270 +
271 + # Nouveau code
272 + driver_enable video_cards_nouveau nouveau
273 +
274 + # ATI code
275 + driver_enable video_cards_r100 radeon
276 + driver_enable video_cards_r200 r200
277 + if ! use video_cards_r100 && \
278 + ! use video_cards_r200; then
279 + driver_enable video_cards_radeon radeon r200
280 + fi
281 + fi
282 +
283 + if use egl; then
284 + myconf+=" --with-egl-platforms=x11$(use wayland && echo ",wayland")$(use gbm && echo ",drm")"
285 + fi
286 +
287 + if use gallium; then
288 + myconf+="
289 + $(use_enable d3d9 nine)
290 + $(use_enable llvm gallium-llvm)
291 + $(use_enable openmax omx)
292 + $(use_enable vaapi va)
293 + $(use_enable vdpau)
294 + $(use_enable xa)
295 + $(use_enable xvmc)
296 + "
297 + use vaapi && myconf+=" --with-va-libdir=/usr/$(get_libdir)/va/drivers"
298 +
299 + gallium_enable swrast
300 + gallium_enable video_cards_vc4 vc4
301 + gallium_enable video_cards_vivante etnaviv
302 + gallium_enable video_cards_vmware svga
303 + gallium_enable video_cards_nouveau nouveau
304 + gallium_enable video_cards_i915 i915
305 + gallium_enable video_cards_imx imx
306 + if ! use video_cards_i915 && \
307 + ! use video_cards_i965; then
308 + gallium_enable video_cards_intel i915
309 + fi
310 +
311 + gallium_enable video_cards_r300 r300
312 + gallium_enable video_cards_r600 r600
313 + gallium_enable video_cards_radeonsi radeonsi
314 + if ! use video_cards_r300 && \
315 + ! use video_cards_r600; then
316 + gallium_enable video_cards_radeon r300 r600
317 + fi
318 +
319 + gallium_enable video_cards_freedreno freedreno
320 + # opencl stuff
321 + if use opencl; then
322 + myconf+="
323 + $(use_enable opencl)
324 + --with-clang-libdir="${EPREFIX}/usr/lib"
325 + "
326 + fi
327 + fi
328 +
329 + if use vulkan; then
330 + vulkan_enable video_cards_i965 intel
331 + vulkan_enable video_cards_radeonsi radeon
332 + fi
333 +
334 + # x86 hardened pax_kernel needs glx-rts, bug 240956
335 + if [[ ${ABI} == x86 ]]; then
336 + myconf+=" $(use_enable pax_kernel glx-read-only-text)"
337 + fi
338 +
339 + # on abi_x86_32 hardened we need to have asm disable
340 + if [[ ${ABI} == x86* ]] && use pic; then
341 + myconf+=" --disable-asm"
342 + fi
343 +
344 + if use gallium; then
345 + myconf+=" $(use_enable osmesa gallium-osmesa)"
346 + else
347 + myconf+=" $(use_enable osmesa)"
348 + fi
349 +
350 + # build fails with BSD indent, bug #428112
351 + use userland_GNU || export INDENT=cat
352 +
353 + ECONF_SOURCE="${S}" \
354 + econf \
355 + --enable-dri \
356 + --enable-glx \
357 + --enable-shared-glapi \
358 + $(use_enable !bindist texture-float) \
359 + $(use_enable d3d9 nine) \
360 + $(use_enable debug) \
361 + $(use_enable dri3) \
362 + $(use_enable egl) \
363 + $(use_enable gbm) \
364 + $(use_enable gles1) \
365 + $(use_enable gles2) \
366 + $(use_enable nptl glx-tls) \
367 + --enable-valgrind=$(usex valgrind auto no) \
368 + --enable-llvm-shared-libs \
369 + --with-dri-drivers=${DRI_DRIVERS} \
370 + --with-gallium-drivers=${GALLIUM_DRIVERS} \
371 + --with-vulkan-drivers=${VULKAN_DRIVERS} \
372 + PYTHON2="${PYTHON}" \
373 + ${myconf}
374 +}
375 +
376 +multilib_src_install() {
377 + emake install DESTDIR="${D}"
378 +
379 + if use classic || use gallium; then
380 + ebegin "Moving DRI/Gallium drivers for dynamic switching"
381 + local gallium_drivers=( i915_dri.so i965_dri.so r300_dri.so r600_dri.so swrast_dri.so )
382 + keepdir /usr/$(get_libdir)/dri
383 + dodir /usr/$(get_libdir)/mesa
384 + for x in ${gallium_drivers[@]}; do
385 + if [ -f "$(get_libdir)/gallium/${x}" ]; then
386 + mv -f "${ED}/usr/$(get_libdir)/dri/${x}" "${ED}/usr/$(get_libdir)/dri/${x/_dri.so/g_dri.so}" \
387 + || die "Failed to move ${x}"
388 + fi
389 + done
390 + if use classic; then
391 + emake -C "${BUILD_DIR}/src/mesa/drivers/dri" DESTDIR="${D}" install
392 + fi
393 + for x in "${ED}"/usr/$(get_libdir)/dri/*.so; do
394 + if [ -f ${x} -o -L ${x} ]; then
395 + mv -f "${x}" "${x/dri/mesa}" \
396 + || die "Failed to move ${x}"
397 + fi
398 + done
399 + pushd "${ED}"/usr/$(get_libdir)/dri || die "pushd failed"
400 + ln -s ../mesa/*.so . || die "Creating symlink failed"
401 + # remove symlinks to drivers known to eselect
402 + for x in ${gallium_drivers[@]}; do
403 + if [ -f ${x} -o -L ${x} ]; then
404 + rm "${x}" || die "Failed to remove ${x}"
405 + fi
406 + done
407 + popd
408 + eend $?
409 + fi
410 + if use opencl; then
411 + ebegin "Moving Gallium/Clover OpenCL implementation for dynamic switching"
412 + local cl_dir="/usr/$(get_libdir)/OpenCL/vendors/mesa"
413 + dodir ${cl_dir}/{lib,include}
414 + if [ -f "${ED}/usr/$(get_libdir)/libOpenCL.so" ]; then
415 + mv -f "${ED}"/usr/$(get_libdir)/libOpenCL.so* \
416 + "${ED}"${cl_dir}
417 + fi
418 + if [ -f "${ED}/usr/include/CL/opencl.h" ]; then
419 + mv -f "${ED}"/usr/include/CL \
420 + "${ED}"${cl_dir}/include
421 + fi
422 + eend $?
423 + fi
424 +
425 + if use openmax; then
426 + echo "XDG_DATA_DIRS=\"${EPREFIX}/usr/share/mesa/xdg\"" > "${T}/99mesaxdgomx"
427 + doenvd "${T}"/99mesaxdgomx
428 + keepdir /usr/share/mesa/xdg
429 + fi
430 +}
431 +
432 +multilib_src_install_all() {
433 + find "${ED}" -name '*.la' -delete
434 + einstalldocs
435 +
436 + if use !bindist; then
437 + dodoc docs/patents.txt
438 + fi
439 +
440 + # Install config file for eselect mesa
441 + insinto /usr/share/mesa
442 + newins "${FILESDIR}/eselect-mesa.conf.9.2" eselect-mesa.conf
443 +}
444 +
445 +multilib_src_test() {
446 + if use llvm; then
447 + 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'
448 + pushd src/gallium/drivers/llvmpipe >/dev/null || die
449 + emake ${llvm_tests}
450 + pax-mark m ${llvm_tests}
451 + popd >/dev/null || die
452 + fi
453 + emake check
454 +}
455 +
456 +pkg_postinst() {
457 + # Switch to the xorg implementation.
458 + echo
459 + eselect opengl set --use-old ${OPENGL_DIR}
460 +
461 + # Select classic/gallium drivers
462 + if use classic || use gallium; then
463 + eselect mesa set --auto
464 + fi
465 +
466 + # Switch to mesa opencl
467 + if use opencl; then
468 + eselect opencl set --use-old ${PN}
469 + fi
470 +
471 + # run omxregister-bellagio to make the OpenMAX drivers known system-wide
472 + if use openmax; then
473 + ebegin "Registering OpenMAX drivers"
474 + BELLAGIO_SEARCH_PATH="${EPREFIX}/usr/$(get_libdir)/libomxil-bellagio0" \
475 + OMX_BELLAGIO_REGISTRY=${EPREFIX}/usr/share/mesa/xdg/.omxregister \
476 + omxregister-bellagio
477 + eend $?
478 + fi
479 +
480 + # warn about patent encumbered texture-float
481 + if use !bindist; then
482 + elog "USE=\"bindist\" was not set. Potentially patent encumbered code was"
483 + elog "enabled. Please see patents.txt for an explanation."
484 + fi
485 +
486 + if ! has_version media-libs/libtxc_dxtn; then
487 + elog "Note that in order to have full S3TC support, it is necessary to install"
488 + elog "media-libs/libtxc_dxtn as well. This may be necessary to get nice"
489 + elog "textures in some apps, and some others even require this to run."
490 + fi
491 +}
492 +
493 +pkg_prerm() {
494 + if use openmax; then
495 + rm "${EPREFIX}"/usr/share/mesa/xdg/.omxregister
496 + fi
497 +}
498 +
499 +# $1 - VIDEO_CARDS flag
500 +# other args - names of DRI drivers to enable
501 +# TODO: avoid code duplication for a more elegant implementation
502 +driver_enable() {
503 + case $# in
504 + # for enabling unconditionally
505 + 1)
506 + DRI_DRIVERS+=",$1"
507 + ;;
508 + *)
509 + if use $1; then
510 + shift
511 + for i in $@; do
512 + DRI_DRIVERS+=",${i}"
513 + done
514 + fi
515 + ;;
516 + esac
517 +}
518 +
519 +gallium_enable() {
520 + case $# in
521 + # for enabling unconditionally
522 + 1)
523 + GALLIUM_DRIVERS+=",$1"
524 + ;;
525 + *)
526 + if use $1; then
527 + shift
528 + for i in $@; do
529 + GALLIUM_DRIVERS+=",${i}"
530 + done
531 + fi
532 + ;;
533 + esac
534 +}
535 +
536 +vulkan_enable() {
537 + case $# in
538 + # for enabling unconditionally
539 + 1)
540 + VULKAN_DRIVERS+=",$1"
541 + ;;
542 + *)
543 + if use $1; then
544 + shift
545 + for i in $@; do
546 + VULKAN_DRIVERS+=",${i}"
547 + done
548 + fi
549 + ;;
550 + esac
551 +}