[150697] trunk/dports/graphics/libepoxy
devans at macports.org
devans at macports.org
Tue Jul 26 22:22:03 PDT 2016
Revision: 150697
https://trac.macports.org/changeset/150697
Author: devans at macports.org
Date: 2016-07-26 22:22:03 -0700 (Tue, 26 Jul 2016)
Log Message:
-----------
libepoxy: tentative patch to stop epoxy_glx_version from crashing if GLX is not available on server or client, increment revision (#51911).
Modified Paths:
--------------
trunk/dports/graphics/libepoxy/Portfile
Added Paths:
-----------
trunk/dports/graphics/libepoxy/files/fix-epoxy-glx-version-if-glx-not-active.patch
Modified: trunk/dports/graphics/libepoxy/Portfile
===================================================================
--- trunk/dports/graphics/libepoxy/Portfile 2016-07-27 05:07:35 UTC (rev 150696)
+++ trunk/dports/graphics/libepoxy/Portfile 2016-07-27 05:22:03 UTC (rev 150697)
@@ -5,7 +5,7 @@
PortGroup github 1.0
github.setup anholt libepoxy 1.3.1 v
-revision 1
+revision 2
license MIT permissive
categories graphics
maintainers devans openmaintainer
@@ -42,6 +42,11 @@
0003-Make-enable-glx-actually-work-on-OSX-and-Windows.patch \
0004-darwin-Use-GLX-instead-of-OpenGL.framework-if-it-is-.patch
+# https://trac.macports.org/ticket/51911
+# https://github.com/anholt/libepoxy/issues/72
+# https://github.com/yaronct/libepoxy/commit/b3b8bd9af7bf1fcfe544fd131f4d4f0d117ae7bc
+patchfiles-append fix-epoxy-glx-version-if-glx-not-active.patch
+
post-patch {
reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/src/dispatch_common.c
}
Added: trunk/dports/graphics/libepoxy/files/fix-epoxy-glx-version-if-glx-not-active.patch
===================================================================
--- trunk/dports/graphics/libepoxy/files/fix-epoxy-glx-version-if-glx-not-active.patch (rev 0)
+++ trunk/dports/graphics/libepoxy/files/fix-epoxy-glx-version-if-glx-not-active.patch 2016-07-27 05:22:03 UTC (rev 150697)
@@ -0,0 +1,41 @@
+--- a/src/dispatch_glx.c.orig 2016-07-26 13:43:09.000000000 -0700
++++ b/src/dispatch_glx.c 2016-07-26 13:44:56.000000000 -0700
+@@ -54,22 +54,23 @@
+ int client_major, client_minor;
+ int server, client;
+ const char *version_string;
+- int ret;
++ int ret=0, sscanf_ret;
+
+- version_string = glXQueryServerString(dpy, screen, GLX_VERSION);
+- ret = sscanf(version_string, "%d.%d", &server_major, &server_minor);
+- assert(ret == 2);
+- server = server_major * 10 + server_minor;
+-
+- version_string = glXGetClientString(dpy, GLX_VERSION);
+- ret = sscanf(version_string, "%d.%d", &client_major, &client_minor);
+- assert(ret == 2);
+- client = client_major * 10 + client_minor;
+-
+- if (client < server)
+- return client;
+- else
+- return server;
++ if ((version_string = glXQueryServerString(dpy, screen, GLX_VERSION)))
++ {
++ sscanf_ret = sscanf(version_string, "%d.%d", &server_major, &server_minor);
++ assert(sscanf_ret == 2);
++ server = server_major * 10 + server_minor;
++ if ((version_string = glXGetClientString(dpy, GLX_VERSION)))
++ {
++ sscanf_ret = sscanf(version_string, "%d.%d", &client_major, &client_minor);
++ assert(sscanf_ret == 2);
++ client = client_major * 10 + client_minor;
++ ret = client <= server ? client : server;
++ }
++ }
++
++ return ret;
+ }
+
+ /**
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20160726/08ba5f8b/attachment-0001.html>
More information about the macports-changes
mailing list