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