Gentoo Archives: gentoo-commits

From: Matt Turner <mattst88@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/mesa/
Date: Sat, 30 Apr 2022 00:14:49
Message-Id: 1651277599.c9eb77eea09a55e75d5434dc9d8cc571bafac71a.mattst88@gentoo
1 commit: c9eb77eea09a55e75d5434dc9d8cc571bafac71a
2 Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
3 AuthorDate: Sat Apr 30 00:13:19 2022 +0000
4 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
5 CommitDate: Sat Apr 30 00:13:19 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c9eb77ee
7
8 media-libs/mesa: Version bump to 22.0.2
9
10 Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>
11
12 media-libs/mesa/Manifest | 1 +
13 media-libs/mesa/mesa-22.0.2.ebuild | 463 +++++++++++++++++++++++++++++++++++++
14 2 files changed, 464 insertions(+)
15
16 diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
17 index 2d137e76a9ae..4344a1fc4367 100644
18 --- a/media-libs/mesa/Manifest
19 +++ b/media-libs/mesa/Manifest
20 @@ -2,4 +2,5 @@ DIST mesa-21.3.7.tar.xz 16569592 BLAKE2B 7c5a3f144b1ce9e8bbb3560ae2bf46afda9d5c4
21 DIST mesa-21.3.8.tar.xz 16593540 BLAKE2B 89a471af3354ae0cf0597c1b6bcd2aff8074d58c16504154291f86cd9a9701f98883cf1077f60a8f17d24be800691a5bfb7ef4ddb10dfa355181bf87805b660c SHA512 0462c44fa8e358dafd03088411452bc172a365902795b3198df1e6cfbf1d87675ef5b72b572de7f15e5ee87b30ce5b2f217c81ea72b376962f6428c6ff83f2e9
22 DIST mesa-22.0.0.tar.xz 15565680 BLAKE2B 65dd09e1864f353f07ab01cb21cb89f858a071d74043b1913b0abe3ee3b3a992ca3878d40ffe52cc45546770d5ad9e198c93a24a8564ffeb9c8a05da38af300c SHA512 9faef66adbacba24d11dfe8e2d1a753295798883a10a7cc91e6df9d678c64a8286a12e60c0d8576d944a8cc76f00c30d27c3a71d3458bbe3dbcd66c88a454c3b
23 DIST mesa-22.0.1.tar.xz 15634448 BLAKE2B c102643a81f47b36da24148564968dd5578b01970d14769eeb501d00ba43f49052893625ac7a8d67638f3d9bfe610440f300eb5657322387d8e5dc15b62f13b2 SHA512 cc8012b8f3fcbecfbb153d0e009e6522c3776023501da8499c06f1eaa9ab0a555ca597e16e4d7a2b954b05c8c0737ae6567e0d8549fb63aa86ae587eb31cd01e
24 +DIST mesa-22.0.2.tar.xz 15688840 BLAKE2B f2ad5beae09577d87f3c47dacbe5ae13a8674054be3de7e69828ef905cc3f0b4e92f4f96eef44b35f98578a290d0e19a3469b76afd4d4e69c06dbb26a2c16490 SHA512 939ddf9acd280e1b20b3540349b3ad07bbeee5d821198f1d667e86634449bf5d0a0df5832753b8b3f8816709c2f02959cce25f3d26a33cc758dd8e25d158ddb8
25 DIST mesa-22.1.0-rc3.tar.xz 15836596 BLAKE2B 8497a74192b80d703f6f87c6411ae24f90a710cf2924b68897eb0d52ac8080d4a76f6224bc912e16d273dee43347420e4b9d54e5e2442a7bf0e409ef5cf656dd SHA512 2ae88d14a8dfdb1b8f720371cb3ce1af775b43a615fd6225b39676948486f4b39c0e9acd989679ea2a12ee803370fd2cd8c1152e8bcec0aa4bbb4e5b7fc78dad
26
27 diff --git a/media-libs/mesa/mesa-22.0.2.ebuild b/media-libs/mesa/mesa-22.0.2.ebuild
28 new file mode 100644
29 index 000000000000..15b5138f55fb
30 --- /dev/null
31 +++ b/media-libs/mesa/mesa-22.0.2.ebuild
32 @@ -0,0 +1,463 @@
33 +# Copyright 1999-2022 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=7
37 +
38 +PYTHON_COMPAT=( python3_{8..10} )
39 +
40 +inherit llvm meson-multilib python-any-r1 linux-info
41 +
42 +MY_P="${P/_/-}"
43 +
44 +DESCRIPTION="OpenGL-like graphic library for Linux"
45 +HOMEPAGE="https://www.mesa3d.org/ https://mesa.freedesktop.org/"
46 +
47 +if [[ ${PV} == 9999 ]]; then
48 + EGIT_REPO_URI="https://gitlab.freedesktop.org/mesa/mesa.git"
49 + inherit git-r3
50 +else
51 + SRC_URI="https://archive.mesa3d.org/${MY_P}.tar.xz"
52 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris"
53 +fi
54 +
55 +LICENSE="MIT"
56 +SLOT="0"
57 +RESTRICT="
58 + !test? ( test )
59 +"
60 +
61 +RADEON_CARDS="r300 r600 radeon radeonsi"
62 +VIDEO_CARDS="${RADEON_CARDS} freedreno intel lima nouveau panfrost v3d vc4 virgl vivante vmware"
63 +for card in ${VIDEO_CARDS}; do
64 + IUSE_VIDEO_CARDS+=" video_cards_${card}"
65 +done
66 +
67 +IUSE="${IUSE_VIDEO_CARDS}
68 + cpu_flags_x86_sse2 d3d9 debug gles1 +gles2 +llvm
69 + lm-sensors opencl osmesa selinux test unwind vaapi valgrind vdpau vulkan
70 + vulkan-overlay wayland +X xa xvmc zink +zstd"
71 +
72 +REQUIRED_USE="
73 + d3d9? ( || ( video_cards_intel video_cards_r300 video_cards_r600 video_cards_radeonsi video_cards_nouveau video_cards_vmware ) )
74 + vulkan? ( video_cards_radeonsi? ( llvm ) )
75 + vulkan-overlay? ( vulkan )
76 + video_cards_radeon? ( x86? ( llvm ) amd64? ( llvm ) )
77 + video_cards_r300? ( x86? ( llvm ) amd64? ( llvm ) )
78 + video_cards_radeonsi? ( llvm )
79 + xa? ( X )
80 + xvmc? ( X )
81 + zink? ( vulkan )
82 +"
83 +
84 +LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.109"
85 +RDEPEND="
86 + >=dev-libs/expat-2.1.0-r3:=[${MULTILIB_USEDEP}]
87 + >=media-libs/libglvnd-1.3.2[X?,${MULTILIB_USEDEP}]
88 + >=sys-libs/zlib-1.2.8[${MULTILIB_USEDEP}]
89 + unwind? ( sys-libs/libunwind[${MULTILIB_USEDEP}] )
90 + llvm? (
91 + video_cards_radeonsi? (
92 + virtual/libelf:0=[${MULTILIB_USEDEP}]
93 + )
94 + video_cards_r600? (
95 + virtual/libelf:0=[${MULTILIB_USEDEP}]
96 + )
97 + video_cards_radeon? (
98 + virtual/libelf:0=[${MULTILIB_USEDEP}]
99 + )
100 + )
101 + lm-sensors? ( sys-apps/lm-sensors:=[${MULTILIB_USEDEP}] )
102 + opencl? (
103 + >=virtual/opencl-3[${MULTILIB_USEDEP}]
104 + dev-libs/libclc
105 + virtual/libelf:0=[${MULTILIB_USEDEP}]
106 + )
107 + vaapi? (
108 + >=x11-libs/libva-1.7.3:=[${MULTILIB_USEDEP}]
109 + )
110 + vdpau? ( >=x11-libs/libvdpau-1.1:=[${MULTILIB_USEDEP}] )
111 + xvmc? ( >=x11-libs/libXvMC-1.0.8:=[${MULTILIB_USEDEP}] )
112 + selinux? ( sys-libs/libselinux[${MULTILIB_USEDEP}] )
113 + wayland? (
114 + >=dev-libs/wayland-1.18.0:=[${MULTILIB_USEDEP}]
115 + )
116 + ${LIBDRM_DEPSTRING}[video_cards_freedreno?,video_cards_intel?,video_cards_nouveau?,video_cards_vc4?,video_cards_vivante?,video_cards_vmware?,${MULTILIB_USEDEP}]
117 + vulkan-overlay? ( dev-util/glslang:0=[${MULTILIB_USEDEP}] )
118 + X? (
119 + >=x11-libs/libX11-1.6.2:=[${MULTILIB_USEDEP}]
120 + >=x11-libs/libxshmfence-1.1:=[${MULTILIB_USEDEP}]
121 + >=x11-libs/libXext-1.3.2:=[${MULTILIB_USEDEP}]
122 + >=x11-libs/libXxf86vm-1.1.3:=[${MULTILIB_USEDEP}]
123 + >=x11-libs/libxcb-1.13:=[${MULTILIB_USEDEP}]
124 + x11-libs/libXfixes:=[${MULTILIB_USEDEP}]
125 + )
126 + zink? ( media-libs/vulkan-loader:=[${MULTILIB_USEDEP}] )
127 + zstd? ( app-arch/zstd:=[${MULTILIB_USEDEP}] )
128 +"
129 +for card in ${RADEON_CARDS}; do
130 + RDEPEND="${RDEPEND}
131 + video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_radeon] )
132 + "
133 +done
134 +RDEPEND="${RDEPEND}
135 + video_cards_radeonsi? ( ${LIBDRM_DEPSTRING}[video_cards_amdgpu] )
136 +"
137 +
138 +# Please keep the LLVM dependency block separate. Since LLVM is slotted,
139 +# we need to *really* make sure we're not pulling one than more slot
140 +# simultaneously.
141 +#
142 +# How to use it:
143 +# 1. List all the working slots (with min versions) in ||, newest first.
144 +# 2. Update the := to specify *max* version, e.g. < 10.
145 +# 3. Specify LLVM_MAX_SLOT, e.g. 9.
146 +LLVM_MAX_SLOT="13"
147 +LLVM_DEPSTR="
148 + || (
149 + sys-devel/llvm:13[${MULTILIB_USEDEP}]
150 + sys-devel/llvm:12[${MULTILIB_USEDEP}]
151 + sys-devel/llvm:11[${MULTILIB_USEDEP}]
152 + )
153 + <sys-devel/llvm-$((LLVM_MAX_SLOT + 1)):=[${MULTILIB_USEDEP}]
154 +"
155 +LLVM_DEPSTR_AMDGPU=${LLVM_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
156 +CLANG_DEPSTR=${LLVM_DEPSTR//llvm/clang}
157 +CLANG_DEPSTR_AMDGPU=${CLANG_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
158 +RDEPEND="${RDEPEND}
159 + llvm? (
160 + opencl? (
161 + video_cards_r600? (
162 + ${CLANG_DEPSTR_AMDGPU}
163 + )
164 + !video_cards_r600? (
165 + video_cards_radeonsi? (
166 + ${CLANG_DEPSTR_AMDGPU}
167 + )
168 + )
169 + !video_cards_r600? (
170 + !video_cards_radeonsi? (
171 + video_cards_radeon? (
172 + ${CLANG_DEPSTR_AMDGPU}
173 + )
174 + )
175 + )
176 + !video_cards_r600? (
177 + !video_cards_radeon? (
178 + !video_cards_radeonsi? (
179 + ${CLANG_DEPSTR}
180 + )
181 + )
182 + )
183 + )
184 + !opencl? (
185 + video_cards_r600? (
186 + ${LLVM_DEPSTR_AMDGPU}
187 + )
188 + !video_cards_r600? (
189 + video_cards_radeonsi? (
190 + ${LLVM_DEPSTR_AMDGPU}
191 + )
192 + )
193 + !video_cards_r600? (
194 + !video_cards_radeonsi? (
195 + video_cards_radeon? (
196 + ${LLVM_DEPSTR_AMDGPU}
197 + )
198 + )
199 + )
200 + !video_cards_r600? (
201 + !video_cards_radeon? (
202 + !video_cards_radeonsi? (
203 + ${LLVM_DEPSTR}
204 + )
205 + )
206 + )
207 + )
208 + )
209 +"
210 +unset {LLVM,CLANG}_DEPSTR{,_AMDGPU}
211 +
212 +DEPEND="${RDEPEND}
213 + valgrind? ( dev-util/valgrind )
214 + wayland? ( >=dev-libs/wayland-protocols-1.24 )
215 + X? (
216 + x11-libs/libXrandr[${MULTILIB_USEDEP}]
217 + x11-base/xorg-proto
218 + )
219 +"
220 +BDEPEND="
221 + ${PYTHON_DEPS}
222 + opencl? (
223 + >=sys-devel/gcc-4.6
224 + )
225 + sys-devel/bison
226 + sys-devel/flex
227 + virtual/pkgconfig
228 + $(python_gen_any_dep ">=dev-python/mako-0.8.0[\${PYTHON_USEDEP}]")
229 + wayland? ( dev-util/wayland-scanner )
230 +"
231 +
232 +S="${WORKDIR}/${MY_P}"
233 +EGIT_CHECKOUT_DIR=${S}
234 +
235 +QA_WX_LOAD="
236 +x86? (
237 + usr/lib*/libglapi.so.0.0.0
238 + usr/lib*/libGLESv1_CM.so.1.1.0
239 + usr/lib*/libGLESv2.so.2.0.0
240 + usr/lib*/libGL.so.1.2.0
241 + usr/lib*/libOSMesa.so.8.0.0
242 + usr/lib/libGLX_mesa.so.0.0.0
243 +)"
244 +
245 +llvm_check_deps() {
246 + local flags=${MULTILIB_USEDEP}
247 + if use video_cards_r600 || use video_cards_radeon || use video_cards_radeonsi
248 + then
249 + flags+=",llvm_targets_AMDGPU(-)"
250 + fi
251 +
252 + if use opencl; then
253 + has_version "sys-devel/clang:${LLVM_SLOT}[${flags}]" || return 1
254 + fi
255 + has_version "sys-devel/llvm:${LLVM_SLOT}[${flags}]"
256 +}
257 +
258 +pkg_pretend() {
259 + if use vulkan; then
260 + if ! use video_cards_freedreno &&
261 + ! use video_cards_intel &&
262 + ! use video_cards_radeonsi &&
263 + ! use video_cards_v3d; then
264 + ewarn "Ignoring USE=vulkan since VIDEO_CARDS does not contain freedreno, intel, radeonsi, or v3d"
265 + fi
266 + fi
267 +
268 + if use opencl; then
269 + if ! use video_cards_r600 &&
270 + ! use video_cards_radeonsi; then
271 + ewarn "Ignoring USE=opencl since VIDEO_CARDS does not contain r600 or radeonsi"
272 + fi
273 + fi
274 +
275 + if use vaapi; then
276 + if ! use video_cards_r600 &&
277 + ! use video_cards_radeonsi &&
278 + ! use video_cards_nouveau; then
279 + ewarn "Ignoring USE=vaapi since VIDEO_CARDS does not contain r600, radeonsi, or nouveau"
280 + fi
281 + fi
282 +
283 + if use vdpau; then
284 + if ! use video_cards_r300 &&
285 + ! use video_cards_r600 &&
286 + ! use video_cards_radeonsi &&
287 + ! use video_cards_nouveau; then
288 + ewarn "Ignoring USE=vdpau since VIDEO_CARDS does not contain r300, r600, radeonsi, or nouveau"
289 + fi
290 + fi
291 +
292 + if use xa; then
293 + if ! use video_cards_freedreno &&
294 + ! use video_cards_nouveau &&
295 + ! use video_cards_vmware; then
296 + ewarn "Ignoring USE=xa since VIDEO_CARDS does not contain freedreno, nouveau, or vmware"
297 + fi
298 + fi
299 +
300 + if use xvmc; then
301 + if ! use video_cards_r600 &&
302 + ! use video_cards_nouveau; then
303 + ewarn "Ignoring USE=xvmc since VIDEO_CARDS does not contain r600 or nouveau"
304 + fi
305 + fi
306 +
307 + if ! use llvm; then
308 + use opencl && ewarn "Ignoring USE=opencl since USE does not contain llvm"
309 + fi
310 +
311 + if use osmesa && ! use llvm; then
312 + ewarn "OSMesa will be slow without enabling USE=llvm"
313 + fi
314 +}
315 +
316 +python_check_deps() {
317 + has_version -b ">=dev-python/mako-0.8.0[${PYTHON_USEDEP}]"
318 +}
319 +
320 +pkg_setup() {
321 + # warning message for bug 459306
322 + if use llvm && has_version sys-devel/llvm[!debug=]; then
323 + ewarn "Mismatch between debug USE flags in media-libs/mesa and sys-devel/llvm"
324 + ewarn "detected! This can cause problems. For details, see bug 459306."
325 + fi
326 +
327 + if use video_cards_intel ||
328 + use video_cards_radeonsi; then
329 + if kernel_is -ge 5 11 3; then
330 + CONFIG_CHECK="~KCMP"
331 + elif kernel_is -ge 5 11; then
332 + CONFIG_CHECK="~CHECKPOINT_RESTORE"
333 + elif kernel_is -ge 5 10 20; then
334 + CONFIG_CHECK="~KCMP"
335 + else
336 + CONFIG_CHECK="~CHECKPOINT_RESTORE"
337 + fi
338 + linux-info_pkg_setup
339 + fi
340 +
341 + if use llvm; then
342 + llvm_pkg_setup
343 + fi
344 + python-any-r1_pkg_setup
345 +}
346 +
347 +multilib_src_configure() {
348 + local emesonargs=()
349 +
350 + local platforms
351 + use X && platforms+="x11"
352 + use wayland && platforms+=",wayland"
353 + emesonargs+=(-Dplatforms=${platforms#,})
354 +
355 + if use video_cards_intel ||
356 + use video_cards_r300 ||
357 + use video_cards_r600 ||
358 + use video_cards_radeonsi ||
359 + use video_cards_nouveau ||
360 + use video_cards_vmware; then
361 + emesonargs+=($(meson_use d3d9 gallium-nine))
362 + else
363 + emesonargs+=(-Dgallium-nine=false)
364 + fi
365 +
366 + if use video_cards_r600 ||
367 + use video_cards_radeonsi ||
368 + use video_cards_nouveau; then
369 + emesonargs+=($(meson_feature vaapi gallium-va))
370 + use vaapi && emesonargs+=( -Dva-libs-path="${EPREFIX}"/usr/$(get_libdir)/va/drivers )
371 + else
372 + emesonargs+=(-Dgallium-va=disabled)
373 + fi
374 +
375 + if use video_cards_r300 ||
376 + use video_cards_r600 ||
377 + use video_cards_radeonsi ||
378 + use video_cards_nouveau; then
379 + emesonargs+=($(meson_feature vdpau gallium-vdpau))
380 + else
381 + emesonargs+=(-Dgallium-vdpau=disabled)
382 + fi
383 +
384 + if use video_cards_freedreno ||
385 + use video_cards_nouveau ||
386 + use video_cards_vmware; then
387 + emesonargs+=($(meson_feature xa gallium-xa))
388 + else
389 + emesonargs+=(-Dgallium-xa=disabled)
390 + fi
391 +
392 + if use video_cards_r600 ||
393 + use video_cards_nouveau; then
394 + emesonargs+=($(meson_feature xvmc gallium-xvmc))
395 + else
396 + emesonargs+=(-Dgallium-xvmc=disabled)
397 + fi
398 +
399 + if use video_cards_freedreno ||
400 + use video_cards_lima ||
401 + use video_cards_panfrost ||
402 + use video_cards_v3d ||
403 + use video_cards_vc4 ||
404 + use video_cards_vivante; then
405 + gallium_enable -- kmsro
406 + fi
407 +
408 + gallium_enable -- swrast
409 + gallium_enable video_cards_freedreno freedreno
410 + gallium_enable video_cards_intel crocus i915 iris
411 + gallium_enable video_cards_lima lima
412 + gallium_enable video_cards_nouveau nouveau
413 + gallium_enable video_cards_panfrost panfrost
414 + gallium_enable video_cards_v3d v3d
415 + gallium_enable video_cards_vc4 vc4
416 + gallium_enable video_cards_virgl virgl
417 + gallium_enable video_cards_vivante etnaviv
418 + gallium_enable video_cards_vmware svga
419 + gallium_enable zink zink
420 +
421 + gallium_enable video_cards_r300 r300
422 + gallium_enable video_cards_r600 r600
423 + gallium_enable video_cards_radeonsi radeonsi
424 + if ! use video_cards_r300 && \
425 + ! use video_cards_r600; then
426 + gallium_enable video_cards_radeon r300 r600
427 + fi
428 +
429 + # opencl stuff
430 + emesonargs+=(
431 + -Dgallium-opencl="$(usex opencl icd disabled)"
432 + )
433 +
434 + if use vulkan; then
435 + vulkan_enable video_cards_freedreno freedreno
436 + vulkan_enable video_cards_intel intel
437 + vulkan_enable video_cards_radeonsi amd
438 + vulkan_enable video_cards_v3d broadcom
439 + fi
440 +
441 + driver_list() {
442 + local drivers="$(sort -u <<< "${1// /$'\n'}")"
443 + echo "${drivers//$'\n'/,}"
444 + }
445 +
446 + local vulkan_layers
447 + use vulkan && vulkan_layers+="device-select"
448 + use vulkan-overlay && vulkan_layers+=",overlay"
449 + emesonargs+=(-Dvulkan-layers=${vulkan_layers#,})
450 +
451 + emesonargs+=(
452 + $(meson_use test build-tests)
453 + -Dglx=$(usex X dri disabled)
454 + -Dshared-glapi=enabled
455 + -Ddri3=enabled
456 + -Degl=enabled
457 + -Dgbm=enabled
458 + -Dglvnd=true
459 + $(meson_feature gles1)
460 + $(meson_feature gles2)
461 + $(meson_feature llvm)
462 + $(meson_feature lm-sensors lmsensors)
463 + $(meson_use osmesa)
464 + $(meson_use selinux)
465 + $(meson_feature unwind libunwind)
466 + $(meson_feature zstd)
467 + $(meson_use cpu_flags_x86_sse2 sse2)
468 + -Dvalgrind=$(usex valgrind auto disabled)
469 + -Dgallium-drivers=$(driver_list "${GALLIUM_DRIVERS[*]}")
470 + -Dvulkan-drivers=$(driver_list "${VULKAN_DRIVERS[*]}")
471 + --buildtype $(usex debug debug plain)
472 + -Db_ndebug=$(usex debug false true)
473 + )
474 + meson_src_configure
475 +}
476 +
477 +multilib_src_test() {
478 + meson_src_test -t 100
479 +}
480 +
481 +# $1 - VIDEO_CARDS flag (check skipped for "--")
482 +# other args - names of DRI drivers to enable
483 +gallium_enable() {
484 + if [[ $1 == -- ]] || use $1; then
485 + shift
486 + GALLIUM_DRIVERS+=("$@")
487 + fi
488 +}
489 +
490 +vulkan_enable() {
491 + if [[ $1 == -- ]] || use $1; then
492 + shift
493 + VULKAN_DRIVERS+=("$@")
494 + fi
495 +}