%define git 0 %define git_branch 25.0 %define opengl_ver 4.6 # define version, RC & release %define main_version 25.0.7 #define relc 1 %define rel 3 %define release %mkrel %{?relc:0.rc%{relc}.}%{rel} %if %{git} %if %{?relc:1}%{!?relc:0} %define release %mkrel 1~rc%{relc}.1.git%{git}.%{rel} %else %define release 1.git%{git}.%{rel} %endif %endif # exclude libgallium-.so from being required as a devel library %global __requires_exclude devel\\(libgallium %define build_tainted 0 %if "%{distro_section}" == "tainted" %define build_tainted 1 %endif %define clname mesaopencl %define rusticlname mesarusticl %define d3dname d3d %define eglname mesaegl %define eglname_glvnd egl %define glname mesagl %define glname_glvnd gl %define glwname mesaglw %define glesv1name mesaglesv1 %define glesv2name mesaglesv2 %define glesv1name_glvnd glesv1_cm %define glesv2name_glvnd glesv2 %define gldispatchname_glvnd gldispatch %define glxname_glvnd glx %define glapiname glapi %define gbmname gbm %define xaname xatracker %define vulkanname mesavulkan %define clmajor 1 %define rusticlmajor 1 %define d3dmajor 1 %define eglmajor 1 %define eglmajor_glvnd 1 %define glmajor 1 %define glmajor_glvnd 1 %define glwmajor 1 %define glesv1major 1 %define glesv2major 2 %define gldispatchmajor 0 %define glxmajor 0 %define glapimajor 0 %define gbmmajor 1 %define waylandeglmajor 1 %define osmesamajor 8 %define xamajor 2 %define libclname %mklibname %{clname} %{clmajor} %define librusticlname %mklibname %{rusticlname} %{rusticlmajor} %define libd3dname %mklibname %{d3dname} %{d3dmajor} %define devd3dname %mklibname %{d3dname} -d %define libeglname %mklibname %{eglname} %{eglmajor} %define deveglname %mklibname %{eglname} -d %define libeglname_glvnd %mklibname %{eglname_glvnd} %{eglmajor_glvnd} %define libglname %mklibname %{glname} %{glmajor} %define devglname %mklibname %{glname} -d %define libglname_glvnd %mklibname %{glname_glvnd} %{glmajor_glvnd} %define libglwname %mklibname %{glwname} %{glwmajor} %define libglesv1name %mklibname %{glesv1name}_ %{glesv1major} %define devglesv1name %mklibname %{glesv1name} -d %define libglesv1name_glvnd %mklibname %{glesv1name_glvnd} %{glesv1major} %define libglesv2name %mklibname %{glesv2name}_ %{glesv2major} %define devglesv2name %mklibname %{glesv2name} -d %define libglesv2name_glvnd %mklibname %{glesv2name_glvnd} %{glesv2major} %define libgldispatchname_glvnd %mklibname %{gldispatchname_glvnd} %{gldispatchmajor} %define libglxname_glvnd %mklibname %{glxname_glvnd} %{glxmajor} %define libglapiname %mklibname %{glapiname} %{glapimajor} %define devglapiname %mklibname %{glapiname} -d %define libgbmname %mklibname %{gbmname} %{gbmmajor} %define devgbmname %mklibname %{gbmname} -d %define libwaylandeglname %mklibname %{waylandeglname} %{waylandeglmajor} %define libosmesaname %mklibname osmesa %{osmesamajor} %define libxaname %mklibname %{xaname} %{xamajor} %define devxaname %mklibname %{xaname} -d %define dridrivers %mklibname dri-drivers %define vulkandrivers %mklibname %{vulkanname}-drivers %define vulkandevel %mklibname %{vulkanname} -d %define libcldevel %mklibname mesaopencl -d %define librusticldevel %mklibname mesarusticl -d %define khrdevel %mklibname mesakhr -d %define osmesadevel %mklibname osmesa -d %define glvnd_devname %mklibname glvnd -d # Architecture-independent Virtual provides: %define libd3dname_virt lib%{d3dname} %define libeglname_virt lib%{eglname} %define libglname_virt lib%{glname} %define libglwname_virt lib%{glwname} %define libglesv1name_virt lib%{glesv1name} %define libglesv2name_virt lib%{glesv2name} %define libglapiname_virt lib%{glapiname} %define libgbmname_virt lib%{gbmname} %define libwaylandeglname_virt lib%{waylandeglname} %define libxaname_virt lib%{xaname} %define mesasrcdir %{_prefix}/src/Mesa/ %define with_valgrind 1 # Note for packagers: to "bootstrap" mesa when switching to # libglvnd, you have to disable vaapi (commenting with_vaapi # below), as vaapi depends on mesa, so it would lead to a # cyclical dependency. Re-enable vaapi once bootstrapped. %define download_crates 0 %{?_with_download: %global download_crates 1} %{?_without_download: %global download_crates 0} %if %{download_crates} %global with_nvk_allow_download 1 %global with_nvk_allow_crates_updates 1 %endif # undefine one of the following with_* entries to disable (it's not enough to just set to 0) %global with_hardware 1 %global with_vulkan_hw 1 %global with_nvk 1 #global with_nvk_allow_download 1 #global with_nvk_allow_crates_updates 1 %global with_vdpau 1 %global with_vaapi 1 %global with_nine 1 %global with_omx 1 %global with_opencl 1 %global with_rusticl 1 %global base_vulkan ,amd,virtio %if 0%{?mageia} < 8 %global with_glvnd 0 %else %global with_glvnd 1 %endif %ifarch %{ix86} x86_64 %global with_crocus 1 %global with_freedreno 1 %global with_i915 1 %global with_iris 1 %global with_vmware 1 %global with_xa 1 %global platform_vulkan ,intel,intel_hasvk %global with_intel_clc 1 %endif %ifarch x86_64 %global with_intel_vk_rt 1 %endif %ifarch %{arm} aarch64 %global with_etnaviv 1 %global with_freedreno 1 #global with_kmsro 1 %global with_lima 1 %global with_panfrost 1 %global with_tegra 1 %global with_vc4 1 %global with_v3d 1 %global with_xa 1 %global platform_vulkan ,broadcom,freedreno,panfrost,imagination-experimental %endif # define with_newname above to have: # lib(64)mesagl1 renamed as lib(64)glx_mesa0 and # lib(64)egl1 renamed as lib(64)egl_mesa0 #global with_newname 1 %if 0%{?with_newname} %define eglname egl_mesa %define glname glx_mesa %define glmajor 0 %define eglmajor 0 %define old_eglname mesaegl %define old_glname mesagl %define old_eglmajor 1 %define old_glmajor 1 %define libold_eglname %mklibname %{old_eglname} %{old_eglmajor} %define libold_glname %mklibname %{old_glname} %{old_glmajor} %endif %ifnarch %{arm} %global with_radeonsi 1 %endif #global with_docs 1 %global vulkan_drivers swrast%{?base_vulkan}%{?platform_vulkan}%{?with_nvk:,nouveau} %if %{mgaversion} < 10 %define bindgendeps rust-bindgen %else %define bindgendeps bindgen-cli %endif Name: mesa Version: %{main_version} Release: %{release} Summary: OpenGL %{opengl_ver} compatible 3D graphics library Group: System/Libraries # force new gcc BuildRequires: gcc >= 12.3.0-1 BuildRequires: binutils >= 1:2.40-10 # for building docs %if 0%{?with_docs} BuildRequires: doxygen %endif BuildRequires: pkgconfig(libdrm) >= 2.4.121 BuildRequires: pkgconfig(expat) BuildRequires: pkgconfig(zlib) >= 1.2.3 BuildRequires: pkgconfig(wayland-protocols) >= 1.41 BuildRequires: pkgconfig(wayland-scanner) BuildRequires: pkgconfig(wayland-client) >= 1.18 BuildRequires: pkgconfig(wayland-server) >= 1.18 BuildRequires: pkgconfig(wayland-egl-backend) >= 3 BuildRequires: pkgconfig(x11) BuildRequires: pkgconfig(xext) BuildRequires: pkgconfig(xdamage) >= 1.1 BuildRequires: pkgconfig(xfixes) BuildRequires: pkgconfig(xt) >= 1.0.5 BuildRequires: pkgconfig(xmu) >= 1.0.3 BuildRequires: x11-proto-devel >= 7.3 BuildRequires: pkgconfig(xcb-glx) >= 1.8.1 BuildRequires: pkgconfig(xxf86vm) BuildRequires: pkgconfig(xcb) BuildRequires: pkgconfig(x11-xcb) BuildRequires: pkgconfig(xcb-dri2) >= 1.8 BuildRequires: pkgconfig(xcb-dri3) BuildRequires: pkgconfig(xcb-present) BuildRequires: pkgconfig(xcb-sync) BuildRequires: pkgconfig(xshmfence) >= 1.1 BuildRequires: pkgconfig(dri2proto) >= 2.8 BuildRequires: pkgconfig(glproto) >= 1.4.14 BuildRequires: pkgconfig(xcb-xfixes) BuildRequires: pkgconfig(xcb-randr) BuildRequires: pkgconfig(xi) >= 1.3 BuildRequires: pkgconfig(xrandr) >= 1.3 BuildRequires: bison BuildRequires: flex BuildRequires: pkgconfig(vdpau) >= 1.1 %if 0%{?with_vaapi} BuildRequires: pkgconfig(libva) >= 0.38.0 %endif %if 0%{?with_omx} BuildRequires: pkgconfig(libomxil-bellagio) %endif BuildRequires: pkgconfig(libelf) %if 0%{?with_glvnd} BuildRequires: pkgconfig(libglvnd) >= 1.3.2 %endif BuildRequires: llvm-devel >= 7.0.0 %if 0%{?with_radeonsi} BuildRequires: llvm-devel >= 15.0.0 %endif %if 0%{?with_opencl} BuildRequires: clang-devel BuildRequires: libclc-devel >= 12.0.0-0.rc4.1 BuildRequires: polly %if 0%{?with_rusticl} || 0%{?with_nvk} BuildRequires: pkgconfig(LLVMSPIRVLib) BuildRequires: pkgconfig(SPIRV-Tools) BuildRequires: rust >= 1.78.0 BuildRequires: rustfmt >= 1.78.0 BuildRequires: %{bindgendeps} >= 0.65.0 %endif %endif %if 0%{?with_nvk} BuildRequires: cbindgen %endif BuildRequires: pkgconfig(talloc) BuildRequires: meson >= 1.4 BuildRequires: pkgconfig(libudev) %if 0%{?with_valgrind} BuildRequires: pkgconfig(valgrind) %endif %if 0%{?mageia} < 8 BuildRequires: python2-libxml2 BuildRequires: python2-mako %endif BuildRequires: python3-libxml2 BuildRequires: python3-mako BuildRequires: python3-pycparser >= 2.20 BuildRequires: python3-yaml BuildRequires: vulkan-headers BuildRequires: glslang %if 0%{?with_vulkan_hw} BuildRequires: pkgconfig(vulkan) %endif BuildRequires: libgcrypt-devel BuildRequires: lm_sensors-devel BuildRequires: pkgconfig(libzstd) BuildRequires: pkgconfig(libunwind) %if 0%{?with_intel_clc} BuildRequires: python3-ply %endif %if %{build_tainted} BuildRequires: pkgconfig(x264) BuildRequires: pkgconfig(x265) %endif URL: https://www.mesa3d.org %if %{git} #Source0: %{name}-%{git}.tar.bz2 # (blino) snapshot of 13.0 branch Source0: %{name}-%{git_branch}-%{git}.tar.xz %else Source0: https://mesa.freedesktop.org/archive/mesa-%{main_version}%{?relc:-rc%{relc}}.tar.xz %endif Source3: make-git-snapshot.sh # Note for packagers: # # build with nvk requires the rust crates listed below, and sometimes other # subpackages not provided externally. The meson setup can automatically # download them when meson it is allowed to do so in a rpm build. Thus setting # %%with_nvk_allow_crates_updates and %%with_nvk_allow_downloads to 1 at the # top of the SPEC file would allow to download and update to a newer version # of crates (the complete list will be contained in the file crates_sources.txt # located in in the BUILDDIR), and then it copies the newer crates binaries, # if any, to the SOURCES dir. Once completed, review the codes of # crates_source.txt below and unset %%with_nvk_allow_crates_updates and # %%with_nvk_allow_downloads conditional flags at the top of the SPEC file # to produce the final release. Alternatively process the SPEC file with # bm with the '--with dowload' argument, to produce the same effect, but # without having to alter the %%with_nvk_allow_crates_updates and # %%with_nvk_allow_download flags, e.g.: # # bm -l mesa.spec --with download # # # list of crates required for nvk Source20: https://crates.io/api/v1/crates/paste/1.0.14/download#/paste-1.0.14.tar.gz Source21: https://crates.io/api/v1/crates/proc-macro2/1.0.86/download#/proc-macro2-1.0.86.tar.gz Source22: https://crates.io/api/v1/crates/quote/1.0.33/download#/quote-1.0.33.tar.gz Source23: https://crates.io/api/v1/crates/syn/2.0.68/download#/syn-2.0.68.tar.gz Source24: https://crates.io/api/v1/crates/unicode-ident/1.0.12/download#/unicode-ident-1.0.12.tar.gz # mesa staging/25.0 branch from 1 (https://www.mesa3d.org/releasing.html#stagingbranch) # https://gitlab.freedesktop.org/mesa/mesa/-/tree/staging/25.0?ref_type=heads # mesa master branch from 200 # https://gitlab.freedesktop.org/mesa/mesa/ # https://bugs.mageia.org/show_bug.cgi?id=34304 # https://gitlab.freedesktop.org/mesa/mesa/-/issues/13072 (https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34946) # https://gitlab.freedesktop.org/mesa/mesa/-/issues/13268 Patch0201: 0001-Better-fixes-for-ACO-Unsupported-opcode-v_lshlrev_b1.patch # other fixes # https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34109 Patch0212: 4075-brw-fix-brw_nir_move_interpolation_to_top.patch # https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35186# Patch0220: 5076-frontends-va-Fix-H264-top-bottom-is-reference-flags.patch # https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35258 Patch0221: 5083-radeonsi-vcn-Use-picture-fence-in-JPEG-decode.patch # mesa pending fixes from 300 Patch0310: gnome-shell-glthread-disable.patch # Mageia patches # nvidia+zink race condition, see https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27521 Patch0504: 27220.patch # # https://bugzilla.redhat.com/show_bug.cgi?id=2277018 # https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28923 Patch0505: 28923.patch # from FC # Backport of https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33805 # to fix clover with libclc from LLVM 20. Patch0600: e4eb5e80c316c0af3fff310ca89e1175d81556c1.patch # Backport of https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32038 # and fixes: vulkan/wsi: implement the Wayland color management protocol Patch0601: 0001-increase-required-wayland-protocols-version-to-1.41.patch Patch0602: 0002-vulkan-wsi-implement-the-Wayland-color-management-pr.patch Patch0603: 0003-vulkan-wsi-implement-support-for-VK_EXT_hdr_metadata.patch Patch0604: 0004-vulkan-wsi-handle-the-compositor-not-supporting-exte.patch Patch0605: 0001-meson-update-wayland-protocols-source_hash.patch Patch0606: 0001-docs-features-add-VK_EXT_hdr_metadata.patch # https://bugzilla.redhat.com/show_bug.cgi?id=2360851 # https://gitlab.freedesktop.org/mesa/mesa/-/issues/13009 Patch0607: 0001-Revert-kopper-Explicitly-choose-zink.patch # from Omv (to be rebased) #Source702: enable-vulkan-video-decode.patch # Fix https://bugs.winehq.org/show_bug.cgi?id=41930 # https://gitlab.freedesktop.org/mesa/mesa/-/issues/5094 # Ported from https://gitlab.freedesktop.org/bvarner/mesa/-/tree/feature/osmesa-preserve-buffer Patch0704: mesa-24.0-osmesa-fix-civ3.patch # from Deb # From opensuse # https://bugzilla.opensuse.org/show_bug.cgi?id=1173185 Patch0900: U_fix-mpeg1_2-decode-mesa-20.2.patch # https://gitlab.freedesktop.org/mesa/mesa/-/issues/9856 Patch0901: u_mesa-CVE-2023-45913.patch # https://gitlab.freedesktop.org/mesa/mesa/-/issues/9858 Patch0902: u_mesa-CVE-2023-45919.patch # https://gitlab.freedesktop.org/mesa/mesa/-/issues/9857 Patch0903: u_mesa-CVE-2023-45922.patch #------------------------------------------------------------------------------ # package mesa License: MIT Requires: %{libglname} = %{version}-%{release} Requires: %{vulkandrivers} = %{version}-%{release} %package -n %{libglname} Summary: Files for Mesa (GL and GLX libs) Group: System/Libraries Provides: %{libglname_virt} = %{version}-%{release} Requires: %{dridrivers} >= %{version}-%{release} %if 0%{?with_glvnd} Requires: %{libglname_glvnd} >= 1.3.1-7 Requires: %{libgldispatchname_glvnd} >= 1.3.1-7 Requires: %{libglxname_glvnd} >= 1.3.1-7 Requires: libglvnd >= 1.3.1-7 %endif %if 0%{?with_newname} Obsoletes: %{libold_glname} < %{version}-%{release} Provides: %{libold_glname} = %{version}-%{release} %endif %package -n %{dridrivers} Summary: Mesa DRI drivers Group: System/Libraries Provides: mesa-dri-drivers # do not require exact release to avoid conflicts when having # x86_64 dri drivers from tainted and i586 dri drivers from core Requires: mesa = %{version} %if 0%{?with_omx} %package omx-drivers Summary: Mesa-based OMX drivers %endif %package -n %{libd3dname} Summary: Mesa Direct3D9 state tracker Group: System/Libraries Provides: %{libd3dname_virt} = %{version}-%{release} %package -n %{devd3dname} Summary: Development files for Mesa Direct3D9 state tracker Group: Development/C Requires: %{libd3dname} = %{version}-%{release} Provides: lib%{d3dname}-devel Provides: %{d3dname}-devel Provides: libd3d-devel Obsoletes: %{_lib}d3d1-devel < 21.0.0-0.rc5.4 %package -n %{devglname} Summary: Development files for Mesa (OpenGL compatible 3D lib) Group: Development/C Requires: %{libglname} = %{version}-%{release} Requires: %{khrdevel} = %{version}-%{release} Provides: lib%{glname}-devel = %{version}-%{release} Provides: %{glname}-devel = %{version}-%{release} Provides: libMesaGL-devel = %{version}-%{release} Provides: MesaGL-devel = %{version}-%{release} Provides: libgl-devel %if 0%{?with_glvnd} Requires: %{glvnd_devname} %else Provides: GL-devel %endif %if 0%{?with_newname} Obsoletes: %{libold_glname}-devel < %{version}-%{release} Provides: %{libold_glname}-devel = %{version}-%{release} %endif Obsoletes: %{_lib}mesagl1-devel < 21.0.0-0.rc5.4 %package -n %{libeglname} Summary: Files for Mesa (EGL libs) Group: System/Libraries Provides: %{libeglname_virt} = %{version}-%{release} %if 0%{?with_glvnd} Requires: %{libeglname_glvnd} >= 1.3.1-7 Requires: %{libgldispatchname_glvnd} >= 1.3.1-7 Requires: %{libglxname_glvnd} >= 1.3.1-7 Requires: libglvnd >= 1.3.1-7 %endif %if 0%{?with_newname} Obsoletes: %{libold_eglname} < %{version}-%{release} Provides: %{libold_eglname} = %{version}-%{release} %endif %package -n %{deveglname} Summary: Development files for Mesa (EGL libs) Group: Development/C Requires: %{libeglname} = %{version}-%{release} Requires: %{khrdevel} = %{version}-%{release} Provides: lib%{eglname}-devel Provides: %{eglname}-devel Provides: libegl-devel %if 0%{?with_glvnd} Requires: %{glvnd_devname} %else Provides: EGL-devel %endif %if 0%{?with_newname} Obsoletes: %{libold_eglname}-devel < %{version}-%{release} Provides: %{libold_eglname}-devel = %{version}-%{release} %endif Obsoletes: %{_lib}mesaegl1-devel < 21.0.0-0.rc5.4 %package -n %{khrdevel} Summary: Mesa Khronos development headers Group: Development/C Provides: mesakhr-devel = %{version}-%{release} # ease upgrade mga6 -> mga7 (mga#25625) Conflicts: %{_lib}mesaegl1-devel < 17.3.9-2 %if 0%{?with_glvnd} Requires: %{glvnd_devname} %endif %package -n %{libosmesaname} Summary: Mesa off-screen rendering library Group: System/Libraries %package -n %{osmesadevel} Summary: Development files for libosmesa Group: Development/C Requires: %{libosmesaname} = %{version}-%{release} Provides: osmesa-devel = %{version}-%{release} %if 0%{?with_glvnd} Requires: %{glvnd_devname} %endif %package -n %{libglapiname} Summary: Files for mesa (glapi libs) Group: System/Libraries Provides: %{libglapiname_virt} = %{version}-%{release} %package -n %{devglapiname} Summary: Development files for glapi libs Group: Development/C Requires: %{libglapiname_virt} = %{version}-%{release} Provides: lib%{glapiname}-devel Provides: %{libglapiname}-devel Obsoletes: %{_lib}glapi0-devel < 21.0.0-0.rc5.4 %if 0%{?with_opencl} %package -n %libclname Summary: Mesa OpenCL runtime library %package -n %libcldevel Summary: Mesa OpenCL development package Requires: %libclname%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} %if 0%{?with_rusticl} %package -n %librusticlname Summary: Mesa RustiCL runtime library %package -n %librusticldevel Summary: Mesa RustiCL development package Requires: %librusticlname%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} %endif %endif %package -n %{libglesv1name} Summary: Files for Mesa (glesv1 libs) Group: System/Libraries Provides: %{libglesv1name_virt} = %{version}-%{release} %if 0%{?with_glvnd} Requires: %{libglesv1name_glvnd} >= 1.3.1-7 %endif %package -n %{devglesv1name} Summary: Development files for glesv1 libs Group: Development/C Requires: %{libglesv1name} = %{version}-%{release} Requires: %{khrdevel} = %{version}-%{release} Provides: lib%{glesv1name}-devel Provides: %{glesv1name}-devel Provides: libglesv1-devel %if 0%{?with_glvnd} Requires: %{glvnd_devname} %endif Obsoletes: %{_lib}mesaglesv1_1-devel < 21.0.0-0.rc5.4 %package -n %{libglesv2name} Summary: Files for Mesa (glesv2 libs) Group: System/Libraries Provides: %{libglesv2name_virt} = %{version}-%{release} %if 0%{?with_glvnd} Requires: %{libglesv2name_glvnd} >= 1.3.1-7 %endif %package -n %{devglesv2name} Summary: Development files for glesv2 libs Group: Development/C Requires: %{libglesv2name} = %{version}-%{release} Requires: %{khrdevel} = %{version}-%{release} Provides: lib%{glesv2name}-devel Provides: %{glesv2name}-devel Provides: libglesv2-devel %if 0%{?with_glvnd} Requires: %{glvnd_devname} %endif Obsoletes: %{_lib}mesaglesv2_2-devel < 21.0.0-0.rc5.4 %package -n %{libgbmname} Summary: Files for Mesa (gbm libs) Group: System/Libraries Provides: %{libgbmname_virt} = %{version}-%{release} %package -n %{devgbmname} Summary: Development files for Mesa (gbm libs) Group: Development/C Requires: %{libgbmname} = %{version}-%{release} Provides: lib%{gbmname}-devel Provides: %{gbmname}-devel Obsoletes: %{_lib}gbm1-devel < 21.0.0-0.rc5.4 %package -n %{_lib}vdpau-driver-nouveau Summary: VDPAU plugin for nouveau driver Group: System/Libraries # temporary: %rename vdpau-driver-nouveau %package -n %{_lib}vdpau-driver-r600 Summary: VDPAU plugin for r600 driver Group: System/Libraries # temporary: %rename vdpau-driver-r600 %package -n %{_lib}vdpau-driver-radeonsi Summary: VDPAU plugin for radeonsi driver Group: System/Libraries # temporary: %rename vdpau-driver-radeonsi %package -n %{_lib}vdpau-driver-virtio_gpu Summary: VDPAU plugin for Virtio GPU driver Group: System/Libraries %package -n %{_lib}vdpau-driver-gallium Summary: VDPAU plugin for gallium driver Group: System/Libraries %package -n %{libxaname} Summary: Files for Mesa XA state tracker Group: System/Libraries Provides: %{libxaname_virt} = %{version}-%{release} %package -n %{devxaname} Summary: Development files for XA libs Group: Development/C Requires: %{libxaname_virt} = %{version}-%{release} Provides: lib%{xaname}-devel Provides: %{libxaname}-devel Obsoletes: %{_lib}xatracker2-devel < 21.0.0-0.rc5.4 %package -n %{vulkandrivers} Summary: Mesa Vulkan driver for Intel and Radeon GPUs Group: System/Libraries %ifarch %{ix86} x86_64 Obsoletes: %{_lib}vulkan_intel < 18.3.0-4 Provides: %{_lib}vulkan_intel = %{version}-%{release} %endif Obsoletes: %{_lib}vulkan_radeon < 18.3.0-4 Provides: %{_lib}vulkan_radeon = %{version}-%{release} %package -n %{vulkandevel} Summary: Mesa Vulkan development files for Intel and Radeon drivers Group: Development/C Requires: %{vulkandrivers} = %{version}-%{release} Obsoletes: %{_lib}vulkan-devel < 0:18.3.0-4 Provides: %{vulkanname}-devel = %{version}-%{release} %package common-devel Summary: Meta package for mesa devel Group: Development/C Requires: %{devglname} = %{version} Requires: mesaglu-devel Requires: freeglut-devel Requires: %{deveglname} = %{version} Requires: %{devglesv1name} = %{version} Requires: %{devglesv2name} = %{version} #------------------------------------------------------------------------------ %description Mesa is an OpenGL %{opengl_ver} compatible 3D graphics library. %description common-devel Mesa common metapackage devel %description -n %{libeglname} Mesa is an OpenGL %{opengl_ver} compatible 3D graphics library. EGL parts. %description -n %{deveglname} Mesa is an OpenGL %{opengl_ver} compatible 3D graphics library. EGL development parts. %description -n %{libglname} Mesa is an OpenGL %{opengl_ver} compatible 3D graphics library. GL and GLX parts. %description -n %{dridrivers} Mesa is an OpenGL %{opengl_ver} compatible 3D graphics library. DRI drivers. %if 0%{?with_omx} %description omx-drivers Mesa-based OMX drivers %endif %description -n %{devglname} Mesa is an OpenGL %{opengl_ver} compatible 3D graphics library. This package contains the headers needed to compile Mesa programs. %description -n %{libglesv1name} OpenGL ES is a low-level, lightweight API for advanced embedded graphics using well-defined subset profiles of OpenGL. This package provides the OpenGL ES library version 1. %description -n %{khrdevel} Mesa Khronos development headers. %description -n %{libosmesaname} Mesa off-screen rendering libraries for rendering OpenGL into application-allocated blocks of memory. %description -n %{osmesadevel} This package contains the headers needed to compile programs against the Mesa off-screen rendering library. %description -n %{libglapiname} This packages provides the glapi shared library used by gallium. %description -n %{devglapiname} This package contains the headers needed to compile programs against glapi shared library. %if 0%{?with_opencl} %description -n %libclname Mesa OpenCL runtime library %description -n %libcldevel Mesa OpenCL development package %if 0%{?with_rusticl} %description -n %librusticlname Mesa RustiCL runtime library %description -n %librusticldevel Mesa RustiCL development package %endif %endif %description -n %{devglesv1name} This package contains the headers needed to compile OpenGL ES 1 programs. %description -n %{libd3dname} Mesa Direct3D9 state tracker. %description -n %{devd3dname} Mesa Direct3D9 state tracker development package. %description -n %{libglesv2name} OpenGL ES is a low-level, lightweight API for advanced embedded graphics using well-defined subset profiles of OpenGL. This package provides the OpenGL ES library version 2. %description -n %{devglesv2name} This package contains the headers needed to compile OpenGL ES 2 programs. %description -n %{libgbmname} Mesa is an OpenGL %{opengl_ver} compatible 3D graphics library. GBM (Graphics Buffer Manager) parts. %description -n %{devgbmname} Mesa is an OpenGL %{opengl_ver} compatible 3D graphics library. GBM (Graphics Buffer Manager) development parts. %description -n %{libxaname} This packages provides the xa shared library used by gallium. %description -n %{devxaname} This package contains the headers needed to compile programs against xa shared library. %description -n %{_lib}vdpau-driver-nouveau This packages provides a VPDAU plugin to enable video acceleration with the nouveau driver. %description -n %{_lib}vdpau-driver-r600 This packages provides a VPDAU plugin to enable video acceleration with the r600 driver. %description -n %{_lib}vdpau-driver-radeonsi This packages provides a VPDAU plugin to enable video acceleration with the radeonsi driver. %description -n %{_lib}vdpau-driver-virtio_gpu This packages provides a VPDAU plugin to enable video acceleration with the virtio_gpu driver. %description -n %{_lib}vdpau-driver-gallium This package provides a VDPAU plugin to enable video acceleration with the gallium driver. %description -n %{vulkandrivers} This package contains the Vulkan parts for Mesa's Intel and Radeon drivers. %description -n %{vulkandevel} This package contains the development files for Mesa's Vulkan implementation. #------------------------------------------------------------------------------ %prep %autosetup -n %{name}-%{version}%{?relc:-rc%{relc}} -p1 # # remove unused docs rm -f docs/README.WIN32 %if 0%{?mageia} >= 8 # Make sure the build uses gnu++14 as llvm 10 headers require that sed -i -e 's/cpp_std=gnu++11/cpp_std=gnu++14/g' meson.build %endif %build # Disable LTO %define _lto_cflags %{nil} # when you update the list of subprojects packages, please update also this list %if 0%{?with_nvk} mkdir -p %_builddir/%name-%version/subprojects/packagecache/ cp -p %{SOURCE20} %_builddir/%name-%version/subprojects/packagecache/ cp -p %{SOURCE21} %_builddir/%name-%version/subprojects/packagecache/ cp -p %{SOURCE22} %_builddir/%name-%version/subprojects/packagecache/ cp -p %{SOURCE23} %_builddir/%name-%version/subprojects/packagecache/ cp -p %{SOURCE24} %_builddir/%name-%version/subprojects/packagecache/ %endif %meson \ %if 0%{?with_nvk_allow_download} --wrap-mode=default \ %endif -Dcpp_std=gnu++17 \ -Db_lto=false \ -Dplatforms=x11,wayland \ -Dosmesa=true \ %ifarch %{ix86} %if %{mgaversion} >= 10 -Dsse2=true \ %else -Dsse2=false \ %endif %endif %if 0%{?with_hardware} -Dgallium-drivers=swrast,virgl,nouveau,r300%{?with_crocus:,crocus}%{?with_i915:,i915}%{?with_iris:,iris}%{?with_vmware:,svga}%{?with_radeonsi:,radeonsi,r600}%{?with_freedreno:,freedreno}%{?with_etnaviv:,etnaviv}%{?with_tegra:,tegra}%{?with_vc4:,vc4}%{?with_v3d:,v3d}%{?with_lima:,lima}%{?with_panfrost:,panfrost}%{?with_vulkan_hw:,zink} \ %else -Dgallium-drivers=swrast,virgl \ %endif -Dgallium-vdpau=%{?with_vdpau:enabled}%{!?with_vdpau:disabled} \ -Dgallium-va=%{?with_vaapi:enabled}%{!?with_vaapi:disabled} \ -Dgallium-xa=%{?with_xa:enabled}%{!?with_xa:disabled} \ -Dgallium-nine=%{?with_nine:true}%{!?with_nine:false} \ %if 0%{?with_opencl} -Dgallium-opencl=%{?with_opencl:icd}%{!?with_opencl:disabled} \ %if 0%{?with_rusticl} -Dgallium-rusticl=%{?with_rusticl:true}%{!?with_rusticl:false} \ %endif %endif -Dvulkan-drivers=%{?vulkan_drivers} \ -Dvulkan-layers=device-select,intel-nullhw,overlay \ -Dshared-glapi=enabled \ -Dgles1=enabled \ -Dgles2=enabled \ -Dopengl=true \ -Dgbm=enabled \ -Dglx=dri \ -Degl=enabled \ %if 0%{?with_glvnd} -Dglvnd=enabled \ %endif -Dgallium-extra-hud=true \ -Dlmsensors=enabled \ %if 0%{?with_intel_clc} -Dintel-clc=enabled \ %endif -Dintel-rt=%{?with_intel_vk_rt:enabled}%{!?with_intel_vk_rt:disabled} \ -Dmicrosoft-clc=disabled \ -Dllvm=enabled \ -Dshared-llvm=enabled \ -Dvalgrind=%{?with_valgrind:enabled}%{!?with_valgrind:disabled} \ -Dbuild-tests=false \ -Dselinux=false \ -Dandroid-libbacktrace=disabled \ %if %{build_tainted} -Dvideo-codecs=h264dec,h264enc,h265dec,h265enc,vc1dec,av1dec,av1enc,vp9dec \ %endif %{nil} # This code updates the crates and the list of crates required for build with # nvk enabled and let meson retrieve them from the network. The newer list will # be contained in the file crates_sources.txt, which should be then copied # in the section near %SOURCE20...%SOURCE24 above. %if 0%{?with_nvk_allow_download} crates="$(%_bindir/ls %_builddir/%name-%version/subprojects/packagecache/)" if [ ! -z "$crates" ]; then j=20; echo "# list of crates required for nvk" > crates_sources.txt for i in $crates; do crate_filename="$i" crate_name="$(echo $i | sed 's/-[0-9].*//')" crate_url="$(cat %_builddir/%name-%version/subprojects/$crate_name.wrap | grep source_url | awk -F= '{print $2}')" echo "Source$j: $crate_url#/$crate_filename" >> crates_sources.txt %if 0%{?with_nvk_allow_crates_updates} if [ ! -e "%_sourcedir/$crate_filename" ]; then cp -p "%_builddir/%name-%version/subprojects/packagecache/$crate_filename" %_sourcedir/ echo "# New Source" >> crates_sources_new.txt echo "Source$j: $crate_url#/$crate_filename" >> crates_sources_new.txt fi %endif ((j++)) done fi %if 0%{?with_nvk_allow_crates_updates} echo "Please check and update the crates list in the .spec file according to files: %{_builddir}/%{name}-%{version}/crates_sources.txt and %{_builddir}/%{name}-%{version}/crates_sources_new.txt" exit 1 %endif %endif %meson_build # build docs %if 0%{?with_docs} (cd doxygen make ) %endif %install %meson_install # FIXME: strip will likely break the hardlink # (blino) hardlink libGL files in %%{_libdir}/mesa # to prevent proprietary driver installers from removing them mkdir -p $RPM_BUILD_ROOT%{_libdir}/mesa pushd $RPM_BUILD_ROOT%{_libdir}/mesa for l in \ %if 0%{?with_glvnd} ../libGLX_mesa.so.* \ %else ../libGL.so.* \ %endif ; do cp -a $l .; done popd %if 0%{?with_glvnd} # default provider for indirect rendering when vendor is not determined ln -s %{_libdir}/libGLX_mesa.so.0 %{buildroot}%{_libdir}/libGLX_indirect.so.0 ln -s %{_libdir}/libGLX_mesa.so.0 %{buildroot}%{_libdir}/libGLX_system.so.0 %endif %ifarch %{x86_64} mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/dri %endif # libvdpau opens the versioned name, don't bother including the unversioned rm -f %{buildroot}%{_libdir}/vdpau/*.so # strip out useless headers rm -f %{buildroot}%{_includedir}/GL/w*.h # remove .la files find %{buildroot} -name '*.la' -delete #------------------------------------------------------------------------------ %files %{_bindir}/mesa-overlay-control.py %{_datadir}/drirc.d/ %files -n %{dridrivers} %dir %{_libdir}/dri %{_libdir}/libgallium-*.so %{_libdir}/dri/*_dri.so %if 0%{?with_vaapi} %{_libdir}/dri/*_drv*.so %endif %if 0%{?with_opencl} %dir %{_libdir}/gallium-pipe %{_libdir}/gallium-pipe/*.so %endif %if 0%{?with_omx} %files omx-drivers #{_libdir}/bellagio/libomx_mesa.so %endif %if 0%{?with_opencl} %files -n %libclname %{_libdir}/libMesaOpenCL.so.* %{_sysconfdir}/OpenCL/vendors/mesa.icd %files -n %libcldevel %{_libdir}/libMesaOpenCL.so %if 0%{?with_rusticl} %files -n %librusticlname %{_libdir}/libRusticlOpenCL.so.* %{_sysconfdir}/OpenCL/vendors/rusticl.icd %files -n %librusticldevel %{_libdir}/libRusticlOpenCL.so %endif %endif %files -n %{libglname} %dir %{_libdir}/mesa %if 0%{?with_glvnd} %{_libdir}/libGLX_mesa.so.* %{_libdir}/mesa/libGLX_mesa.so.* %{_libdir}/libGLX_indirect.so.* %{_libdir}/libGLX_system.so.* %else %{_libdir}/libGL.so.* %{_libdir}/mesa/libGL.so.%{glmajor}{,.*} %endif %files -n %{libeglname} %if 0%{?with_glvnd} %{_libdir}/libEGL_mesa.so.* %{_datadir}/glvnd/egl_vendor.d/50_mesa.json %else %{_libdir}/libEGL.so.%{eglmajor}{,.*} %endif %files -n %{libosmesaname} %{_libdir}/libOSMesa.so.%{osmesamajor}{,.*} %files -n %{libglapiname} #{_libdir}/libglapi.so.#{glapimajor}{,.*} %files -n %{libglesv1name} %if 0%{?with_glvnd} == 0 %{_libdir}/libGLESv1_CM.so.%{glesv1major}{,.*} %endif %files -n %{libd3dname} %{_libdir}/d3d/*.so.* %files -n %{libglesv2name} %if 0%{?with_glvnd} == 0 %{_libdir}/libGLESv2.so.%{glesv2major}{,.*} %endif %files -n %{libgbmname} %{_libdir}/libgbm.so.%{gbmmajor} %{_libdir}/libgbm.so.%{gbmmajor}.* %{_libdir}/gbm/dri_gbm.so %files -n %{libxaname} %{_libdir}/libxatracker.so.%{xamajor}{,.*} %files -n %{devglname} %dir %{_includedir}/GL %if 0%{?with_glvnd} %{_libdir}/libGLX_mesa.so %else %{_includedir}/GL/gl.h %{_includedir}/GL/glext.h %{_includedir}/GL/glx.h %{_includedir}/GL/glxext.h %{_includedir}/GL/glcorearb.h %{_libdir}/libGL.so %{_libdir}/pkgconfig/gl.pc %endif %dir %{_includedir}/GL/internal %{_includedir}/GL/internal/dri_interface.h %{_libdir}/pkgconfig/dri.pc %files common-devel %files -n %{deveglname} %{_includedir}/EGL %if 0%{?with_glvnd} %{_libdir}/libEGL_mesa.so %else %{_libdir}/libEGL.so %{_libdir}/pkgconfig/egl.pc %endif %files -n %{khrdevel} %if 0%{?with_glvnd} == 0 %{_includedir}/KHR %endif %files -n %{osmesadevel} %if 0%{?with_docs} %doc docs doxygen/main %endif %dir %{_includedir}/GL %{_includedir}/GL/osmesa.h %{_libdir}/libOSMesa.so %{_libdir}/pkgconfig/osmesa.pc %files -n %{devglapiname} #{_libdir}/libglapi.so %files -n %{devglesv1name} %if 0%{?with_glvnd} == 0 %{_includedir}/GLES %{_libdir}/libGLESv1_CM.so %{_libdir}/pkgconfig/glesv1_cm.pc %endif %files -n %{devglesv2name} %if 0%{?with_glvnd} == 0 %{_includedir}/GLES2 %{_includedir}/GLES3 %{_libdir}/libGLESv2.so %{_libdir}/pkgconfig/glesv2.pc %endif %files -n %{devd3dname} %{_includedir}/d3dadapter %{_libdir}/d3d/*.so %{_libdir}/pkgconfig/d3d.pc %files -n %{devgbmname} %{_libdir}/libgbm.so %{_includedir}/gbm.h %{_libdir}/pkgconfig/gbm.pc %files -n %{devxaname} %{_libdir}/libxatracker.so %{_includedir}/xa_tracker.h %{_includedir}/xa_composite.h %{_includedir}/xa_context.h %{_libdir}/pkgconfig/xatracker.pc %files -n %{_lib}vdpau-driver-nouveau %{_libdir}/vdpau/libvdpau_nouveau.so.* %if 0%{?with_radeonsi} %files -n %{_lib}vdpau-driver-r600 %{_libdir}/vdpau/libvdpau_r600.so.* %files -n %{_lib}vdpau-driver-radeonsi %{_libdir}/vdpau/libvdpau_radeonsi.so.* %endif %files -n %{_lib}vdpau-driver-virtio_gpu %{_libdir}/vdpau/libvdpau_virtio_gpu.so.* %files -n %{_lib}vdpau-driver-gallium %{_libdir}/vdpau %files -n %{vulkandrivers} %dir %{_datadir}/vulkan %dir %{_datadir}/vulkan/icd.d %{_libdir}/libvulkan_lvp.so %{_datadir}/vulkan/icd.d/lvp_icd.*.json %{_libdir}/libVkLayer_MESA_device_select.so %{_libdir}/libVkLayer_MESA_overlay.so %{_datadir}/vulkan/explicit_layer.d/VkLayer_MESA_overlay.json %{_datadir}/vulkan/implicit_layer.d/VkLayer_MESA_device_select.json %if 0%{?with_vulkan_hw} %{_libdir}/libvulkan_radeon.so %{_datadir}/vulkan/icd.d/radeon_icd.*.json %if 0%{?with_nvk} %{_libdir}/libvulkan_nouveau.so %{_datadir}/vulkan/icd.d/nouveau_icd.*.json %endif %ifarch %{ix86} x86_64 %{_libdir}/libvulkan_intel.so %{_datadir}/vulkan/icd.d/intel_icd.*.json %{_libdir}/libvulkan_intel_hasvk.so %{_datadir}/vulkan/icd.d/intel_hasvk_icd.*.json %{_libdir}/libVkLayer_INTEL_nullhw.so %{_datadir}/vulkan/explicit_layer.d/VkLayer_INTEL_nullhw.json %endif %ifarch %{arm} aarch64 %{_libdir}/libvulkan_broadcom.so %{_datadir}/vulkan/icd.d/broadcom_icd.*.json %{_libdir}/libvulkan_freedreno.so %{_datadir}/vulkan/icd.d/freedreno_icd.*.json %{_libdir}/libvulkan_panfrost.so %{_datadir}/vulkan/icd.d/panfrost_icd.*.json %{_libdir}/libpowervr_rogue.so %{_libdir}/libvulkan_powervr_mesa.so %{_datadir}/vulkan/icd.d/powervr_mesa_icd.*.json %endif %{_libdir}/libvulkan_virtio.so %{_datadir}/vulkan/icd.d/virtio_icd.*.json %endif %files -n %{vulkandevel}