# (until they start to be somehow versioned themselves)
%define glapi_ver 7.1.0
# other packages
-%define libdrm_ver 2.4.100
+%define libdrm_ver 2.4.102
%define dri2proto_ver 2.8
%define glproto_ver 1.4.14
%define zlib_ver 1.2.8
%undefine with_swr
%endif
+%if %{with gallium_radeon} || %{with gallium_nouveau}
+%define with_vdpau 1
+%define with_xvmc 1
+%endif
+
Summary: Free OpenGL implementation
Summary(pl.UTF-8): Wolnodostępna implementacja standardu OpenGL
Name: Mesa
-Version: 20.0.5
+Version: 20.2.2
Release: 1
License: MIT (core) and others - see license.html file
Group: X11/Libraries
#Source0: ftp://ftp.freedesktop.org/pub/mesa/mesa-%{version}.tar.xz
## Source0-md5: 7c61a801311fb8d2f7b3cceb7b5cf308
Source0: https://gitlab.freedesktop.org/mesa/mesa/-/archive/mesa-%{version}/mesa-mesa-%{version}.tar.bz2
-# Source0-md5: 8cead0e352499fbda32f1e6261e9f000
+# Source0-md5: 1b3618f475afb777d8ced7231a613a41
Patch0: nouveau_no_rtti.patch
Patch1: i9x5-tex-ignore-the-diff-between-GL_TEXTURE_2D-and-GL_TEXTURE_RECTANGLE.patch
-Patch2: llvm10.patch
URL: http://www.mesa3d.org/
%{?with_opencl_spirv:BuildRequires: SPIRV-LLVM-Translator-devel >= 0.2.1}
%{?with_gallium_zink:BuildRequires: Vulkan-Loader-devel}
+BuildRequires: bison >= 2.3
%{?with_opencl:BuildRequires: clang-devel >= %{llvm_ver}}
BuildRequires: elfutils-devel
BuildRequires: expat-devel >= 1.95
+BuildRequires: flex
BuildRequires: gcc >= %{gcc_ver}
BuildRequires: libdrm-devel >= %{libdrm_ver}
-%{?with_glvnd:BuildRequires: libglvnd-devel >= 1.2.0}
+%{?with_glvnd:BuildRequires: libglvnd-devel >= 1.3.2}
BuildRequires: libselinux-devel
BuildRequires: libstdc++-devel >= %{gcc_ver}
BuildRequires: libunwind-devel
%{?with_va:BuildRequires: libva-devel}
%{?with_va:BuildRequires: pkgconfig(libva) >= 0.39.0}
-BuildRequires: libvdpau-devel >= 1.1
+%{?with_vdpau:BuildRequires: libvdpau-devel >= 1.1}
BuildRequires: libxcb-devel >= 1.13
%{?with_gallium:BuildRequires: llvm-devel >= %{llvm_ver}}
%{?with_radv:BuildRequires: llvm-devel >= %{llvm_ver}}
%{?with_opencl:BuildRequires: llvm-libclc}
%{?with_omx:BuildRequires: libomxil-bellagio-devel}
-BuildRequires: meson >= 0.51
+BuildRequires: meson >= 0.52
BuildRequires: ninja >= 1.5
BuildRequires: pkgconfig
BuildRequires: pkgconfig(talloc) >= 2.0.1
%{?with_wayland:BuildRequires: wayland-egl-devel >= %{wayland_ver}}
BuildRequires: xorg-lib-libXdamage-devel >= 1.1
BuildRequires: xorg-lib-libXext-devel >= 1.0.5
-BuildRequires: xorg-lib-libXfixes-devel
+BuildRequires: xorg-lib-libXfixes-devel >= 2.0
BuildRequires: xorg-lib-libXrandr-devel >= 1.3
BuildRequires: xorg-lib-libXv-devel
-BuildRequires: xorg-lib-libXvMC-devel >= 1.0.6
+%{?with_xvmc:BuildRequires: xorg-lib-libXvMC-devel >= 1.0.6}
BuildRequires: xorg-lib-libXxf86vm-devel
BuildRequires: xorg-lib-libxshmfence-devel >= 1.1
BuildRequires: xorg-proto-dri2proto-devel >= %{dri2proto_ver}
Requires: xorg-lib-libX11-devel
Requires: xorg-lib-libXdamage-devel >= 1.1
Requires: xorg-lib-libXext-devel >= 1.0.5
-Requires: xorg-lib-libXfixes-devel
+Requires: xorg-lib-libXfixes-devel >= 2.0
Requires: xorg-lib-libXxf86vm-devel
Requires: xorg-proto-dri2proto-devel >= %{dri2proto_ver}
Requires: xorg-proto-glproto-devel >= %{glproto_ver}
%setup -q -n mesa-mesa-%{version}
%patch0 -p1
%patch1 -p1
-%patch2 -p1
%build
%if %{with opencl}
kmsro \
lima \
panfrost \
-tegra \
+%{?with_gallium_nouveau:tegra} \
v3d \
vc4 \
%endif
vulkan_drivers=$(echo $vulkan_drivers | xargs | tr ' ' ',')
%meson build \
- -Dplatforms=x11,drm%{?with_wayland:,wayland},surfaceless \
- -Ddri3=true \
+ -Dplatforms=x11%{?with_wayland:,wayland} \
+ -Ddri3=enabled \
-Ddri-drivers=${dri_drivers} \
-Ddri-drivers-path=%{_libdir}/xorg/modules/dri \
- -Degl=%{?with_egl:true}%{!?with_egl:false} \
+ -Degl=%{?with_egl:enabled}%{!?with_egl:disabled} \
-Dgallium-drivers=${gallium_drivers} \
%{?with_hud_extra:-Dgallium-extra-hud=true} \
-Dgallium-nine=%{?with_nine:true}%{!?with_nine:false} \
%else
-Dgallium-opencl=disabled \
%endif
- -Dgallium-va=%{?with_va:true}%{!?with_va:false} \
- -Dgallium-vdpau=true \
- -Dgallium-xvmc=true \
- -Dgallium-xa=%{?with_xa:true}%{!?with_xa:false} \
- -Dgbm=%{?with_gbm:true}%{!?with_gbm:false} \
+ -Dgallium-va=%{?with_va:enabled}%{!?with_va:disabled} \
+ %{?with_vdpau:-Dgallium-vdpau=enabled} \
+ %{?with_xvmc:-Dgallium-xvmc=enabled} \
+ -Dgallium-xa=%{?with_xa:enabled}%{!?with_xa:disabled} \
+ -Dgbm=%{?with_gbm:enabled}%{!?with_gbm:disabled} \
-Dglvnd=%{?with_glvnd:true}%{!?with_glvnd:false} \
- -Dlibunwind=true \
- -Dlmsensors=%{?with_lm_sensors:true}%{!?with_lm_sensors:false} \
+ -Dlibunwind=enabled \
+ -Dlmsensors=%{?with_lm_sensors:enabled}%{!?with_lm_sensors:disabled} \
%{?with_opencl_spirv:-Dopencl-spirv=true} \
-Dosmesa=%{?with_gallium:gallium}%{!?with_gallium:classic} \
-Dselinux=true \
%clean
rm -rf $RPM_BUILD_ROOT
+%post OpenCL-icd -p /sbin/ldconfig
+%postun OpenCL-icd -p /sbin/ldconfig
+
%post libEGL -p /sbin/ldconfig
%postun libEGL -p /sbin/ldconfig
%files libGL
%defattr(644,root,root,755)
-%doc docs/{*.html,README.UVD,features.txt,relnotes/*.html}
+%doc docs/{*.rst,README.UVD,features.txt,relnotes/*.rst}
%if %{with glvnd}
%attr(755,root,root) %{_libdir}/libGLX_mesa.so.*.*
%attr(755,root,root) %ghost %{_libdir}/libGLX_mesa.so.0
%files libGL-devel
%defattr(644,root,root,755)
-%doc docs/specs/*
+%doc docs/_extra/specs/*
%if %{without glvnd}
%dir %{_includedir}/GL
%{_includedir}/GL/gl.h
%if %{with gallium_nouveau}
%files libXvMC-nouveau
%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libXvMCnouveau.so.1.*.*
+%attr(755,root,root) %ghost %{_libdir}/libXvMCnouveau.so.1
%attr(755,root,root) %{_libdir}/libXvMCnouveau.so
%endif
%if %{with gallium_radeon}
%files libXvMC-r600
%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libXvMCr600.so.1.*.*
+%attr(755,root,root) %ghost %{_libdir}/libXvMCr600.so.1
%attr(755,root,root) %{_libdir}/libXvMCr600.so
%endif
%endif
%endif
+%ifarch %{ix86} %{x8664} x32
%files dri-driver-intel-i915
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/xorg/modules/dri/i915_dri.so
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/xorg/modules/dri/iris_dri.so
%endif
+%endif
%files dri-driver-nouveau
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/xorg/modules/dri/swrast_dri.so
%if %{with gallium}
-%ifarch %{arm}
+%ifarch %{arm} aarch64
%files dri-driver-etnaviv
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/xorg/modules/dri/etnaviv_dri.so
-%attr(755,root,root) %{_libdir}/xorg/modules/dri/imx-drm_dri.so
%files dri-driver-freedreno
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/xorg/modules/dri/ili9225_dri.so
%attr(755,root,root) %{_libdir}/xorg/modules/dri/ili9341_dri.so
%attr(755,root,root) %{_libdir}/xorg/modules/dri/imx-drm_dri.so
+%attr(755,root,root) %{_libdir}/xorg/modules/dri/ingenic-drm_dri.so
+%attr(755,root,root) %{_libdir}/xorg/modules/dri/mcde_dri.so
%attr(755,root,root) %{_libdir}/xorg/modules/dri/meson_dri.so
%attr(755,root,root) %{_libdir}/xorg/modules/dri/mi0283qt_dri.so
+%attr(755,root,root) %{_libdir}/xorg/modules/dri/mxsfb-drm_dri.so
%attr(755,root,root) %{_libdir}/xorg/modules/dri/pl111_dri.so
%attr(755,root,root) %{_libdir}/xorg/modules/dri/repaper_dri.so
%attr(755,root,root) %{_libdir}/xorg/modules/dri/rockchip_dri.so
%attr(755,root,root) %{_libdir}/xorg/modules/dri/st7586_dri.so
%attr(755,root,root) %{_libdir}/xorg/modules/dri/st7735r_dri.so
+%attr(755,root,root) %{_libdir}/xorg/modules/dri/stm_dri.so
%attr(755,root,root) %{_libdir}/xorg/modules/dri/sun4i-drm_dri.so
%files dri-driver-lima
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/xorg/modules/dri/panfrost_dri.so
+%if %{with gallium_nouveau}
%files dri-driver-tegra
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/xorg/modules/dri/tegra_dri.so
+%endif
%files dri-driver-v3d
%defattr(644,root,root,755)
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/xorg/modules/dri/virtio_gpu_dri.so
+%ifarch %{ix86} %{x8664} x32
%files dri-driver-vmwgfx
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/xorg/modules/dri/vmwgfx_dri.so
+%endif
%if %{with gallium_zink}
%files dri-driver-zink
%attr(755,root,root) %{_libdir}/bellagio/libomx_mesa.so
%endif
+%ifarch %{ix86} %{x8664} x32
%files vulkan-icd-intel
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/libvulkan_intel.so
%files vulkan-icd-intel-devel
%defattr(644,root,root,755)
%{_includedir}/vulkan/vulkan_intel.h
+%endif
%if %{with radv}
%files vulkan-icd-radeon