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