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