# TODO:
# - subpackage with non-dri libGL for use with X-servers with missing GLX extension?
# - resurrect static if it's useful
-# - subpackage egl?
#
# Conditional build:
-%bcond_without demos # don't build demos
-%bcond_with egl # don't build egl
+%bcond_without egl # build egl
%bcond_without gallium # don't build gallium
-%bcond_with gallium_intel # gallium i915 driver (but doesn't work with AIGLX)
+%bcond_with gallium_intel # gallium i915 driver (but doesn't work with AIGLX)
+%bcond_with gallium_radeon # gallium radeon driver
+%bcond_without gallium_nouveau # gallium nouveau driver
%bcond_without motif # build static libGLw without Motif interface
%bcond_with multigl # package libGL in a way allowing concurrent install with nvidia/fglrx drivers
%bcond_without osmesa # don't build osmesa
-%bcond_with static
+%bcond_with static # static libraries
#
# minimal supported xserver version
%define xserver_ver 1.5.0
# (until they start to be somehow versioned themselves)
%define glapi_ver 7.1.0
#
-%define libdrm_ver 2.4.18
-%define dri2proto_ver 1.99.3
+%define libdrm_ver 2.4.23
+%define dri2proto_ver 2.1
+%define glproto_ver 1.4.11
#
Summary: Free OpenGL implementation
Summary(pl.UTF-8): Wolnodostępna implementacja standardu OpenGL
Name: Mesa
-Version: 7.7
-Release: 2%{?with_multigl:.mgl}
+Version: 7.10.1
+Release: 1%{?with_multigl:.mgl}
License: MIT (core), SGI (GLU,libGLw) and others - see license.html file
Group: X11/Libraries
Source0: ftp://ftp.freedesktop.org/pub/mesa/%{version}/%{name}Lib-%{version}.tar.bz2
-# Source0-md5: e3fa64a1508bc23dd9de9dd2cea7cfb1
-Source1: ftp://ftp.freedesktop.org/pub/mesa/%{version}/%{name}Demos-%{version}.tar.bz2
-# Source1-md5: 6fd616b27b9826d0faa23e08e05d9435
+# Source0-md5: efe8da4d80c2a5d32a800770b8ce5dfa
Patch0: %{name}-realclean.patch
-Patch1: %{name}-tgsi_dump.patch
+Patch1: %{name}-selinux.patch
+Patch2: %{name}-git.patch
+Patch3: %{name}-nouveau-updates.patch
+Patch4: %{name}-nouveau-revert.patch
+Patch5: %{name}-nouveau-classic-libdrm.patch
URL: http://www.mesa3d.org/
-%{?with_demos:BuildRequires: OpenGL-glut-devel >= 3.8}
-BuildRequires: autoconf
+BuildRequires: autoconf >= 2.59
BuildRequires: automake
BuildRequires: expat-devel
-%{?with_demos:BuildRequires: glew-devel}
BuildRequires: libdrm-devel >= %{libdrm_ver}
BuildRequires: libselinux-devel
-BuildRequires: libstdc++-devel
+BuildRequires: libstdc++-devel >= 5:3.3.0
+BuildRequires: libtalloc-devel >= 2:2.0.1
BuildRequires: libtool >= 2:1.4d
%{?with_motif:BuildRequires: motif-devel}
+BuildRequires: pixman-devel
BuildRequires: pkgconfig
BuildRequires: python
+BuildRequires: python-modules
BuildRequires: rpmbuild(macros) >= 1.470
BuildRequires: sed >= 4.0
BuildRequires: xorg-lib-libXdamage-devel
BuildRequires: xorg-lib-libXt-devel
BuildRequires: xorg-lib-libXxf86vm-devel
BuildRequires: xorg-proto-dri2proto-devel >= %{dri2proto_ver}
-BuildRequires: xorg-proto-glproto-devel
-BuildRequires: xorg-proto-printproto-devel
+BuildRequires: xorg-proto-glproto-devel >= %{glproto_ver}
BuildRequires: xorg-util-makedepend
+BuildRequires: xorg-xserver-server-devel
+%if %{with egl}
+BuildRequires: libxcb-devel
+BuildRequires: udev-devel >= 150
+%endif
+%if %{with gallium}
+BuildRequires: xorg-proto-xextproto-devel >= 7.0.99.1
+BuildRequires: xorg-xserver-server-devel >= 1.6.0
+%endif
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%if %{without gallium}
%undefine with_gallium_intel
+%undefine with_gallium_radeon
%endif
%description
OpenGL od SGI i nie twierdzi, że Mesa jest kompatybilnym zamiennikiem
OpenGL ani powiązana z SGI.
+%package libEGL
+Summary: Mesa implementation of EGL Native Platform Graphics Interface library
+Summary(pl.UTF-8): Implementacja Mesa biblioteki interfejsu EGL
+License: MIT
+Group: Libraries
+Requires: OpenGL >= 1.2
+Requires: udev-libs >= 150
+Provides: EGL = 1.4
+
+%description libEGL
+This package contains shared libEGL - Mesa implementation of EGL
+Native Platform Graphics Interface as specified by Khronos Group:
+<http://www.khronos.org/egl/>.
+
+%description libEGL -l pl.UTF-8
+Ten pakiet zawiera bibliotekę współdzieloną libEGL - implementację
+Mesa standardu EGL Native Platform Graphics Interface (interfejsu
+graficznego platformy natywnej) wg specyfikacji Khronos Group:
+<http://www.khronos.org/egl/>.
+
+%package libEGL-devel
+Summary: Header files for Mesa implementation of EGL library
+Summary(pl.UTF-8): Pliki nagłówkowe implementacji Mesa biblioteki EGL
+License: MIT
+Group: Development/Libraries
+Requires: %{name}-libEGL = %{version}-%{release}
+Requires: OpenGL-devel >= 1.2
+Requires: libstdc++-devel
+Provides: EGL-devel = 1.4
+
+%description libEGL-devel
+Header files for Mesa implementation of EGL library.
+
+%description libEGL-devel -l pl.UTF-8
+Pliki nagłówkowe implementacji Mesa biblioteki EGL.
+
+%package libEGL-static
+Summary: Static Mesa libEGL library
+Summary(pl.UTF-8): Statyczna biblioteka Mesa libEGL
+License: MIT
+Group: Development/Libraries
+Requires: %{name}-libEGL-devel = %{version}-%{release}
+Provides: EGL-static = 1.4
+
+%description libEGL-static
+Static Mesa libEGL library.
+
+%description libEGL-static -l pl.UTF-8
+Statyczna biblioteka Mesa libEGL.
+
%package libGL
Summary: Free Mesa3D implementation of libGL OpenGL library
Summary(pl.UTF-8): Wolnodostępna implementacja Mesa3D biblioteki libGL ze standardu OpenGL
Requires: xorg-lib-libXext-devel
Requires: xorg-lib-libXxf86vm-devel
Requires: xorg-proto-dri2proto-devel >= %{dri2proto_ver}
+Requires: xorg-proto-glproto-devel >= %{glproto_ver}
Suggests: OpenGL-doc-man
Provides: OpenGL-GLX-devel = 1.4
Provides: OpenGL-devel = 2.1
%description libGLw
SGI OpenGL Xt widgets library.
-%description libGLU -l pl.UTF-8
+%description libGLw -l pl.UTF-8
Biblioteka SGI widgetów Xt dla OpenGL-a.
%package libGLw-devel
%description utils -l pl.UTF-8
Programy narzędziowe OpenGL z projektu Mesa3D: glxgears i glxinfo.
-%package demos
-Summary: Mesa Demos source code
-Summary(pl.UTF-8): Kod źródłowy programów demonstrujących dla bibliotek Mesa
-License: various (MIT, SGI, GPL - see copyright notes in sources)
-Group: Development/Libraries
-Requires: OpenGL-devel
-
-%description demos
-Demonstration programs for the Mesa libraries in source code form.
-
-%description demos -l pl.UTF-8
-Kod źródłowy programów demonstracyjnych dla bibliotek Mesa.
-
%package dri-driver-ati-mach64
Summary: X.org DRI driver for ATI Mach64 card family
Summary(pl.UTF-8): Sterownik X.org DRI dla rodziny kart ATI Mach64
Sterownik X.org DRI dla VMware.
%prep
-%setup -q -b1
+%setup -q
%patch0 -p0
%patch1 -p1
-
-# fix demos
-find progs -type f|xargs sed -i -e "s,\.\./images/,%{_examplesdir}/%{name}-%{version}/images/,g"
+#patch2 -p1
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
%build
%{__aclocal}
%{__autoconf}
-dri_drivers="i810 i965 mach64 mga r128 r200 r300 r600 radeon savage \
+dri_drivers="i810 i965 mach64 mga r128 \
+%if %{without gallium_radeon}
+r200 r300 r600 radeon \
+%endif
+savage \
%if %{without gallium_intel}
i915 \
%endif
--enable-selinux \
--enable-pic \
--enable-glx-tls \
- --%{?with_egl:en}%{!?with_egl:dis}able-egl \
- --with%{!?with_demos:out}-demos"
+ --disable-glut \
+ --disable-os-mesa \
+ --%{?with_egl:en}%{!?with_egl:dis}able-egl"
-%if %{with osmesa}
-# osmesa variants
-%configure $common_flags \
+osmesa_common_flags="\
--with-driver=osmesa \
--disable-asm \
+ --disable-glu"
+
+%if %{with osmesa}
+# osmesa variants
+%configure $common_flags $osmesa_common_flags \
--with-osmesa-bits=8
-%{__make} \
- SRC_DIRS=mesa
+%{__make}
mv %{_lib} osmesa8
%{__make} clean
-%configure $common_flags \
- --with-driver=osmesa \
- --disable-asm \
+%configure $common_flags $osmesa_common_flags \
--with-osmesa-bits=16
-%{__make} \
- SRC_DIRS=mesa
+%{__make}
mv %{_lib} osmesa16
%{__make} clean
-%configure $common_flags \
- --with-driver=osmesa \
- --disable-asm \
+%configure $common_flags $osmesa_common_flags \
--with-osmesa-bits=32
-%{__make} \
- SRC_DIRS=mesa
+%{__make}
mv %{_lib} osmesa32
%{__make} clean
%endif
%configure $common_flags \
- --enable-glu \
- --enable-glw \
- --disable-glut \
%if %{with gallium}
--enable-gallium \
--%{?with_gallium_intel:en}%{!?with_gallium_intel:dis}able-gallium-intel \
+ --%{?with_gallium_radeon:en}%{!?with_gallium_radeon:dis}able-gallium-radeon \
--enable-gallium-svga \
- --enable-gallium-nouveau \
- --with-state-trackers=dri \
+ %{?with_gallium_nouveau:--enable-gallium-nouveau} \
+ --with-state-trackers=dri,glx \
%else
--disable-gallium \
%endif
--with-dri-driverdir=%{_libdir}/xorg/modules/dri
%{__make}
-%{__make} -C progs/xdemos glxgears glxinfo
-%if %{with demos}
-%{__make} -C progs/demos
-%endif
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_bindir},%{_examplesdir}/%{name}-%{version}}
+install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
# libs without drivers
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
%if %{with osmesa}
-install osmesa*/* $RPM_BUILD_ROOT%{_libdir}
+install osmesa*/*OSMesa* $RPM_BUILD_ROOT%{_libdir}
%endif
-install progs/xdemos/{glxgears,glxinfo} $RPM_BUILD_ROOT%{_bindir}
-# work on copy to keep -bi --short-circuit working
-rm -rf progs-clean
-install -d progs-clean
-for l in demos glsl osdemos redbook samples xdemos ; do
- cp -a progs/$l progs-clean/$l
- %{__make} -C progs-clean/$l clean
- cp -Rf progs-clean/$l $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/$l
-done
-rm -rf progs-clean
-for l in util images ; do
- cp -Rf progs/$l $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/$l
-done
rm -rf $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/*/{.deps,CVS,Makefile.{BeOS*,win,cygnus,DJ,dja}}
# strip out undesirable headers
olddir=$(pwd)
cd $RPM_BUILD_ROOT%{_includedir}/GL
-rm [a-fh-np-wyz]*.h gg*.h glf*.h
+rm [a-fh-np-wyz]*.h glf*.h
cd $RPM_BUILD_ROOT%{_libdir}
cd $olddir
%clean
rm -rf $RPM_BUILD_ROOT
+%post libEGL -p /sbin/ldconfig
+%postun libEGL -p /sbin/ldconfig
+
%post libGL -p /sbin/ldconfig
%postun libGL -p /sbin/ldconfig
%post libGLw -p /sbin/ldconfig
%postun libGLw -p /sbin/ldconfig
+%if %{with egl}
+%files libEGL
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libEGL.so.*.*
+%attr(755,root,root) %ghost %{_libdir}/libEGL.so.1
+%dir %{_libdir}/egl
+%attr(755,root,root) %{_libdir}/egl/egl_dri2.so
+%attr(755,root,root) %{_libdir}/egl/egl_glx.so
+
+%files libEGL-devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libEGL.so
+%dir %{_includedir}/EGL
+%{_includedir}/EGL/egl.h
+%{_includedir}/EGL/eglext.h
+%{_includedir}/EGL/eglplatform.h
+%dir %{_includedir}/KHR
+%{_includedir}/KHR/khrplatform.h
+%{_pkgconfigdir}/egl.pc
+
+%if %{with static}
+%files libEGL-static
+%defattr(644,root,root,755)
+%{_libdir}/libEGL.a
+%endif
+%endif
+
%files libGL
%defattr(644,root,root,755)
%doc docs/{*.html,README.{3DFX,GGI,MITS,QUAKE,THREADS},RELNOTES*}
%files libOSMesa
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/libOSMesa*.so.*.*
-%attr(755,root,root) %ghost %{_libdir}/libOSMesa*.so.[0-9]
+%attr(755,root,root) %ghost %{_libdir}/libOSMesa*.so.7
%files libOSMesa-devel
%defattr(644,root,root,755)
%endif
%endif
-%files utils
-%defattr(644,root,root,755)
-%attr(755,root,root) %{_bindir}/glxgears
-%attr(755,root,root) %{_bindir}/glxinfo
-
%files dri-driver-ati-mach64
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/xorg/modules/dri/mach64_dri.so
%attr(755,root,root) %{_libdir}/xorg/modules/dri/mga_dri.so
%if %{with gallium}
+%if %{with gallium_nouveau}
%files dri-driver-nouveau
%defattr(644,root,root,755)
+#%attr(755,root,root) %{_libdir}/xorg/modules/drivers/modesetting_drv.so
%attr(755,root,root) %{_libdir}/xorg/modules/dri/nouveau_dri.so
%endif
+%endif
%files dri-driver-savage
%defattr(644,root,root,755)
%files dri-driver-swrast
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/xorg/modules/dri/swrast_dri.so
+%attr(755,root,root) %{_libdir}/xorg/modules/dri/swrastg_dri.so
%files dri-driver-tdfx
%defattr(644,root,root,755)
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/xorg/modules/dri/vmwgfx_dri.so
%endif
-
-%if %{with demos}
-%files demos
-%defattr(644,root,root,755)
-%{_examplesdir}/%{name}-%{version}
-%endif