Source0: ftp://ftp.freedesktop.org/pub/mesa/mesa-%{version}.tar.xz
# Source0-md5: b4b021279ea21e1eb8a1369afa6f19a0
Patch0: %{name}-link.patch
+Patch1: glvnd-fix-gl-dot-pc.patch
URL: http://www.mesa3d.org/
BuildRequires: autoconf >= 2.60
BuildRequires: automake
%prep
%setup -q -n mesa-%{version}
%patch0 -p1
+%if %{with glvnd}
+%patch1 -p1
+%endif
%build
%{__libtoolize}
--- /dev/null
+diff -up mesa-12.0.3/src/mesa/gl.pc.in.jx mesa-12.0.3/src/mesa/gl.pc.in
+--- mesa-12.0.3/src/mesa/gl.pc.in.jx 2016-01-18 02:39:26.000000000 -0500
++++ mesa-12.0.3/src/mesa/gl.pc.in 2016-10-25 13:06:44.013159358 -0400
+@@ -7,7 +7,7 @@ Name: gl
+ Description: Mesa OpenGL library
+ Requires.private: @GL_PC_REQ_PRIV@
+ Version: @PACKAGE_VERSION@
+-Libs: -L${libdir} -l@GL_LIB@
++Libs: -L${libdir} -lGL
+ Libs.private: @GL_PC_LIB_PRIV@
+ Cflags: -I${includedir} @GL_PC_CFLAGS@
+ glx_tls: @GLX_TLS@