# 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_with opencl %bcond_without osmesa %bcond_without osmesa_gallium %bcond_with va %bcond_without vdpau %bcond_without wayland %{?build_selinux}%{?!build_selinux:%bcond_with selinux} # Direct3D9 state tracker ("nine") %bcond_without nine %ifarch %{arm} %define dri_drivers "nouveau,r200,radeon" %else %define dri_drivers "i915,i965,nouveau,r200,radeon" %bcond_without vmware %endif %define gallium_drivers r300,r600,radeonsi,nouveau,svga,swrast,ilo Summary: OpenGL-compatible 3D graphics library Name: mesa Version: 11.0.6 Release: 1 License: MIT Group: System/Libraries Url: http://www.mesa3d.org Source0: ftp://ftp.freedesktop.org/pub/mesa/%{version}/mesa-%{version}.tar.xz Source1: mesa.rpmlintrc Source3: make-git-snapshot.sh Patch1: mesa-9.2-hardware-float.patch Patch2: mesa-10.2-evergreen-big-endian.patch BuildRequires: bison BuildRequires: flex BuildRequires: gccmakedep BuildRequires: libxml2-python BuildRequires: makedepend BuildRequires: elfutils-devel BuildRequires: llvm-devel BuildRequires: pkgconfig(expat) BuildRequires: pkgconfig(libdrm) >= 2.4.56 BuildRequires: pkgconfig(libudev) %if %{with va} BuildRequires: pkgconfig(libva) %endif BuildRequires: pkgconfig(talloc) %if %{with vdpau} BuildRequires: pkgconfig(vdpau) %endif %if %{with wayland} BuildRequires: pkgconfig(wayland-client) %endif BuildRequires: pkgconfig(x11) BuildRequires: pkgconfig(xdamage) BuildRequires: pkgconfig(xext) BuildRequires: pkgconfig(xfixes) BuildRequires: pkgconfig(xi) BuildRequires: pkgconfig(xmu) BuildRequires: pkgconfig(xproto) BuildRequires: pkgconfig(xt) 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 # [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). # Mesa 10.x does not provide dricore library anymore. The DRI drivers now # get what they need some other way (see also mesa repo, # commit dde9260fdc1fb6792df24a4790ea1c255ad9284a, # "mesa: Remove dricore from the build") # # We need these obsoletes in case someone is updating the system from # ROSA R3 or ROSA 2012 LTS, etc. %define dricoremajor 1 %define libdricore %mklibname dricore %{dricoremajor} %define devdricore %mklibname dricore -d Obsoletes: %{libdricore} < %{EVRD} Obsoletes: %{devdricore} < %{EVRD} %description Mesa is an OpenGL compatible 3D graphics library. This particular package contains no libraries but rather the common files. %files %doc docs/COPYING docs/README.* %config(noreplace) %{_sysconfdir}/drirc #---------------------------------------------------------------------------- %define dridrivers %mklibname dri-drivers %package -n %{dridrivers} Summary: Mesa DRI drivers Group: System/Libraries %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/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/ilo_dri.so %if %{with va} %{_libdir}/dri/gallium_drv_video.so %endif # xvmc state tracker backends %{_libdir}/libXvMCnouveau.so.* %{_libdir}/libXvMCr600.so.* %{_libdir}/libXvMCgallium.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.* # 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. #---------------------------------------------------------------------------- %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} %doc docs/COPYING %{_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} %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} %doc docs/COPYING %{_includedir}/GL/gl.h %{_includedir}/GL/gl_mangle.h %{_includedir}/GL/glext.h %{_includedir}/GL/glx.h %{_includedir}/GL/glxext.h %{_includedir}/GL/glx_mangle.h %if !%{with osmesa} %{_includedir}/GL/osmesa.h %endif %{_includedir}/GL/wglext.h %{_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} %doc docs/COPYING %{_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} %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} %doc docs/COPYING %{_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} %doc docs/COPYING %{_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} %doc docs/COPYING %{_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} %doc docs/COPYING %{_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} %doc docs/COPYING %{_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} %doc docs/COPYING %{_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} %doc docs/COPYING %{_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 = %{version}-%{release} %description -n %{devglesv3} This package contains the headers needed to compile OpenGL ES 3 programs. %files -n %{devglesv3} %doc docs/COPYING %{_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} %doc docs/COPYING %{_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} %doc docs/COPYING %{_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} %doc docs/COPYING %{_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} %doc docs/COPYING %{_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} %doc docs/COPYING %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} %doc docs/COPYING %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} %doc docs/COPYING %{_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} %doc docs/COPYING %dir %{_includedir}/GL %{_includedir}/GL/osmesa.h %{_libdir}/libOSMesa.so %{_libdir}/pkgconfig/osmesa.pc %endif #---------------------------------------------------------------------------- %if %{with wayland} %define waylandeglmajor 1 %define libwaylandegl %mklibname wayland-egl %{waylandeglmajor} %package -n %{libwaylandegl} Summary: Files for Mesa (Wayland EGL libs) Group: System/Libraries %description -n %{libwaylandegl} Mesa is an OpenGL compatible 3D graphics library: Wayland EGL platform parts. %files -n %{libwaylandegl} %doc docs/COPYING %{_libdir}/libwayland-egl.so.%{waylandeglmajor}* %endif #---------------------------------------------------------------------------- %if %{with wayland} %define devwaylandegl %mklibname wayland-egl -d %package -n %{devwaylandegl} Summary: Development files for Mesa (Wayland EGL libs) Group: Development/C Requires: %{libwaylandegl} = %{EVRD} %description -n %{devwaylandegl} Mesa is an OpenGL compatible 3D graphics library. This package contains the headers needed to compile Mesa programs based on Wayland EGL platform. %files -n %{devwaylandegl} %doc docs/COPYING %{_libdir}/libwayland-egl.so %{_libdir}/pkgconfig/wayland-egl.pc %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 wayland} Requires: %{devwaylandegl} = %{EVRD} %endif %if %{with osmesa} Requires: %{devosmesa} = %{EVRD} %endif %if %{with nine} Requires: %{devd3dtracker} = %{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 #---------------------------------------------------------------------------- %prep %setup -q %apply_patches %build # Always (re)generate auto* generated files using our autotools and libtoolize autoreconf -vfi # Support for DRI3 starts from Xorg 1.15. When building Mesa for an older # version of Xorg, replace --enable-dri3 with --disable-dri3 below. %configure2_5x \ %if %{with selinux} --enable-selinux \ %endif --enable-dri \ --enable-dri3 \ --enable-vdpau \ %if %{with va} --enable-va \ %else --disable-va \ %endif --disable-omx \ %if %{with opencl} --enable-opencl \ TODO: if OpenCL support in Mesa is needed, it needs more work %else --disable-opencl \ %endif %if %{with osmesa} %if %{with osmesa_gallium} --enable-gallium-osmesa \ %else --enable-osmesa \ %endif %endif --with-dri-driverdir=%{_libdir}/dri \ --with-dri-drivers="%{dri_drivers}" \ --enable-r600-llvm-compiler \ %if %{with vmware} --enable-xa \ %endif %if %{with nine} --enable-nine \ %else --disable-nine \ %endif --with-gallium-drivers="%{gallium_drivers}" \ --enable-gallium-llvm \ --enable-egl \ --enable-gbm \ --enable-gles1 \ --enable-gles2 \ --enable-shared-glapi \ %if %{with wayland} --with-egl-platforms=x11,drm,surfaceless,wayland \ %else --with-egl-platforms=x11,drm,surfaceless \ %endif --enable-glx-tls \ --enable-texture-float=yes \ --enable-xvmc %make %install %makeinstall_std # 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}%{_prefix}/lib/dri %endif rm -f %{buildroot}/%{_includedir}/GL/glut.h rm -f %{buildroot}/%{_includedir}/GL/glutf90.h # .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