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, 08 Aug 2017 20:09:11
Message-Id: 1502221727.42fcedcacecc73275fa55306da3d69fcc87f0805.lluixhi@gentoo
1 commit: 42fcedcacecc73275fa55306da3d69fcc87f0805
2 Author: Aric Belsito <lluixhi <AT> gmail <DOT> com>
3 AuthorDate: Tue Aug 8 19:48:47 2017 +0000
4 Commit: Aric Belsito <lluixhi <AT> gmail <DOT> com>
5 CommitDate: Tue Aug 8 19:48:47 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/musl.git/commit/?id=42fcedca
7
8 media-libs/mesa: version bump to 17.1.6/17.2.0_rc3
9
10 media-libs/mesa/Manifest | 4 +
11 media-libs/mesa/mesa-17.1.6.ebuild | 507 ++++++++++++++++++++++++++++++++
12 media-libs/mesa/mesa-17.2.0_rc3.ebuild | 508 +++++++++++++++++++++++++++++++++
13 3 files changed, 1019 insertions(+)
14
15 diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
16 index 95b6729..33df8c3 100644
17 --- a/media-libs/mesa/Manifest
18 +++ b/media-libs/mesa/Manifest
19 @@ -13,6 +13,8 @@ DIST mesa-17.1.2.tar.xz 9837516 SHA256 0937804f43746339b1f9540d8f9c8b4a1bb3d3eec
20 DIST mesa-17.1.3.tar.xz 9861256 SHA256 5f1ee9a8aea2880f887884df2dea0c16dd1b13eb42fd2e52265db0dc1b380e8c SHA512 b487d4f3d7717f379e7aaf66958bbef886fbae219e6e0333123c4623dc7db84109aca8cf07be08c0b79a74bdb198c704073fd549c6e85aa952ed3c97da1a8a94 WHIRLPOOL f9e2634e8a4c9765739ca4db005901d4df077f954e9008c05ee26dfc10e008166e5128096db071e0e26f4bdf244ecb9f8767b8862b018a68d677a3579c789114
21 DIST mesa-17.1.4.tar.xz 9899196 SHA256 06f3b0e6a28f0d20b7f3391cf67fe89ae98ecd0a686cd545da76557b6cec9cad SHA512 cb8369f0edd3e17b4eee8da159b9dc487f8144d69fe4b95901e9aa6a924759866f26f91fc2ead7036707eecea41582185e7ce73d54f97bf310f198b72ee0a8e4 WHIRLPOOL 5c313d7b938c58a7e2f59b619161316629ee996025dc5810742c881716cfcee441a8b3641d644fa0bc4aeec6c44c4b1ce99f515a59159a3391cf4948c2bab45a
22 DIST mesa-17.1.5.tar.xz 9901876 SHA256 378516b171712687aace4c7ea8b37c85895231d7a6d61e1e27362cf6034fded9 SHA512 a12671afd812b304e1db690b123a9de16332608541f71cc3ee9128a3630c81416d46255e5bdbf19e14e85716b218f447987b555e3bc0081b8b6f392556fa21e2 WHIRLPOOL b3a94172df5061774e7746ca9f2191f0f04ff375cb76406e22a694141d185f650ce04b3fa4f89b054aa3348f3562886982b5b725680d9ab1cdd6108900da91b7
23 +DIST mesa-17.1.6.tar.xz 9868932 SHA256 0686deadde1f126b20aa67e47e8c50502043eee4ecdf60d5009ffda3cebfee50 SHA512 cf57f29a21208f0a9bc84157f806bcaf6fd0583352449fcb986b05773eeefc99c4040dc41b242782dd5aa9ff7f9c5312b17a4db82d87f600acf165b6acdfc95a WHIRLPOOL 38d6043001798ea9876b55a45222b129596ae92ebb1cc2af36bb0cc8523acce11b38a658d0e8a8afad1b99a49f7d4cdc229b7a3cbb7c15d9858614a91a4994f8
24 +DIST mesa-17.2.0-rc3.tar.xz 10405100 SHA256 bd417166bc55a74a20e7687738c2f081364637e40a0712989e04b3ba7e404ff2 SHA512 34cc307e82f227fc0398185ac8a349c96631c47e407e883e80523850eeeb0eb4cc445780f61494c2ba81856965d8ae06819330fa54c149808a18db9e872c12b6 WHIRLPOOL 8ea40f6b4a6366b502cd2f2f1ab4bf371dab695b0ed86825a0f0abb36198adfd2d335cf43b668acc4606216a736be41fc735daee1b1b6b6060f4f044bc6f948f
25 EBUILD mesa-13.0.5.ebuild 13658 SHA256 c2d8750e43354a05926dd17e7bba27a9c348ea49d723ed3a0045f5b8dd34f639 SHA512 30af415e1448909b0420080edf24b8006cc55d8b0b70d0d9b6f2c5f5d40b710c5ebb463f1203204de5e7e71bcb68564d490bd61be8c52362e0219d62074eb279 WHIRLPOOL de6f514c8d879c41b7f63429d45790f133b1c60412262f0b38bffc5cae69f8621bbbbc988fc851f5c764a7867a5a22885391f80ab342ff4e84cf5b2bf0798a2c
26 EBUILD mesa-13.0.6.ebuild 13584 SHA256 3bfff928951edec571894f54fada7bb718e95e94f82806764731d09522b5304d SHA512 1fb15e100deeb50f5de436e2ffe3e131ebe3badb820aa1ddef8cfa691426b42bd3fbe66fd55cd848f9c5f6de9b5dd396f6879813730fb0a234a96a818a71b1cc WHIRLPOOL 6a7d6a0c01a847bfdb8bdeb3fa7ff558e4f3ac77b6f3f4334037ab3098f7763fe26de34378a49a57cbbefdec6ab22952cb0c948517b0885d882e0b92626af585
27 EBUILD mesa-17.0.6.ebuild 13603 SHA256 b4e554e727d9e35f77a83d5cb7ae8f19542e3e7ea367d3377496bc73f3e6da47 SHA512 f0415ed538799bc0a74ff94563629b7b86372eba0aae17448e38c190be8211dcd48bad902b876ff54b7c9d65df4d83fd4a22cb197be9ab4d960202ee09d0beb7 WHIRLPOOL c32a1c4d6a7fd06c9782ef980874ee6830b8477733b8c0f656e5a84a7ccd1f99cef19fdc1af913fdf5db62bc76bba75333afc20e96338b57f23a6b5534f152a6
28 @@ -23,4 +25,6 @@ EBUILD mesa-17.1.2.ebuild 13563 SHA256 7fe23c5eb390594f5918c8778c150b32e6cec8ab0
29 EBUILD mesa-17.1.3.ebuild 13510 SHA256 fb31bfe5fa3f48e577f148df82d4aaf65357684e1f6798b8ec99557dea096504 SHA512 ed870976b76a02d697b72f193dbeea49edf1d7e503250b2955dae7e26db2c19be5c3b81a8f99010e3650cd3ee680a4f3983c883ec336d0a2ab3fbdf029543676 WHIRLPOOL 38585d8528ae5c544fdfd8569025db782a51515756f9fa5983269d5b62c7f54cd3febcaf943786335c69bdefa1842ee3f39282a5ba52b52e2171e892d3f0f91d
30 EBUILD mesa-17.1.4.ebuild 13510 SHA256 fb31bfe5fa3f48e577f148df82d4aaf65357684e1f6798b8ec99557dea096504 SHA512 ed870976b76a02d697b72f193dbeea49edf1d7e503250b2955dae7e26db2c19be5c3b81a8f99010e3650cd3ee680a4f3983c883ec336d0a2ab3fbdf029543676 WHIRLPOOL 38585d8528ae5c544fdfd8569025db782a51515756f9fa5983269d5b62c7f54cd3febcaf943786335c69bdefa1842ee3f39282a5ba52b52e2171e892d3f0f91d
31 EBUILD mesa-17.1.5.ebuild 13510 SHA256 fb31bfe5fa3f48e577f148df82d4aaf65357684e1f6798b8ec99557dea096504 SHA512 ed870976b76a02d697b72f193dbeea49edf1d7e503250b2955dae7e26db2c19be5c3b81a8f99010e3650cd3ee680a4f3983c883ec336d0a2ab3fbdf029543676 WHIRLPOOL 38585d8528ae5c544fdfd8569025db782a51515756f9fa5983269d5b62c7f54cd3febcaf943786335c69bdefa1842ee3f39282a5ba52b52e2171e892d3f0f91d
32 +EBUILD mesa-17.1.6.ebuild 13510 SHA256 fb31bfe5fa3f48e577f148df82d4aaf65357684e1f6798b8ec99557dea096504 SHA512 ed870976b76a02d697b72f193dbeea49edf1d7e503250b2955dae7e26db2c19be5c3b81a8f99010e3650cd3ee680a4f3983c883ec336d0a2ab3fbdf029543676 WHIRLPOOL 38585d8528ae5c544fdfd8569025db782a51515756f9fa5983269d5b62c7f54cd3febcaf943786335c69bdefa1842ee3f39282a5ba52b52e2171e892d3f0f91d
33 +EBUILD mesa-17.2.0_rc3.ebuild 13540 SHA256 8c57a4975cbb06ee234154ccbdd663395b892f0b26c719281b589ae12de64eb2 SHA512 3052e8241f5b8d2c33e21ef52add6f0a6671b7b4e6588e0ba6c14aff8cf921ad6324b5806236d1457ee5d8189840f28d419b30849103067d6132ce1d0e76e73a WHIRLPOOL 30831891d0452ad51bd0898dec4fdf3657b748586fbb8f9a26d59855f0c1244995ea0434e272c857ae3dec47994774442920c5742cf000cbc22c76486c2c7680
34 MISC metadata.xml 2536 SHA256 d19b63eae85e1a25553e11db8b6e38b31f55810412d7e48680bd78fda4fe4808 SHA512 1cd7e6d44125ee93792e403205fa07b434867764f31135e26997518e5b848ffdc57af6b3591c541531bab45c9bb629b88638001a03c314347c708f743899e666 WHIRLPOOL 561a884f9ea3bc15d070e52e53cf3ea461a94ee33f0b06778595c83ab9e35311367dbe37a681201d19cb0c9610fe7eebfb295e1cf116c2b040d286ee579676ac
35
36 diff --git a/media-libs/mesa/mesa-17.1.6.ebuild b/media-libs/mesa/mesa-17.1.6.ebuild
37 new file mode 100644
38 index 0000000..4c8cef4
39 --- /dev/null
40 +++ b/media-libs/mesa/mesa-17.1.6.ebuild
41 @@ -0,0 +1,507 @@
42 +# Copyright 1999-2017 Gentoo Foundation
43 +# Distributed under the terms of the GNU General Public License v2
44 +
45 +EAPI=6
46 +
47 +EGIT_REPO_URI="https://anongit.freedesktop.org/git/mesa/mesa.git"
48 +
49 +if [[ ${PV} = 9999 ]]; then
50 + GIT_ECLASS="git-r3"
51 + EXPERIMENTAL="true"
52 +fi
53 +
54 +PYTHON_COMPAT=( python2_7 )
55 +
56 +inherit autotools llvm multilib-minimal python-any-r1 pax-utils ${GIT_ECLASS}
57 +
58 +OPENGL_DIR="xorg-x11"
59 +
60 +MY_P="${P/_/-}"
61 +
62 +DESCRIPTION="OpenGL-like graphic library for Linux"
63 +HOMEPAGE="https://www.mesa3d.org/"
64 +
65 +if [[ $PV == 9999 ]]; then
66 + SRC_URI=""
67 +else
68 + SRC_URI="https://mesa.freedesktop.org/archive/${MY_P}.tar.xz"
69 + 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"
70 +fi
71 +
72 +LICENSE="MIT"
73 +SLOT="0"
74 +RESTRICT="!bindist? ( bindist )"
75 +
76 +INTEL_CARDS="i915 i965 intel"
77 +RADEON_CARDS="r100 r200 r300 r600 radeon radeonsi"
78 +VIDEO_CARDS="${INTEL_CARDS} ${RADEON_CARDS} freedreno imx nouveau vc4 vivante vmware"
79 +for card in ${VIDEO_CARDS}; do
80 + IUSE_VIDEO_CARDS+=" video_cards_${card}"
81 +done
82 +
83 +IUSE="${IUSE_VIDEO_CARDS}
84 + bindist +classic d3d9 debug +dri3 +egl +gallium +gbm gles1 gles2 unwind
85 + +llvm +nptl opencl osmesa pax_kernel openmax pic selinux vaapi valgrind
86 + vdpau vulkan wayland xvmc xa"
87 +
88 +REQUIRED_USE="
89 + d3d9? ( dri3 gallium )
90 + llvm? ( gallium )
91 + opencl? ( gallium llvm )
92 + openmax? ( gallium )
93 + gles1? ( egl )
94 + gles2? ( egl )
95 + vaapi? ( gallium )
96 + vdpau? ( gallium )
97 + vulkan? ( || ( video_cards_i965 video_cards_radeonsi )
98 + video_cards_radeonsi? ( llvm ) )
99 + wayland? ( egl gbm )
100 + xa? ( gallium )
101 + video_cards_freedreno? ( gallium )
102 + video_cards_intel? ( classic )
103 + video_cards_i915? ( || ( classic gallium ) )
104 + video_cards_i965? ( classic )
105 + video_cards_imx? ( gallium )
106 + video_cards_nouveau? ( || ( classic gallium ) )
107 + video_cards_radeon? ( || ( classic gallium )
108 + gallium? ( x86? ( llvm ) amd64? ( llvm ) ) )
109 + video_cards_r100? ( classic )
110 + video_cards_r200? ( classic )
111 + video_cards_r300? ( gallium x86? ( llvm ) amd64? ( llvm ) )
112 + video_cards_r600? ( gallium )
113 + video_cards_radeonsi? ( gallium llvm )
114 + video_cards_vc4? ( gallium )
115 + video_cards_vivante? ( gallium gbm )
116 + video_cards_vmware? ( gallium )
117 +"
118 +
119 +LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.77"
120 +# keep correct libdrm and dri2proto dep
121 +# keep blocks in rdepend for binpkg
122 +RDEPEND="
123 + !<x11-base/xorg-server-1.7
124 + !<=x11-proto/xf86driproto-2.0.3
125 + abi_x86_32? ( !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)] )
126 + classic? ( app-eselect/eselect-mesa )
127 + gallium? ( app-eselect/eselect-mesa )
128 + >=app-eselect/eselect-opengl-1.3.0
129 + >=dev-libs/expat-2.1.0-r3:=[${MULTILIB_USEDEP}]
130 + >=sys-libs/zlib-1.2.8[${MULTILIB_USEDEP}]
131 + >=x11-libs/libX11-1.6.2:=[${MULTILIB_USEDEP}]
132 + >=x11-libs/libxshmfence-1.1:=[${MULTILIB_USEDEP}]
133 + >=x11-libs/libXdamage-1.1.4-r1:=[${MULTILIB_USEDEP}]
134 + >=x11-libs/libXext-1.3.2:=[${MULTILIB_USEDEP}]
135 + >=x11-libs/libXxf86vm-1.1.3:=[${MULTILIB_USEDEP}]
136 + >=x11-libs/libxcb-1.9.3:=[${MULTILIB_USEDEP}]
137 + x11-libs/libXfixes:=[${MULTILIB_USEDEP}]
138 + unwind? ( sys-libs/libunwind[${MULTILIB_USEDEP}] )
139 + llvm? (
140 + video_cards_radeonsi? (
141 + virtual/libelf:0=[${MULTILIB_USEDEP}]
142 + vulkan? ( >=sys-devel/llvm-3.9.0:=[${MULTILIB_USEDEP}] )
143 + )
144 + video_cards_r600? (
145 + virtual/libelf:0=[${MULTILIB_USEDEP}]
146 + )
147 + video_cards_radeon? (
148 + virtual/libelf:0=[${MULTILIB_USEDEP}]
149 + )
150 + >=sys-devel/llvm-3.6.0:=[${MULTILIB_USEDEP}]
151 + )
152 + opencl? (
153 + app-eselect/eselect-opencl
154 + dev-libs/libclc
155 + virtual/libelf:0=[${MULTILIB_USEDEP}]
156 + )
157 + openmax? ( >=media-libs/libomxil-bellagio-0.9.3:=[${MULTILIB_USEDEP}] )
158 + vaapi? (
159 + >=x11-libs/libva-1.6.0:=[${MULTILIB_USEDEP}]
160 + video_cards_nouveau? ( !<=x11-libs/libva-vdpau-driver-0.7.4-r3 )
161 + )
162 + vdpau? ( >=x11-libs/libvdpau-1.1:=[${MULTILIB_USEDEP}] )
163 + wayland? ( >=dev-libs/wayland-1.11.0:=[${MULTILIB_USEDEP}] )
164 + xvmc? ( >=x11-libs/libXvMC-1.0.8:=[${MULTILIB_USEDEP}] )
165 + ${LIBDRM_DEPSTRING}[video_cards_freedreno?,video_cards_nouveau?,video_cards_vc4?,video_cards_vivante?,video_cards_vmware?,${MULTILIB_USEDEP}]
166 +"
167 +for card in ${INTEL_CARDS}; do
168 + RDEPEND="${RDEPEND}
169 + video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
170 + "
171 +done
172 +
173 +for card in ${RADEON_CARDS}; do
174 + RDEPEND="${RDEPEND}
175 + video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_radeon] )
176 + "
177 +done
178 +RDEPEND="${RDEPEND}
179 + video_cards_radeonsi? ( ${LIBDRM_DEPSTRING}[video_cards_amdgpu] )
180 +"
181 +
182 +# FIXME: kill the sys-devel/llvm[video_cards_radeon] compat once
183 +# LLVM < 3.9 is out of the game
184 +DEPEND="${RDEPEND}
185 + ${PYTHON_DEPS}
186 + llvm? (
187 + video_cards_radeonsi? ( || (
188 + sys-devel/llvm[llvm_targets_AMDGPU]
189 + sys-devel/llvm[video_cards_radeon]
190 + ) )
191 + )
192 + opencl? (
193 + >=sys-devel/llvm-3.6.0:=[${MULTILIB_USEDEP}]
194 + >=sys-devel/clang-3.6.0:=[${MULTILIB_USEDEP}]
195 + >=sys-devel/gcc-4.6
196 + )
197 + sys-devel/gettext
198 + virtual/pkgconfig
199 + valgrind? ( dev-util/valgrind )
200 + >=x11-proto/dri2proto-2.8-r1:=[${MULTILIB_USEDEP}]
201 + dri3? (
202 + >=x11-proto/dri3proto-1.0:=[${MULTILIB_USEDEP}]
203 + >=x11-proto/presentproto-1.0:=[${MULTILIB_USEDEP}]
204 + )
205 + >=x11-proto/glproto-1.4.17-r1:=[${MULTILIB_USEDEP}]
206 + >=x11-proto/xextproto-7.2.1-r1:=[${MULTILIB_USEDEP}]
207 + >=x11-proto/xf86driproto-2.1.1-r1:=[${MULTILIB_USEDEP}]
208 + >=x11-proto/xf86vidmodeproto-2.3.1-r1:=[${MULTILIB_USEDEP}]
209 +"
210 +[[ ${PV} == 9999 ]] && DEPEND+="
211 + sys-devel/bison
212 + sys-devel/flex
213 + $(python_gen_any_dep ">=dev-python/mako-0.7.3[\${PYTHON_USEDEP}]")
214 +"
215 +
216 +S="${WORKDIR}/${MY_P}"
217 +EGIT_CHECKOUT_DIR=${S}
218 +
219 +QA_WX_LOAD="
220 +x86? (
221 + !pic? (
222 + usr/lib*/libglapi.so.0.0.0
223 + usr/lib*/libGLESv1_CM.so.1.1.0
224 + usr/lib*/libGLESv2.so.2.0.0
225 + usr/lib*/libGL.so.1.2.0
226 + usr/lib*/libOSMesa.so.8.0.0
227 + )
228 +)"
229 +
230 +pkg_setup() {
231 + # warning message for bug 459306
232 + if use llvm && has_version sys-devel/llvm[!debug=]; then
233 + ewarn "Mismatch between debug USE flags in media-libs/mesa and sys-devel/llvm"
234 + ewarn "detected! This can cause problems. For details, see bug 459306."
235 + fi
236 +
237 + if use llvm || use opencl; then
238 + llvm_pkg_setup
239 + fi
240 + python-any-r1_pkg_setup
241 +}
242 +
243 +src_prepare() {
244 + eapply "${FILESDIR}"/${PN}-11-execinfo.patch
245 + eapply "${FILESDIR}"/${PN}-13-musl_endian.patch
246 +
247 + eautoreconf
248 +
249 + eapply_user
250 +}
251 +
252 +multilib_src_configure() {
253 + local myconf
254 +
255 + if use classic; then
256 + # Configurable DRI drivers
257 + driver_enable swrast
258 +
259 + # Intel code
260 + driver_enable video_cards_i915 i915
261 + driver_enable video_cards_i965 i965
262 + if ! use video_cards_i915 && \
263 + ! use video_cards_i965; then
264 + driver_enable video_cards_intel i915 i965
265 + fi
266 +
267 + # Nouveau code
268 + driver_enable video_cards_nouveau nouveau
269 +
270 + # ATI code
271 + driver_enable video_cards_r100 radeon
272 + driver_enable video_cards_r200 r200
273 + if ! use video_cards_r100 && \
274 + ! use video_cards_r200; then
275 + driver_enable video_cards_radeon radeon r200
276 + fi
277 + fi
278 +
279 + if use egl; then
280 + myconf+=" --with-egl-platforms=x11,surfaceless$(use wayland && echo ",wayland")$(use gbm && echo ",drm")"
281 + fi
282 +
283 + if use gallium; then
284 + myconf+="
285 + $(use_enable d3d9 nine)
286 + $(use_enable llvm)
287 + $(use_enable openmax omx)
288 + $(use_enable vaapi va)
289 + $(use_enable vdpau)
290 + $(use_enable xa)
291 + $(use_enable xvmc)
292 + "
293 + use vaapi && myconf+=" --with-va-libdir=/usr/$(get_libdir)/va/drivers"
294 +
295 + gallium_enable swrast
296 + gallium_enable video_cards_vc4 vc4
297 + gallium_enable video_cards_vivante etnaviv
298 + gallium_enable video_cards_vmware svga
299 + gallium_enable video_cards_nouveau nouveau
300 + gallium_enable video_cards_i915 i915
301 + gallium_enable video_cards_imx imx
302 + if ! use video_cards_i915 && \
303 + ! use video_cards_i965; then
304 + gallium_enable video_cards_intel i915
305 + fi
306 +
307 + gallium_enable video_cards_r300 r300
308 + gallium_enable video_cards_r600 r600
309 + gallium_enable video_cards_radeonsi radeonsi
310 + if ! use video_cards_r300 && \
311 + ! use video_cards_r600; then
312 + gallium_enable video_cards_radeon r300 r600
313 + fi
314 +
315 + gallium_enable video_cards_freedreno freedreno
316 + # opencl stuff
317 + if use opencl; then
318 + myconf+="
319 + $(use_enable opencl)
320 + --with-clang-libdir="${EPREFIX}/usr/lib"
321 + "
322 + fi
323 + fi
324 +
325 + if use vulkan; then
326 + vulkan_enable video_cards_i965 intel
327 + vulkan_enable video_cards_radeonsi radeon
328 + fi
329 +
330 + # x86 hardened pax_kernel needs glx-rts, bug 240956
331 + if [[ ${ABI} == x86 ]]; then
332 + myconf+=" $(use_enable pax_kernel glx-read-only-text)"
333 + fi
334 +
335 + # on abi_x86_32 hardened we need to have asm disable
336 + if [[ ${ABI} == x86* ]] && use pic; then
337 + myconf+=" --disable-asm"
338 + fi
339 +
340 + if use gallium; then
341 + myconf+=" $(use_enable osmesa gallium-osmesa)"
342 + else
343 + myconf+=" $(use_enable osmesa)"
344 + fi
345 +
346 + # build fails with BSD indent, bug #428112
347 + use userland_GNU || export INDENT=cat
348 +
349 + ECONF_SOURCE="${S}" \
350 + econf \
351 + --enable-dri \
352 + --enable-glx \
353 + --enable-shared-glapi \
354 + $(use_enable !bindist texture-float) \
355 + $(use_enable d3d9 nine) \
356 + $(use_enable debug) \
357 + $(use_enable dri3) \
358 + $(use_enable egl) \
359 + $(use_enable gbm) \
360 + $(use_enable gles1) \
361 + $(use_enable gles2) \
362 + $(use_enable nptl glx-tls) \
363 + $(use_enable unwind libunwind) \
364 + --enable-valgrind=$(usex valgrind auto no) \
365 + --enable-llvm-shared-libs \
366 + --with-dri-drivers=${DRI_DRIVERS} \
367 + --with-gallium-drivers=${GALLIUM_DRIVERS} \
368 + --with-vulkan-drivers=${VULKAN_DRIVERS} \
369 + PYTHON2="${PYTHON}" \
370 + ${myconf}
371 +}
372 +
373 +multilib_src_install() {
374 + emake install DESTDIR="${D}"
375 +
376 + if use classic || use gallium; then
377 + ebegin "Moving DRI/Gallium drivers for dynamic switching"
378 + local gallium_drivers=( i915_dri.so i965_dri.so r300_dri.so r600_dri.so swrast_dri.so )
379 + keepdir /usr/$(get_libdir)/dri
380 + dodir /usr/$(get_libdir)/mesa
381 + for x in ${gallium_drivers[@]}; do
382 + if [ -f "$(get_libdir)/gallium/${x}" ]; then
383 + mv -f "${ED}/usr/$(get_libdir)/dri/${x}" "${ED}/usr/$(get_libdir)/dri/${x/_dri.so/g_dri.so}" \
384 + || die "Failed to move ${x}"
385 + fi
386 + done
387 + if use classic; then
388 + emake -C "${BUILD_DIR}/src/mesa/drivers/dri" DESTDIR="${D}" install
389 + fi
390 + for x in "${ED}"/usr/$(get_libdir)/dri/*.so; do
391 + if [ -f ${x} -o -L ${x} ]; then
392 + mv -f "${x}" "${x/dri/mesa}" \
393 + || die "Failed to move ${x}"
394 + fi
395 + done
396 + pushd "${ED}"/usr/$(get_libdir)/dri || die "pushd failed"
397 + ln -s ../mesa/*.so . || die "Creating symlink failed"
398 + # remove symlinks to drivers known to eselect
399 + for x in ${gallium_drivers[@]}; do
400 + if [ -f ${x} -o -L ${x} ]; then
401 + rm "${x}" || die "Failed to remove ${x}"
402 + fi
403 + done
404 + popd
405 + eend $?
406 + fi
407 + if use opencl; then
408 + ebegin "Moving Gallium/Clover OpenCL implementation for dynamic switching"
409 + local cl_dir="/usr/$(get_libdir)/OpenCL/vendors/mesa"
410 + dodir ${cl_dir}/{lib,include}
411 + if [ -f "${ED}/usr/$(get_libdir)/libOpenCL.so" ]; then
412 + mv -f "${ED}"/usr/$(get_libdir)/libOpenCL.so* \
413 + "${ED}"${cl_dir}
414 + fi
415 + if [ -f "${ED}/usr/include/CL/opencl.h" ]; then
416 + mv -f "${ED}"/usr/include/CL \
417 + "${ED}"${cl_dir}/include
418 + fi
419 + eend $?
420 + fi
421 +
422 + if use openmax; then
423 + echo "XDG_DATA_DIRS=\"${EPREFIX}/usr/share/mesa/xdg\"" > "${T}/99mesaxdgomx"
424 + doenvd "${T}"/99mesaxdgomx
425 + keepdir /usr/share/mesa/xdg
426 + fi
427 +}
428 +
429 +multilib_src_install_all() {
430 + find "${ED}" -name '*.la' -delete
431 + einstalldocs
432 +
433 + if use !bindist; then
434 + dodoc docs/patents.txt
435 + fi
436 +
437 + # Install config file for eselect mesa
438 + insinto /usr/share/mesa
439 + newins "${FILESDIR}/eselect-mesa.conf.9.2" eselect-mesa.conf
440 +}
441 +
442 +multilib_src_test() {
443 + if use llvm; then
444 + 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'
445 + pushd src/gallium/drivers/llvmpipe >/dev/null || die
446 + emake ${llvm_tests}
447 + pax-mark m ${llvm_tests}
448 + popd >/dev/null || die
449 + fi
450 + emake check
451 +}
452 +
453 +pkg_postinst() {
454 + # Switch to the xorg implementation.
455 + echo
456 + eselect opengl set --use-old ${OPENGL_DIR}
457 +
458 + # Select classic/gallium drivers
459 + if use classic || use gallium; then
460 + eselect mesa set --auto
461 + fi
462 +
463 + # Switch to mesa opencl
464 + if use opencl; then
465 + eselect opencl set --use-old ${PN}
466 + fi
467 +
468 + # run omxregister-bellagio to make the OpenMAX drivers known system-wide
469 + if use openmax; then
470 + ebegin "Registering OpenMAX drivers"
471 + BELLAGIO_SEARCH_PATH="${EPREFIX}/usr/$(get_libdir)/libomxil-bellagio0" \
472 + OMX_BELLAGIO_REGISTRY=${EPREFIX}/usr/share/mesa/xdg/.omxregister \
473 + omxregister-bellagio
474 + eend $?
475 + fi
476 +
477 + # warn about patent encumbered texture-float
478 + if use !bindist; then
479 + elog "USE=\"bindist\" was not set. Potentially patent encumbered code was"
480 + elog "enabled. Please see patents.txt for an explanation."
481 + fi
482 +
483 + if ! has_version media-libs/libtxc_dxtn; then
484 + elog "Note that in order to have full S3TC support, it is necessary to install"
485 + elog "media-libs/libtxc_dxtn as well. This may be necessary to get nice"
486 + elog "textures in some apps, and some others even require this to run."
487 + fi
488 +}
489 +
490 +pkg_prerm() {
491 + if use openmax; then
492 + rm "${EPREFIX}"/usr/share/mesa/xdg/.omxregister
493 + fi
494 +}
495 +
496 +# $1 - VIDEO_CARDS flag
497 +# other args - names of DRI drivers to enable
498 +# TODO: avoid code duplication for a more elegant implementation
499 +driver_enable() {
500 + case $# in
501 + # for enabling unconditionally
502 + 1)
503 + DRI_DRIVERS+=",$1"
504 + ;;
505 + *)
506 + if use $1; then
507 + shift
508 + for i in $@; do
509 + DRI_DRIVERS+=",${i}"
510 + done
511 + fi
512 + ;;
513 + esac
514 +}
515 +
516 +gallium_enable() {
517 + case $# in
518 + # for enabling unconditionally
519 + 1)
520 + GALLIUM_DRIVERS+=",$1"
521 + ;;
522 + *)
523 + if use $1; then
524 + shift
525 + for i in $@; do
526 + GALLIUM_DRIVERS+=",${i}"
527 + done
528 + fi
529 + ;;
530 + esac
531 +}
532 +
533 +vulkan_enable() {
534 + case $# in
535 + # for enabling unconditionally
536 + 1)
537 + VULKAN_DRIVERS+=",$1"
538 + ;;
539 + *)
540 + if use $1; then
541 + shift
542 + for i in $@; do
543 + VULKAN_DRIVERS+=",${i}"
544 + done
545 + fi
546 + ;;
547 + esac
548 +}
549
550 diff --git a/media-libs/mesa/mesa-17.2.0_rc3.ebuild b/media-libs/mesa/mesa-17.2.0_rc3.ebuild
551 new file mode 100644
552 index 0000000..d71ed5f
553 --- /dev/null
554 +++ b/media-libs/mesa/mesa-17.2.0_rc3.ebuild
555 @@ -0,0 +1,508 @@
556 +# Copyright 1999-2017 Gentoo Foundation
557 +# Distributed under the terms of the GNU General Public License v2
558 +
559 +EAPI=6
560 +
561 +EGIT_REPO_URI="https://anongit.freedesktop.org/git/mesa/mesa.git"
562 +
563 +if [[ ${PV} = 9999 ]]; then
564 + GIT_ECLASS="git-r3"
565 + EXPERIMENTAL="true"
566 +fi
567 +
568 +PYTHON_COMPAT=( python2_7 )
569 +
570 +inherit autotools llvm multilib-minimal python-any-r1 pax-utils ${GIT_ECLASS}
571 +
572 +OPENGL_DIR="xorg-x11"
573 +
574 +MY_P="${P/_/-}"
575 +
576 +DESCRIPTION="OpenGL-like graphic library for Linux"
577 +HOMEPAGE="https://www.mesa3d.org/"
578 +
579 +if [[ $PV == 9999 ]]; then
580 + SRC_URI=""
581 +else
582 + SRC_URI="https://mesa.freedesktop.org/archive/${MY_P}.tar.xz"
583 + 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"
584 +fi
585 +
586 +LICENSE="MIT"
587 +SLOT="0"
588 +RESTRICT="!bindist? ( bindist )"
589 +
590 +RADEON_CARDS="r100 r200 r300 r600 radeon radeonsi"
591 +VIDEO_CARDS="${RADEON_CARDS} freedreno i915 i965 imx intel nouveau vc4 vivante vmware"
592 +for card in ${VIDEO_CARDS}; do
593 + IUSE_VIDEO_CARDS+=" video_cards_${card}"
594 +done
595 +
596 +IUSE="${IUSE_VIDEO_CARDS}
597 + bindist +classic d3d9 debug +dri3 +egl +gallium +gbm gles1 gles2 unwind
598 + +llvm +nptl opencl osmesa pax_kernel openmax pic selinux vaapi valgrind
599 + vdpau vulkan wayland xvmc xa"
600 +
601 +REQUIRED_USE="
602 + d3d9? ( dri3 gallium )
603 + llvm? ( gallium )
604 + opencl? ( gallium llvm )
605 + openmax? ( gallium )
606 + gles1? ( egl )
607 + gles2? ( egl )
608 + vaapi? ( gallium )
609 + vdpau? ( gallium )
610 + vulkan? ( || ( video_cards_i965 video_cards_radeonsi )
611 + video_cards_radeonsi? ( llvm ) )
612 + wayland? ( egl gbm )
613 + xa? ( gallium )
614 + video_cards_freedreno? ( gallium )
615 + video_cards_intel? ( classic )
616 + video_cards_i915? ( || ( classic gallium ) )
617 + video_cards_i965? ( classic )
618 + video_cards_imx? ( gallium )
619 + video_cards_nouveau? ( || ( classic gallium ) )
620 + video_cards_radeon? ( || ( classic gallium )
621 + gallium? ( x86? ( llvm ) amd64? ( llvm ) ) )
622 + video_cards_r100? ( classic )
623 + video_cards_r200? ( classic )
624 + video_cards_r300? ( gallium x86? ( llvm ) amd64? ( llvm ) )
625 + video_cards_r600? ( gallium )
626 + video_cards_radeonsi? ( gallium llvm )
627 + video_cards_vc4? ( gallium )
628 + video_cards_vivante? ( gallium gbm )
629 + video_cards_vmware? ( gallium )
630 +"
631 +
632 +LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.82"
633 +# keep correct libdrm and dri2proto dep
634 +# keep blocks in rdepend for binpkg
635 +RDEPEND="
636 + !<x11-base/xorg-server-1.7
637 + !<=x11-proto/xf86driproto-2.0.3
638 + abi_x86_32? ( !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)] )
639 + classic? ( app-eselect/eselect-mesa )
640 + gallium? ( app-eselect/eselect-mesa )
641 + >=app-eselect/eselect-opengl-1.3.0
642 + >=dev-libs/expat-2.1.0-r3:=[${MULTILIB_USEDEP}]
643 + >=sys-libs/zlib-1.2.8[${MULTILIB_USEDEP}]
644 + >=x11-libs/libX11-1.6.2:=[${MULTILIB_USEDEP}]
645 + >=x11-libs/libxshmfence-1.1:=[${MULTILIB_USEDEP}]
646 + >=x11-libs/libXdamage-1.1.4-r1:=[${MULTILIB_USEDEP}]
647 + >=x11-libs/libXext-1.3.2:=[${MULTILIB_USEDEP}]
648 + >=x11-libs/libXxf86vm-1.1.3:=[${MULTILIB_USEDEP}]
649 + >=x11-libs/libxcb-1.9.3:=[${MULTILIB_USEDEP}]
650 + x11-libs/libXfixes:=[${MULTILIB_USEDEP}]
651 + unwind? ( sys-libs/libunwind[${MULTILIB_USEDEP}] )
652 + llvm? (
653 + video_cards_radeonsi? (
654 + virtual/libelf:0=[${MULTILIB_USEDEP}]
655 + vulkan? ( >=sys-devel/llvm-3.9.0:=[${MULTILIB_USEDEP}] )
656 + )
657 + video_cards_r600? (
658 + virtual/libelf:0=[${MULTILIB_USEDEP}]
659 + )
660 + video_cards_radeon? (
661 + virtual/libelf:0=[${MULTILIB_USEDEP}]
662 + )
663 + >=sys-devel/llvm-3.6.0:=[${MULTILIB_USEDEP}]
664 + )
665 + opencl? (
666 + app-eselect/eselect-opencl
667 + dev-libs/libclc
668 + virtual/libelf:0=[${MULTILIB_USEDEP}]
669 + )
670 + openmax? ( >=media-libs/libomxil-bellagio-0.9.3:=[${MULTILIB_USEDEP}] )
671 + vaapi? (
672 + >=x11-libs/libva-1.6.0:=[${MULTILIB_USEDEP}]
673 + video_cards_nouveau? ( !<=x11-libs/libva-vdpau-driver-0.7.4-r3 )
674 + )
675 + vdpau? ( >=x11-libs/libvdpau-1.1:=[${MULTILIB_USEDEP}] )
676 + wayland? (
677 + >=dev-libs/wayland-1.11.0:=[${MULTILIB_USEDEP}]
678 + >=dev-libs/wayland-protocols-1.8
679 + )
680 + xvmc? ( >=x11-libs/libXvMC-1.0.8:=[${MULTILIB_USEDEP}] )
681 + ${LIBDRM_DEPSTRING}[video_cards_freedreno?,video_cards_nouveau?,video_cards_vc4?,video_cards_vivante?,video_cards_vmware?,${MULTILIB_USEDEP}]
682 +
683 + video_cards_intel? (
684 + !video_cards_i965? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
685 + )
686 + video_cards_i915? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
687 +"
688 +for card in ${RADEON_CARDS}; do
689 + RDEPEND="${RDEPEND}
690 + video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_radeon] )
691 + "
692 +done
693 +RDEPEND="${RDEPEND}
694 + video_cards_radeonsi? ( ${LIBDRM_DEPSTRING}[video_cards_amdgpu] )
695 +"
696 +
697 +# FIXME: kill the sys-devel/llvm[video_cards_radeon] compat once
698 +# LLVM < 3.9 is out of the game
699 +DEPEND="${RDEPEND}
700 + ${PYTHON_DEPS}
701 + llvm? (
702 + video_cards_radeonsi? ( || (
703 + sys-devel/llvm[llvm_targets_AMDGPU]
704 + sys-devel/llvm[video_cards_radeon]
705 + ) )
706 + )
707 + opencl? (
708 + >=sys-devel/llvm-3.6.0:=[${MULTILIB_USEDEP}]
709 + >=sys-devel/clang-3.6.0:=[${MULTILIB_USEDEP}]
710 + >=sys-devel/gcc-4.6
711 + )
712 + sys-devel/gettext
713 + virtual/pkgconfig
714 + valgrind? ( dev-util/valgrind )
715 + >=x11-proto/dri2proto-2.8-r1:=[${MULTILIB_USEDEP}]
716 + dri3? (
717 + >=x11-proto/dri3proto-1.0:=[${MULTILIB_USEDEP}]
718 + >=x11-proto/presentproto-1.0:=[${MULTILIB_USEDEP}]
719 + )
720 + >=x11-proto/glproto-1.4.17-r1:=[${MULTILIB_USEDEP}]
721 + >=x11-proto/xextproto-7.2.1-r1:=[${MULTILIB_USEDEP}]
722 + >=x11-proto/xf86driproto-2.1.1-r1:=[${MULTILIB_USEDEP}]
723 + >=x11-proto/xf86vidmodeproto-2.3.1-r1:=[${MULTILIB_USEDEP}]
724 +"
725 +[[ ${PV} == 9999 ]] && DEPEND+="
726 + sys-devel/bison
727 + sys-devel/flex
728 + $(python_gen_any_dep ">=dev-python/mako-0.7.3[\${PYTHON_USEDEP}]")
729 +"
730 +
731 +S="${WORKDIR}/${MY_P}"
732 +EGIT_CHECKOUT_DIR=${S}
733 +
734 +QA_WX_LOAD="
735 +x86? (
736 + !pic? (
737 + usr/lib*/libglapi.so.0.0.0
738 + usr/lib*/libGLESv1_CM.so.1.1.0
739 + usr/lib*/libGLESv2.so.2.0.0
740 + usr/lib*/libGL.so.1.2.0
741 + usr/lib*/libOSMesa.so.8.0.0
742 + )
743 +)"
744 +
745 +pkg_setup() {
746 + # warning message for bug 459306
747 + if use llvm && has_version sys-devel/llvm[!debug=]; then
748 + ewarn "Mismatch between debug USE flags in media-libs/mesa and sys-devel/llvm"
749 + ewarn "detected! This can cause problems. For details, see bug 459306."
750 + fi
751 +
752 + if use llvm || use opencl; then
753 + llvm_pkg_setup
754 + fi
755 + python-any-r1_pkg_setup
756 +}
757 +
758 +src_prepare() {
759 + eapply "${FILESDIR}"/${PN}-11-execinfo.patch
760 + eapply "${FILESDIR}"/${PN}-13-musl_endian.patch
761 +
762 + eautoreconf
763 +
764 + eapply_user
765 +}
766 +
767 +multilib_src_configure() {
768 + local myconf
769 +
770 + if use classic; then
771 + # Configurable DRI drivers
772 + driver_enable swrast
773 +
774 + # Intel code
775 + driver_enable video_cards_i915 i915
776 + driver_enable video_cards_i965 i965
777 + if ! use video_cards_i915 && \
778 + ! use video_cards_i965; then
779 + driver_enable video_cards_intel i915 i965
780 + fi
781 +
782 + # Nouveau code
783 + driver_enable video_cards_nouveau nouveau
784 +
785 + # ATI code
786 + driver_enable video_cards_r100 radeon
787 + driver_enable video_cards_r200 r200
788 + if ! use video_cards_r100 && \
789 + ! use video_cards_r200; then
790 + driver_enable video_cards_radeon radeon r200
791 + fi
792 + fi
793 +
794 + if use egl; then
795 + myconf+=" --with-platforms=x11,surfaceless$(use wayland && echo ",wayland")$(use gbm && echo ",drm")"
796 + fi
797 +
798 + if use gallium; then
799 + myconf+="
800 + $(use_enable d3d9 nine)
801 + $(use_enable llvm)
802 + $(use_enable openmax omx)
803 + $(use_enable vaapi va)
804 + $(use_enable vdpau)
805 + $(use_enable xa)
806 + $(use_enable xvmc)
807 + "
808 + use vaapi && myconf+=" --with-va-libdir=/usr/$(get_libdir)/va/drivers"
809 +
810 + gallium_enable swrast
811 + gallium_enable video_cards_vc4 vc4
812 + gallium_enable video_cards_vivante etnaviv
813 + gallium_enable video_cards_vmware svga
814 + gallium_enable video_cards_nouveau nouveau
815 + gallium_enable video_cards_i915 i915
816 + gallium_enable video_cards_imx imx
817 + if ! use video_cards_i915 && \
818 + ! use video_cards_i965; then
819 + gallium_enable video_cards_intel i915
820 + fi
821 +
822 + gallium_enable video_cards_r300 r300
823 + gallium_enable video_cards_r600 r600
824 + gallium_enable video_cards_radeonsi radeonsi
825 + if ! use video_cards_r300 && \
826 + ! use video_cards_r600; then
827 + gallium_enable video_cards_radeon r300 r600
828 + fi
829 +
830 + gallium_enable video_cards_freedreno freedreno
831 + # opencl stuff
832 + if use opencl; then
833 + myconf+="
834 + $(use_enable opencl)
835 + --with-clang-libdir="${EPREFIX}/usr/lib"
836 + "
837 + fi
838 + fi
839 +
840 + if use vulkan; then
841 + vulkan_enable video_cards_i965 intel
842 + vulkan_enable video_cards_radeonsi radeon
843 + fi
844 +
845 + # x86 hardened pax_kernel needs glx-rts, bug 240956
846 + if [[ ${ABI} == x86 ]]; then
847 + myconf+=" $(use_enable pax_kernel glx-read-only-text)"
848 + fi
849 +
850 + # on abi_x86_32 hardened we need to have asm disable
851 + if [[ ${ABI} == x86* ]] && use pic; then
852 + myconf+=" --disable-asm"
853 + fi
854 +
855 + if use gallium; then
856 + myconf+=" $(use_enable osmesa gallium-osmesa)"
857 + else
858 + myconf+=" $(use_enable osmesa)"
859 + fi
860 +
861 + # build fails with BSD indent, bug #428112
862 + use userland_GNU || export INDENT=cat
863 +
864 + ECONF_SOURCE="${S}" \
865 + econf \
866 + --enable-dri \
867 + --enable-glx \
868 + --enable-shared-glapi \
869 + $(use_enable !bindist texture-float) \
870 + $(use_enable d3d9 nine) \
871 + $(use_enable debug) \
872 + $(use_enable dri3) \
873 + $(use_enable egl) \
874 + $(use_enable gbm) \
875 + $(use_enable gles1) \
876 + $(use_enable gles2) \
877 + $(use_enable nptl glx-tls) \
878 + $(use_enable unwind libunwind) \
879 + --enable-valgrind=$(usex valgrind auto no) \
880 + --enable-llvm-shared-libs \
881 + --with-dri-drivers=${DRI_DRIVERS} \
882 + --with-gallium-drivers=${GALLIUM_DRIVERS} \
883 + --with-vulkan-drivers=${VULKAN_DRIVERS} \
884 + PYTHON2="${PYTHON}" \
885 + ${myconf}
886 +}
887 +
888 +multilib_src_install() {
889 + emake install DESTDIR="${D}"
890 +
891 + if use classic || use gallium; then
892 + ebegin "Moving DRI/Gallium drivers for dynamic switching"
893 + local gallium_drivers=( i915_dri.so i965_dri.so r300_dri.so r600_dri.so swrast_dri.so )
894 + keepdir /usr/$(get_libdir)/dri
895 + dodir /usr/$(get_libdir)/mesa
896 + for x in ${gallium_drivers[@]}; do
897 + if [ -f "$(get_libdir)/gallium/${x}" ]; then
898 + mv -f "${ED}/usr/$(get_libdir)/dri/${x}" "${ED}/usr/$(get_libdir)/dri/${x/_dri.so/g_dri.so}" \
899 + || die "Failed to move ${x}"
900 + fi
901 + done
902 + if use classic; then
903 + emake -C "${BUILD_DIR}/src/mesa/drivers/dri" DESTDIR="${D}" install
904 + fi
905 + for x in "${ED}"/usr/$(get_libdir)/dri/*.so; do
906 + if [ -f ${x} -o -L ${x} ]; then
907 + mv -f "${x}" "${x/dri/mesa}" \
908 + || die "Failed to move ${x}"
909 + fi
910 + done
911 + pushd "${ED}"/usr/$(get_libdir)/dri || die "pushd failed"
912 + ln -s ../mesa/*.so . || die "Creating symlink failed"
913 + # remove symlinks to drivers known to eselect
914 + for x in ${gallium_drivers[@]}; do
915 + if [ -f ${x} -o -L ${x} ]; then
916 + rm "${x}" || die "Failed to remove ${x}"
917 + fi
918 + done
919 + popd
920 + eend $?
921 + fi
922 + if use opencl; then
923 + ebegin "Moving Gallium/Clover OpenCL implementation for dynamic switching"
924 + local cl_dir="/usr/$(get_libdir)/OpenCL/vendors/mesa"
925 + dodir ${cl_dir}/{lib,include}
926 + if [ -f "${ED}/usr/$(get_libdir)/libOpenCL.so" ]; then
927 + mv -f "${ED}"/usr/$(get_libdir)/libOpenCL.so* \
928 + "${ED}"${cl_dir}
929 + fi
930 + if [ -f "${ED}/usr/include/CL/opencl.h" ]; then
931 + mv -f "${ED}"/usr/include/CL \
932 + "${ED}"${cl_dir}/include
933 + fi
934 + eend $?
935 + fi
936 +
937 + if use openmax; then
938 + echo "XDG_DATA_DIRS=\"${EPREFIX}/usr/share/mesa/xdg\"" > "${T}/99mesaxdgomx"
939 + doenvd "${T}"/99mesaxdgomx
940 + keepdir /usr/share/mesa/xdg
941 + fi
942 +}
943 +
944 +multilib_src_install_all() {
945 + find "${ED}" -name '*.la' -delete
946 + einstalldocs
947 +
948 + if use !bindist; then
949 + dodoc docs/patents.txt
950 + fi
951 +
952 + # Install config file for eselect mesa
953 + insinto /usr/share/mesa
954 + newins "${FILESDIR}/eselect-mesa.conf.9.2" eselect-mesa.conf
955 +}
956 +
957 +multilib_src_test() {
958 + if use llvm; then
959 + 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'
960 + pushd src/gallium/drivers/llvmpipe >/dev/null || die
961 + emake ${llvm_tests}
962 + pax-mark m ${llvm_tests}
963 + popd >/dev/null || die
964 + fi
965 + emake check
966 +}
967 +
968 +pkg_postinst() {
969 + # Switch to the xorg implementation.
970 + echo
971 + eselect opengl set --use-old ${OPENGL_DIR}
972 +
973 + # Select classic/gallium drivers
974 + if use classic || use gallium; then
975 + eselect mesa set --auto
976 + fi
977 +
978 + # Switch to mesa opencl
979 + if use opencl; then
980 + eselect opencl set --use-old ${PN}
981 + fi
982 +
983 + # run omxregister-bellagio to make the OpenMAX drivers known system-wide
984 + if use openmax; then
985 + ebegin "Registering OpenMAX drivers"
986 + BELLAGIO_SEARCH_PATH="${EPREFIX}/usr/$(get_libdir)/libomxil-bellagio0" \
987 + OMX_BELLAGIO_REGISTRY=${EPREFIX}/usr/share/mesa/xdg/.omxregister \
988 + omxregister-bellagio
989 + eend $?
990 + fi
991 +
992 + # warn about patent encumbered texture-float
993 + if use !bindist; then
994 + elog "USE=\"bindist\" was not set. Potentially patent encumbered code was"
995 + elog "enabled. Please see patents.txt for an explanation."
996 + fi
997 +
998 + if ! has_version media-libs/libtxc_dxtn; then
999 + elog "Note that in order to have full S3TC support, it is necessary to install"
1000 + elog "media-libs/libtxc_dxtn as well. This may be necessary to get nice"
1001 + elog "textures in some apps, and some others even require this to run."
1002 + fi
1003 +}
1004 +
1005 +pkg_prerm() {
1006 + if use openmax; then
1007 + rm "${EPREFIX}"/usr/share/mesa/xdg/.omxregister
1008 + fi
1009 +}
1010 +
1011 +# $1 - VIDEO_CARDS flag
1012 +# other args - names of DRI drivers to enable
1013 +# TODO: avoid code duplication for a more elegant implementation
1014 +driver_enable() {
1015 + case $# in
1016 + # for enabling unconditionally
1017 + 1)
1018 + DRI_DRIVERS+=",$1"
1019 + ;;
1020 + *)
1021 + if use $1; then
1022 + shift
1023 + for i in $@; do
1024 + DRI_DRIVERS+=",${i}"
1025 + done
1026 + fi
1027 + ;;
1028 + esac
1029 +}
1030 +
1031 +gallium_enable() {
1032 + case $# in
1033 + # for enabling unconditionally
1034 + 1)
1035 + GALLIUM_DRIVERS+=",$1"
1036 + ;;
1037 + *)
1038 + if use $1; then
1039 + shift
1040 + for i in $@; do
1041 + GALLIUM_DRIVERS+=",${i}"
1042 + done
1043 + fi
1044 + ;;
1045 + esac
1046 +}
1047 +
1048 +vulkan_enable() {
1049 + case $# in
1050 + # for enabling unconditionally
1051 + 1)
1052 + VULKAN_DRIVERS+=",$1"
1053 + ;;
1054 + *)
1055 + if use $1; then
1056 + shift
1057 + for i in $@; do
1058 + VULKAN_DRIVERS+=",${i}"
1059 + done
1060 + fi
1061 + ;;
1062 + esac
1063 +}