mesa/mesa.spec
Your Name b40349dd24
Some checks failed
Run CI/CD... / main (push) Failing after 1m18s
Add .gitignore and .gitea/workflows/ci.yml
2025-01-31 15:18:52 +00:00

814 lines
23 KiB
RPMSpec

%define __noautoreq 'devel\\(libLLVM.*'
# FIXME: fix the cases when immediate symbol resolution is not enough.
# For the present, fall back to the old symbol resolution rules for ld.
%define _disable_ld_now 1
%bcond_without dri3
%bcond_with opencl
%bcond_without osmesa
%bcond_without osmesa_gallium
%bcond_without va
%bcond_without vdpau
%bcond_without wayland
%{?build_selinux}%{?!build_selinux:%bcond_with selinux}
# Direct3D9 state tracker ("nine")
%bcond_without nine
# Vulkan
%bcond_without vulkan
%define vulkan_drivers --with-vulkan-drivers=intel,radeon
%ifarch %{arm}
%define dri_drivers "swrast,nouveau,r200,radeon"
%else
%define dri_drivers "swrast,i915,i965,nouveau,r200,radeon"
%bcond_without vmware
%endif
%define gallium_drivers r300,r600,radeonsi,nouveau,svga,swrast,virgl
Summary: OpenGL-compatible 3D graphics library
Name: mesa
Version: 20.1.10
Release: 2
License: MIT
Group: System/Libraries
Url: http://www.mesa3d.org
Source0: https://mesa.freedesktop.org/archive/mesa-%{version}.tar.xz
Source3: make-git-snapshot.sh
Source101: mesa.rpmlintrc
Patch0: mesa-11.2-evergreen-big-endian.patch
Patch1: mesa-19.2.3-arm32-buildfix.patch
BuildRequires: cmake
BuildRequires: meson >= 0.48.0
BuildRequires: intltool
BuildRequires: itstool
BuildRequires: bison
BuildRequires: flex
BuildRequires: elfutils-devel
BuildRequires: gccmakedep
BuildRequires: libxml2-python
BuildRequires: lm_sensors-devel
BuildRequires: pkgconfig(libomxil-bellagio)
BuildRequires: makedepend
BuildRequires: python3-mako
BuildRequires: pkgconfig(epoxy)
BuildRequires: pkgconfig(expat)
BuildRequires: pkgconfig(gtk+-3.0)
BuildRequires: pkgconfig(libdrm) >= 2.4.99
BuildRequires: pkgconfig(libunwind)
BuildRequires: pkgconfig(python3)
%if %{with va}
BuildRequires: pkgconfig(libva)
%endif
BuildRequires: pkgconfig(talloc)
%if %{with vdpau}
BuildRequires: pkgconfig(vdpau)
%endif
BuildRequires: gcc >= 5.3
BuildRequires: clang >= 7.0.0
BuildRequires: clang-devel >= 7.0.0
BuildRequires: llvm >= 7.0.0
BuildRequires: llvm-devel >= 7.0.0
%if %{without opencl}
BuildRequires: opencl-headers >= 2.1
BuildRequires: pkgconfig(OpenCL) >= 2.1
%endif
%if %{with wayland}
BuildRequires: pkgconfig(wayland-client) >= 1.11
BuildRequires: pkgconfig(wayland-protocols)
%endif
BuildRequires: pkgconfig(x11)
BuildRequires: pkgconfig(xdamage)
BuildRequires: pkgconfig(xext)
BuildRequires: pkgconfig(xfixes)
BuildRequires: pkgconfig(xi)
BuildRequires: pkgconfig(xmu)
BuildRequires: pkgconfig(xproto)
BuildRequires: pkgconfig(xrandr)
BuildRequires: pkgconfig(xt)
BuildRequires: pkgconfig(xv)
BuildRequires: pkgconfig(xvmc)
BuildRequires: pkgconfig(xxf86vm)
# Needed to build with support for DRI2 and DRI3 X11 extensions.
BuildRequires: pkgconfig(dri2proto)
BuildRequires: pkgconfig(dri3proto)
BuildRequires: pkgconfig(xshmfence)
BuildRequires: pkgconfig(xcb-dri3)
BuildRequires: pkgconfig(xcb-present)
%if %{with selinux}
BuildRequires: libselinux-devel
%endif
%if %{with vulkan}
# for SHA1 implementation from libnettle:
BuildRequires: pkgconfig(nettle)
BuildRequires: pkgconfig(vulkan)
%endif
# [NB] Do not mark it noarch, otherwise rpm will be confused on where
# to store debuginfo for the subpackages (all debug info should be stored
# in mesa-debuginfo).
%description
Mesa is an OpenGL compatible 3D graphics library. This particular package
contains no libraries but rather the common files.
%files
%doc docs/README.*
#----------------------------------------------------------------------------
%if %{with opencl}
# In Rosa 2016.1 we have indipendent libopencl packages
%define clmajor 1
%define clname mesaopencl
%define libclname %mklibname %{clname} %{clmajor}
%define develcl %mklibname %{clname} -d
%package -n %{libclname}
Summary: Files for MESA (OpenCL libraries)
Group: System/Libraries
%description -n %{libclname}
Open Computing Language (OpenCL) is a framework for writing programs that
execute across heterogeneous platforms consisting of central processing units
(CPUs), graphics processing units (GPUs), DSPs and other processors.
OpenCL includes a language (based on C99) for writing kernels (functions that
execute on OpenCL devices), plus application programming interfaces (APIs)
that are used to define and then control the platforms. OpenCL provides
parallel computing using task-based and data-based parallelism. OpenCL is an
open standard maintained by the non-profit technology consortium Khronos
Group. It has been adopted by Intel, AMD, Nvidia, and ARM Holdings.
%files -n %{libclname}
%doc VERSION
%config(noreplace) %{_sysconfdir}/OpenCL/vendors/mesa.icd
%{_libdir}/libMesaOpenCL.so.%{clmajor}*
%endif
#----------------------------------------------------------------------------
%define dridrivers %mklibname dri-drivers
%package -n %{dridrivers}
Summary: Mesa DRI drivers
Group: System/Libraries
# This helps if a user tries to install RPMs from Fedora and the like
# which often require mesa-dri-drivers.
Provides: mesa-dri-drivers = %{EVRD}
Requires: mesa = %{EVRD}
Requires(post): update-alternatives
Requires(postun): update-alternatives
%description -n %{dridrivers}
Mesa is an OpenGL compatible 3D graphics library. This
package contains the DRI drivers and also the experimental back-ends for the
vdpau and xvmc state trackers.
%files -n %{dridrivers}
%dir %{_libdir}/dri
%{_libdir}/dri/i915_dri.so
%{_libdir}/dri/i965_dri.so
%{_libdir}/dri/iris_dri.so
%{_libdir}/dri/nouveau_dri.so
%{_libdir}/dri/nouveau_vieux_dri.so
%{_libdir}/dri/r200_dri.so
%{_libdir}/dri/r300_dri.so
%{_libdir}/dri/r600_dri.so
%{_libdir}/dri/radeon_dri.so
%{_libdir}/dri/radeonsi_dri.so
%{_libdir}/dri/swrast_dri.so
%{_libdir}/dri/kms_swrast_dri.so
%{_libdir}/dri/vmwgfx_dri.so
%{_libdir}/dri/virtio_gpu_dri.so
%if %{with va}
%{_libdir}/dri/nouveau_drv_video.so
%{_libdir}/dri/r600_drv_video.so
%{_libdir}/dri/radeonsi_drv_video.so
%endif
%if %{with opencl}
################################
## gallium opencl pipe drivers
%dir %{_libdir}/gallium-pipe
%{_libdir}/gallium-pipe/pipe_nouveau.so
%{_libdir}/gallium-pipe/pipe_i915.so
%{_libdir}/gallium-pipe/pipe_r300.so
%{_libdir}/gallium-pipe/pipe_r600.so
%{_libdir}/gallium-pipe/pipe_radeonsi.so
%{_libdir}/gallium-pipe/pipe_swrast.so
%{_libdir}/gallium-pipe/pipe_vmwgfx.so
%endif
# omx_bellagio state tracker backends
%{_libdir}/bellagio/libomx_mesa.so
# vdpau state tracker backends
%{_libdir}/vdpau/libvdpau_nouveau.so.*
%{_libdir}/vdpau/libvdpau_r600.so.*
%{_libdir}/vdpau/libvdpau_r300.so.*
%{_libdir}/vdpau/libvdpau_radeonsi.so.*
%{_libdir}/libXvMCgallium.so.*
%{_libdir}/libXvMCnouveau.so.*
%{_libdir}/libXvMCr600.so.*
# XvMC and VDPAU are no longer supported for softpipe, see the commits
# 7c253184, 5f7233c8 and a few other in mesa git repo. For r300, VDPAU
# support has been re-enabled.
%post -n %{dridrivers}
set -efu
# /usr/share/drirc.d/00-mesa-defaults.conf
# cannot be coinstalled in packages of differents architectures,
# so we have to either rename it to 00-mesa-defaults_%{_arch}.conf
# or make it a symlink.
# The idea is that on x86_64 systems with installed 32-bit libdri-drivers
# symlink from 32-bit package will have lower priority, won't be created
# and so Mesa will not have to read the same config twice as it would be
# if we renamed it to 00-mesa-defaults_%{_arch}.conf.
%ifarch x86_64
alternatives_priority=10
%else
alternatives_priority=5
%endif
if [ ! -L %{_datadir}/drirc.d/00-mesa-defaults.conf ] && \
[ -f %{_datadir}/drirc.d/00-mesa-defaults.conf ]
then
# Workaround possible file conflicts between packages during upgrade
# from previous versions without update-alternatives
rm -fv %{_datadir}/drirc.d/00-mesa-defaults.conf
elif [ -L %{_datadir}/drirc.d/00-mesa-defaults.conf ] && \
! readlink %{_datadir}/drirc.d/00-mesa-defaults.conf | grep -q '/etc/alternatives/mesa_default_dri_conf$'
then
echo "%{_datadir}/drirc.d/00-mesa-defaults.conf seems to be a manually made symlink, we will NOT"
echo "point it to %{_defaultdocdir}/mesa/00-mesa-defaults_%{_arch}.conf.sample"
exit 0
fi
[ ! -d %{_datadir}/drirc.d/ ] && mkdir -p %{_datadir}/drirc.d/
if [ ! -f %{_defaultdocdir}/mesa/00-mesa-defaults_%{_arch}.conf.sample ]; then
# On x86_64 systems mesa:i586 may be not installed
# and then the second alternative will not exist
exit 0
fi
update-alternatives --install \
%{_datadir}/drirc.d/00-mesa-defaults.conf \
mesa_default_dri_conf \
%{_defaultdocdir}/mesa/00-mesa-defaults_%{_arch}.conf.sample \
"$alternatives_priority"
%postun -n %{dridrivers}
if [ $1 -eq 0 ]; then
update-alternatives --remove \
mesa_default_dri_conf \
%{_defaultdocdir}/mesa/00-mesa-defaults_%{_arch}.conf.sample && \
[ -d %{_datadir}/drirc.d/ ] && \
find %{_datadir}/drirc.d/ -maxdepth 0 -empty -exec rm -fr {} \; || :
fi
#----------------------------------------------------------------------------
%define glmajor 1
%define libgl %mklibname gl %{glmajor}
%package -n %{libgl}
Summary: Files for Mesa (GL and GLX libs)
Group: System/Libraries
Requires: %{dridrivers} = %{EVRD}
Suggests: %mklibname txc-dxtn
# Needed in case someone updates the system from ROSA 2012 LTS
Provides: libmesagl = %{EVRD}
%rename %{_lib}mesagl1
%description -n %{libgl}
Mesa is an OpenGL compatible 3D graphics library: GL
and GLX parts.
%files -n %{libgl}
%{_libdir}/libGL.so.%{glmajor}*
%dir %{_libdir}/mesa
%{_libdir}/mesa/libGL.so.%{glmajor}*
#----------------------------------------------------------------------------
%define devgl %mklibname gl -d
%package -n %{devgl}
Summary: Development files for Mesa (OpenGL compatible 3D lib)
Group: Development/C
Requires: %{libgl} = %{EVRD}
Requires: llvm-devel
# Uses header files from EGL development package
Requires: pkgconfig(egl)
%rename %{_lib}mesagl1-devel
%description -n %{devgl}
Mesa is an OpenGL compatible 3D graphics library. This
package contains the headers needed to compile Mesa programs.
%files -n %{devgl}
%{_includedir}/GL/gl.h
%{_includedir}/GL/glext.h
%{_includedir}/GL/glx.h
%{_includedir}/GL/glxext.h
%if !%{with osmesa}
%{_includedir}/GL/osmesa.h
%endif
%{_libdir}/libGL.so
%{_libdir}/libXvMC*.so
%{_libdir}/pkgconfig/gl.pc
%{_libdir}/pkgconfig/dri.pc
%{_includedir}/GL/glcorearb.h
%dir %{_includedir}/GL/internal
%{_includedir}/GL/internal/dri_interface.h
#----------------------------------------------------------------------------
%define eglmajor 1
%define libegl %mklibname egl %{eglmajor}
%package -n %{libegl}
Summary: Files for Mesa (EGL libs)
Group: System/Libraries
%rename %{_lib}mesaegl1
%description -n %{libegl}
Mesa is an OpenGL compatible 3D graphics library: EGL
parts.
%files -n %{libegl}
%{_libdir}/libEGL.so.%{eglmajor}*
#----------------------------------------------------------------------------
%define devegl %mklibname egl -d
%package -n %{devegl}
Summary: Development files for Mesa (EGL libs)
Group: Development/C
Requires: %{libegl} = %{EVRD}
# The development files for libxxf86vm are also needed here.
Requires: pkgconfig(xxf86vm)
%rename %{_lib}mesaegl1-devel
%description -n %{devegl}
Mesa is an OpenGL compatible 3D graphics library. This
package contains the headers needed to compile Mesa programs based on EGL.
%files -n %{devegl}
%{_includedir}/EGL
%{_includedir}/KHR
%{_libdir}/libEGL.so
%{_libdir}/pkgconfig/egl.pc
#----------------------------------------------------------------------------
%define gbmmajor 1
%define libgbm %mklibname gbm %{gbmmajor}
%package -n %{libgbm}
Summary: Files for Mesa (gbm libs)
Group: System/Libraries
%description -n %{libgbm}
Mesa is an OpenGL compatible 3D graphics library: GBM
(Graphics Buffer Manager) parts.
%files -n %{libgbm}
%{_libdir}/libgbm.so.%{gbmmajor}*
#----------------------------------------------------------------------------
%define devgbm %mklibname gbm -d
%package -n %{devgbm}
Summary: Development files for Mesa (gbm libs)
Group: Development/C
Requires: %{libgbm} = %{EVRD}
# libudev-devel is needed for development with gbm libs.
Requires: pkgconfig(libudev)
%description -n %{devgbm}
Mesa is an OpenGL compatible 3D graphics library. This
package contains the headers needed to compile Mesa programs based on GBM
(Graphics Buffer Manager).
%files -n %{devgbm}
%{_includedir}/gbm.h
%{_libdir}/libgbm.so
%{_libdir}/pkgconfig/gbm.pc
#----------------------------------------------------------------------------
%define glesv1major 1
%define libglesv1 %mklibname glesv1_ %{glesv1major}
%package -n %{libglesv1}
Summary: Files for Mesa (glesv1 libs)
Group: System/Libraries
%rename %{_lib}mesaglesv1_1
%description -n %{libglesv1}
Mesa is an OpenGL compatible 3D graphics library:
OpenGL ES library version 1 parts. OpenGL ES is a low-level, lightweight API
for advanced embedded graphics using well-defined subset profiles of OpenGL.
%files -n %{libglesv1}
%{_libdir}/libGLESv1_CM.so.%{glesv1major}*
#----------------------------------------------------------------------------
%define devglesv1 %mklibname glesv1 -d
%package -n %{devglesv1}
Summary: Development files for glesv1 libs
Group: Development/C
Requires: %{libglesv1} = %{EVRD}
%rename %{_lib}mesaglesv1_1-devel
%description -n %{devglesv1}
Mesa is an OpenGL compatible 3D graphics library. This
package contains the headers needed to compile OpenGL ES 1 programs.
%files -n %{devglesv1}
%{_includedir}/GLES
%{_libdir}/libGLESv1_CM.so
%{_libdir}/pkgconfig/glesv1_cm.pc
#----------------------------------------------------------------------------
%define glesv2major 2
%define libglesv2 %mklibname glesv2_ %{glesv2major}
%package -n %{libglesv2}
Summary: Files for Mesa (glesv2 libs)
Group: System/Libraries
%rename %{_lib}mesaglesv2_2
%description -n %{libglesv2}
Mesa is an OpenGL compatible 3D graphics library:
OpenGL ES library version 2 parts. OpenGL ES is a low-level, lightweight API
for advanced embedded graphics using well-defined subset profiles of OpenGL.
%files -n %{libglesv2}
%{_libdir}/libGLESv2.so.%{glesv2major}*
#----------------------------------------------------------------------------
%define devglesv2 %mklibname glesv2 -d
%package -n %{devglesv2}
Summary: Development files for glesv2 libs
Group: Development/C
Requires: %{libglesv2} = %{EVRD}
%rename %{_lib}mesaglesv2_2-devel
%description -n %{devglesv2}
Mesa is an OpenGL compatible 3D graphics library. This
package contains the headers needed to compile OpenGL ES 2 programs.
%files -n %{devglesv2}
%{_includedir}/GLES2
%{_libdir}/libGLESv2.so
%{_libdir}/pkgconfig/glesv2.pc
#----------------------------------------------------------------------------
%define devglesv3 %mklibname glesv3 -d
%package -n %{devglesv3}
Summary: Development files for glesv3 libs
Group: Development/C
# there is no pkgconfig
Provides: glesv3-devel = %{EVRD}
%description -n %{devglesv3}
This package contains the headers needed to compile OpenGL ES 3 programs.
%files -n %{devglesv3}
%{_includedir}/GLES3
#----------------------------------------------------------------------------
%define glapimajor 0
%define libglapi %mklibname glapi %{glapimajor}
%package -n %{libglapi}
Summary: Files for Mesa (glapi libs)
Group: System/Libraries
%description -n %{libglapi}
Mesa is an OpenGL compatible 3D graphics library. This
package provides the glapi shared library used by gallium drivers.
%files -n %{libglapi}
%{_libdir}/libglapi.so.%{glapimajor}*
#----------------------------------------------------------------------------
%define devglapi %mklibname glapi -d
%package -n %{devglapi}
Summary: Development files for glapi libs
Group: Development/C
Requires: %{libglapi} = %{EVRD}
Provides: glapi-devel = %{EVRD}
%description -n %{devglapi}
Mesa is an OpenGL compatible 3D graphics library. This
package contains the headers needed to compile programs against glapi shared
library.
%files -n %{devglapi}
%{_libdir}/libglapi.so
#----------------------------------------------------------------------------
%define xamajor 2
%define libxatracker %mklibname xatracker %{xamajor}
%define devxatracker %mklibname xatracker -d
%package -n %{libxatracker}
Summary: Mesa XA state tracker
Group: System/Libraries
%description -n %{libxatracker}
This package contains Mesa XA state tracker.
%files -n %{libxatracker}
%{_libdir}/libxatracker.so.%{xamajor}*
#----------------------------------------------------------------------------
%package -n %{devxatracker}
Summary: Development files for XA state tracker
Group: Development/C
Requires: %{libxatracker} = %{EVRD}
%description -n %{devxatracker}
This package contains the development files for the Mesa XA state tracker.
%files -n %{devxatracker}
%{_includedir}/xa_*.h
%{_libdir}/libxatracker.so
%{_libdir}/pkgconfig/xatracker.pc
#----------------------------------------------------------------------------
%define d3dmajor 1
%define libd3dtracker %mklibname d3dtracker %{d3dmajor}
%define devd3dtracker %mklibname d3dtracker -d
%package -n %{libd3dtracker}
Summary: Mesa Direct3D9 state tracker
Group: System/Libraries
%description -n %{libd3dtracker}
This package contains Mesa Direct3D9 ("nine") state tracker.
%files -n %{libd3dtracker}
%dir %{_libdir}/d3d
%{_libdir}/d3d/d3dadapter9.so.%{d3dmajor}*
#----------------------------------------------------------------------------
%package -n %{devd3dtracker}
Summary: Development files for Direct3D9 state tracker
Group: Development/C
Requires: %{libd3dtracker} = %{EVRD}
%description -n %{devd3dtracker}
This package contains the development files for the Mesa Direct3D9 ("nine")
state tracker.
%files -n %{devd3dtracker}
%dir %{_includedir}/d3dadapter
%{_includedir}/d3dadapter/*
%{_libdir}/d3d/d3dadapter9.so
%{_libdir}/pkgconfig/d3d.pc
#----------------------------------------------------------------------------
%if %{with osmesa}
%define osmesamajor 8
%define libosmesa %mklibname osmesa %{osmesamajor}
%package -n %{libosmesa}
Summary: Mesa offscreen rendering libraries
Group: System/Libraries
%description -n %{libosmesa}
Mesa is an OpenGL compatible 3D graphics library: Mesa
off-screen rendering library.
%files -n %{libosmesa}
%{_libdir}/libOSMesa.so.%{osmesamajor}*
%endif
#----------------------------------------------------------------------------
%if %{with osmesa}
%define devosmesa %mklibname osmesa -d
%package -n %{devosmesa}
Summary: Mesa offscreen rendering development package
Group: Development/C
Requires: %{libosmesa} = %{EVRD}
%description -n %{devosmesa}
Mesa is an OpenGL compatible 3D graphics library. This
package contains the Mesa off-screen rendering development files.
%files -n %{devosmesa}
%dir %{_includedir}/GL
%{_includedir}/GL/osmesa.h
%{_libdir}/libOSMesa.so
%{_libdir}/pkgconfig/osmesa.pc
%endif
#----------------------------------------------------------------------------
%if %{with vulkan}
%define vlkdrivers %mklibname vulkan-drivers
%define devvlkdrivers %mklibname vulkan-drivers -d
%package -n %{vlkdrivers}
Summary: Mesa Vulkan drivers
Requires: vulkan
Provides: mesa-vulkan-drivers = %{EVRD}
%description -n %{vlkdrivers}
The drivers with support for the Vulkan API.
%files -n %{vlkdrivers}
%{_libdir}/libvulkan_intel.so
%{_libdir}/libvulkan_radeon.so
%{_datadir}/vulkan/icd.d/intel_icd*.json
%{_datadir}/vulkan/icd.d/radeon_icd*.json
#----------------------------------------------------------------------------
%package -n %{devvlkdrivers}
Summary: Mesa Vulkan development files
Requires: %{vlkdrivers} = %{EVRD}
Requires: vulkan-devel
Provides: mesa-vulkan-devel = %{EVRD}
%description -n %{devvlkdrivers}
Mesa headers for development with the Vulkan API.
%files -n %{devvlkdrivers}
%{_includedir}/vulkan/
%endif
#----------------------------------------------------------------------------
%package common-devel
Summary: Meta package for Mesa development files
Group: Development/C
Requires: %{devgl} = %{EVRD}
Requires: %{devxatracker} = %{EVRD}
Requires: %{devegl} = %{EVRD}
Requires: %{devglapi} = %{EVRD}
Requires: %{devgbm} = %{EVRD}
Requires: %{devglesv1} = %{EVRD}
Requires: %{devglesv2} = %{EVRD}
Requires: %{devglesv3} = %{EVRD}
%if %{with osmesa}
Requires: %{devosmesa} = %{EVRD}
%endif
%if %{with nine}
Requires: %{devd3dtracker} = %{EVRD}
%endif
%if %{with vulkan}
Requires: %{devvlkdrivers} = %{EVRD}
%endif
Requires: pkgconfig(glu)
Requires: pkgconfig(glut)
%description common-devel
Mesa common meta package for development files.
%files common-devel
# This is the meta package for development
#----------------------------------------------------------------------------
%package tools
Summary: Tools for debugging Mesa drivers
Group: Development/Tools
%description tools
Tools for debugging Mesa drivers.
%files tools
%{_bindir}/aubinator
%{_bindir}/aubinator_error_decode
%{_bindir}/aubinator_viewer
%{_bindir}/glsl_compiler
%{_bindir}/glsl_test
%{_bindir}/i965_asm
%{_bindir}/i965_disasm
%{_bindir}/intel_dump_gpu
%{_bindir}/intel_error2aub
%{_bindir}/intel_sanitize_gpu
%{_bindir}/nouveau_compiler
%{_bindir}/spirv2nir
%{_bindir}/xvmc_bench
%{_bindir}/xvmc_blocks
%{_bindir}/xvmc_context
%{_bindir}/xvmc_rendering
%{_bindir}/xvmc_subpicture
%{_bindir}/xvmc_surface
%{_libexecdir}/libintel_dump_gpu.so
%{_libexecdir}/libintel_sanitize_gpu.so
#----------------------------------------------------------------------------
%prep
%setup -q
%apply_patches
%build
%global optflags %{optflags} -fno-strict-aliasing
%meson \
-Dplatforms=x11,wayland,drm,surfaceless \
-Ddri3=true \
-Dgallium-extra-hud=true \
-Dgallium-vdpau=true \
-Dgallium-xvmc=true \
-Dgallium-omx=bellagio \
%if %{with va}
-Dgallium-va=true \
%else
-Dgallium-va=false \
%endif
-Dgallium-xa=true \
-Dgallium-nine=true \
%if %{with opencl}
-Dgallium-opencl=icd \
%else
-Dgallium-opencl=disabled \
%endif
-Dgbm=true \
-Dglx=dri \
-Degl=true \
-Dllvm="true" \
-Dlibunwind=true \
-Dlmsensors=true \
-Dtexture-float=true \
-Dosmesa=gallium \
-Dgles1=true \
-Dgles2=true \
-Dglx-direct=true \
-Dopengl=true \
-Dshader-cache=true \
-Dshared-glapi=true \
-Dshared-llvm=true \
-Dtools=all \
-Dswr-arches=avx,avx2,knl,skx
%meson_build
%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 %{buildroot}%{_libdir}/mesa
pushd %{buildroot}%{_libdir}/mesa
for l in ../libGL.so.*; do cp -a $l .; done
popd
%ifarch x86_64
mkdir -p %{buildroot}%{_libdir}/dri
%endif
rm -f %{buildroot}/%{_includedir}/GL/glut.h
rm -f %{buildroot}/%{_includedir}/GL/glutf90.h
%if %{with vulkan}
# These headers are included into vulkan-devel already.
rm -f %{buildroot}/%{_includedir}/vulkan/vk_platform.h
rm -f %{buildroot}/%{_includedir}/vulkan/vulkan.h
%endif
# .so files are not needed by vdpau: there is not devel package
rm -f %{buildroot}%{_libdir}/vdpau/libvdpau_*.so
# Use swrastg if built (Anssi 12/2011)
[ -e %{buildroot}%{_libdir}/dri/swrastg_dri.so ] && mv %{buildroot}%{_libdir}/dri/swrast{g,}_dri.so
# Prevent file conflicts between coinstalled x86_64 and i586 packages.
# We also create symlink /usr/share/drirc.d/00-mesa-defaults.conf -> /usr/share/doc/mesa/00-mesa-defaults_%{_arch}.conf.sample
# by update-alternatives(8) in %post of lib(64)dri-drivers.
# We can't make 'mesa' a noarch package, see the comment about debuginfo above.
mkdir -p %{buildroot}%{_defaultdocdir}/mesa/
mv %{buildroot}%{_datadir}/drirc.d/00-mesa-defaults.conf %{buildroot}%{_defaultdocdir}/mesa/00-mesa-defaults_%{_arch}.conf.sample