1 |
commit: f278b44af78a06699a6ec0c3335ca1f5e01e3aac |
2 |
Author: Matt Turner <mattst88 <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Oct 30 17:30:39 2017 +0000 |
4 |
Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Oct 30 17:53:38 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f278b44a |
7 |
|
8 |
media-libs/mesa: Version bump to 17.2.4 |
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.4.ebuild | 582 +++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 583 insertions(+) |
15 |
|
16 |
diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest |
17 |
index 1747050410b..f1b17181625 100644 |
18 |
--- a/media-libs/mesa/Manifest |
19 |
+++ b/media-libs/mesa/Manifest |
20 |
@@ -8,3 +8,4 @@ DIST mesa-17.2.0.tar.xz 10335284 SHA256 3123448f770eae58bc73e15480e78909defb892f |
21 |
DIST mesa-17.2.1.tar.xz 10414776 SHA256 77385d17827cff24a3bae134342234f2efe7f7f990e778109682571dbbc9ba1e SHA512 19a7d6c2e2d439b1c73199bffd4154b42017bccc138be954a893c3b70e885f07988de84dc8aa2aff36e06295e91f0181d5b95372152f6f0f80b7afe4b3846b6a WHIRLPOOL b9048aa4d512307c3f558a925afb39949ea84b7e52ca52e2ba39cf6fba38c284ef527b25fdbfa7ec22ca6c9e17a8628ce41fc8916bfaafc7f5142c3476750b6d |
22 |
DIST mesa-17.2.2.tar.xz 10359156 SHA256 cf522244d6a5a1ecde3fc00e7c96935253fe22f808f064cab98be6f3faa65782 SHA512 641342c68989b8d801c37e668b012d3b7c4ad43d8ca01b74f8cbb3a1ec25b7390f69fe7ebc84b29dab1c6a4ac01c882ec9fd4a6b331505629461bdbbe6aa3f7e WHIRLPOOL 74271721fb38a0c62f6f35d84ba9196e000f2fe2a32e75120288e77649a87e225464572d347fc149190b573d22c32dfee3e174d6a2578b3c649c4b72375a94ec |
23 |
DIST mesa-17.2.3.tar.xz 10344180 SHA256 a0b0ec8f7b24dd044d7ab30a8c7e6d3767521e245f88d4ed5dd93315dc56f837 SHA512 749a0a46b772974633e405804ace7f509afb79f47811dbbdd390333721d744f2ac64f985ff1fd6c5aa3019b700be70bc1f75f60745ed9f4c5b08a9a8f77dfc76 WHIRLPOOL 333bdb9dd15726a4a19fa7a87d2044aba6ebaea2eb83dd436f916020221a8bc46d667e8710a701c52930217292ecdfd468b654a7846357aa8881356987f394c0 |
24 |
+DIST mesa-17.2.4.tar.xz 10381984 SHA256 5ba408fecd6e1132e5490eec1a2f04466214e4c65c8b89b331be844768c2e550 SHA512 665b63aab6af3f8f263f182d85d9ad71db7a23bcbaf67d62fe53c258cb0f600266ac82e72d681ec20cf7c66b47d4076aad5c3f553519f19110ee577da2707085 WHIRLPOOL 29750c50a496cb27e0b4466bf0d1496434330a96259616dd7c368adc3d9478aa6ba1facf11ec4ff231a244f890781c12637327b1675c423786693c40f787945d |
25 |
|
26 |
diff --git a/media-libs/mesa/mesa-17.2.4.ebuild b/media-libs/mesa/mesa-17.2.4.ebuild |
27 |
new file mode 100644 |
28 |
index 00000000000..12be4d77969 |
29 |
--- /dev/null |
30 |
+++ b/media-libs/mesa/mesa-17.2.4.ebuild |
31 |
@@ -0,0 +1,582 @@ |
32 |
+# Copyright 1999-2017 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/" |
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 ) |
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.82" |
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 |
+ abi_x86_32? ( !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)] ) |
116 |
+ classic? ( app-eselect/eselect-mesa ) |
117 |
+ gallium? ( app-eselect/eselect-mesa ) |
118 |
+ >=app-eselect/eselect-opengl-1.3.0 |
119 |
+ >=dev-libs/expat-2.1.0-r3:=[${MULTILIB_USEDEP}] |
120 |
+ >=sys-libs/zlib-1.2.8[${MULTILIB_USEDEP}] |
121 |
+ >=x11-libs/libX11-1.6.2:=[${MULTILIB_USEDEP}] |
122 |
+ >=x11-libs/libxshmfence-1.1:=[${MULTILIB_USEDEP}] |
123 |
+ >=x11-libs/libXdamage-1.1.4-r1:=[${MULTILIB_USEDEP}] |
124 |
+ >=x11-libs/libXext-1.3.2:=[${MULTILIB_USEDEP}] |
125 |
+ >=x11-libs/libXxf86vm-1.1.3:=[${MULTILIB_USEDEP}] |
126 |
+ >=x11-libs/libxcb-1.9.3:=[${MULTILIB_USEDEP}] |
127 |
+ x11-libs/libXfixes:=[${MULTILIB_USEDEP}] |
128 |
+ unwind? ( sys-libs/libunwind[${MULTILIB_USEDEP}] ) |
129 |
+ llvm? ( |
130 |
+ video_cards_radeonsi? ( |
131 |
+ virtual/libelf:0=[${MULTILIB_USEDEP}] |
132 |
+ ) |
133 |
+ video_cards_r600? ( |
134 |
+ virtual/libelf:0=[${MULTILIB_USEDEP}] |
135 |
+ ) |
136 |
+ video_cards_radeon? ( |
137 |
+ virtual/libelf:0=[${MULTILIB_USEDEP}] |
138 |
+ ) |
139 |
+ ) |
140 |
+ opencl? ( |
141 |
+ app-eselect/eselect-opencl |
142 |
+ dev-libs/libclc |
143 |
+ virtual/libelf:0=[${MULTILIB_USEDEP}] |
144 |
+ ) |
145 |
+ openmax? ( >=media-libs/libomxil-bellagio-0.9.3:=[${MULTILIB_USEDEP}] ) |
146 |
+ vaapi? ( |
147 |
+ >=x11-libs/libva-1.7.3:=[${MULTILIB_USEDEP}] |
148 |
+ video_cards_nouveau? ( !<=x11-libs/libva-vdpau-driver-0.7.4-r3 ) |
149 |
+ ) |
150 |
+ vdpau? ( >=x11-libs/libvdpau-1.1:=[${MULTILIB_USEDEP}] ) |
151 |
+ wayland? ( |
152 |
+ >=dev-libs/wayland-1.11.0:=[${MULTILIB_USEDEP}] |
153 |
+ >=dev-libs/wayland-protocols-1.8 |
154 |
+ ) |
155 |
+ xvmc? ( >=x11-libs/libXvMC-1.0.8:=[${MULTILIB_USEDEP}] ) |
156 |
+ ${LIBDRM_DEPSTRING}[video_cards_freedreno?,video_cards_nouveau?,video_cards_vc4?,video_cards_vivante?,video_cards_vmware?,${MULTILIB_USEDEP}] |
157 |
+ |
158 |
+ video_cards_intel? ( |
159 |
+ !video_cards_i965? ( ${LIBDRM_DEPSTRING}[video_cards_intel] ) |
160 |
+ ) |
161 |
+ video_cards_i915? ( ${LIBDRM_DEPSTRING}[video_cards_intel] ) |
162 |
+" |
163 |
+for card in ${RADEON_CARDS}; do |
164 |
+ RDEPEND="${RDEPEND} |
165 |
+ video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_radeon] ) |
166 |
+ " |
167 |
+done |
168 |
+RDEPEND="${RDEPEND} |
169 |
+ video_cards_radeonsi? ( ${LIBDRM_DEPSTRING}[video_cards_amdgpu] ) |
170 |
+" |
171 |
+ |
172 |
+# Please keep the LLVM dependency block separate. Since LLVM is slotted, |
173 |
+# we need to *really* make sure we're not pulling one than more slot |
174 |
+# simultaneously. |
175 |
+# |
176 |
+# How to use it: |
177 |
+# 1. List all the working slots (with min versions) in ||, newest first. |
178 |
+# 2. Update the := to specify *max* version, e.g. < 7. |
179 |
+# 3. Specify LLVM_MAX_SLOT, e.g. 6. |
180 |
+LLVM_MAX_SLOT="5" |
181 |
+LLVM_DEPSTR=" |
182 |
+ || ( |
183 |
+ sys-devel/llvm:5[${MULTILIB_USEDEP}] |
184 |
+ sys-devel/llvm:4[${MULTILIB_USEDEP}] |
185 |
+ >=sys-devel/llvm-3.9.0:0[${MULTILIB_USEDEP}] |
186 |
+ ) |
187 |
+ sys-devel/llvm:=[${MULTILIB_USEDEP}] |
188 |
+" |
189 |
+LLVM_DEPSTR_AMDGPU=${LLVM_DEPSTR//]/,llvm_targets_AMDGPU(-)]} |
190 |
+CLANG_DEPSTR=${LLVM_DEPSTR//llvm/clang} |
191 |
+CLANG_DEPSTR_AMDGPU=${CLANG_DEPSTR//]/,llvm_targets_AMDGPU(-)]} |
192 |
+RDEPEND="${RDEPEND} |
193 |
+ llvm? ( |
194 |
+ opencl? ( |
195 |
+ video_cards_r600? ( |
196 |
+ ${CLANG_DEPSTR_AMDGPU} |
197 |
+ ) |
198 |
+ !video_cards_r600? ( |
199 |
+ video_cards_radeonsi? ( |
200 |
+ ${CLANG_DEPSTR_AMDGPU} |
201 |
+ ) |
202 |
+ ) |
203 |
+ !video_cards_r600? ( |
204 |
+ !video_cards_radeonsi? ( |
205 |
+ video_cards_radeon? ( |
206 |
+ ${CLANG_DEPSTR_AMDGPU} |
207 |
+ ) |
208 |
+ ) |
209 |
+ ) |
210 |
+ !video_cards_r600? ( |
211 |
+ !video_cards_radeon? ( |
212 |
+ !video_cards_radeonsi? ( |
213 |
+ ${CLANG_DEPSTR} |
214 |
+ ) |
215 |
+ ) |
216 |
+ ) |
217 |
+ ) |
218 |
+ !opencl? ( |
219 |
+ video_cards_r600? ( |
220 |
+ ${LLVM_DEPSTR_AMDGPU} |
221 |
+ ) |
222 |
+ !video_cards_r600? ( |
223 |
+ video_cards_radeonsi? ( |
224 |
+ ${LLVM_DEPSTR_AMDGPU} |
225 |
+ ) |
226 |
+ ) |
227 |
+ !video_cards_r600? ( |
228 |
+ !video_cards_radeonsi? ( |
229 |
+ video_cards_radeon? ( |
230 |
+ ${LLVM_DEPSTR_AMDGPU} |
231 |
+ ) |
232 |
+ ) |
233 |
+ ) |
234 |
+ !video_cards_r600? ( |
235 |
+ !video_cards_radeon? ( |
236 |
+ !video_cards_radeonsi? ( |
237 |
+ ${LLVM_DEPSTR} |
238 |
+ ) |
239 |
+ ) |
240 |
+ ) |
241 |
+ ) |
242 |
+ ) |
243 |
+" |
244 |
+unset {LLVM,CLANG}_DEPSTR{,_AMDGPU} |
245 |
+ |
246 |
+DEPEND="${RDEPEND} |
247 |
+ ${PYTHON_DEPS} |
248 |
+ opencl? ( |
249 |
+ >=sys-devel/gcc-4.6 |
250 |
+ ) |
251 |
+ sys-devel/gettext |
252 |
+ virtual/pkgconfig |
253 |
+ valgrind? ( dev-util/valgrind ) |
254 |
+ >=x11-proto/dri2proto-2.8-r1:=[${MULTILIB_USEDEP}] |
255 |
+ dri3? ( |
256 |
+ >=x11-proto/dri3proto-1.0:=[${MULTILIB_USEDEP}] |
257 |
+ >=x11-proto/presentproto-1.0:=[${MULTILIB_USEDEP}] |
258 |
+ ) |
259 |
+ >=x11-proto/glproto-1.4.17-r1:=[${MULTILIB_USEDEP}] |
260 |
+ >=x11-proto/xextproto-7.2.1-r1:=[${MULTILIB_USEDEP}] |
261 |
+ >=x11-proto/xf86driproto-2.1.1-r1:=[${MULTILIB_USEDEP}] |
262 |
+ >=x11-proto/xf86vidmodeproto-2.3.1-r1:=[${MULTILIB_USEDEP}] |
263 |
+" |
264 |
+[[ ${PV} == 9999 ]] && DEPEND+=" |
265 |
+ sys-devel/bison |
266 |
+ sys-devel/flex |
267 |
+ $(python_gen_any_dep ">=dev-python/mako-0.7.3[\${PYTHON_USEDEP}]") |
268 |
+" |
269 |
+ |
270 |
+S="${WORKDIR}/${MY_P}" |
271 |
+EGIT_CHECKOUT_DIR=${S} |
272 |
+ |
273 |
+QA_WX_LOAD=" |
274 |
+x86? ( |
275 |
+ !pic? ( |
276 |
+ usr/lib*/libglapi.so.0.0.0 |
277 |
+ usr/lib*/libGLESv1_CM.so.1.1.0 |
278 |
+ usr/lib*/libGLESv2.so.2.0.0 |
279 |
+ usr/lib*/libGL.so.1.2.0 |
280 |
+ usr/lib*/libOSMesa.so.8.0.0 |
281 |
+ ) |
282 |
+)" |
283 |
+ |
284 |
+llvm_check_deps() { |
285 |
+ local flags=${MULTILIB_USEDEP} |
286 |
+ if use video_cards_r600 || use video_cards_radeon || use video_cards_radeonsi |
287 |
+ then |
288 |
+ flags+=",llvm_targets_AMDGPU(-)" |
289 |
+ fi |
290 |
+ |
291 |
+ if use opencl; then |
292 |
+ has_version "sys-devel/clang[${flags}]" || return 1 |
293 |
+ fi |
294 |
+ has_version "sys-devel/llvm[${flags}]" |
295 |
+} |
296 |
+ |
297 |
+pkg_setup() { |
298 |
+ # warning message for bug 459306 |
299 |
+ if use llvm && has_version sys-devel/llvm[!debug=]; then |
300 |
+ ewarn "Mismatch between debug USE flags in media-libs/mesa and sys-devel/llvm" |
301 |
+ ewarn "detected! This can cause problems. For details, see bug 459306." |
302 |
+ fi |
303 |
+ |
304 |
+ if use llvm; then |
305 |
+ llvm_pkg_setup |
306 |
+ fi |
307 |
+ python-any-r1_pkg_setup |
308 |
+} |
309 |
+ |
310 |
+src_prepare() { |
311 |
+ [[ ${PV} == 9999 ]] && eautoreconf |
312 |
+ eapply_user |
313 |
+} |
314 |
+ |
315 |
+multilib_src_configure() { |
316 |
+ local myconf |
317 |
+ |
318 |
+ if use classic; then |
319 |
+ # Configurable DRI drivers |
320 |
+ driver_enable swrast |
321 |
+ |
322 |
+ # Intel code |
323 |
+ driver_enable video_cards_i915 i915 |
324 |
+ driver_enable video_cards_i965 i965 |
325 |
+ if ! use video_cards_i915 && \ |
326 |
+ ! use video_cards_i965; then |
327 |
+ driver_enable video_cards_intel i915 i965 |
328 |
+ fi |
329 |
+ |
330 |
+ # Nouveau code |
331 |
+ driver_enable video_cards_nouveau nouveau |
332 |
+ |
333 |
+ # ATI code |
334 |
+ driver_enable video_cards_r100 radeon |
335 |
+ driver_enable video_cards_r200 r200 |
336 |
+ if ! use video_cards_r100 && \ |
337 |
+ ! use video_cards_r200; then |
338 |
+ driver_enable video_cards_radeon radeon r200 |
339 |
+ fi |
340 |
+ fi |
341 |
+ |
342 |
+ if use egl; then |
343 |
+ myconf+=" --with-platforms=x11,surfaceless$(use wayland && echo ",wayland")$(use gbm && echo ",drm")" |
344 |
+ fi |
345 |
+ |
346 |
+ if use gallium; then |
347 |
+ myconf+=" |
348 |
+ $(use_enable d3d9 nine) |
349 |
+ $(use_enable llvm) |
350 |
+ $(use_enable openmax omx) |
351 |
+ $(use_enable vaapi va) |
352 |
+ $(use_enable vdpau) |
353 |
+ $(use_enable xa) |
354 |
+ $(use_enable xvmc) |
355 |
+ " |
356 |
+ use vaapi && myconf+=" --with-va-libdir=/usr/$(get_libdir)/va/drivers" |
357 |
+ |
358 |
+ gallium_enable swrast |
359 |
+ gallium_enable video_cards_vc4 vc4 |
360 |
+ gallium_enable video_cards_vivante etnaviv |
361 |
+ gallium_enable video_cards_vmware svga |
362 |
+ gallium_enable video_cards_nouveau nouveau |
363 |
+ gallium_enable video_cards_i915 i915 |
364 |
+ gallium_enable video_cards_imx imx |
365 |
+ if ! use video_cards_i915 && \ |
366 |
+ ! use video_cards_i965; then |
367 |
+ gallium_enable video_cards_intel i915 |
368 |
+ fi |
369 |
+ |
370 |
+ gallium_enable video_cards_r300 r300 |
371 |
+ gallium_enable video_cards_r600 r600 |
372 |
+ gallium_enable video_cards_radeonsi radeonsi |
373 |
+ if ! use video_cards_r300 && \ |
374 |
+ ! use video_cards_r600; then |
375 |
+ gallium_enable video_cards_radeon r300 r600 |
376 |
+ fi |
377 |
+ |
378 |
+ gallium_enable video_cards_freedreno freedreno |
379 |
+ # opencl stuff |
380 |
+ if use opencl; then |
381 |
+ myconf+=" |
382 |
+ $(use_enable opencl) |
383 |
+ --with-clang-libdir="${EPREFIX}/usr/lib" |
384 |
+ " |
385 |
+ fi |
386 |
+ |
387 |
+ gallium_enable video_cards_virgl virgl |
388 |
+ fi |
389 |
+ |
390 |
+ if use vulkan; then |
391 |
+ vulkan_enable video_cards_i965 intel |
392 |
+ vulkan_enable video_cards_radeonsi radeon |
393 |
+ fi |
394 |
+ |
395 |
+ # x86 hardened pax_kernel needs glx-rts, bug 240956 |
396 |
+ if [[ ${ABI} == x86 ]]; then |
397 |
+ myconf+=" $(use_enable pax_kernel glx-read-only-text)" |
398 |
+ fi |
399 |
+ |
400 |
+ # on abi_x86_32 hardened we need to have asm disable |
401 |
+ if [[ ${ABI} == x86* ]] && use pic; then |
402 |
+ myconf+=" --disable-asm" |
403 |
+ fi |
404 |
+ |
405 |
+ if use gallium; then |
406 |
+ myconf+=" $(use_enable osmesa gallium-osmesa)" |
407 |
+ else |
408 |
+ myconf+=" $(use_enable osmesa)" |
409 |
+ fi |
410 |
+ |
411 |
+ # build fails with BSD indent, bug #428112 |
412 |
+ use userland_GNU || export INDENT=cat |
413 |
+ |
414 |
+ ECONF_SOURCE="${S}" \ |
415 |
+ econf \ |
416 |
+ --enable-dri \ |
417 |
+ --enable-glx \ |
418 |
+ --enable-shared-glapi \ |
419 |
+ $(use_enable !bindist texture-float) \ |
420 |
+ $(use_enable d3d9 nine) \ |
421 |
+ $(use_enable debug) \ |
422 |
+ $(use_enable dri3) \ |
423 |
+ $(use_enable egl) \ |
424 |
+ $(use_enable gbm) \ |
425 |
+ $(use_enable gles1) \ |
426 |
+ $(use_enable gles2) \ |
427 |
+ $(use_enable nptl glx-tls) \ |
428 |
+ $(use_enable unwind libunwind) \ |
429 |
+ --enable-valgrind=$(usex valgrind auto no) \ |
430 |
+ --enable-llvm-shared-libs \ |
431 |
+ --with-dri-drivers=${DRI_DRIVERS} \ |
432 |
+ --with-gallium-drivers=${GALLIUM_DRIVERS} \ |
433 |
+ --with-vulkan-drivers=${VULKAN_DRIVERS} \ |
434 |
+ PYTHON2="${PYTHON}" \ |
435 |
+ ${myconf} |
436 |
+} |
437 |
+ |
438 |
+multilib_src_install() { |
439 |
+ emake install DESTDIR="${D}" |
440 |
+ |
441 |
+ if use classic || use gallium; then |
442 |
+ ebegin "Moving DRI/Gallium drivers for dynamic switching" |
443 |
+ local gallium_drivers=( i915_dri.so i965_dri.so r300_dri.so r600_dri.so swrast_dri.so ) |
444 |
+ keepdir /usr/$(get_libdir)/dri |
445 |
+ dodir /usr/$(get_libdir)/mesa |
446 |
+ for x in ${gallium_drivers[@]}; do |
447 |
+ if [ -f "$(get_libdir)/gallium/${x}" ]; then |
448 |
+ mv -f "${ED}/usr/$(get_libdir)/dri/${x}" "${ED}/usr/$(get_libdir)/dri/${x/_dri.so/g_dri.so}" \ |
449 |
+ || die "Failed to move ${x}" |
450 |
+ fi |
451 |
+ done |
452 |
+ if use classic; then |
453 |
+ emake -C "${BUILD_DIR}/src/mesa/drivers/dri" DESTDIR="${D}" install |
454 |
+ fi |
455 |
+ for x in "${ED}"/usr/$(get_libdir)/dri/*.so; do |
456 |
+ if [ -f ${x} -o -L ${x} ]; then |
457 |
+ mv -f "${x}" "${x/dri/mesa}" \ |
458 |
+ || die "Failed to move ${x}" |
459 |
+ fi |
460 |
+ done |
461 |
+ pushd "${ED}"/usr/$(get_libdir)/dri || die "pushd failed" |
462 |
+ ln -s ../mesa/*.so . || die "Creating symlink failed" |
463 |
+ # remove symlinks to drivers known to eselect |
464 |
+ for x in ${gallium_drivers[@]}; do |
465 |
+ if [ -f ${x} -o -L ${x} ]; then |
466 |
+ rm "${x}" || die "Failed to remove ${x}" |
467 |
+ fi |
468 |
+ done |
469 |
+ popd |
470 |
+ eend $? |
471 |
+ fi |
472 |
+ if use opencl; then |
473 |
+ ebegin "Moving Gallium/Clover OpenCL implementation for dynamic switching" |
474 |
+ local cl_dir="/usr/$(get_libdir)/OpenCL/vendors/mesa" |
475 |
+ dodir ${cl_dir}/{lib,include} |
476 |
+ if [ -f "${ED}/usr/$(get_libdir)/libOpenCL.so" ]; then |
477 |
+ mv -f "${ED}"/usr/$(get_libdir)/libOpenCL.so* \ |
478 |
+ "${ED}"${cl_dir} |
479 |
+ fi |
480 |
+ if [ -f "${ED}/usr/include/CL/opencl.h" ]; then |
481 |
+ mv -f "${ED}"/usr/include/CL \ |
482 |
+ "${ED}"${cl_dir}/include |
483 |
+ fi |
484 |
+ eend $? |
485 |
+ fi |
486 |
+ |
487 |
+ if use openmax; then |
488 |
+ echo "XDG_DATA_DIRS=\"${EPREFIX}/usr/share/mesa/xdg\"" > "${T}/99mesaxdgomx" |
489 |
+ doenvd "${T}"/99mesaxdgomx |
490 |
+ keepdir /usr/share/mesa/xdg |
491 |
+ fi |
492 |
+} |
493 |
+ |
494 |
+multilib_src_install_all() { |
495 |
+ find "${ED}" -name '*.la' -delete |
496 |
+ einstalldocs |
497 |
+ |
498 |
+ if use !bindist; then |
499 |
+ dodoc docs/patents.txt |
500 |
+ fi |
501 |
+ |
502 |
+ # Install config file for eselect mesa |
503 |
+ insinto /usr/share/mesa |
504 |
+ newins "${FILESDIR}/eselect-mesa.conf.9.2" eselect-mesa.conf |
505 |
+} |
506 |
+ |
507 |
+multilib_src_test() { |
508 |
+ if use llvm; then |
509 |
+ 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' |
510 |
+ pushd src/gallium/drivers/llvmpipe >/dev/null || die |
511 |
+ emake ${llvm_tests} |
512 |
+ pax-mark m ${llvm_tests} |
513 |
+ popd >/dev/null || die |
514 |
+ fi |
515 |
+ emake check |
516 |
+} |
517 |
+ |
518 |
+pkg_postinst() { |
519 |
+ # Switch to the xorg implementation. |
520 |
+ echo |
521 |
+ eselect opengl set --use-old ${OPENGL_DIR} |
522 |
+ |
523 |
+ # Select classic/gallium drivers |
524 |
+ if use classic || use gallium; then |
525 |
+ eselect mesa set --auto |
526 |
+ fi |
527 |
+ |
528 |
+ # Switch to mesa opencl |
529 |
+ if use opencl; then |
530 |
+ eselect opencl set --use-old ${PN} |
531 |
+ fi |
532 |
+ |
533 |
+ # run omxregister-bellagio to make the OpenMAX drivers known system-wide |
534 |
+ if use openmax; then |
535 |
+ ebegin "Registering OpenMAX drivers" |
536 |
+ BELLAGIO_SEARCH_PATH="${EPREFIX}/usr/$(get_libdir)/libomxil-bellagio0" \ |
537 |
+ OMX_BELLAGIO_REGISTRY=${EPREFIX}/usr/share/mesa/xdg/.omxregister \ |
538 |
+ omxregister-bellagio |
539 |
+ eend $? |
540 |
+ fi |
541 |
+ |
542 |
+ # warn about patent encumbered texture-float |
543 |
+ if use !bindist; then |
544 |
+ elog "USE=\"bindist\" was not set. Potentially patent encumbered code was" |
545 |
+ elog "enabled. Please see patents.txt for an explanation." |
546 |
+ fi |
547 |
+ |
548 |
+ if ! has_version media-libs/libtxc_dxtn; then |
549 |
+ elog "Note that in order to have full S3TC support, it is necessary to install" |
550 |
+ elog "media-libs/libtxc_dxtn as well. This may be necessary to get nice" |
551 |
+ elog "textures in some apps, and some others even require this to run." |
552 |
+ fi |
553 |
+} |
554 |
+ |
555 |
+pkg_prerm() { |
556 |
+ if use openmax; then |
557 |
+ rm "${EPREFIX}"/usr/share/mesa/xdg/.omxregister |
558 |
+ fi |
559 |
+} |
560 |
+ |
561 |
+# $1 - VIDEO_CARDS flag |
562 |
+# other args - names of DRI drivers to enable |
563 |
+# TODO: avoid code duplication for a more elegant implementation |
564 |
+driver_enable() { |
565 |
+ case $# in |
566 |
+ # for enabling unconditionally |
567 |
+ 1) |
568 |
+ DRI_DRIVERS+=",$1" |
569 |
+ ;; |
570 |
+ *) |
571 |
+ if use $1; then |
572 |
+ shift |
573 |
+ for i in $@; do |
574 |
+ DRI_DRIVERS+=",${i}" |
575 |
+ done |
576 |
+ fi |
577 |
+ ;; |
578 |
+ esac |
579 |
+} |
580 |
+ |
581 |
+gallium_enable() { |
582 |
+ case $# in |
583 |
+ # for enabling unconditionally |
584 |
+ 1) |
585 |
+ GALLIUM_DRIVERS+=",$1" |
586 |
+ ;; |
587 |
+ *) |
588 |
+ if use $1; then |
589 |
+ shift |
590 |
+ for i in $@; do |
591 |
+ GALLIUM_DRIVERS+=",${i}" |
592 |
+ done |
593 |
+ fi |
594 |
+ ;; |
595 |
+ esac |
596 |
+} |
597 |
+ |
598 |
+vulkan_enable() { |
599 |
+ case $# in |
600 |
+ # for enabling unconditionally |
601 |
+ 1) |
602 |
+ VULKAN_DRIVERS+=",$1" |
603 |
+ ;; |
604 |
+ *) |
605 |
+ if use $1; then |
606 |
+ shift |
607 |
+ for i in $@; do |
608 |
+ VULKAN_DRIVERS+=",${i}" |
609 |
+ done |
610 |
+ fi |
611 |
+ ;; |
612 |
+ esac |
613 |
+} |