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:24
Message-Id: 1652911325.7c55875eb9e42398c46e8ac4e3d1bb92a613559a.mattst88@gentoo
1 commit: 7c55875eb9e42398c46e8ac4e3d1bb92a613559a
2 Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
3 AuthorDate: Wed May 18 22:01:36 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=7c55875e
7
8 media-libs/mesa: Drop old versions
9
10 Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>
11
12 media-libs/mesa/Manifest | 2 -
13 media-libs/mesa/mesa-22.1.0_rc4.ebuild | 463 ---------------------------------
14 media-libs/mesa/mesa-22.1.0_rc5.ebuild | 463 ---------------------------------
15 3 files changed, 928 deletions(-)
16
17 diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
18 index c4e4182e2b5a..7f104150ac60 100644
19 --- a/media-libs/mesa/Manifest
20 +++ b/media-libs/mesa/Manifest
21 @@ -1,5 +1,3 @@
22 DIST mesa-21.3.8.tar.xz 16593540 BLAKE2B 89a471af3354ae0cf0597c1b6bcd2aff8074d58c16504154291f86cd9a9701f98883cf1077f60a8f17d24be800691a5bfb7ef4ddb10dfa355181bf87805b660c SHA512 0462c44fa8e358dafd03088411452bc172a365902795b3198df1e6cfbf1d87675ef5b72b572de7f15e5ee87b30ce5b2f217c81ea72b376962f6428c6ff83f2e9
23 DIST mesa-22.0.3.tar.xz 15711916 BLAKE2B 2ecf9bc2293861e93abcc66cd5df6651a9eb7e533573273063df76ef01d0a39d6097c7a49ec682439bd6f4f0dfd55cd8e61051a731405759174c55b91dbd7725 SHA512 3982cd2fadca5349b2513885ed734c2422e3f2dced85f471f245b120ffaf018acafcd929dc5ec317f2c568bb5f619f5a3475d3a92495f766a2eefb225efcac14
24 -DIST mesa-22.1.0-rc4.tar.xz 15852292 BLAKE2B 87b18ab81f58e7778fa0df902a6f020bf9e0e910be7ddc2d7d4af72c68211b7543be8f123a2952c0d640e5c13a277a0ce72c9163d61e7286159ba31ac8854c46 SHA512 755027304eef52b88da94e035c391ed75cdf780099fb5d2c0e4e48b69da3713a9250ba29bbea4e468f280f5112b975cd49fe11a7a89b957c30071bfb0151fc6d
25 -DIST mesa-22.1.0-rc5.tar.xz 15878456 BLAKE2B fa42b02640fefa52699f89d9c1d20d9239804a8d3c35dc09ce918c4deec62551aa534b8b760d49a8d4b4ab8dd36e1a77718c71a828d3d3cd38f8cb658840c479 SHA512 ead33cc76b273985f85baa297458ef00404595e5b29d81bdd55785437c521831afcaed4e89e8a577e8cb0f5630d856b9e68629365a0ea690cb982d1ab90765db
26 DIST mesa-22.1.0.tar.xz 15934484 BLAKE2B d4e3956f4a100bc54919ac7c8aeadb6d99fdd349b3a669b40967f14997f383c7ade6da957390f628e8dc521e8afde6ee67e7d9620099676c9889253630b9f8f0 SHA512 a2a6f6f37d1e63aa5537a2bbdfd8634fafebf7e223099deb0fd96749d6d1880ea692231fe12eb06ade78a5eb483d11d6f9ef746e94fe3fd58b4381d469afa934
27
28 diff --git a/media-libs/mesa/mesa-22.1.0_rc4.ebuild b/media-libs/mesa/mesa-22.1.0_rc4.ebuild
29 deleted file mode 100644
30 index 47832d49429b..000000000000
31 --- a/media-libs/mesa/mesa-22.1.0_rc4.ebuild
32 +++ /dev/null
33 @@ -1,463 +0,0 @@
34 -# Copyright 1999-2022 Gentoo Authors
35 -# Distributed under the terms of the GNU General Public License v2
36 -
37 -EAPI=7
38 -
39 -PYTHON_COMPAT=( python3_{8..10} )
40 -
41 -inherit llvm meson-multilib python-any-r1 linux-info
42 -
43 -MY_P="${P/_/-}"
44 -
45 -DESCRIPTION="OpenGL-like graphic library for Linux"
46 -HOMEPAGE="https://www.mesa3d.org/ https://mesa.freedesktop.org/"
47 -
48 -if [[ ${PV} == 9999 ]]; then
49 - EGIT_REPO_URI="https://gitlab.freedesktop.org/mesa/mesa.git"
50 - inherit git-r3
51 -else
52 - SRC_URI="https://archive.mesa3d.org/${MY_P}.tar.xz"
53 - 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"
54 -fi
55 -
56 -LICENSE="MIT"
57 -SLOT="0"
58 -RESTRICT="
59 - !test? ( test )
60 -"
61 -
62 -RADEON_CARDS="r300 r600 radeon radeonsi"
63 -VIDEO_CARDS="${RADEON_CARDS} freedreno intel lima nouveau panfrost v3d vc4 virgl vivante vmware"
64 -for card in ${VIDEO_CARDS}; do
65 - IUSE_VIDEO_CARDS+=" video_cards_${card}"
66 -done
67 -
68 -IUSE="${IUSE_VIDEO_CARDS}
69 - cpu_flags_x86_sse2 d3d9 debug gles1 +gles2 +llvm
70 - lm-sensors opencl osmesa selinux test unwind vaapi valgrind vdpau vulkan
71 - vulkan-overlay wayland +X xa xvmc zink +zstd"
72 -
73 -REQUIRED_USE="
74 - d3d9? ( || ( video_cards_intel video_cards_r300 video_cards_r600 video_cards_radeonsi video_cards_nouveau video_cards_vmware ) )
75 - vulkan? ( video_cards_radeonsi? ( llvm ) )
76 - vulkan-overlay? ( vulkan )
77 - video_cards_radeon? ( x86? ( llvm ) amd64? ( llvm ) )
78 - video_cards_r300? ( x86? ( llvm ) amd64? ( llvm ) )
79 - video_cards_radeonsi? ( llvm )
80 - xa? ( X )
81 - xvmc? ( X )
82 - zink? ( vulkan )
83 -"
84 -
85 -LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.110"
86 -RDEPEND="
87 - >=dev-libs/expat-2.1.0-r3:=[${MULTILIB_USEDEP}]
88 - >=media-libs/libglvnd-1.3.2[X?,${MULTILIB_USEDEP}]
89 - >=sys-libs/zlib-1.2.8[${MULTILIB_USEDEP}]
90 - unwind? ( sys-libs/libunwind[${MULTILIB_USEDEP}] )
91 - llvm? (
92 - video_cards_radeonsi? (
93 - virtual/libelf:0=[${MULTILIB_USEDEP}]
94 - )
95 - video_cards_r600? (
96 - virtual/libelf:0=[${MULTILIB_USEDEP}]
97 - )
98 - video_cards_radeon? (
99 - virtual/libelf:0=[${MULTILIB_USEDEP}]
100 - )
101 - )
102 - lm-sensors? ( sys-apps/lm-sensors:=[${MULTILIB_USEDEP}] )
103 - opencl? (
104 - >=virtual/opencl-3[${MULTILIB_USEDEP}]
105 - dev-libs/libclc
106 - virtual/libelf:0=[${MULTILIB_USEDEP}]
107 - )
108 - vaapi? (
109 - >=x11-libs/libva-1.7.3:=[${MULTILIB_USEDEP}]
110 - )
111 - vdpau? ( >=x11-libs/libvdpau-1.1:=[${MULTILIB_USEDEP}] )
112 - xvmc? ( >=x11-libs/libXvMC-1.0.8:=[${MULTILIB_USEDEP}] )
113 - selinux? ( sys-libs/libselinux[${MULTILIB_USEDEP}] )
114 - wayland? (
115 - >=dev-libs/wayland-1.18.0:=[${MULTILIB_USEDEP}]
116 - )
117 - ${LIBDRM_DEPSTRING}[video_cards_freedreno?,video_cards_intel?,video_cards_nouveau?,video_cards_vc4?,video_cards_vivante?,video_cards_vmware?,${MULTILIB_USEDEP}]
118 - vulkan-overlay? ( dev-util/glslang:0=[${MULTILIB_USEDEP}] )
119 - X? (
120 - >=x11-libs/libX11-1.6.2:=[${MULTILIB_USEDEP}]
121 - >=x11-libs/libxshmfence-1.1:=[${MULTILIB_USEDEP}]
122 - >=x11-libs/libXext-1.3.2:=[${MULTILIB_USEDEP}]
123 - >=x11-libs/libXxf86vm-1.1.3:=[${MULTILIB_USEDEP}]
124 - >=x11-libs/libxcb-1.13:=[${MULTILIB_USEDEP}]
125 - x11-libs/libXfixes:=[${MULTILIB_USEDEP}]
126 - )
127 - zink? ( media-libs/vulkan-loader:=[${MULTILIB_USEDEP}] )
128 - zstd? ( app-arch/zstd:=[${MULTILIB_USEDEP}] )
129 -"
130 -for card in ${RADEON_CARDS}; do
131 - RDEPEND="${RDEPEND}
132 - video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_radeon] )
133 - "
134 -done
135 -RDEPEND="${RDEPEND}
136 - video_cards_radeonsi? ( ${LIBDRM_DEPSTRING}[video_cards_amdgpu] )
137 -"
138 -
139 -# Please keep the LLVM dependency block separate. Since LLVM is slotted,
140 -# we need to *really* make sure we're not pulling one than more slot
141 -# simultaneously.
142 -#
143 -# How to use it:
144 -# 1. List all the working slots (with min versions) in ||, newest first.
145 -# 2. Update the := to specify *max* version, e.g. < 10.
146 -# 3. Specify LLVM_MAX_SLOT, e.g. 9.
147 -LLVM_MAX_SLOT="14"
148 -LLVM_DEPSTR="
149 - || (
150 - sys-devel/llvm:14[${MULTILIB_USEDEP}]
151 - sys-devel/llvm:13[${MULTILIB_USEDEP}]
152 - sys-devel/llvm:12[${MULTILIB_USEDEP}]
153 - )
154 - <sys-devel/llvm-$((LLVM_MAX_SLOT + 1)):=[${MULTILIB_USEDEP}]
155 -"
156 -LLVM_DEPSTR_AMDGPU=${LLVM_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
157 -CLANG_DEPSTR=${LLVM_DEPSTR//llvm/clang}
158 -CLANG_DEPSTR_AMDGPU=${CLANG_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
159 -RDEPEND="${RDEPEND}
160 - llvm? (
161 - opencl? (
162 - video_cards_r600? (
163 - ${CLANG_DEPSTR_AMDGPU}
164 - )
165 - !video_cards_r600? (
166 - video_cards_radeonsi? (
167 - ${CLANG_DEPSTR_AMDGPU}
168 - )
169 - )
170 - !video_cards_r600? (
171 - !video_cards_radeonsi? (
172 - video_cards_radeon? (
173 - ${CLANG_DEPSTR_AMDGPU}
174 - )
175 - )
176 - )
177 - !video_cards_r600? (
178 - !video_cards_radeon? (
179 - !video_cards_radeonsi? (
180 - ${CLANG_DEPSTR}
181 - )
182 - )
183 - )
184 - )
185 - !opencl? (
186 - video_cards_r600? (
187 - ${LLVM_DEPSTR_AMDGPU}
188 - )
189 - !video_cards_r600? (
190 - video_cards_radeonsi? (
191 - ${LLVM_DEPSTR_AMDGPU}
192 - )
193 - )
194 - !video_cards_r600? (
195 - !video_cards_radeonsi? (
196 - video_cards_radeon? (
197 - ${LLVM_DEPSTR_AMDGPU}
198 - )
199 - )
200 - )
201 - !video_cards_r600? (
202 - !video_cards_radeon? (
203 - !video_cards_radeonsi? (
204 - ${LLVM_DEPSTR}
205 - )
206 - )
207 - )
208 - )
209 - )
210 -"
211 -unset {LLVM,CLANG}_DEPSTR{,_AMDGPU}
212 -
213 -DEPEND="${RDEPEND}
214 - valgrind? ( dev-util/valgrind )
215 - wayland? ( >=dev-libs/wayland-protocols-1.24 )
216 - X? (
217 - x11-libs/libXrandr[${MULTILIB_USEDEP}]
218 - x11-base/xorg-proto
219 - )
220 -"
221 -BDEPEND="
222 - ${PYTHON_DEPS}
223 - opencl? (
224 - >=sys-devel/gcc-4.6
225 - )
226 - sys-devel/bison
227 - sys-devel/flex
228 - virtual/pkgconfig
229 - $(python_gen_any_dep ">=dev-python/mako-0.8.0[\${PYTHON_USEDEP}]")
230 - wayland? ( dev-util/wayland-scanner )
231 -"
232 -
233 -S="${WORKDIR}/${MY_P}"
234 -EGIT_CHECKOUT_DIR=${S}
235 -
236 -QA_WX_LOAD="
237 -x86? (
238 - usr/lib*/libglapi.so.0.0.0
239 - usr/lib*/libGLESv1_CM.so.1.1.0
240 - usr/lib*/libGLESv2.so.2.0.0
241 - usr/lib*/libGL.so.1.2.0
242 - usr/lib*/libOSMesa.so.8.0.0
243 - usr/lib/libGLX_mesa.so.0.0.0
244 -)"
245 -
246 -llvm_check_deps() {
247 - local flags=${MULTILIB_USEDEP}
248 - if use video_cards_r600 || use video_cards_radeon || use video_cards_radeonsi
249 - then
250 - flags+=",llvm_targets_AMDGPU(-)"
251 - fi
252 -
253 - if use opencl; then
254 - has_version "sys-devel/clang:${LLVM_SLOT}[${flags}]" || return 1
255 - fi
256 - has_version "sys-devel/llvm:${LLVM_SLOT}[${flags}]"
257 -}
258 -
259 -pkg_pretend() {
260 - if use vulkan; then
261 - if ! use video_cards_freedreno &&
262 - ! use video_cards_intel &&
263 - ! use video_cards_radeonsi &&
264 - ! use video_cards_v3d; then
265 - ewarn "Ignoring USE=vulkan since VIDEO_CARDS does not contain freedreno, intel, radeonsi, or v3d"
266 - fi
267 - fi
268 -
269 - if use opencl; then
270 - if ! use video_cards_r600 &&
271 - ! use video_cards_radeonsi; then
272 - ewarn "Ignoring USE=opencl since VIDEO_CARDS does not contain r600 or radeonsi"
273 - fi
274 - fi
275 -
276 - if use vaapi; then
277 - if ! use video_cards_r600 &&
278 - ! use video_cards_radeonsi &&
279 - ! use video_cards_nouveau; then
280 - ewarn "Ignoring USE=vaapi since VIDEO_CARDS does not contain r600, radeonsi, or nouveau"
281 - fi
282 - fi
283 -
284 - if use vdpau; then
285 - if ! 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 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 - 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_r600 ||
368 - use video_cards_radeonsi ||
369 - use video_cards_nouveau; then
370 - emesonargs+=($(meson_feature vaapi gallium-va))
371 - use vaapi && emesonargs+=( -Dva-libs-path="${EPREFIX}"/usr/$(get_libdir)/va/drivers )
372 - else
373 - emesonargs+=(-Dgallium-va=disabled)
374 - fi
375 -
376 - if use video_cards_r300 ||
377 - use video_cards_r600 ||
378 - use video_cards_radeonsi ||
379 - use video_cards_nouveau; then
380 - emesonargs+=($(meson_feature vdpau gallium-vdpau))
381 - else
382 - emesonargs+=(-Dgallium-vdpau=disabled)
383 - fi
384 -
385 - if use video_cards_freedreno ||
386 - use video_cards_nouveau ||
387 - use video_cards_vmware; then
388 - emesonargs+=($(meson_feature xa gallium-xa))
389 - else
390 - emesonargs+=(-Dgallium-xa=disabled)
391 - fi
392 -
393 - if use video_cards_r600 ||
394 - use video_cards_nouveau; then
395 - emesonargs+=($(meson_feature xvmc gallium-xvmc))
396 - else
397 - emesonargs+=(-Dgallium-xvmc=disabled)
398 - fi
399 -
400 - if use video_cards_freedreno ||
401 - use video_cards_lima ||
402 - use video_cards_panfrost ||
403 - use video_cards_v3d ||
404 - use video_cards_vc4 ||
405 - use video_cards_vivante; then
406 - gallium_enable -- kmsro
407 - fi
408 -
409 - gallium_enable -- swrast
410 - gallium_enable video_cards_freedreno freedreno
411 - gallium_enable video_cards_intel crocus i915 iris
412 - gallium_enable video_cards_lima lima
413 - gallium_enable video_cards_nouveau nouveau
414 - gallium_enable video_cards_panfrost panfrost
415 - gallium_enable video_cards_v3d v3d
416 - gallium_enable video_cards_vc4 vc4
417 - gallium_enable video_cards_virgl virgl
418 - gallium_enable video_cards_vivante etnaviv
419 - gallium_enable video_cards_vmware svga
420 - gallium_enable zink zink
421 -
422 - gallium_enable video_cards_r300 r300
423 - gallium_enable video_cards_r600 r600
424 - gallium_enable video_cards_radeonsi radeonsi
425 - if ! use video_cards_r300 && \
426 - ! use video_cards_r600; then
427 - gallium_enable video_cards_radeon r300 r600
428 - fi
429 -
430 - # opencl stuff
431 - emesonargs+=(
432 - -Dgallium-opencl="$(usex opencl icd disabled)"
433 - )
434 -
435 - if use vulkan; then
436 - vulkan_enable video_cards_freedreno freedreno
437 - vulkan_enable video_cards_intel intel
438 - vulkan_enable video_cards_radeonsi amd
439 - vulkan_enable video_cards_v3d broadcom
440 - fi
441 -
442 - driver_list() {
443 - local drivers="$(sort -u <<< "${1// /$'\n'}")"
444 - echo "${drivers//$'\n'/,}"
445 - }
446 -
447 - local vulkan_layers
448 - use vulkan && vulkan_layers+="device-select"
449 - use vulkan-overlay && vulkan_layers+=",overlay"
450 - emesonargs+=(-Dvulkan-layers=${vulkan_layers#,})
451 -
452 - emesonargs+=(
453 - $(meson_use test build-tests)
454 - -Dglx=$(usex X dri disabled)
455 - -Dshared-glapi=enabled
456 - -Ddri3=enabled
457 - -Degl=enabled
458 - -Dgbm=enabled
459 - -Dglvnd=true
460 - $(meson_feature gles1)
461 - $(meson_feature gles2)
462 - $(meson_feature llvm)
463 - $(meson_feature lm-sensors lmsensors)
464 - $(meson_use osmesa)
465 - $(meson_use selinux)
466 - $(meson_feature unwind libunwind)
467 - $(meson_feature zstd)
468 - $(meson_use cpu_flags_x86_sse2 sse2)
469 - -Dvalgrind=$(usex valgrind auto disabled)
470 - -Dgallium-drivers=$(driver_list "${GALLIUM_DRIVERS[*]}")
471 - -Dvulkan-drivers=$(driver_list "${VULKAN_DRIVERS[*]}")
472 - --buildtype $(usex debug debug plain)
473 - -Db_ndebug=$(usex debug false true)
474 - )
475 - meson_src_configure
476 -}
477 -
478 -multilib_src_test() {
479 - meson_src_test -t 100
480 -}
481 -
482 -# $1 - VIDEO_CARDS flag (check skipped for "--")
483 -# other args - names of DRI drivers to enable
484 -gallium_enable() {
485 - if [[ $1 == -- ]] || use $1; then
486 - shift
487 - GALLIUM_DRIVERS+=("$@")
488 - fi
489 -}
490 -
491 -vulkan_enable() {
492 - if [[ $1 == -- ]] || use $1; then
493 - shift
494 - VULKAN_DRIVERS+=("$@")
495 - fi
496 -}
497
498 diff --git a/media-libs/mesa/mesa-22.1.0_rc5.ebuild b/media-libs/mesa/mesa-22.1.0_rc5.ebuild
499 deleted file mode 100644
500 index 47832d49429b..000000000000
501 --- a/media-libs/mesa/mesa-22.1.0_rc5.ebuild
502 +++ /dev/null
503 @@ -1,463 +0,0 @@
504 -# Copyright 1999-2022 Gentoo Authors
505 -# Distributed under the terms of the GNU General Public License v2
506 -
507 -EAPI=7
508 -
509 -PYTHON_COMPAT=( python3_{8..10} )
510 -
511 -inherit llvm meson-multilib python-any-r1 linux-info
512 -
513 -MY_P="${P/_/-}"
514 -
515 -DESCRIPTION="OpenGL-like graphic library for Linux"
516 -HOMEPAGE="https://www.mesa3d.org/ https://mesa.freedesktop.org/"
517 -
518 -if [[ ${PV} == 9999 ]]; then
519 - EGIT_REPO_URI="https://gitlab.freedesktop.org/mesa/mesa.git"
520 - inherit git-r3
521 -else
522 - SRC_URI="https://archive.mesa3d.org/${MY_P}.tar.xz"
523 - 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"
524 -fi
525 -
526 -LICENSE="MIT"
527 -SLOT="0"
528 -RESTRICT="
529 - !test? ( test )
530 -"
531 -
532 -RADEON_CARDS="r300 r600 radeon radeonsi"
533 -VIDEO_CARDS="${RADEON_CARDS} freedreno intel lima nouveau panfrost v3d vc4 virgl vivante vmware"
534 -for card in ${VIDEO_CARDS}; do
535 - IUSE_VIDEO_CARDS+=" video_cards_${card}"
536 -done
537 -
538 -IUSE="${IUSE_VIDEO_CARDS}
539 - cpu_flags_x86_sse2 d3d9 debug gles1 +gles2 +llvm
540 - lm-sensors opencl osmesa selinux test unwind vaapi valgrind vdpau vulkan
541 - vulkan-overlay wayland +X xa xvmc zink +zstd"
542 -
543 -REQUIRED_USE="
544 - d3d9? ( || ( video_cards_intel video_cards_r300 video_cards_r600 video_cards_radeonsi video_cards_nouveau video_cards_vmware ) )
545 - vulkan? ( video_cards_radeonsi? ( llvm ) )
546 - vulkan-overlay? ( vulkan )
547 - video_cards_radeon? ( x86? ( llvm ) amd64? ( llvm ) )
548 - video_cards_r300? ( x86? ( llvm ) amd64? ( llvm ) )
549 - video_cards_radeonsi? ( llvm )
550 - xa? ( X )
551 - xvmc? ( X )
552 - zink? ( vulkan )
553 -"
554 -
555 -LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.110"
556 -RDEPEND="
557 - >=dev-libs/expat-2.1.0-r3:=[${MULTILIB_USEDEP}]
558 - >=media-libs/libglvnd-1.3.2[X?,${MULTILIB_USEDEP}]
559 - >=sys-libs/zlib-1.2.8[${MULTILIB_USEDEP}]
560 - unwind? ( sys-libs/libunwind[${MULTILIB_USEDEP}] )
561 - llvm? (
562 - video_cards_radeonsi? (
563 - virtual/libelf:0=[${MULTILIB_USEDEP}]
564 - )
565 - video_cards_r600? (
566 - virtual/libelf:0=[${MULTILIB_USEDEP}]
567 - )
568 - video_cards_radeon? (
569 - virtual/libelf:0=[${MULTILIB_USEDEP}]
570 - )
571 - )
572 - lm-sensors? ( sys-apps/lm-sensors:=[${MULTILIB_USEDEP}] )
573 - opencl? (
574 - >=virtual/opencl-3[${MULTILIB_USEDEP}]
575 - dev-libs/libclc
576 - virtual/libelf:0=[${MULTILIB_USEDEP}]
577 - )
578 - vaapi? (
579 - >=x11-libs/libva-1.7.3:=[${MULTILIB_USEDEP}]
580 - )
581 - vdpau? ( >=x11-libs/libvdpau-1.1:=[${MULTILIB_USEDEP}] )
582 - xvmc? ( >=x11-libs/libXvMC-1.0.8:=[${MULTILIB_USEDEP}] )
583 - selinux? ( sys-libs/libselinux[${MULTILIB_USEDEP}] )
584 - wayland? (
585 - >=dev-libs/wayland-1.18.0:=[${MULTILIB_USEDEP}]
586 - )
587 - ${LIBDRM_DEPSTRING}[video_cards_freedreno?,video_cards_intel?,video_cards_nouveau?,video_cards_vc4?,video_cards_vivante?,video_cards_vmware?,${MULTILIB_USEDEP}]
588 - vulkan-overlay? ( dev-util/glslang:0=[${MULTILIB_USEDEP}] )
589 - X? (
590 - >=x11-libs/libX11-1.6.2:=[${MULTILIB_USEDEP}]
591 - >=x11-libs/libxshmfence-1.1:=[${MULTILIB_USEDEP}]
592 - >=x11-libs/libXext-1.3.2:=[${MULTILIB_USEDEP}]
593 - >=x11-libs/libXxf86vm-1.1.3:=[${MULTILIB_USEDEP}]
594 - >=x11-libs/libxcb-1.13:=[${MULTILIB_USEDEP}]
595 - x11-libs/libXfixes:=[${MULTILIB_USEDEP}]
596 - )
597 - zink? ( media-libs/vulkan-loader:=[${MULTILIB_USEDEP}] )
598 - zstd? ( app-arch/zstd:=[${MULTILIB_USEDEP}] )
599 -"
600 -for card in ${RADEON_CARDS}; do
601 - RDEPEND="${RDEPEND}
602 - video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_radeon] )
603 - "
604 -done
605 -RDEPEND="${RDEPEND}
606 - video_cards_radeonsi? ( ${LIBDRM_DEPSTRING}[video_cards_amdgpu] )
607 -"
608 -
609 -# Please keep the LLVM dependency block separate. Since LLVM is slotted,
610 -# we need to *really* make sure we're not pulling one than more slot
611 -# simultaneously.
612 -#
613 -# How to use it:
614 -# 1. List all the working slots (with min versions) in ||, newest first.
615 -# 2. Update the := to specify *max* version, e.g. < 10.
616 -# 3. Specify LLVM_MAX_SLOT, e.g. 9.
617 -LLVM_MAX_SLOT="14"
618 -LLVM_DEPSTR="
619 - || (
620 - sys-devel/llvm:14[${MULTILIB_USEDEP}]
621 - sys-devel/llvm:13[${MULTILIB_USEDEP}]
622 - sys-devel/llvm:12[${MULTILIB_USEDEP}]
623 - )
624 - <sys-devel/llvm-$((LLVM_MAX_SLOT + 1)):=[${MULTILIB_USEDEP}]
625 -"
626 -LLVM_DEPSTR_AMDGPU=${LLVM_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
627 -CLANG_DEPSTR=${LLVM_DEPSTR//llvm/clang}
628 -CLANG_DEPSTR_AMDGPU=${CLANG_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
629 -RDEPEND="${RDEPEND}
630 - llvm? (
631 - opencl? (
632 - video_cards_r600? (
633 - ${CLANG_DEPSTR_AMDGPU}
634 - )
635 - !video_cards_r600? (
636 - video_cards_radeonsi? (
637 - ${CLANG_DEPSTR_AMDGPU}
638 - )
639 - )
640 - !video_cards_r600? (
641 - !video_cards_radeonsi? (
642 - video_cards_radeon? (
643 - ${CLANG_DEPSTR_AMDGPU}
644 - )
645 - )
646 - )
647 - !video_cards_r600? (
648 - !video_cards_radeon? (
649 - !video_cards_radeonsi? (
650 - ${CLANG_DEPSTR}
651 - )
652 - )
653 - )
654 - )
655 - !opencl? (
656 - video_cards_r600? (
657 - ${LLVM_DEPSTR_AMDGPU}
658 - )
659 - !video_cards_r600? (
660 - video_cards_radeonsi? (
661 - ${LLVM_DEPSTR_AMDGPU}
662 - )
663 - )
664 - !video_cards_r600? (
665 - !video_cards_radeonsi? (
666 - video_cards_radeon? (
667 - ${LLVM_DEPSTR_AMDGPU}
668 - )
669 - )
670 - )
671 - !video_cards_r600? (
672 - !video_cards_radeon? (
673 - !video_cards_radeonsi? (
674 - ${LLVM_DEPSTR}
675 - )
676 - )
677 - )
678 - )
679 - )
680 -"
681 -unset {LLVM,CLANG}_DEPSTR{,_AMDGPU}
682 -
683 -DEPEND="${RDEPEND}
684 - valgrind? ( dev-util/valgrind )
685 - wayland? ( >=dev-libs/wayland-protocols-1.24 )
686 - X? (
687 - x11-libs/libXrandr[${MULTILIB_USEDEP}]
688 - x11-base/xorg-proto
689 - )
690 -"
691 -BDEPEND="
692 - ${PYTHON_DEPS}
693 - opencl? (
694 - >=sys-devel/gcc-4.6
695 - )
696 - sys-devel/bison
697 - sys-devel/flex
698 - virtual/pkgconfig
699 - $(python_gen_any_dep ">=dev-python/mako-0.8.0[\${PYTHON_USEDEP}]")
700 - wayland? ( dev-util/wayland-scanner )
701 -"
702 -
703 -S="${WORKDIR}/${MY_P}"
704 -EGIT_CHECKOUT_DIR=${S}
705 -
706 -QA_WX_LOAD="
707 -x86? (
708 - usr/lib*/libglapi.so.0.0.0
709 - usr/lib*/libGLESv1_CM.so.1.1.0
710 - usr/lib*/libGLESv2.so.2.0.0
711 - usr/lib*/libGL.so.1.2.0
712 - usr/lib*/libOSMesa.so.8.0.0
713 - usr/lib/libGLX_mesa.so.0.0.0
714 -)"
715 -
716 -llvm_check_deps() {
717 - local flags=${MULTILIB_USEDEP}
718 - if use video_cards_r600 || use video_cards_radeon || use video_cards_radeonsi
719 - then
720 - flags+=",llvm_targets_AMDGPU(-)"
721 - fi
722 -
723 - if use opencl; then
724 - has_version "sys-devel/clang:${LLVM_SLOT}[${flags}]" || return 1
725 - fi
726 - has_version "sys-devel/llvm:${LLVM_SLOT}[${flags}]"
727 -}
728 -
729 -pkg_pretend() {
730 - if use vulkan; then
731 - if ! use video_cards_freedreno &&
732 - ! use video_cards_intel &&
733 - ! use video_cards_radeonsi &&
734 - ! use video_cards_v3d; then
735 - ewarn "Ignoring USE=vulkan since VIDEO_CARDS does not contain freedreno, intel, radeonsi, or v3d"
736 - fi
737 - fi
738 -
739 - if use opencl; then
740 - if ! use video_cards_r600 &&
741 - ! use video_cards_radeonsi; then
742 - ewarn "Ignoring USE=opencl since VIDEO_CARDS does not contain r600 or radeonsi"
743 - fi
744 - fi
745 -
746 - if use vaapi; then
747 - if ! use video_cards_r600 &&
748 - ! use video_cards_radeonsi &&
749 - ! use video_cards_nouveau; then
750 - ewarn "Ignoring USE=vaapi since VIDEO_CARDS does not contain r600, radeonsi, or nouveau"
751 - fi
752 - fi
753 -
754 - if use vdpau; then
755 - if ! use video_cards_r300 &&
756 - ! use video_cards_r600 &&
757 - ! use video_cards_radeonsi &&
758 - ! use video_cards_nouveau; then
759 - ewarn "Ignoring USE=vdpau since VIDEO_CARDS does not contain r300, r600, radeonsi, or nouveau"
760 - fi
761 - fi
762 -
763 - if use xa; then
764 - if ! use video_cards_freedreno &&
765 - ! use video_cards_nouveau &&
766 - ! use video_cards_vmware; then
767 - ewarn "Ignoring USE=xa since VIDEO_CARDS does not contain freedreno, nouveau, or vmware"
768 - fi
769 - fi
770 -
771 - if use xvmc; then
772 - if ! use video_cards_r600 &&
773 - ! use video_cards_nouveau; then
774 - ewarn "Ignoring USE=xvmc since VIDEO_CARDS does not contain r600 or nouveau"
775 - fi
776 - fi
777 -
778 - if ! use llvm; then
779 - use opencl && ewarn "Ignoring USE=opencl since USE does not contain llvm"
780 - fi
781 -
782 - if use osmesa && ! use llvm; then
783 - ewarn "OSMesa will be slow without enabling USE=llvm"
784 - fi
785 -}
786 -
787 -python_check_deps() {
788 - has_version -b ">=dev-python/mako-0.8.0[${PYTHON_USEDEP}]"
789 -}
790 -
791 -pkg_setup() {
792 - # warning message for bug 459306
793 - if use llvm && has_version sys-devel/llvm[!debug=]; then
794 - ewarn "Mismatch between debug USE flags in media-libs/mesa and sys-devel/llvm"
795 - ewarn "detected! This can cause problems. For details, see bug 459306."
796 - fi
797 -
798 - if use video_cards_intel ||
799 - use video_cards_radeonsi; then
800 - if kernel_is -ge 5 11 3; then
801 - CONFIG_CHECK="~KCMP"
802 - elif kernel_is -ge 5 11; then
803 - CONFIG_CHECK="~CHECKPOINT_RESTORE"
804 - elif kernel_is -ge 5 10 20; then
805 - CONFIG_CHECK="~KCMP"
806 - else
807 - CONFIG_CHECK="~CHECKPOINT_RESTORE"
808 - fi
809 - linux-info_pkg_setup
810 - fi
811 -
812 - if use llvm; then
813 - llvm_pkg_setup
814 - fi
815 - python-any-r1_pkg_setup
816 -}
817 -
818 -multilib_src_configure() {
819 - local emesonargs=()
820 -
821 - local platforms
822 - use X && platforms+="x11"
823 - use wayland && platforms+=",wayland"
824 - emesonargs+=(-Dplatforms=${platforms#,})
825 -
826 - if use video_cards_intel ||
827 - use video_cards_r300 ||
828 - use video_cards_r600 ||
829 - use video_cards_radeonsi ||
830 - use video_cards_nouveau ||
831 - use video_cards_vmware; then
832 - emesonargs+=($(meson_use d3d9 gallium-nine))
833 - else
834 - emesonargs+=(-Dgallium-nine=false)
835 - fi
836 -
837 - if use video_cards_r600 ||
838 - use video_cards_radeonsi ||
839 - use video_cards_nouveau; then
840 - emesonargs+=($(meson_feature vaapi gallium-va))
841 - use vaapi && emesonargs+=( -Dva-libs-path="${EPREFIX}"/usr/$(get_libdir)/va/drivers )
842 - else
843 - emesonargs+=(-Dgallium-va=disabled)
844 - fi
845 -
846 - if use video_cards_r300 ||
847 - use video_cards_r600 ||
848 - use video_cards_radeonsi ||
849 - use video_cards_nouveau; then
850 - emesonargs+=($(meson_feature vdpau gallium-vdpau))
851 - else
852 - emesonargs+=(-Dgallium-vdpau=disabled)
853 - fi
854 -
855 - if use video_cards_freedreno ||
856 - use video_cards_nouveau ||
857 - use video_cards_vmware; then
858 - emesonargs+=($(meson_feature xa gallium-xa))
859 - else
860 - emesonargs+=(-Dgallium-xa=disabled)
861 - fi
862 -
863 - if use video_cards_r600 ||
864 - use video_cards_nouveau; then
865 - emesonargs+=($(meson_feature xvmc gallium-xvmc))
866 - else
867 - emesonargs+=(-Dgallium-xvmc=disabled)
868 - fi
869 -
870 - if use video_cards_freedreno ||
871 - use video_cards_lima ||
872 - use video_cards_panfrost ||
873 - use video_cards_v3d ||
874 - use video_cards_vc4 ||
875 - use video_cards_vivante; then
876 - gallium_enable -- kmsro
877 - fi
878 -
879 - gallium_enable -- swrast
880 - gallium_enable video_cards_freedreno freedreno
881 - gallium_enable video_cards_intel crocus i915 iris
882 - gallium_enable video_cards_lima lima
883 - gallium_enable video_cards_nouveau nouveau
884 - gallium_enable video_cards_panfrost panfrost
885 - gallium_enable video_cards_v3d v3d
886 - gallium_enable video_cards_vc4 vc4
887 - gallium_enable video_cards_virgl virgl
888 - gallium_enable video_cards_vivante etnaviv
889 - gallium_enable video_cards_vmware svga
890 - gallium_enable zink zink
891 -
892 - gallium_enable video_cards_r300 r300
893 - gallium_enable video_cards_r600 r600
894 - gallium_enable video_cards_radeonsi radeonsi
895 - if ! use video_cards_r300 && \
896 - ! use video_cards_r600; then
897 - gallium_enable video_cards_radeon r300 r600
898 - fi
899 -
900 - # opencl stuff
901 - emesonargs+=(
902 - -Dgallium-opencl="$(usex opencl icd disabled)"
903 - )
904 -
905 - if use vulkan; then
906 - vulkan_enable video_cards_freedreno freedreno
907 - vulkan_enable video_cards_intel intel
908 - vulkan_enable video_cards_radeonsi amd
909 - vulkan_enable video_cards_v3d broadcom
910 - fi
911 -
912 - driver_list() {
913 - local drivers="$(sort -u <<< "${1// /$'\n'}")"
914 - echo "${drivers//$'\n'/,}"
915 - }
916 -
917 - local vulkan_layers
918 - use vulkan && vulkan_layers+="device-select"
919 - use vulkan-overlay && vulkan_layers+=",overlay"
920 - emesonargs+=(-Dvulkan-layers=${vulkan_layers#,})
921 -
922 - emesonargs+=(
923 - $(meson_use test build-tests)
924 - -Dglx=$(usex X dri disabled)
925 - -Dshared-glapi=enabled
926 - -Ddri3=enabled
927 - -Degl=enabled
928 - -Dgbm=enabled
929 - -Dglvnd=true
930 - $(meson_feature gles1)
931 - $(meson_feature gles2)
932 - $(meson_feature llvm)
933 - $(meson_feature lm-sensors lmsensors)
934 - $(meson_use osmesa)
935 - $(meson_use selinux)
936 - $(meson_feature unwind libunwind)
937 - $(meson_feature zstd)
938 - $(meson_use cpu_flags_x86_sse2 sse2)
939 - -Dvalgrind=$(usex valgrind auto disabled)
940 - -Dgallium-drivers=$(driver_list "${GALLIUM_DRIVERS[*]}")
941 - -Dvulkan-drivers=$(driver_list "${VULKAN_DRIVERS[*]}")
942 - --buildtype $(usex debug debug plain)
943 - -Db_ndebug=$(usex debug false true)
944 - )
945 - meson_src_configure
946 -}
947 -
948 -multilib_src_test() {
949 - meson_src_test -t 100
950 -}
951 -
952 -# $1 - VIDEO_CARDS flag (check skipped for "--")
953 -# other args - names of DRI drivers to enable
954 -gallium_enable() {
955 - if [[ $1 == -- ]] || use $1; then
956 - shift
957 - GALLIUM_DRIVERS+=("$@")
958 - fi
959 -}
960 -
961 -vulkan_enable() {
962 - if [[ $1 == -- ]] || use $1; then
963 - shift
964 - VULKAN_DRIVERS+=("$@")
965 - fi
966 -}