mesa/mesa.spec
Eugene Shatokhin 90f53bd922 Sync to 2014.1
2014-12-19 20:10:05 +03:00

632 lines
17 KiB
RPMSpec

# 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 radeonsi
%bcond_with va
%bcond_without vdpau
%bcond_without wayland
%ifarch %{arm}
%define dri_drivers "nouveau,r200,radeon"
%else
%define dri_drivers "i915,i965,nouveau,r200,radeon"
%bcond_without vmware
%endif
# as for the dri drivers: so providing one.
%define gallium_drivers "r300,r600,nouveau,svga,swrast"
%if %{with radeonsi}
%define gallium_drivers "r300,r600,radeonsi,nouveau,svga,swrast"
%endif
Summary: OpenGL 3.x compatible 3D graphics library
Name: mesa
Version: 10.3.3
Release: 4
License: MIT
Group: System/Libraries
Url: http://www.mesa3d.org
Source0: ftp://ftp.freedesktop.org/pub/mesa/%{version}/MesaLib-%{version}.tar.bz2
Source1: mesa.rpmlintrc
Source3: make-git-snapshot.sh
Patch1: mesa-9.2-hardware-float.patch
Patch2: mesa-10.2-evergreen-big-endian.patch
# libXvMCnouveau.so.1.0.0 and libXvMCr600.so.1.0.0 are actually hard links
# to libXvMCgallium.so.1.0.0, which is not installed itself by default.
# However, the package build system seems to create libXvMCgallium.so.1
# symlink for these based on their soname and gets confused as a result.
# Make the Mesa's build system install libXvMCgallium.so.1.0.0 to avoid this
# mess.
Patch3: mesa-10.3-do-install-libxvmcgallium.patch
# fix crash when llvmpipe tries to use sse instructions,
# but llvm detects a cpu that doesn't support them.
# https://freedesktop.org/patch/34445/
Patch4: Mesa-dev-gallivm-force-sse-instructions-for-llvm-3.5.patch
# Fedora
Patch18: 0002-mesa-10.0-nv50-fix-build.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)
# [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/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
%if %{with radeonsi}
%{_libdir}/dri/radeonsi_dri.so
%endif
%{_libdir}/dri/swrast_dri.so
%{_libdir}/dri/kms_swrast_dri.so
%{_libdir}/dri/vmwgfx_dri.so
# 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.*
%if %{with radeonsi}
%{_libdir}/vdpau/libvdpau_radeonsi.so.*
%endif
# XvMC and VDPAU are no longer supported for r300 and softpipe, see the
# commits 7c253184, 5f7233c8 and a few other in mesa git repo.
#----------------------------------------------------------------------------
%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
# Should be removed when we cleanup other packages' Requires on this
Provides: libmesagl = %{EVRD}
%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}
%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/wmesa.h
%{_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
%description -n %{libegl}
Mesa is an OpenGL compatible 3D graphics library: EGL
parts.
%files -n %{libegl}
%doc docs/COPYING
%{_libdir}/libEGL.so.%{eglmajor}*
%dir %{_libdir}/egl
%{_libdir}/egl/egl_gallium.so
#----------------------------------------------------------------------------
%define devegl %mklibname egl -d
%package -n %{devegl}
Summary: Development files for Mesa (EGL libs)
Group: Development/C
Requires: %{libegl} = %{EVRD}
%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}*
%{_libdir}/gbm/gbm_*.so
#----------------------------------------------------------------------------
%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
%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}
%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
%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}
%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
packages 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}
%package -n %{libxatracker}
Summary: Files for Mesa (xa state tracker)
Group: System/Libraries
%description -n %{libxatracker}
Mesa is an OpenGL compatible 3D graphics library: Mesa
back-end for the xa state tracker.
%files -n %{libxatracker}
%doc docs/COPYING
%{_libdir}/libxatracker.so.%{xamajor}*
#----------------------------------------------------------------------------
%define devxatracker %mklibname xatracker -d
%package -n %{devxatracker}
Summary: Development files for xa state tracker
Group: Development/C
Requires: %{libxatracker} = %{EVRD}
%description -n %{devxatracker}
Mesa is an OpenGL compatible 3D graphics library. This
package contains the headers needed to compile programs against the xa state
tracker.
%files -n %{devxatracker}
%doc docs/COPYING
%{_includedir}/xa_*.h
%{_libdir}/libxatracker.so
%{_libdir}/pkgconfig/xatracker.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
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 -n Mesa-%{version}
%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 \
--enable-dri \
--enable-dri3 \
--enable-vdpau \
%if %{with opencl}
--enable-opencl \
TODO: if OpenCL support in Mesa is needed, it needs more work
%else
--disable-opencl \
%endif
%if %{with osmesa}
--enable-osmesa \
%endif
--with-dri-driverdir=%{_libdir}/dri \
--with-dri-drivers="%{dri_drivers}" \
--enable-r600-llvm-compiler \
%if %{with vmware}
--enable-xa \
%endif
--with-gallium-drivers="%{gallium_drivers}" \
--enable-gallium-llvm \
--enable-egl \
--enable-gallium-egl \
--enable-gallium-gbm \
--enable-gbm \
--enable-gles1 \
--enable-gles2 \
--enable-shared-glapi \
%if %{with wayland}
--with-egl-platforms=x11,drm,wayland \
%else
--with-egl-platforms=x11,drm \
%endif
%if %{with radeonsi}
--enable-glx-tls \
%else
--disable-glx-tls \
%endif
--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