From e33eddd12aa5b1c12b6056349c88a0979e57fc05 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 13 Mar 2017 12:15:38 +0100 Subject: [PATCH] Fix xdriinfo not working with libglvnd (rhbz#1429894) --- mesa-demos.spec | 10 ++++++- xdriinfo-1.0.4-glvnd.patch | 54 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 xdriinfo-1.0.4-glvnd.patch diff --git a/mesa-demos.spec b/mesa-demos.spec index e29f30e..1df697d 100644 --- a/mesa-demos.spec +++ b/mesa-demos.spec @@ -7,7 +7,7 @@ Summary: Mesa demos Name: mesa-demos Version: 8.3.0 -Release: 5%{?dist} +Release: 6%{?dist} License: MIT Group: System Environment/Libraries URL: http://www.mesa3d.org @@ -18,6 +18,8 @@ Source2: mesad-git-snapshot.sh # Patch pointblast/spriteblast out of the Makefile for legal reasons Patch0: mesa-demos-8.0.1-legal.patch Patch1: mesa-demos-as-needed.patch +# Fix xdriinfo not working with libglvnd +Patch2: xdriinfo-1.0.4-glvnd.patch BuildRequires: pkgconfig autoconf automake libtool BuildRequires: freeglut-devel BuildRequires: mesa-libGL-devel @@ -50,6 +52,9 @@ The egl-utils package provides the eglinfo and es2_info utilities. %setup -q -n %{name}-%{version} -b1 %patch0 -p1 -b .legal %patch1 -p1 -b .asneeded +pushd ../%{xdriinfo} +%patch2 -p1 +popd # These two files are distributable, but non-free (lack of permission to modify). rm -rf src/demos/pointblast.c @@ -98,6 +103,9 @@ install -m 0755 src/egl/opengles2/es2_info %{buildroot}%{_bindir} %{_bindir}/es2_info %changelog +* Mon Mar 13 2017 Hans de Goede - 8.3.0-6 +- Fix xdriinfo not working with libglvnd (rhbz#1429894) + * Fri Feb 10 2017 Fedora Release Engineering - 8.3.0-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild diff --git a/xdriinfo-1.0.4-glvnd.patch b/xdriinfo-1.0.4-glvnd.patch new file mode 100644 index 0000000..0dc4c0a --- /dev/null +++ b/xdriinfo-1.0.4-glvnd.patch @@ -0,0 +1,54 @@ +diff -up xdriinfo-1.0.4/xdriinfo.c~ xdriinfo-1.0.4/xdriinfo.c +--- xdriinfo-1.0.4/xdriinfo.c~ 2009-10-16 23:39:10.000000000 +0200 ++++ xdriinfo-1.0.4/xdriinfo.c 2017-03-13 12:01:53.419636100 +0100 +@@ -101,23 +101,9 @@ int main (int argc, char *argv[]) { + return 1; + } + } +- /* if the argument to the options command is a driver name, we can handle +- * it without opening an X connection */ +- if (func == OPTIONS && screenNum == -1) { +- const char *options = (*GetDriverConfig) (funcArg); +- if (!options) { +- fprintf (stderr, +- "Driver \"%s\" is not installed or does not support configuration.\n", +- funcArg); +- return 1; +- } +- printf ("%s", options); +- if (isatty (STDOUT_FILENO)) +- printf ("\n"); +- return 0; +- } ++ + /* driver command needs a valid screen number */ +- else if (func == DRIVER && screenNum == -1) { ++ if (func == DRIVER && screenNum == -1) { + fprintf (stderr, "Invalid screen number \"%s\".\n", funcArg); + return 1; + } +@@ -135,6 +121,9 @@ int main (int argc, char *argv[]) { + return 1; + } + ++ /* Call glXGetClientString to load vendor libs on glvnd enabled systems */ ++ glXGetClientString (dpy, GLX_EXTENSIONS); ++ + switch (func) { + case NSCREENS: + printf ("%d", nScreens); +@@ -154,7 +143,13 @@ int main (int argc, char *argv[]) { + break; + } + case OPTIONS: { +- const char *name = (*GetScreenDriver) (dpy, screenNum), *options; ++ const char *name, *options; ++ ++ if (screenNum == -1) { ++ name = funcArg; ++ } else { ++ name = (*GetScreenDriver) (dpy, screenNum); ++ } + if (!name) { + fprintf (stderr, "Screen \"%d\" is not direct rendering capable.\n", + screenNum);