From 6abbf81ef2f298e3221ff5e67a1f3c5f23958212 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 14 Dec 2020 13:26:14 +0000 Subject: gentoo resync : 14.12.2020 --- media-libs/mesa/Manifest | 8 +- media-libs/mesa/mesa-20.2.4.ebuild | 556 ++++++++++++++++++++++++++++++++ media-libs/mesa/mesa-20.3.0.ebuild | 558 +++++++++++++++++++++++++++++++++ media-libs/mesa/mesa-20.3.0_rc2.ebuild | 553 -------------------------------- media-libs/mesa/mesa-9999.ebuild | 27 +- 5 files changed, 1135 insertions(+), 567 deletions(-) create mode 100644 media-libs/mesa/mesa-20.2.4.ebuild create mode 100644 media-libs/mesa/mesa-20.3.0.ebuild delete mode 100644 media-libs/mesa/mesa-20.3.0_rc2.ebuild (limited to 'media-libs/mesa') diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest index 2de53c2f36aa..592f492ad419 100644 --- a/media-libs/mesa/Manifest +++ b/media-libs/mesa/Manifest @@ -1,8 +1,10 @@ DIST mesa-20.1.10.tar.xz 12918420 BLAKE2B 408f4bc6eb0dc11199cd161d6914b77cb57313bca94f26794cbfd05332922c45dc216a64e33df9fad64cd41e1ad8b2de6c2e5f99cad234870f7a5b970a62dcbd SHA512 0d4016abfcc733c853d7b6c3c997ddc554a44088c0a4d9a7edb51ab5ad7d9e1234728b61ffcb9c82a6c5fee1429091a1c31cbeabcb1b50411337b99ee550d28a DIST mesa-20.2.3.tar.xz 13844212 BLAKE2B 53eff6d43d2e05dad051c30de624bd8d872e87d6f1d2f32b631b1c4fea657b8dd9b2d5b9702bdd9138b0d9d6c78b74d737162d3f1c76ca969ce6d9ae4f561eda SHA512 e55b57523f6fdb1199586538c119c3e7c81d1a7af86be14c90d140c514f65e54ac0c56bd341686d04b770b80d3ddd92188ee17b3bc23f243aed10c25de7e19a6 -DIST mesa-20.3.0-rc2.tar.xz 14085024 BLAKE2B c87e3e48ed1dfec2da4fa6bbb549fc925d806f8681e8dc1b3fc3b54eec4864402bb34009a95998c1fc818ddb7d1df2d51347df3d20ec9e4364245ae4f750f16d SHA512 1d94100550b60a0dc6e984d898114b11b8656e2954e946478a2732cec678d1e6a0f07bb5bcdc856facf7e274aea52cfc2b4228c064eadc7bbc00147c6b17cc0e +DIST mesa-20.2.4.tar.xz 13869928 BLAKE2B 078dc88be08d3b41d5144c4d72b0044512dc77c7afcbc6366dc7b9d435886afc65009277b215f6e2898cef98a7c52fb232d8b36bd6e6d1114326302d5acc9216 SHA512 e60decb867a3ca08b99e72aa62db8c5515696bf4a9e2642c1703479167a79b0828192f6dcca688263f5786cd524308a4410e47111fa7b97c091473e4ac4ee799 +DIST mesa-20.3.0.tar.xz 14158932 BLAKE2B 13aa0829691b8cb37eafb913a9fd396637022aafe93c6c40af0c0cd3a179d75fb33c2379420bc94940d82885fb1ea3f26a832ed97b3ae842a334aa8ed1407d31 SHA512 69ee0bc1e7a69a519597dd55f4d601f35fe51ed6687d6f6beff6aef3da8d82de932220305fc187e06a52aaf0073d434a6e3458619c767b9b7932464a2cbb2cf2 EBUILD mesa-20.1.10.ebuild 14439 BLAKE2B 44180101e4e4c6692661cae16822ed29e292e86821df1361e733839bceeb8353883e5aff3893a91f5e09936aa8e5c0d2d14f8871f558c24590e61b78c6e8716a SHA512 d4474ce10d3cab18cc75ff5c0b9cfe2d05e0987e9c20a2a01ce2cf9873fac0b8e259fad1196327cf3426406e0a338ed326ff9309439af93403f458b104f0fde7 EBUILD mesa-20.2.3.ebuild 14709 BLAKE2B f32b8f3f99197ad5e7a16393929ddccb1b6fb650dcf413587a74a497531b94ea7c3ba2f0490a32b37729e33271d100e52fa480c8b6422742a16e9ddb9d756911 SHA512 5223621eaf05a7f2b7500b8f31c1b0cf0a68b729c00a57527e741eb353aa57c65e1abffeb552bedf70012338beb7d49efdadd4847626cfbabbc89f59938dc5f2 -EBUILD mesa-20.3.0_rc2.ebuild 14785 BLAKE2B 13affc84aea9015a935438268bb2b71a5751026ad6cb903b37ad6ee52cc449129835a21231597b7f75227381bb90ecb4ec5f54bc272da98130e59642d51110dc SHA512 bc70799ecbcb81ed135354fcdca48f1fe50c35ebbbc0c48d162a70c9d700f7db49ec054dc5266dedeee0cc98d49e16f8a3486f5f50c5651b8344a17aa2509a0c -EBUILD mesa-9999.ebuild 14785 BLAKE2B 13affc84aea9015a935438268bb2b71a5751026ad6cb903b37ad6ee52cc449129835a21231597b7f75227381bb90ecb4ec5f54bc272da98130e59642d51110dc SHA512 bc70799ecbcb81ed135354fcdca48f1fe50c35ebbbc0c48d162a70c9d700f7db49ec054dc5266dedeee0cc98d49e16f8a3486f5f50c5651b8344a17aa2509a0c +EBUILD mesa-20.2.4.ebuild 14790 BLAKE2B 9ca2d00b39d3bb307ac2cc68ac3b531c2413e44dd902a6510c2b8dacbf8da09765129519e2d36e8e5972315b4b2c740402a5558775d8d22b7af63710fc54b0ac SHA512 f0852f53d8810d89ad2f84d4f6d49a749305a8ae120c9d06fa4cf7258dbf0630d74fd60074f53ec871bb658ba5d78ebcd90006c72be5706a7c156a2a1a13555b +EBUILD mesa-20.3.0.ebuild 14877 BLAKE2B daf969be2dc77ab4d88c1656d01ce244b326aa4462836e3b8ab1402febb677100850ddec1b89c0e025cf3b0af582bf220b4f5f3cc7212fbf38677e2a79440435 SHA512 45e9652f9c8965f35bab368d2332a5aae72b93d5ceb44425bbc0b6781bc1f622f5f8bc79914170869490f896746dabf079a099feade2343928abfd6a6104bfe0 +EBUILD mesa-9999.ebuild 14818 BLAKE2B d196d517ea52bc878e43e96efb814f8a03a3b69746b4a6b134933c0efb5dc047909975f7bfc90882ba3b0148d09526e0992d56b8fde1dfbbab551c883dda730a SHA512 6008aac202f6b54914b637be9f6c4d25203579beb5f947b63fbd96c5b216eec58d9bd69343f913368dbe19193f2a7d0a99a4fd7d68e511f1cf096f89eeb08396 MISC metadata.xml 1895 BLAKE2B abf62dda9b9eba657e310c68fdd86aaa49c550dc34ef624e8feb038e0412f0da786e1120dc16631399cb2c83961b88e78571347c3e6d464c2cf3a343bc0f1483 SHA512 7758641386100e07c1112afe04a8613de8ae1e35a8e940f0eefcfc7daa829789c42b903320339b04b44c2400f0857c180740407abd171e9773a9f51e3dd9468a diff --git a/media-libs/mesa/mesa-20.2.4.ebuild b/media-libs/mesa/mesa-20.2.4.ebuild new file mode 100644 index 000000000000..9c506a4c2497 --- /dev/null +++ b/media-libs/mesa/mesa-20.2.4.ebuild @@ -0,0 +1,556 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{6,7,8,9} ) + +inherit llvm meson multilib-minimal python-any-r1 linux-info + +OPENGL_DIR="xorg-x11" + +MY_P="${P/_/-}" + +DESCRIPTION="OpenGL-like graphic library for Linux" +HOMEPAGE="https://www.mesa3d.org/ https://mesa.freedesktop.org/" + +if [[ ${PV} == 9999 ]]; then + EGIT_REPO_URI="https://gitlab.freedesktop.org/mesa/mesa.git" + inherit git-r3 +else + SRC_URI="https://archive.mesa3d.org/${MY_P}.tar.xz" + KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ~ppc ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris" +fi + +LICENSE="MIT" +SLOT="0" +RESTRICT=" + !test? ( test ) +" + +RADEON_CARDS="r100 r200 r300 r600 radeon radeonsi" +VIDEO_CARDS="${RADEON_CARDS} freedreno i915 i965 intel iris lima nouveau panfrost v3d vc4 virgl vivante vmware" +for card in ${VIDEO_CARDS}; do + IUSE_VIDEO_CARDS+=" video_cards_${card}" +done + +IUSE="${IUSE_VIDEO_CARDS} + +classic d3d9 debug +dri3 +egl +gallium +gbm gles1 +gles2 +llvm + lm-sensors opencl osmesa selinux test unwind vaapi valgrind vdpau vulkan + vulkan-overlay wayland +X xa xvmc zink +zstd" + +REQUIRED_USE=" + d3d9? ( dri3 || ( video_cards_iris video_cards_r300 video_cards_r600 video_cards_radeonsi video_cards_nouveau video_cards_vmware ) ) + gles1? ( egl ) + gles2? ( egl ) + vulkan? ( dri3 + video_cards_radeonsi? ( llvm ) ) + vulkan-overlay? ( vulkan ) + wayland? ( egl gbm ) + video_cards_freedreno? ( gallium ) + video_cards_intel? ( classic ) + video_cards_i915? ( || ( classic gallium ) ) + video_cards_i965? ( classic ) + video_cards_iris? ( gallium ) + video_cards_lima? ( gallium ) + video_cards_nouveau? ( || ( classic gallium ) ) + video_cards_panfrost? ( gallium ) + video_cards_radeon? ( || ( classic gallium ) + gallium? ( x86? ( llvm ) amd64? ( llvm ) ) ) + video_cards_r100? ( classic ) + video_cards_r200? ( classic ) + video_cards_r300? ( gallium x86? ( llvm ) amd64? ( llvm ) ) + video_cards_r600? ( gallium ) + video_cards_radeonsi? ( gallium llvm ) + video_cards_v3d? ( gallium ) + video_cards_vc4? ( gallium ) + video_cards_virgl? ( gallium ) + video_cards_vivante? ( gallium gbm ) + video_cards_vmware? ( gallium ) + xa? ( X ) + xvmc? ( X ) + zink? ( gallium vulkan ) +" + +LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.100" +RDEPEND=" + >=dev-libs/expat-2.1.0-r3:=[${MULTILIB_USEDEP}] + >=media-libs/libglvnd-1.3.2[X?,${MULTILIB_USEDEP}] + >=sys-libs/zlib-1.2.8[${MULTILIB_USEDEP}] + gallium? ( + unwind? ( sys-libs/libunwind[${MULTILIB_USEDEP}] ) + llvm? ( + video_cards_radeonsi? ( + virtual/libelf:0=[${MULTILIB_USEDEP}] + ) + video_cards_r600? ( + virtual/libelf:0=[${MULTILIB_USEDEP}] + ) + video_cards_radeon? ( + virtual/libelf:0=[${MULTILIB_USEDEP}] + ) + ) + lm-sensors? ( sys-apps/lm-sensors:=[${MULTILIB_USEDEP}] ) + opencl? ( + >=virtual/opencl-3[${MULTILIB_USEDEP}] + dev-libs/libclc + virtual/libelf:0=[${MULTILIB_USEDEP}] + ) + vaapi? ( + >=x11-libs/libva-1.7.3:=[${MULTILIB_USEDEP}] + ) + vdpau? ( >=x11-libs/libvdpau-1.1:=[${MULTILIB_USEDEP}] ) + xvmc? ( >=x11-libs/libXvMC-1.0.8:=[${MULTILIB_USEDEP}] ) + ) + selinux? ( sys-libs/libselinux[${MULTILIB_USEDEP}] ) + wayland? ( + >=dev-libs/wayland-1.15.0:=[${MULTILIB_USEDEP}] + >=dev-libs/wayland-protocols-1.8 + ) + ${LIBDRM_DEPSTRING}[video_cards_freedreno?,video_cards_nouveau?,video_cards_vc4?,video_cards_vivante?,video_cards_vmware?,${MULTILIB_USEDEP}] + video_cards_intel? ( + !video_cards_i965? ( ${LIBDRM_DEPSTRING}[video_cards_intel] ) + ) + video_cards_i915? ( ${LIBDRM_DEPSTRING}[video_cards_intel] ) + vulkan-overlay? ( dev-util/glslang:0=[${MULTILIB_USEDEP}] ) + X? ( + >=x11-libs/libX11-1.6.2:=[${MULTILIB_USEDEP}] + >=x11-libs/libxshmfence-1.1:=[${MULTILIB_USEDEP}] + >=x11-libs/libXdamage-1.1.4-r1:=[${MULTILIB_USEDEP}] + >=x11-libs/libXext-1.3.2:=[${MULTILIB_USEDEP}] + >=x11-libs/libXxf86vm-1.1.3:=[${MULTILIB_USEDEP}] + >=x11-libs/libxcb-1.13:=[${MULTILIB_USEDEP}] + x11-libs/libXfixes:=[${MULTILIB_USEDEP}] + ) + zink? ( media-libs/vulkan-loader:=[${MULTILIB_USEDEP}] ) + zstd? ( app-arch/zstd:=[${MULTILIB_USEDEP}] ) +" +for card in ${RADEON_CARDS}; do + RDEPEND="${RDEPEND} + video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_radeon] ) + " +done +RDEPEND="${RDEPEND} + video_cards_radeonsi? ( ${LIBDRM_DEPSTRING}[video_cards_amdgpu] ) +" + +# Please keep the LLVM dependency block separate. Since LLVM is slotted, +# we need to *really* make sure we're not pulling one than more slot +# simultaneously. +# +# How to use it: +# 1. List all the working slots (with min versions) in ||, newest first. +# 2. Update the := to specify *max* version, e.g. < 10. +# 3. Specify LLVM_MAX_SLOT, e.g. 9. +LLVM_MAX_SLOT="11" +LLVM_DEPSTR=" + || ( + sys-devel/llvm:11[${MULTILIB_USEDEP}] + sys-devel/llvm:10[${MULTILIB_USEDEP}] + sys-devel/llvm:9[${MULTILIB_USEDEP}] + ) + =dev-python/mako-0.8.0[\${PYTHON_USEDEP}]") +" + +S="${WORKDIR}/${MY_P}" +EGIT_CHECKOUT_DIR=${S} + +QA_WX_LOAD=" +x86? ( + usr/lib*/libglapi.so.0.0.0 + usr/lib*/libGLESv1_CM.so.1.1.0 + usr/lib*/libGLESv2.so.2.0.0 + usr/lib*/libGL.so.1.2.0 + usr/lib*/libOSMesa.so.8.0.0 + usr/lib/libGLX_mesa.so.0.0.0 +)" + +llvm_check_deps() { + local flags=${MULTILIB_USEDEP} + if use video_cards_r600 || use video_cards_radeon || use video_cards_radeonsi + then + flags+=",llvm_targets_AMDGPU(-)" + fi + + if use opencl; then + has_version "sys-devel/clang:${LLVM_SLOT}[${flags}]" || return 1 + fi + has_version "sys-devel/llvm:${LLVM_SLOT}[${flags}]" +} + +pkg_pretend() { + if use vulkan; then + if ! use video_cards_i965 && + ! use video_cards_iris && + ! use video_cards_radeonsi; then + ewarn "Ignoring USE=vulkan since VIDEO_CARDS does not contain i965, iris, or radeonsi" + fi + fi + + if use opencl; then + if ! use video_cards_r600 && + ! use video_cards_radeonsi; then + ewarn "Ignoring USE=opencl since VIDEO_CARDS does not contain r600 or radeonsi" + fi + fi + + if use vaapi; then + if ! use video_cards_r600 && + ! use video_cards_radeonsi && + ! use video_cards_nouveau; then + ewarn "Ignoring USE=vaapi since VIDEO_CARDS does not contain r600, radeonsi, or nouveau" + fi + fi + + if use vdpau; then + if ! use video_cards_r300 && + ! use video_cards_r600 && + ! use video_cards_radeonsi && + ! use video_cards_nouveau; then + ewarn "Ignoring USE=vdpau since VIDEO_CARDS does not contain r300, r600, radeonsi, or nouveau" + fi + fi + + if use xa; then + if ! use video_cards_freedreno && + ! use video_cards_nouveau && + ! use video_cards_vmware; then + ewarn "Ignoring USE=xa since VIDEO_CARDS does not contain freedreno, nouveau, or vmware" + fi + fi + + if use xvmc; then + if ! use video_cards_r600 && + ! use video_cards_nouveau; then + ewarn "Ignoring USE=xvmc since VIDEO_CARDS does not contain r600 or nouveau" + fi + fi + + if ! use gallium; then + use lm-sensors && ewarn "Ignoring USE=lm-sensors since USE does not contain gallium" + use llvm && ewarn "Ignoring USE=llvm since USE does not contain gallium" + use opencl && ewarn "Ignoring USE=opencl since USE does not contain gallium" + use vaapi && ewarn "Ignoring USE=vaapi since USE does not contain gallium" + use vdpau && ewarn "Ignoring USE=vdpau since USE does not contain gallium" + use unwind && ewarn "Ignoring USE=unwind since USE does not contain gallium" + use xa && ewarn "Ignoring USE=xa since USE does not contain gallium" + use xvmc && ewarn "Ignoring USE=xvmc since USE does not contain gallium" + fi + + if ! use llvm; then + use opencl && ewarn "Ignoring USE=opencl since USE does not contain llvm" + fi +} + +python_check_deps() { + has_version -b ">=dev-python/mako-0.8.0[${PYTHON_USEDEP}]" +} + +pkg_setup() { + # warning message for bug 459306 + if use llvm && has_version sys-devel/llvm[!debug=]; then + ewarn "Mismatch between debug USE flags in media-libs/mesa and sys-devel/llvm" + ewarn "detected! This can cause problems. For details, see bug 459306." + fi + + if use video_cards_i965 || + use video_cards_iris || + use video_cards_radeonsi; then + CONFIG_CHECK="~CHECKPOINT_RESTORE" + linux-info_pkg_setup + fi + + if use gallium && use llvm; then + llvm_pkg_setup + fi + python-any-r1_pkg_setup +} + +multilib_src_configure() { + local emesonargs=() + + if use classic; then + # Intel code + dri_driver_enable video_cards_i915 i915 + dri_driver_enable video_cards_i965 i965 + if ! use video_cards_i915 && \ + ! use video_cards_i965; then + dri_driver_enable video_cards_intel i915 i965 + fi + + # Nouveau code + dri_driver_enable video_cards_nouveau nouveau + + # ATI code + dri_driver_enable video_cards_r100 r100 + dri_driver_enable video_cards_r200 r200 + if ! use video_cards_r100 && \ + ! use video_cards_r200; then + dri_driver_enable video_cards_radeon r100 r200 + fi + fi + + local platforms + use X && platforms+="x11" + use wayland && platforms+=",wayland" + [[ -n $platforms ]] && emesonargs+=(-Dplatforms=${platforms#,}) + + if use X || use egl; then + emesonargs+=(-Dglvnd=true) + else + emesonargs+=(-Dglvnd=false) + fi + + if use gallium; then + emesonargs+=( + $(meson_feature llvm) + $(meson_feature lm-sensors lmsensors) + $(meson_feature unwind libunwind) + ) + + if use video_cards_iris || + use video_cards_r300 || + use video_cards_r600 || + use video_cards_radeonsi || + use video_cards_nouveau || + use video_cards_vmware; then + emesonargs+=($(meson_use d3d9 gallium-nine)) + else + emesonargs+=(-Dgallium-nine=false) + fi + + if use video_cards_r600 || + use video_cards_radeonsi || + use video_cards_nouveau; then + emesonargs+=($(meson_feature vaapi gallium-va)) + use vaapi && emesonargs+=( -Dva-libs-path="${EPREFIX}"/usr/$(get_libdir)/va/drivers ) + else + emesonargs+=(-Dgallium-va=disabled) + fi + + if use video_cards_r300 || + use video_cards_r600 || + use video_cards_radeonsi || + use video_cards_nouveau; then + emesonargs+=($(meson_feature vdpau gallium-vdpau)) + else + emesonargs+=(-Dgallium-vdpau=disabled) + fi + + if use video_cards_freedreno || + use video_cards_nouveau || + use video_cards_vmware; then + emesonargs+=($(meson_feature xa gallium-xa)) + else + emesonargs+=(-Dgallium-xa=disabled) + fi + + if use video_cards_r600 || + use video_cards_nouveau; then + emesonargs+=($(meson_feature xvmc gallium-xvmc)) + else + emesonargs+=(-Dgallium-xvmc=disabled) + fi + + if use video_cards_freedreno || + use video_cards_lima || + use video_cards_panfrost || + use video_cards_v3d || + use video_cards_vc4 || + use video_cards_vivante; then + gallium_enable -- kmsro + fi + + gallium_enable video_cards_lima lima + gallium_enable video_cards_panfrost panfrost + gallium_enable video_cards_v3d v3d + gallium_enable video_cards_vc4 vc4 + gallium_enable video_cards_vivante etnaviv + gallium_enable video_cards_vmware svga + gallium_enable video_cards_nouveau nouveau + gallium_enable zink zink + + # Only one i915 driver (classic vs gallium). Default to classic. + if ! use classic; then + gallium_enable video_cards_i915 i915 + if ! use video_cards_i915 && \ + ! use video_cards_i965; then + gallium_enable video_cards_intel i915 + fi + fi + + gallium_enable video_cards_iris iris + + gallium_enable video_cards_r300 r300 + gallium_enable video_cards_r600 r600 + gallium_enable video_cards_radeonsi radeonsi + if ! use video_cards_r300 && \ + ! use video_cards_r600; then + gallium_enable video_cards_radeon r300 r600 + fi + + gallium_enable video_cards_freedreno freedreno + gallium_enable video_cards_virgl virgl + + # opencl stuff + emesonargs+=( + -Dgallium-opencl="$(usex opencl icd disabled)" + ) + fi + + if use vulkan; then + vulkan_enable video_cards_i965 intel + vulkan_enable video_cards_iris intel + vulkan_enable video_cards_radeonsi amd + fi + + if use gallium; then + gallium_enable -- swrast + emesonargs+=( -Dosmesa=$(usex osmesa gallium none) ) + else + dri_driver_enable -- swrast + emesonargs+=( -Dosmesa=$(usex osmesa classic none) ) + fi + + driver_list() { + local drivers="$(sort -u <<< "${1// /$'\n'}")" + echo "${drivers//$'\n'/,}" + } + + emesonargs+=( + $(meson_use test build-tests) + -Dglx=$(usex X dri disabled) + -Dshared-glapi=enabled + $(meson_feature dri3) + $(meson_feature egl) + $(meson_feature gbm) + $(meson_feature gles1) + $(meson_feature gles2) + $(meson_use selinux) + $(meson_feature zstd) + -Dvalgrind=$(usex valgrind auto false) + -Ddri-drivers=$(driver_list "${DRI_DRIVERS[*]}") + -Dgallium-drivers=$(driver_list "${GALLIUM_DRIVERS[*]}") + -Dvulkan-drivers=$(driver_list "${VULKAN_DRIVERS[*]}") + $(meson_use vulkan vulkan-device-select-layer) + $(meson_use vulkan-overlay vulkan-overlay-layer) + --buildtype $(usex debug debug plain) + -Db_ndebug=$(usex debug false true) + ) + meson_src_configure +} + +multilib_src_compile() { + meson_src_compile +} + +multilib_src_install() { + meson_src_install +} + +multilib_src_install_all() { + einstalldocs +} + +multilib_src_test() { + meson_src_test -t 100 +} + +# $1 - VIDEO_CARDS flag (check skipped for "--") +# other args - names of DRI drivers to enable +dri_driver_enable() { + if [[ $1 == -- ]] || use $1; then + shift + DRI_DRIVERS+=("$@") + fi +} + +gallium_enable() { + if [[ $1 == -- ]] || use $1; then + shift + GALLIUM_DRIVERS+=("$@") + fi +} + +vulkan_enable() { + if [[ $1 == -- ]] || use $1; then + shift + VULKAN_DRIVERS+=("$@") + fi +} diff --git a/media-libs/mesa/mesa-20.3.0.ebuild b/media-libs/mesa/mesa-20.3.0.ebuild new file mode 100644 index 000000000000..4a9d566b07cd --- /dev/null +++ b/media-libs/mesa/mesa-20.3.0.ebuild @@ -0,0 +1,558 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{6,7,8,9} ) + +inherit llvm meson multilib-minimal python-any-r1 linux-info + +OPENGL_DIR="xorg-x11" + +MY_P="${P/_/-}" + +DESCRIPTION="OpenGL-like graphic library for Linux" +HOMEPAGE="https://www.mesa3d.org/ https://mesa.freedesktop.org/" + +if [[ ${PV} == 9999 ]]; then + EGIT_REPO_URI="https://gitlab.freedesktop.org/mesa/mesa.git" + inherit git-r3 +else + SRC_URI="https://archive.mesa3d.org/${MY_P}.tar.xz" + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris" +fi + +LICENSE="MIT" +SLOT="0" +RESTRICT=" + !test? ( test ) +" + +RADEON_CARDS="r100 r200 r300 r600 radeon radeonsi" +VIDEO_CARDS="${RADEON_CARDS} freedreno i915 i965 intel iris lima nouveau panfrost v3d vc4 virgl vivante vmware" +for card in ${VIDEO_CARDS}; do + IUSE_VIDEO_CARDS+=" video_cards_${card}" +done + +IUSE="${IUSE_VIDEO_CARDS} + +classic d3d9 debug +dri3 +egl +gallium +gbm gles1 +gles2 +llvm + lm-sensors opencl osmesa selinux test unwind vaapi valgrind vdpau vulkan + vulkan-overlay wayland +X xa xvmc zink +zstd" + +REQUIRED_USE=" + d3d9? ( dri3 || ( video_cards_iris video_cards_r300 video_cards_r600 video_cards_radeonsi video_cards_nouveau video_cards_vmware ) ) + gles1? ( egl ) + gles2? ( egl ) + vulkan? ( dri3 + video_cards_radeonsi? ( llvm ) ) + vulkan-overlay? ( vulkan ) + wayland? ( egl gbm ) + video_cards_freedreno? ( gallium ) + video_cards_intel? ( classic ) + video_cards_i915? ( || ( classic gallium ) ) + video_cards_i965? ( classic ) + video_cards_iris? ( gallium ) + video_cards_lima? ( gallium ) + video_cards_nouveau? ( || ( classic gallium ) ) + video_cards_panfrost? ( gallium ) + video_cards_radeon? ( || ( classic gallium ) + gallium? ( x86? ( llvm ) amd64? ( llvm ) ) ) + video_cards_r100? ( classic ) + video_cards_r200? ( classic ) + video_cards_r300? ( gallium x86? ( llvm ) amd64? ( llvm ) ) + video_cards_r600? ( gallium ) + video_cards_radeonsi? ( gallium llvm ) + video_cards_v3d? ( gallium ) + video_cards_vc4? ( gallium ) + video_cards_virgl? ( gallium ) + video_cards_vivante? ( gallium gbm ) + video_cards_vmware? ( gallium ) + xa? ( X ) + xvmc? ( X ) + zink? ( gallium vulkan ) +" + +LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.100" +RDEPEND=" + >=dev-libs/expat-2.1.0-r3:=[${MULTILIB_USEDEP}] + >=media-libs/libglvnd-1.3.2[X?,${MULTILIB_USEDEP}] + >=sys-libs/zlib-1.2.8[${MULTILIB_USEDEP}] + gallium? ( + unwind? ( sys-libs/libunwind[${MULTILIB_USEDEP}] ) + llvm? ( + video_cards_radeonsi? ( + virtual/libelf:0=[${MULTILIB_USEDEP}] + ) + video_cards_r600? ( + virtual/libelf:0=[${MULTILIB_USEDEP}] + ) + video_cards_radeon? ( + virtual/libelf:0=[${MULTILIB_USEDEP}] + ) + ) + lm-sensors? ( sys-apps/lm-sensors:=[${MULTILIB_USEDEP}] ) + opencl? ( + >=virtual/opencl-3[${MULTILIB_USEDEP}] + dev-libs/libclc + virtual/libelf:0=[${MULTILIB_USEDEP}] + ) + vaapi? ( + >=x11-libs/libva-1.7.3:=[${MULTILIB_USEDEP}] + ) + vdpau? ( >=x11-libs/libvdpau-1.1:=[${MULTILIB_USEDEP}] ) + xvmc? ( >=x11-libs/libXvMC-1.0.8:=[${MULTILIB_USEDEP}] ) + ) + selinux? ( sys-libs/libselinux[${MULTILIB_USEDEP}] ) + wayland? ( + >=dev-libs/wayland-1.15.0:=[${MULTILIB_USEDEP}] + >=dev-libs/wayland-protocols-1.8 + ) + ${LIBDRM_DEPSTRING}[video_cards_freedreno?,video_cards_nouveau?,video_cards_vc4?,video_cards_vivante?,video_cards_vmware?,${MULTILIB_USEDEP}] + video_cards_intel? ( + !video_cards_i965? ( ${LIBDRM_DEPSTRING}[video_cards_intel] ) + ) + video_cards_i915? ( ${LIBDRM_DEPSTRING}[video_cards_intel] ) + vulkan-overlay? ( dev-util/glslang:0=[${MULTILIB_USEDEP}] ) + X? ( + >=x11-libs/libX11-1.6.2:=[${MULTILIB_USEDEP}] + >=x11-libs/libxshmfence-1.1:=[${MULTILIB_USEDEP}] + >=x11-libs/libXdamage-1.1.4-r1:=[${MULTILIB_USEDEP}] + >=x11-libs/libXext-1.3.2:=[${MULTILIB_USEDEP}] + >=x11-libs/libXxf86vm-1.1.3:=[${MULTILIB_USEDEP}] + >=x11-libs/libxcb-1.13:=[${MULTILIB_USEDEP}] + x11-libs/libXfixes:=[${MULTILIB_USEDEP}] + ) + zink? ( media-libs/vulkan-loader:=[${MULTILIB_USEDEP}] ) + zstd? ( app-arch/zstd:=[${MULTILIB_USEDEP}] ) +" +for card in ${RADEON_CARDS}; do + RDEPEND="${RDEPEND} + video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_radeon] ) + " +done +RDEPEND="${RDEPEND} + video_cards_radeonsi? ( ${LIBDRM_DEPSTRING}[video_cards_amdgpu] ) +" + +# Please keep the LLVM dependency block separate. Since LLVM is slotted, +# we need to *really* make sure we're not pulling one than more slot +# simultaneously. +# +# How to use it: +# 1. List all the working slots (with min versions) in ||, newest first. +# 2. Update the := to specify *max* version, e.g. < 10. +# 3. Specify LLVM_MAX_SLOT, e.g. 9. +LLVM_MAX_SLOT="11" +LLVM_DEPSTR=" + || ( + sys-devel/llvm:11[${MULTILIB_USEDEP}] + sys-devel/llvm:10[${MULTILIB_USEDEP}] + sys-devel/llvm:9[${MULTILIB_USEDEP}] + ) + =dev-python/mako-0.8.0[\${PYTHON_USEDEP}]") +" + +S="${WORKDIR}/${MY_P}" +EGIT_CHECKOUT_DIR=${S} + +QA_WX_LOAD=" +x86? ( + usr/lib*/libglapi.so.0.0.0 + usr/lib*/libGLESv1_CM.so.1.1.0 + usr/lib*/libGLESv2.so.2.0.0 + usr/lib*/libGL.so.1.2.0 + usr/lib*/libOSMesa.so.8.0.0 + usr/lib/libGLX_mesa.so.0.0.0 +)" + +llvm_check_deps() { + local flags=${MULTILIB_USEDEP} + if use video_cards_r600 || use video_cards_radeon || use video_cards_radeonsi + then + flags+=",llvm_targets_AMDGPU(-)" + fi + + if use opencl; then + has_version "sys-devel/clang:${LLVM_SLOT}[${flags}]" || return 1 + fi + has_version "sys-devel/llvm:${LLVM_SLOT}[${flags}]" +} + +pkg_pretend() { + if use vulkan; then + if ! use video_cards_i965 && + ! use video_cards_iris && + ! use video_cards_radeonsi && + ! use video_cards_v3d; then + ewarn "Ignoring USE=vulkan since VIDEO_CARDS does not contain i965, iris, radeonsi, or v3d" + fi + fi + + if use opencl; then + if ! use video_cards_r600 && + ! use video_cards_radeonsi; then + ewarn "Ignoring USE=opencl since VIDEO_CARDS does not contain r600 or radeonsi" + fi + fi + + if use vaapi; then + if ! use video_cards_r600 && + ! use video_cards_radeonsi && + ! use video_cards_nouveau; then + ewarn "Ignoring USE=vaapi since VIDEO_CARDS does not contain r600, radeonsi, or nouveau" + fi + fi + + if use vdpau; then + if ! use video_cards_r300 && + ! use video_cards_r600 && + ! use video_cards_radeonsi && + ! use video_cards_nouveau; then + ewarn "Ignoring USE=vdpau since VIDEO_CARDS does not contain r300, r600, radeonsi, or nouveau" + fi + fi + + if use xa; then + if ! use video_cards_freedreno && + ! use video_cards_nouveau && + ! use video_cards_vmware; then + ewarn "Ignoring USE=xa since VIDEO_CARDS does not contain freedreno, nouveau, or vmware" + fi + fi + + if use xvmc; then + if ! use video_cards_r600 && + ! use video_cards_nouveau; then + ewarn "Ignoring USE=xvmc since VIDEO_CARDS does not contain r600 or nouveau" + fi + fi + + if ! use gallium; then + use lm-sensors && ewarn "Ignoring USE=lm-sensors since USE does not contain gallium" + use llvm && ewarn "Ignoring USE=llvm since USE does not contain gallium" + use opencl && ewarn "Ignoring USE=opencl since USE does not contain gallium" + use vaapi && ewarn "Ignoring USE=vaapi since USE does not contain gallium" + use vdpau && ewarn "Ignoring USE=vdpau since USE does not contain gallium" + use unwind && ewarn "Ignoring USE=unwind since USE does not contain gallium" + use xa && ewarn "Ignoring USE=xa since USE does not contain gallium" + use xvmc && ewarn "Ignoring USE=xvmc since USE does not contain gallium" + fi + + if ! use llvm; then + use opencl && ewarn "Ignoring USE=opencl since USE does not contain llvm" + fi +} + +python_check_deps() { + has_version -b ">=dev-python/mako-0.8.0[${PYTHON_USEDEP}]" +} + +pkg_setup() { + # warning message for bug 459306 + if use llvm && has_version sys-devel/llvm[!debug=]; then + ewarn "Mismatch between debug USE flags in media-libs/mesa and sys-devel/llvm" + ewarn "detected! This can cause problems. For details, see bug 459306." + fi + + if use video_cards_i965 || + use video_cards_iris || + use video_cards_radeonsi; then + CONFIG_CHECK="~CHECKPOINT_RESTORE" + linux-info_pkg_setup + fi + + if use gallium && use llvm; then + llvm_pkg_setup + fi + python-any-r1_pkg_setup +} + +multilib_src_configure() { + local emesonargs=() + + if use classic; then + # Intel code + dri_driver_enable video_cards_i915 i915 + dri_driver_enable video_cards_i965 i965 + if ! use video_cards_i915 && \ + ! use video_cards_i965; then + dri_driver_enable video_cards_intel i915 i965 + fi + + # Nouveau code + dri_driver_enable video_cards_nouveau nouveau + + # ATI code + dri_driver_enable video_cards_r100 r100 + dri_driver_enable video_cards_r200 r200 + if ! use video_cards_r100 && \ + ! use video_cards_r200; then + dri_driver_enable video_cards_radeon r100 r200 + fi + fi + + local platforms + use X && platforms+="x11" + use wayland && platforms+=",wayland" + [[ -n $platforms ]] && emesonargs+=(-Dplatforms=${platforms#,}) + + if use X || use egl; then + emesonargs+=(-Dglvnd=true) + else + emesonargs+=(-Dglvnd=false) + fi + + if use gallium; then + emesonargs+=( + $(meson_feature llvm) + $(meson_feature lm-sensors lmsensors) + $(meson_feature unwind libunwind) + ) + + if use video_cards_iris || + use video_cards_r300 || + use video_cards_r600 || + use video_cards_radeonsi || + use video_cards_nouveau || + use video_cards_vmware; then + emesonargs+=($(meson_use d3d9 gallium-nine)) + else + emesonargs+=(-Dgallium-nine=false) + fi + + if use video_cards_r600 || + use video_cards_radeonsi || + use video_cards_nouveau; then + emesonargs+=($(meson_feature vaapi gallium-va)) + use vaapi && emesonargs+=( -Dva-libs-path="${EPREFIX}"/usr/$(get_libdir)/va/drivers ) + else + emesonargs+=(-Dgallium-va=disabled) + fi + + if use video_cards_r300 || + use video_cards_r600 || + use video_cards_radeonsi || + use video_cards_nouveau; then + emesonargs+=($(meson_feature vdpau gallium-vdpau)) + else + emesonargs+=(-Dgallium-vdpau=disabled) + fi + + if use video_cards_freedreno || + use video_cards_nouveau || + use video_cards_vmware; then + emesonargs+=($(meson_feature xa gallium-xa)) + else + emesonargs+=(-Dgallium-xa=disabled) + fi + + if use video_cards_r600 || + use video_cards_nouveau; then + emesonargs+=($(meson_feature xvmc gallium-xvmc)) + else + emesonargs+=(-Dgallium-xvmc=disabled) + fi + + if use video_cards_freedreno || + use video_cards_lima || + use video_cards_panfrost || + use video_cards_v3d || + use video_cards_vc4 || + use video_cards_vivante; then + gallium_enable -- kmsro + fi + + gallium_enable video_cards_lima lima + gallium_enable video_cards_panfrost panfrost + gallium_enable video_cards_v3d v3d + gallium_enable video_cards_vc4 vc4 + gallium_enable video_cards_vivante etnaviv + gallium_enable video_cards_vmware svga + gallium_enable video_cards_nouveau nouveau + gallium_enable zink zink + + # Only one i915 driver (classic vs gallium). Default to classic. + if ! use classic; then + gallium_enable video_cards_i915 i915 + if ! use video_cards_i915 && \ + ! use video_cards_i965; then + gallium_enable video_cards_intel i915 + fi + fi + + gallium_enable video_cards_iris iris + + gallium_enable video_cards_r300 r300 + gallium_enable video_cards_r600 r600 + gallium_enable video_cards_radeonsi radeonsi + if ! use video_cards_r300 && \ + ! use video_cards_r600; then + gallium_enable video_cards_radeon r300 r600 + fi + + gallium_enable video_cards_freedreno freedreno + gallium_enable video_cards_virgl virgl + + # opencl stuff + emesonargs+=( + -Dgallium-opencl="$(usex opencl icd disabled)" + ) + fi + + if use vulkan; then + vulkan_enable video_cards_i965 intel + vulkan_enable video_cards_iris intel + vulkan_enable video_cards_radeonsi amd + vulkan_enable video_cards_v3d broadcom + fi + + if use gallium; then + gallium_enable -- swrast + emesonargs+=( -Dosmesa=$(usex osmesa gallium none) ) + else + dri_driver_enable -- swrast + emesonargs+=( -Dosmesa=$(usex osmesa classic none) ) + fi + + driver_list() { + local drivers="$(sort -u <<< "${1// /$'\n'}")" + echo "${drivers//$'\n'/,}" + } + + emesonargs+=( + $(meson_use test build-tests) + -Dglx=$(usex X dri disabled) + -Dshared-glapi=enabled + $(meson_feature dri3) + $(meson_feature egl) + $(meson_feature gbm) + $(meson_feature gles1) + $(meson_feature gles2) + $(meson_use selinux) + $(meson_feature zstd) + -Dvalgrind=$(usex valgrind auto false) + -Ddri-drivers=$(driver_list "${DRI_DRIVERS[*]}") + -Dgallium-drivers=$(driver_list "${GALLIUM_DRIVERS[*]}") + -Dvulkan-drivers=$(driver_list "${VULKAN_DRIVERS[*]}") + $(meson_use vulkan vulkan-device-select-layer) + $(meson_use vulkan-overlay vulkan-overlay-layer) + --buildtype $(usex debug debug plain) + -Db_ndebug=$(usex debug false true) + ) + meson_src_configure +} + +multilib_src_compile() { + meson_src_compile +} + +multilib_src_install() { + meson_src_install +} + +multilib_src_install_all() { + einstalldocs +} + +multilib_src_test() { + meson_src_test -t 100 +} + +# $1 - VIDEO_CARDS flag (check skipped for "--") +# other args - names of DRI drivers to enable +dri_driver_enable() { + if [[ $1 == -- ]] || use $1; then + shift + DRI_DRIVERS+=("$@") + fi +} + +gallium_enable() { + if [[ $1 == -- ]] || use $1; then + shift + GALLIUM_DRIVERS+=("$@") + fi +} + +vulkan_enable() { + if [[ $1 == -- ]] || use $1; then + shift + VULKAN_DRIVERS+=("$@") + fi +} diff --git a/media-libs/mesa/mesa-20.3.0_rc2.ebuild b/media-libs/mesa/mesa-20.3.0_rc2.ebuild deleted file mode 100644 index 1da56517de7e..000000000000 --- a/media-libs/mesa/mesa-20.3.0_rc2.ebuild +++ /dev/null @@ -1,553 +0,0 @@ -# Copyright 1999-2020 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -PYTHON_COMPAT=( python3_{6,7,8,9} ) - -inherit llvm meson multilib-minimal python-any-r1 linux-info - -OPENGL_DIR="xorg-x11" - -MY_P="${P/_/-}" - -DESCRIPTION="OpenGL-like graphic library for Linux" -HOMEPAGE="https://www.mesa3d.org/ https://mesa.freedesktop.org/" - -if [[ ${PV} == 9999 ]]; then - EGIT_REPO_URI="https://gitlab.freedesktop.org/mesa/mesa.git" - inherit git-r3 -else - SRC_URI="https://archive.mesa3d.org/${MY_P}.tar.xz" - KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris" -fi - -LICENSE="MIT" -SLOT="0" -RESTRICT=" - !test? ( test ) -" - -RADEON_CARDS="r100 r200 r300 r600 radeon radeonsi" -VIDEO_CARDS="${RADEON_CARDS} freedreno i915 i965 intel iris lima nouveau panfrost v3d vc4 virgl vivante vmware" -for card in ${VIDEO_CARDS}; do - IUSE_VIDEO_CARDS+=" video_cards_${card}" -done - -IUSE="${IUSE_VIDEO_CARDS} - +classic d3d9 debug +dri3 +egl +gallium +gbm gles1 +gles2 +llvm - lm-sensors opencl osmesa selinux test unwind vaapi valgrind vdpau vulkan - vulkan-overlay wayland +X xa xvmc zink +zstd" - -REQUIRED_USE=" - d3d9? ( dri3 || ( video_cards_iris video_cards_r300 video_cards_r600 video_cards_radeonsi video_cards_nouveau video_cards_vmware ) ) - gles1? ( egl ) - gles2? ( egl ) - vulkan? ( dri3 - video_cards_radeonsi? ( llvm ) ) - vulkan-overlay? ( vulkan ) - wayland? ( egl gbm ) - video_cards_freedreno? ( gallium ) - video_cards_intel? ( classic ) - video_cards_i915? ( || ( classic gallium ) ) - video_cards_i965? ( classic ) - video_cards_iris? ( gallium ) - video_cards_lima? ( gallium ) - video_cards_nouveau? ( || ( classic gallium ) ) - video_cards_panfrost? ( gallium ) - video_cards_radeon? ( || ( classic gallium ) - gallium? ( x86? ( llvm ) amd64? ( llvm ) ) ) - video_cards_r100? ( classic ) - video_cards_r200? ( classic ) - video_cards_r300? ( gallium x86? ( llvm ) amd64? ( llvm ) ) - video_cards_r600? ( gallium ) - video_cards_radeonsi? ( gallium llvm ) - video_cards_v3d? ( gallium ) - video_cards_vc4? ( gallium ) - video_cards_virgl? ( gallium ) - video_cards_vivante? ( gallium gbm ) - video_cards_vmware? ( gallium ) - xa? ( X ) - xvmc? ( X ) - zink? ( gallium vulkan ) -" - -LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.100" -RDEPEND=" - >=dev-libs/expat-2.1.0-r3:=[${MULTILIB_USEDEP}] - >=media-libs/libglvnd-1.3.2[X?,${MULTILIB_USEDEP}] - >=sys-libs/zlib-1.2.8[${MULTILIB_USEDEP}] - gallium? ( - unwind? ( sys-libs/libunwind[${MULTILIB_USEDEP}] ) - llvm? ( - video_cards_radeonsi? ( - virtual/libelf:0=[${MULTILIB_USEDEP}] - ) - video_cards_r600? ( - virtual/libelf:0=[${MULTILIB_USEDEP}] - ) - video_cards_radeon? ( - virtual/libelf:0=[${MULTILIB_USEDEP}] - ) - ) - lm-sensors? ( sys-apps/lm-sensors:=[${MULTILIB_USEDEP}] ) - opencl? ( - >=virtual/opencl-3[${MULTILIB_USEDEP}] - dev-libs/libclc - virtual/libelf:0=[${MULTILIB_USEDEP}] - ) - vaapi? ( - >=x11-libs/libva-1.7.3:=[${MULTILIB_USEDEP}] - ) - vdpau? ( >=x11-libs/libvdpau-1.1:=[${MULTILIB_USEDEP}] ) - xvmc? ( >=x11-libs/libXvMC-1.0.8:=[${MULTILIB_USEDEP}] ) - ) - selinux? ( sys-libs/libselinux[${MULTILIB_USEDEP}] ) - wayland? ( - >=dev-libs/wayland-1.15.0:=[${MULTILIB_USEDEP}] - >=dev-libs/wayland-protocols-1.8 - ) - ${LIBDRM_DEPSTRING}[video_cards_freedreno?,video_cards_nouveau?,video_cards_vc4?,video_cards_vivante?,video_cards_vmware?,${MULTILIB_USEDEP}] - video_cards_intel? ( - !video_cards_i965? ( ${LIBDRM_DEPSTRING}[video_cards_intel] ) - ) - video_cards_i915? ( ${LIBDRM_DEPSTRING}[video_cards_intel] ) - vulkan-overlay? ( dev-util/glslang:0=[${MULTILIB_USEDEP}] ) - X? ( - >=x11-libs/libX11-1.6.2:=[${MULTILIB_USEDEP}] - >=x11-libs/libxshmfence-1.1:=[${MULTILIB_USEDEP}] - >=x11-libs/libXdamage-1.1.4-r1:=[${MULTILIB_USEDEP}] - >=x11-libs/libXext-1.3.2:=[${MULTILIB_USEDEP}] - >=x11-libs/libXxf86vm-1.1.3:=[${MULTILIB_USEDEP}] - >=x11-libs/libxcb-1.13:=[${MULTILIB_USEDEP}] - x11-libs/libXfixes:=[${MULTILIB_USEDEP}] - ) - zink? ( media-libs/vulkan-loader:=[${MULTILIB_USEDEP}] ) - zstd? ( app-arch/zstd:=[${MULTILIB_USEDEP}] ) -" -for card in ${RADEON_CARDS}; do - RDEPEND="${RDEPEND} - video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_radeon] ) - " -done -RDEPEND="${RDEPEND} - video_cards_radeonsi? ( ${LIBDRM_DEPSTRING}[video_cards_amdgpu] ) -" - -# Please keep the LLVM dependency block separate. Since LLVM is slotted, -# we need to *really* make sure we're not pulling one than more slot -# simultaneously. -# -# How to use it: -# 1. List all the working slots (with min versions) in ||, newest first. -# 2. Update the := to specify *max* version, e.g. < 10. -# 3. Specify LLVM_MAX_SLOT, e.g. 9. -LLVM_MAX_SLOT="11" -LLVM_DEPSTR=" - || ( - sys-devel/llvm:11[${MULTILIB_USEDEP}] - sys-devel/llvm:10[${MULTILIB_USEDEP}] - sys-devel/llvm:9[${MULTILIB_USEDEP}] - ) - =dev-python/mako-0.8.0[\${PYTHON_USEDEP}]") -" - -S="${WORKDIR}/${MY_P}" -EGIT_CHECKOUT_DIR=${S} - -QA_WX_LOAD=" -x86? ( - usr/lib*/libglapi.so.0.0.0 - usr/lib*/libGLESv1_CM.so.1.1.0 - usr/lib*/libGLESv2.so.2.0.0 - usr/lib*/libGL.so.1.2.0 - usr/lib*/libOSMesa.so.8.0.0 - usr/lib/libGLX_mesa.so.0.0.0 -)" - -llvm_check_deps() { - local flags=${MULTILIB_USEDEP} - if use video_cards_r600 || use video_cards_radeon || use video_cards_radeonsi - then - flags+=",llvm_targets_AMDGPU(-)" - fi - - if use opencl; then - has_version "sys-devel/clang:${LLVM_SLOT}[${flags}]" || return 1 - fi - has_version "sys-devel/llvm:${LLVM_SLOT}[${flags}]" -} - -pkg_pretend() { - if use vulkan; then - if ! use video_cards_i965 && - ! use video_cards_iris && - ! use video_cards_radeonsi && - ! use video_cards_v3d; then - ewarn "Ignoring USE=vulkan since VIDEO_CARDS does not contain i965, iris, radeonsi, or v3d" - fi - fi - - if use opencl; then - if ! use video_cards_r600 && - ! use video_cards_radeonsi; then - ewarn "Ignoring USE=opencl since VIDEO_CARDS does not contain r600 or radeonsi" - fi - fi - - if use vaapi; then - if ! use video_cards_r600 && - ! use video_cards_radeonsi && - ! use video_cards_nouveau; then - ewarn "Ignoring USE=vaapi since VIDEO_CARDS does not contain r600, radeonsi, or nouveau" - fi - fi - - if use vdpau; then - if ! use video_cards_r300 && - ! use video_cards_r600 && - ! use video_cards_radeonsi && - ! use video_cards_nouveau; then - ewarn "Ignoring USE=vdpau since VIDEO_CARDS does not contain r300, r600, radeonsi, or nouveau" - fi - fi - - if use xa; then - if ! use video_cards_freedreno && - ! use video_cards_nouveau && - ! use video_cards_vmware; then - ewarn "Ignoring USE=xa since VIDEO_CARDS does not contain freedreno, nouveau, or vmware" - fi - fi - - if use xvmc; then - if ! use video_cards_r600 && - ! use video_cards_nouveau; then - ewarn "Ignoring USE=xvmc since VIDEO_CARDS does not contain r600 or nouveau" - fi - fi - - if ! use gallium; then - use lm-sensors && ewarn "Ignoring USE=lm-sensors since USE does not contain gallium" - use llvm && ewarn "Ignoring USE=llvm since USE does not contain gallium" - use opencl && ewarn "Ignoring USE=opencl since USE does not contain gallium" - use vaapi && ewarn "Ignoring USE=vaapi since USE does not contain gallium" - use vdpau && ewarn "Ignoring USE=vdpau since USE does not contain gallium" - use unwind && ewarn "Ignoring USE=unwind since USE does not contain gallium" - use xa && ewarn "Ignoring USE=xa since USE does not contain gallium" - use xvmc && ewarn "Ignoring USE=xvmc since USE does not contain gallium" - fi - - if ! use llvm; then - use opencl && ewarn "Ignoring USE=opencl since USE does not contain llvm" - fi -} - -python_check_deps() { - has_version -b ">=dev-python/mako-0.8.0[${PYTHON_USEDEP}]" -} - -pkg_setup() { - # warning message for bug 459306 - if use llvm && has_version sys-devel/llvm[!debug=]; then - ewarn "Mismatch between debug USE flags in media-libs/mesa and sys-devel/llvm" - ewarn "detected! This can cause problems. For details, see bug 459306." - fi - - if use video_cards_i965 || - use video_cards_iris || - use video_cards_radeonsi; then - CONFIG_CHECK="~CHECKPOINT_RESTORE" - linux-info_pkg_setup - fi - - if use gallium && use llvm; then - llvm_pkg_setup - fi - python-any-r1_pkg_setup -} - -multilib_src_configure() { - local emesonargs=() - - if use classic; then - # Intel code - dri_driver_enable video_cards_i915 i915 - dri_driver_enable video_cards_i965 i965 - if ! use video_cards_i915 && \ - ! use video_cards_i965; then - dri_driver_enable video_cards_intel i915 i965 - fi - - # Nouveau code - dri_driver_enable video_cards_nouveau nouveau - - # ATI code - dri_driver_enable video_cards_r100 r100 - dri_driver_enable video_cards_r200 r200 - if ! use video_cards_r100 && \ - ! use video_cards_r200; then - dri_driver_enable video_cards_radeon r100 r200 - fi - fi - - local platforms - use X && platforms+="x11" - use wayland && platforms+=",wayland" - [[ -n $platforms ]] && emesonargs+=(-Dplatforms=${platforms#,}) - - if use gallium; then - emesonargs+=( - $(meson_feature llvm) - $(meson_feature lm-sensors lmsensors) - $(meson_feature unwind libunwind) - ) - - if use video_cards_iris || - use video_cards_r300 || - use video_cards_r600 || - use video_cards_radeonsi || - use video_cards_nouveau || - use video_cards_vmware; then - emesonargs+=($(meson_use d3d9 gallium-nine)) - else - emesonargs+=(-Dgallium-nine=false) - fi - - if use video_cards_r600 || - use video_cards_radeonsi || - use video_cards_nouveau; then - emesonargs+=($(meson_feature vaapi gallium-va)) - use vaapi && emesonargs+=( -Dva-libs-path="${EPREFIX}"/usr/$(get_libdir)/va/drivers ) - else - emesonargs+=(-Dgallium-va=disabled) - fi - - if use video_cards_r300 || - use video_cards_r600 || - use video_cards_radeonsi || - use video_cards_nouveau; then - emesonargs+=($(meson_feature vdpau gallium-vdpau)) - else - emesonargs+=(-Dgallium-vdpau=disabled) - fi - - if use video_cards_freedreno || - use video_cards_nouveau || - use video_cards_vmware; then - emesonargs+=($(meson_feature xa gallium-xa)) - else - emesonargs+=(-Dgallium-xa=disabled) - fi - - if use video_cards_r600 || - use video_cards_nouveau; then - emesonargs+=($(meson_feature xvmc gallium-xvmc)) - else - emesonargs+=(-Dgallium-xvmc=disabled) - fi - - if use video_cards_freedreno || - use video_cards_lima || - use video_cards_panfrost || - use video_cards_v3d || - use video_cards_vc4 || - use video_cards_vivante; then - gallium_enable -- kmsro - fi - - gallium_enable video_cards_lima lima - gallium_enable video_cards_panfrost panfrost - gallium_enable video_cards_v3d v3d - gallium_enable video_cards_vc4 vc4 - gallium_enable video_cards_vivante etnaviv - gallium_enable video_cards_vmware svga - gallium_enable video_cards_nouveau nouveau - gallium_enable zink zink - - # Only one i915 driver (classic vs gallium). Default to classic. - if ! use classic; then - gallium_enable video_cards_i915 i915 - if ! use video_cards_i915 && \ - ! use video_cards_i965; then - gallium_enable video_cards_intel i915 - fi - fi - - gallium_enable video_cards_iris iris - - gallium_enable video_cards_r300 r300 - gallium_enable video_cards_r600 r600 - gallium_enable video_cards_radeonsi radeonsi - if ! use video_cards_r300 && \ - ! use video_cards_r600; then - gallium_enable video_cards_radeon r300 r600 - fi - - gallium_enable video_cards_freedreno freedreno - gallium_enable video_cards_virgl virgl - - # opencl stuff - emesonargs+=( - -Dgallium-opencl="$(usex opencl icd disabled)" - ) - fi - - if use vulkan; then - vulkan_enable video_cards_i965 intel - vulkan_enable video_cards_iris intel - vulkan_enable video_cards_radeonsi amd - vulkan_enable video_cards_v3d broadcom - fi - - if use gallium; then - gallium_enable -- swrast - emesonargs+=( -Dosmesa=$(usex osmesa gallium none) ) - else - dri_driver_enable -- swrast - emesonargs+=( -Dosmesa=$(usex osmesa classic none) ) - fi - - driver_list() { - local drivers="$(sort -u <<< "${1// /$'\n'}")" - echo "${drivers//$'\n'/,}" - } - - emesonargs+=( - $(meson_use test build-tests) - -Dglx=$(usex X dri disabled) - -Dglvnd=true - -Dshared-glapi=true - $(meson_feature dri3) - $(meson_feature egl) - $(meson_feature gbm) - $(meson_feature gles1) - $(meson_feature gles2) - $(meson_use selinux) - $(meson_feature zstd) - -Dvalgrind=$(usex valgrind auto false) - -Ddri-drivers=$(driver_list "${DRI_DRIVERS[*]}") - -Dgallium-drivers=$(driver_list "${GALLIUM_DRIVERS[*]}") - -Dvulkan-drivers=$(driver_list "${VULKAN_DRIVERS[*]}") - $(meson_use vulkan vulkan-device-select-layer) - $(meson_use vulkan-overlay vulkan-overlay-layer) - --buildtype $(usex debug debug plain) - -Db_ndebug=$(usex debug false true) - ) - meson_src_configure -} - -multilib_src_compile() { - meson_src_compile -} - -multilib_src_install() { - meson_src_install -} - -multilib_src_install_all() { - einstalldocs -} - -multilib_src_test() { - meson_src_test -t 100 -} - -# $1 - VIDEO_CARDS flag (check skipped for "--") -# other args - names of DRI drivers to enable -dri_driver_enable() { - if [[ $1 == -- ]] || use $1; then - shift - DRI_DRIVERS+=("$@") - fi -} - -gallium_enable() { - if [[ $1 == -- ]] || use $1; then - shift - GALLIUM_DRIVERS+=("$@") - fi -} - -vulkan_enable() { - if [[ $1 == -- ]] || use $1; then - shift - VULKAN_DRIVERS+=("$@") - fi -} diff --git a/media-libs/mesa/mesa-9999.ebuild b/media-libs/mesa/mesa-9999.ebuild index 1da56517de7e..5c410fcd9811 100644 --- a/media-libs/mesa/mesa-9999.ebuild +++ b/media-libs/mesa/mesa-9999.ebuild @@ -43,6 +43,7 @@ REQUIRED_USE=" d3d9? ( dri3 || ( video_cards_iris video_cards_r300 video_cards_r600 video_cards_radeonsi video_cards_nouveau video_cards_vmware ) ) gles1? ( egl ) gles2? ( egl ) + osmesa? ( gallium ) vulkan? ( dri3 video_cards_radeonsi? ( llvm ) ) vulkan-overlay? ( vulkan ) @@ -116,7 +117,6 @@ RDEPEND=" X? ( >=x11-libs/libX11-1.6.2:=[${MULTILIB_USEDEP}] >=x11-libs/libxshmfence-1.1:=[${MULTILIB_USEDEP}] - >=x11-libs/libXdamage-1.1.4-r1:=[${MULTILIB_USEDEP}] >=x11-libs/libXext-1.3.2:=[${MULTILIB_USEDEP}] >=x11-libs/libXxf86vm-1.1.3:=[${MULTILIB_USEDEP}] >=x11-libs/libxcb-1.13:=[${MULTILIB_USEDEP}] @@ -317,6 +317,10 @@ pkg_pretend() { if ! use llvm; then use opencl && ewarn "Ignoring USE=opencl since USE does not contain llvm" fi + + if use osmesa && ! use llvm; then + ewarn "OSMesa will be slow without enabling USE=llvm" + fi } python_check_deps() { @@ -347,6 +351,8 @@ multilib_src_configure() { local emesonargs=() if use classic; then + dri_driver_enable !gallium swrast + # Intel code dri_driver_enable video_cards_i915 i915 dri_driver_enable video_cards_i965 i965 @@ -372,6 +378,12 @@ multilib_src_configure() { use wayland && platforms+=",wayland" [[ -n $platforms ]] && emesonargs+=(-Dplatforms=${platforms#,}) + if use X || use egl; then + emesonargs+=(-Dglvnd=true) + else + emesonargs+=(-Dglvnd=false) + fi + if use gallium; then emesonargs+=( $(meson_feature llvm) @@ -432,6 +444,7 @@ multilib_src_configure() { gallium_enable -- kmsro fi + gallium_enable -- swrast gallium_enable video_cards_lima lima gallium_enable video_cards_panfrost panfrost gallium_enable video_cards_v3d v3d @@ -476,14 +489,6 @@ multilib_src_configure() { vulkan_enable video_cards_v3d broadcom fi - if use gallium; then - gallium_enable -- swrast - emesonargs+=( -Dosmesa=$(usex osmesa gallium none) ) - else - dri_driver_enable -- swrast - emesonargs+=( -Dosmesa=$(usex osmesa classic none) ) - fi - driver_list() { local drivers="$(sort -u <<< "${1// /$'\n'}")" echo "${drivers//$'\n'/,}" @@ -492,13 +497,13 @@ multilib_src_configure() { emesonargs+=( $(meson_use test build-tests) -Dglx=$(usex X dri disabled) - -Dglvnd=true - -Dshared-glapi=true + -Dshared-glapi=enabled $(meson_feature dri3) $(meson_feature egl) $(meson_feature gbm) $(meson_feature gles1) $(meson_feature gles2) + $(meson_use osmesa) $(meson_use selinux) $(meson_feature zstd) -Dvalgrind=$(usex valgrind auto false) -- cgit v1.2.3