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, 02 Dec 2022 02:19:05
Message-Id: 1669947490.05e4f62b3299bc9d82401786ec983e0e69107fef.mattst88@gentoo
1 commit: 05e4f62b3299bc9d82401786ec983e0e69107fef
2 Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
3 AuthorDate: Thu Dec 1 16:52:08 2022 +0000
4 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
5 CommitDate: Fri Dec 2 02:18:10 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=05e4f62b
7
8 media-libs/mesa: Version bump to 22.3.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.3.0.ebuild | 459 +++++++++++++++++++++++++++++++++++++
14 2 files changed, 460 insertions(+)
15
16 diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
17 index 2d4a7e444daa..37cdb32ca6fd 100644
18 --- a/media-libs/mesa/Manifest
19 +++ b/media-libs/mesa/Manifest
20 @@ -1,3 +1,4 @@
21 DIST mesa-22.1.7.tar.xz 16109944 BLAKE2B 0d4724068eff0ad242e81808ff94b73e1b5da810d27706b5a594ad77875b54562db6d9f752b61bcfff773b26bbc64b751d4dd13cfa256106d3114377ea668d26 SHA512 447e87359445edce231761d94b316b2aa20e9ab58e4b59d75cbb1696dd0900e7164c32bebc3b75700b4070570b456f7a8cf0914181371754a52427d34e4b9120
22 DIST mesa-22.2.2.tar.xz 16424508 BLAKE2B 08ab46718a767a7771affb4b5b6164fbc5430fd5a657cdf4008f16a84892673824976ba84450afbbb3a9431868dddc7f3570c11ab319f1bc9b892f46327b2c59 SHA512 a1eb67e1ae4880c79b1fdc570f4389baba0b8ba796da7e695c9af19a7d92b6c06b95570e6c796548b61355989025fb7efbf9acac74cbd695f7e297dc913b933c
23 DIST mesa-22.2.3.tar.xz 16464020 BLAKE2B 8f1482983ff9de9565a7f48f22e315b022ea8a07d7157e0d202c4d027d13ad4563c40ea63e1d0a92675af7f23d5245be9ed137955c3a9dd85171a35d497a94b2 SHA512 08e9ce43392c46f9c0d122d70e118511eea81422d06f93ab6d330689b46feed3ac1c3bdcdcfd4a27cd5b9eaf26aab518d152a2c753f07b8ed19575d4ed892ad6
24 +DIST mesa-22.3.0.tar.xz 16878600 BLAKE2B 16b11bfad509292338fc46b36e49d747e5cd43a96c753cc2a8c0b915c7b86198a30aa78c8e2bcbaa0daf8cadd79a82046cf32ee6f6e373dcc00e2fdef554bc66 SHA512 bf4d344459f97d266a5943b33aecf062b0825e13c1617afdab71c4ba6a87a201440761c9a32a6e0060910a0917122e3f4d29f666d6b94a38a71c94b9ff3ab9da
25
26 diff --git a/media-libs/mesa/mesa-22.3.0.ebuild b/media-libs/mesa/mesa-22.3.0.ebuild
27 new file mode 100644
28 index 000000000000..b0737f166279
29 --- /dev/null
30 +++ b/media-libs/mesa/mesa-22.3.0.ebuild
31 @@ -0,0 +1,459 @@
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? ( video_cards_radeonsi? ( dev-util/glslang ) )
225 + vulkan-overlay? ( dev-util/glslang )
226 + wayland? ( dev-util/wayland-scanner )
227 +"
228 +
229 +S="${WORKDIR}/${MY_P}"
230 +EGIT_CHECKOUT_DIR=${S}
231 +
232 +QA_WX_LOAD="
233 +x86? (
234 + usr/lib*/libglapi.so.0.0.0
235 + usr/lib*/libGLESv1_CM.so.1.1.0
236 + usr/lib*/libGLESv2.so.2.0.0
237 + usr/lib*/libGL.so.1.2.0
238 + usr/lib*/libOSMesa.so.8.0.0
239 + usr/lib/libGLX_mesa.so.0.0.0
240 +)"
241 +
242 +llvm_check_deps() {
243 + local flags=${MULTILIB_USEDEP}
244 + if use video_cards_r600 || use video_cards_radeon || use video_cards_radeonsi
245 + then
246 + flags+=",llvm_targets_AMDGPU(-)"
247 + fi
248 +
249 + if use opencl; then
250 + has_version "sys-devel/clang:${LLVM_SLOT}[${flags}]" || return 1
251 + fi
252 + has_version "sys-devel/llvm:${LLVM_SLOT}[${flags}]"
253 +}
254 +
255 +pkg_pretend() {
256 + if use vulkan; then
257 + if ! use video_cards_d3d12 &&
258 + ! use video_cards_freedreno &&
259 + ! use video_cards_intel &&
260 + ! use video_cards_radeonsi &&
261 + ! use video_cards_v3d; then
262 + ewarn "Ignoring USE=vulkan since VIDEO_CARDS does not contain d3d12, freedreno, intel, radeonsi, or v3d"
263 + fi
264 + fi
265 +
266 + if use opencl; then
267 + if ! use video_cards_r600 &&
268 + ! use video_cards_radeonsi; then
269 + ewarn "Ignoring USE=opencl since VIDEO_CARDS does not contain r600 or radeonsi"
270 + fi
271 + fi
272 +
273 + if use vaapi; then
274 + if ! use video_cards_d3d12 &&
275 + ! use video_cards_r600 &&
276 + ! use video_cards_radeonsi &&
277 + ! use video_cards_nouveau; then
278 + ewarn "Ignoring USE=vaapi since VIDEO_CARDS does not contain d3d12, r600, radeonsi, or nouveau"
279 + fi
280 + fi
281 +
282 + if use vdpau; then
283 + if ! use video_cards_d3d12 &&
284 + ! 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 d3d12, 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 llvm; then
301 + use opencl && ewarn "Ignoring USE=opencl since USE does not contain llvm"
302 + fi
303 +
304 + if use osmesa && ! use llvm; then
305 + ewarn "OSMesa will be slow without enabling USE=llvm"
306 + fi
307 +}
308 +
309 +python_check_deps() {
310 + python_has_version -b ">=dev-python/mako-0.8.0[${PYTHON_USEDEP}]"
311 +}
312 +
313 +pkg_setup() {
314 + # warning message for bug 459306
315 + if use llvm && has_version sys-devel/llvm[!debug=]; then
316 + ewarn "Mismatch between debug USE flags in media-libs/mesa and sys-devel/llvm"
317 + ewarn "detected! This can cause problems. For details, see bug 459306."
318 + fi
319 +
320 + if use video_cards_intel ||
321 + use video_cards_radeonsi; then
322 + if kernel_is -ge 5 11 3; then
323 + CONFIG_CHECK="~KCMP"
324 + elif kernel_is -ge 5 11; then
325 + CONFIG_CHECK="~CHECKPOINT_RESTORE"
326 + elif kernel_is -ge 5 10 20; then
327 + CONFIG_CHECK="~KCMP"
328 + else
329 + CONFIG_CHECK="~CHECKPOINT_RESTORE"
330 + fi
331 + linux-info_pkg_setup
332 + fi
333 +
334 + if use llvm; then
335 + llvm_pkg_setup
336 + fi
337 + python-any-r1_pkg_setup
338 +}
339 +
340 +multilib_src_configure() {
341 + local emesonargs=()
342 +
343 + local platforms
344 + use X && platforms+="x11"
345 + use wayland && platforms+=",wayland"
346 + emesonargs+=(-Dplatforms=${platforms#,})
347 +
348 + if use video_cards_intel ||
349 + use video_cards_r300 ||
350 + use video_cards_r600 ||
351 + use video_cards_radeonsi ||
352 + use video_cards_nouveau ||
353 + use video_cards_vmware; then
354 + emesonargs+=($(meson_use d3d9 gallium-nine))
355 + else
356 + emesonargs+=(-Dgallium-nine=false)
357 + fi
358 +
359 + if use video_cards_d3d12 ||
360 + use video_cards_r600 ||
361 + use video_cards_radeonsi ||
362 + use video_cards_nouveau; then
363 + emesonargs+=($(meson_feature vaapi gallium-va))
364 + use vaapi && emesonargs+=( -Dva-libs-path="${EPREFIX}"/usr/$(get_libdir)/va/drivers )
365 + else
366 + emesonargs+=(-Dgallium-va=disabled)
367 + fi
368 +
369 + if use video_cards_d3d12; then
370 + emesonargs+=($(meson_feature vaapi gallium-d3d12-video))
371 + fi
372 +
373 + if use video_cards_d3d12 ||
374 + use video_cards_r300 ||
375 + use video_cards_r600 ||
376 + use video_cards_radeonsi ||
377 + use video_cards_nouveau; then
378 + emesonargs+=($(meson_feature vdpau gallium-vdpau))
379 + else
380 + emesonargs+=(-Dgallium-vdpau=disabled)
381 + fi
382 +
383 + if use video_cards_freedreno ||
384 + use video_cards_nouveau ||
385 + use video_cards_vmware; then
386 + emesonargs+=($(meson_feature xa gallium-xa))
387 + else
388 + emesonargs+=(-Dgallium-xa=disabled)
389 + fi
390 +
391 + if use video_cards_freedreno ||
392 + use video_cards_lima ||
393 + use video_cards_panfrost ||
394 + use video_cards_v3d ||
395 + use video_cards_vc4 ||
396 + use video_cards_vivante; then
397 + gallium_enable -- kmsro
398 + fi
399 +
400 + gallium_enable -- swrast
401 + gallium_enable video_cards_freedreno freedreno
402 + gallium_enable video_cards_intel crocus i915 iris
403 + gallium_enable video_cards_lima lima
404 + gallium_enable video_cards_d3d12 d3d12
405 + gallium_enable video_cards_nouveau nouveau
406 + gallium_enable video_cards_panfrost panfrost
407 + gallium_enable video_cards_v3d v3d
408 + gallium_enable video_cards_vc4 vc4
409 + gallium_enable video_cards_virgl virgl
410 + gallium_enable video_cards_vivante etnaviv
411 + gallium_enable video_cards_vmware svga
412 + gallium_enable zink zink
413 +
414 + gallium_enable video_cards_r300 r300
415 + gallium_enable video_cards_r600 r600
416 + gallium_enable video_cards_radeonsi radeonsi
417 + if ! use video_cards_r300 && \
418 + ! use video_cards_r600; then
419 + gallium_enable video_cards_radeon r300 r600
420 + fi
421 +
422 + # opencl stuff
423 + emesonargs+=(
424 + -Dgallium-opencl="$(usex opencl icd disabled)"
425 + )
426 +
427 + if use vulkan; then
428 + vulkan_enable video_cards_freedreno freedreno
429 + vulkan_enable video_cards_intel intel
430 + vulkan_enable video_cards_d3d12 microsoft-experimental
431 + vulkan_enable video_cards_radeonsi amd
432 + vulkan_enable video_cards_v3d broadcom
433 + fi
434 +
435 + driver_list() {
436 + local drivers="$(sort -u <<< "${1// /$'\n'}")"
437 + echo "${drivers//$'\n'/,}"
438 + }
439 +
440 + local vulkan_layers
441 + use vulkan && vulkan_layers+="device-select"
442 + use vulkan-overlay && vulkan_layers+=",overlay"
443 + emesonargs+=(-Dvulkan-layers=${vulkan_layers#,})
444 +
445 + emesonargs+=(
446 + $(meson_use test build-tests)
447 + -Dglx=$(usex X dri disabled)
448 + -Dshared-glapi=enabled
449 + -Ddri3=enabled
450 + -Degl=enabled
451 + -Dgbm=enabled
452 + -Dglvnd=true
453 + $(meson_feature gles1)
454 + $(meson_feature gles2)
455 + $(meson_feature llvm)
456 + $(meson_feature lm-sensors lmsensors)
457 + $(meson_use osmesa)
458 + $(meson_use selinux)
459 + $(meson_feature unwind libunwind)
460 + $(meson_feature zstd)
461 + $(meson_use cpu_flags_x86_sse2 sse2)
462 + -Dvalgrind=$(usex valgrind auto disabled)
463 + -Dvideo-codecs=$(usex proprietary-codecs "h264dec,h264enc,h265dec,h265enc,vc1dec" "")
464 + -Dgallium-drivers=$(driver_list "${GALLIUM_DRIVERS[*]}")
465 + -Dvulkan-drivers=$(driver_list "${VULKAN_DRIVERS[*]}")
466 + --buildtype $(usex debug debug plain)
467 + -Db_ndebug=$(usex debug false true)
468 + )
469 + meson_src_configure
470 +}
471 +
472 +multilib_src_test() {
473 + meson_src_test -t 100
474 +}
475 +
476 +# $1 - VIDEO_CARDS flag (check skipped for "--")
477 +# other args - names of DRI drivers to enable
478 +gallium_enable() {
479 + if [[ $1 == -- ]] || use $1; then
480 + shift
481 + GALLIUM_DRIVERS+=("$@")
482 + fi
483 +}
484 +
485 +vulkan_enable() {
486 + if [[ $1 == -- ]] || use $1; then
487 + shift
488 + VULKAN_DRIVERS+=("$@")
489 + fi
490 +}