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