[148437] trunk/dports/x11/mesa

jeremyhu at macports.org jeremyhu at macports.org
Sun May 8 01:35:15 PDT 2016


Revision: 148437
          https://trac.macports.org/changeset/148437
Author:   jeremyhu at macports.org
Date:     2016-05-08 01:35:14 -0700 (Sun, 08 May 2016)
Log Message:
-----------
mesa: Fix implementation of glGetAttachedObjectsARB

Modified Paths:
--------------
    trunk/dports/x11/mesa/Portfile
    trunk/dports/x11/mesa/files/static-strndup.patch

Added Paths:
-----------
    trunk/dports/x11/mesa/files/0001-mesa-Deal-with-size-differences-between-GLuint-and-G.patch
    trunk/dports/x11/mesa/files/0002-applegl-Provide-requirements-of-_SET_DrawBuffers.patch
    trunk/dports/x11/mesa/files/0003-glext.h-Add-missing-include-of-stddef.h-for-ptrdiff_.patch

Removed Paths:
-------------
    trunk/dports/x11/mesa/files/5001-glext.h-Add-missing-include-of-stddef.h-for-ptrdiff_.patch
    trunk/dports/x11/mesa/files/5002-darwin-Suppress-type-conversion-warnings-for-GLhandl.patch
    trunk/dports/x11/mesa/files/5003-applegl-Provide-requirements-of-_SET_DrawBuffers.patch

Modified: trunk/dports/x11/mesa/Portfile
===================================================================
--- trunk/dports/x11/mesa/Portfile	2016-05-08 06:20:12 UTC (rev 148436)
+++ trunk/dports/x11/mesa/Portfile	2016-05-08 08:35:14 UTC (rev 148437)
@@ -7,7 +7,7 @@
 name                mesa
 epoch               1
 version             11.2.1
-
+revision            1
 categories          x11 graphics
 maintainers         jeremyhu openmaintainer
 license             MIT
@@ -43,9 +43,9 @@
 
 patch.pre_args      -p1
 patchfiles \
-    5001-glext.h-Add-missing-include-of-stddef.h-for-ptrdiff_.patch \
-    5002-darwin-Suppress-type-conversion-warnings-for-GLhandl.patch \
-    5003-applegl-Provide-requirements-of-_SET_DrawBuffers.patch
+    0001-mesa-Deal-with-size-differences-between-GLuint-and-G.patch \
+    0002-applegl-Provide-requirements-of-_SET_DrawBuffers.patch \
+    0003-glext.h-Add-missing-include-of-stddef.h-for-ptrdiff_.patch
 
 if {[string match *gcc* ${configure.compiler}]} {
     # Older gcc fail to do -Werror=missing-prototypes correctly

Added: trunk/dports/x11/mesa/files/0001-mesa-Deal-with-size-differences-between-GLuint-and-G.patch
===================================================================
--- trunk/dports/x11/mesa/files/0001-mesa-Deal-with-size-differences-between-GLuint-and-G.patch	                        (rev 0)
+++ trunk/dports/x11/mesa/files/0001-mesa-Deal-with-size-differences-between-GLuint-and-G.patch	2016-05-08 08:35:14 UTC (rev 148437)
@@ -0,0 +1,64 @@
+From 1bef9a9d46b5e61fb546ec562e0d3cc974336f2d Mon Sep 17 00:00:00 2001
+From: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
+Date: Sun, 8 May 2016 00:47:10 -0700
+Subject: [PATCH 1/3] mesa: Deal with size differences between GLuint and
+ GLhandleARB in GetAttachedObjectsARB
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
+CC: Nicolai Hähnle <nhaehnle at gmail.com>
+CC: Matt Turner <mattst88 at gmail.com>
+CC: Ian Romanick <idr at freedesktop.org>
+---
+ src/mesa/main/shaderapi.c | 26 +++++++++++++++++++++++++-
+ 1 file changed, 25 insertions(+), 1 deletion(-)
+
+diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
+index 8c1fba8..0b630eb 100644
+--- a/src/mesa/main/shaderapi.c
++++ b/src/mesa/main/shaderapi.c
+@@ -476,6 +476,30 @@ get_attached_shaders(struct gl_context *ctx, GLuint program, GLsizei maxCount,
+    }
+ }
+ 
++static void
++get_attached_shadersARB(struct gl_context *ctx, GLhandleARB container, GLsizei maxCount,
++                        GLsizei *count, GLhandleARB *obj)
++{
++   struct gl_shader_program *shProg;
++
++   if (maxCount < 0) {
++      _mesa_error(ctx, GL_INVALID_VALUE, "glGetAttachedShadersARB(maxCount < 0)");
++      return;
++   }
++
++   shProg =
++      _mesa_lookup_shader_program_err(ctx, (GLuint)container, "glGetAttachedShaders");
++
++   if (shProg) {
++      GLuint i;
++      for (i = 0; i < (GLuint) maxCount && i < shProg->NumShaders; i++) {
++         obj[i] = (GLhandleARB)shProg->Shaders[i]->Name;
++      }
++      if (count)
++         *count = i;
++   }
++}
++
+ 
+ /**
+  * glGetHandleARB() - return ID/name of currently bound shader program.
+@@ -1371,7 +1395,7 @@ _mesa_GetAttachedObjectsARB(GLhandleARB container, GLsizei maxCount,
+                             GLsizei * count, GLhandleARB * obj)
+ {
+    GET_CURRENT_CONTEXT(ctx);
+-   get_attached_shaders(ctx, container, maxCount, count, obj);
++   get_attached_shadersARB(ctx, container, maxCount, count, obj);
+ }
+ 
+ 
+-- 
+2.8.2
+

Added: trunk/dports/x11/mesa/files/0002-applegl-Provide-requirements-of-_SET_DrawBuffers.patch
===================================================================
--- trunk/dports/x11/mesa/files/0002-applegl-Provide-requirements-of-_SET_DrawBuffers.patch	                        (rev 0)
+++ trunk/dports/x11/mesa/files/0002-applegl-Provide-requirements-of-_SET_DrawBuffers.patch	2016-05-08 08:35:14 UTC (rev 148437)
@@ -0,0 +1,58 @@
+From 255d11874ab10a007239fa42b8a42fda106175db Mon Sep 17 00:00:00 2001
+From: Jon TURNEY <jon.turney at dronecode.org.uk>
+Date: Mon, 12 May 2014 16:30:26 +0100
+Subject: [PATCH 2/3] applegl: Provide requirements of _SET_DrawBuffers
+
+_SET_DrawBuffers requires driDispatchRemapTable, so we need to link with
+libmesa for remap.c.  libmesa requires the C++ linker.
+
+Also need to arrange to call _mesa_init_remap_table() to initialize the
+remap table.
+
+Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
+Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu at freedesktop.org>
+---
+ src/glx/Makefile.am         | 5 ++++-
+ src/glx/apple/apple_glapi.c | 3 +++
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/src/glx/Makefile.am b/src/glx/Makefile.am
+index d65fb81..a4364ac 100644
+--- a/src/glx/Makefile.am
++++ b/src/glx/Makefile.am
+@@ -143,7 +143,10 @@ libglx_la_SOURCES += \
+ 	applegl_glx.c
+ 
+ SUBDIRS += apple
+-libglx_la_LIBADD += $(builddir)/apple/libappleglx.la
++libglx_la_LIBADD += \
++	$(builddir)/apple/libappleglx.la \
++	$(top_builddir)/src/mesa/libmesa.la
++nodist_EXTRA_lib at GL_LIB@_la_SOURCES = dummy.cpp
+ endif
+ 
+ GL_LIBS = \
+diff --git a/src/glx/apple/apple_glapi.c b/src/glx/apple/apple_glapi.c
+index 4d19f7f..849044b 100644
+--- a/src/glx/apple/apple_glapi.c
++++ b/src/glx/apple/apple_glapi.c
+@@ -39,6 +39,7 @@
+ #include <GL/gl.h>
+ 
+ #include "main/glheader.h"
++#include "main/remap.h"
+ #include "glapi.h"
+ #include "glapitable.h"
+ #include "main/dispatch.h"
+@@ -54,6 +55,8 @@ static void _apple_glapi_create_table(void) {
+     if (__applegl_api)
+         return;
+ 
++    _mesa_init_remap_table();
++
+     __ogl_framework_api = _glapi_create_table_from_handle(apple_cgl_get_dl_handle(), "gl");
+     assert(__ogl_framework_api);
+ 
+-- 
+2.8.2
+

Added: trunk/dports/x11/mesa/files/0003-glext.h-Add-missing-include-of-stddef.h-for-ptrdiff_.patch
===================================================================
--- trunk/dports/x11/mesa/files/0003-glext.h-Add-missing-include-of-stddef.h-for-ptrdiff_.patch	                        (rev 0)
+++ trunk/dports/x11/mesa/files/0003-glext.h-Add-missing-include-of-stddef.h-for-ptrdiff_.patch	2016-05-08 08:35:14 UTC (rev 148437)
@@ -0,0 +1,25 @@
+From 9b1e24faf2bf6df2434757102f11b0cc7eb64788 Mon Sep 17 00:00:00 2001
+From: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
+Date: Wed, 11 Feb 2015 12:32:56 -0800
+Subject: [PATCH 3/3] glext.h: Add missing include of stddef.h for ptrdiff_t
+
+Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
+---
+ include/GL/glext.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/include/GL/glext.h b/include/GL/glext.h
+index 907a582..babe4eb 100644
+--- a/include/GL/glext.h
++++ b/include/GL/glext.h
+@@ -4662,6 +4662,7 @@ GLAPI void APIENTRY glVertexBlendARB (GLint count);
+ 
+ #ifndef GL_ARB_vertex_buffer_object
+ #define GL_ARB_vertex_buffer_object 1
++#include <stddef.h>
+ typedef ptrdiff_t GLsizeiptrARB;
+ typedef ptrdiff_t GLintptrARB;
+ #define GL_BUFFER_SIZE_ARB                0x8764
+-- 
+2.8.2
+

Deleted: trunk/dports/x11/mesa/files/5001-glext.h-Add-missing-include-of-stddef.h-for-ptrdiff_.patch
===================================================================
--- trunk/dports/x11/mesa/files/5001-glext.h-Add-missing-include-of-stddef.h-for-ptrdiff_.patch	2016-05-08 06:20:12 UTC (rev 148436)
+++ trunk/dports/x11/mesa/files/5001-glext.h-Add-missing-include-of-stddef.h-for-ptrdiff_.patch	2016-05-08 08:35:14 UTC (rev 148437)
@@ -1,27 +0,0 @@
-From 32e797544db668ccafbddc65e91c6fe1c79fb802 Mon Sep 17 00:00:00 2001
-From: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
-Date: Wed, 11 Feb 2015 12:32:56 -0800
-Subject: [PATCH 5001/5003] glext.h: Add missing include of stddef.h for
- ptrdiff_t
-
-Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
-(cherry picked from commit 8ea9fa778a04d1535f994e39dcfdae7ee1add37e)
----
- include/GL/glext.h | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/include/GL/glext.h b/include/GL/glext.h
-index a3873a6..dded95b 100644
---- a/include/GL/glext.h
-+++ b/include/GL/glext.h
-@@ -4662,6 +4662,7 @@ GLAPI void APIENTRY glVertexBlendARB (GLint count);
- 
- #ifndef GL_ARB_vertex_buffer_object
- #define GL_ARB_vertex_buffer_object 1
-+#include <stddef.h>
- typedef ptrdiff_t GLsizeiptrARB;
- typedef ptrdiff_t GLintptrARB;
- #define GL_BUFFER_SIZE_ARB                0x8764
--- 
-2.6.0
-

Deleted: trunk/dports/x11/mesa/files/5002-darwin-Suppress-type-conversion-warnings-for-GLhandl.patch
===================================================================
--- trunk/dports/x11/mesa/files/5002-darwin-Suppress-type-conversion-warnings-for-GLhandl.patch	2016-05-08 06:20:12 UTC (rev 148436)
+++ trunk/dports/x11/mesa/files/5002-darwin-Suppress-type-conversion-warnings-for-GLhandl.patch	2016-05-08 08:35:14 UTC (rev 148437)
@@ -1,75 +0,0 @@
-From 945b0070642ac6256a22c7b23c20e022e2444f88 Mon Sep 17 00:00:00 2001
-From: Jon TURNEY <jon.turney at dronecode.org.uk>
-Date: Sun, 11 May 2014 14:40:07 +0100
-Subject: [PATCH 5002/5003] darwin: Suppress type conversion warnings for
- GLhandleARB
-
-On darwin, GLhandleARB is defined as a void *, not the unsigned int it is on
-linux.
-
-For the moment, apply a cast to supress the warning
-
-Possibly this is safe, as for the mesa software renderer the shader program
-handle is not a real pointer, but a integer handle
-
-Probably this is not the right thing to do, and we should pay closer attention
-to how the GLhandlerARB type is used.
-
-main/shader_query.cpp:49:7: error: no matching function for call to '_mesa_lookup_shader_program_err'
-      _mesa_lookup_shader_program_err(ctx, program, "glBindAttribLocation");
-      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-../../src/mesa/main/shaderobj.h:81:1: note: candidate function not viable: cannot convert argument of incomplete type 'GLhandleARB' (aka 'void *') to 'GLuint' (aka 'unsigned int')
-_mesa_lookup_shader_program_err(struct gl_context *ctx, GLuint name,
-^
-main/shader_query.cpp:111:13: error: no matching function for call to '_mesa_lookup_shader_program_err'
-   shProg = _mesa_lookup_shader_program_err(ctx, program, "glGetActiveAttrib");
-            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-../../src/mesa/main/shaderobj.h:81:1: note: candidate function not viable: cannot convert argument of incomplete type 'GLhandleARB' (aka 'void *') to 'GLuint' (aka 'unsigned int')
-_mesa_lookup_shader_program_err(struct gl_context *ctx, GLuint name,
-^
-main/shader_query.cpp:218:7: error: no matching function for call to '_mesa_lookup_shader_program_err'
-      _mesa_lookup_shader_program_err(ctx, program, "glGetAttribLocation");
-      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-../../src/mesa/main/shaderobj.h:81:1: note: candidate function not viable: cannot convert argument of incomplete type 'GLhandleARB' (aka 'void *') to 'GLuint' (aka 'unsigned int')
-_mesa_lookup_shader_program_err(struct gl_context *ctx, GLuint name,
-
-Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
-(cherry picked from commit 24eefbd4ca271f22400549dd44ccd409263089e1)
----
- src/mesa/main/shader_query.cpp | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/src/mesa/main/shader_query.cpp b/src/mesa/main/shader_query.cpp
-index df9081b..b2d2f54 100644
---- a/src/mesa/main/shader_query.cpp
-+++ b/src/mesa/main/shader_query.cpp
-@@ -71,7 +71,7 @@ _mesa_BindAttribLocation(GLhandleARB program, GLuint index,
-    GET_CURRENT_CONTEXT(ctx);
- 
-    struct gl_shader_program *const shProg =
--      _mesa_lookup_shader_program_err(ctx, program, "glBindAttribLocation");
-+      _mesa_lookup_shader_program_err(ctx, (uintptr_t)program, "glBindAttribLocation");
-    if (!shProg)
-       return;
- 
-@@ -139,7 +139,7 @@ _mesa_GetActiveAttrib(GLhandleARB program, GLuint desired_index,
-       return;
-    }
- 
--   shProg = _mesa_lookup_shader_program_err(ctx, program, "glGetActiveAttrib");
-+   shProg = _mesa_lookup_shader_program_err(ctx, (uintptr_t)program, "glGetActiveAttrib");
-    if (!shProg)
-       return;
- 
-@@ -196,7 +196,7 @@ _mesa_GetAttribLocation(GLhandleARB program, const GLcharARB * name)
- {
-    GET_CURRENT_CONTEXT(ctx);
-    struct gl_shader_program *const shProg =
--      _mesa_lookup_shader_program_err(ctx, program, "glGetAttribLocation");
-+      _mesa_lookup_shader_program_err(ctx, (uintptr_t)program, "glGetAttribLocation");
- 
-    if (!shProg) {
-       return -1;
--- 
-2.6.0
-

Deleted: trunk/dports/x11/mesa/files/5003-applegl-Provide-requirements-of-_SET_DrawBuffers.patch
===================================================================
--- trunk/dports/x11/mesa/files/5003-applegl-Provide-requirements-of-_SET_DrawBuffers.patch	2016-05-08 06:20:12 UTC (rev 148436)
+++ trunk/dports/x11/mesa/files/5003-applegl-Provide-requirements-of-_SET_DrawBuffers.patch	2016-05-08 08:35:14 UTC (rev 148437)
@@ -1,60 +0,0 @@
-From 987e162c61b28192e575bd9742c84a67472d415c Mon Sep 17 00:00:00 2001
-From: Jon TURNEY <jon.turney at dronecode.org.uk>
-Date: Mon, 12 May 2014 16:30:26 +0100
-Subject: [PATCH 5003/5003] applegl: Provide requirements of _SET_DrawBuffers
-
-_SET_DrawBuffers requires driDispatchRemapTable, so we need to link with libmesa
-for remap.c.  libmesa requires the C++ linker.
-
-Also need to arrange to call _mesa_init_remap_table() to initialize the remap
-table.
-
-XXX: There has to be a better way fixing this.
-
-Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
-(cherry picked from commit 9800301a312ac06e0ce0af20e5817ee1e44ed4a5)
----
- src/glx/Makefile.am         | 5 ++++-
- src/glx/apple/apple_glapi.c | 3 +++
- 2 files changed, 7 insertions(+), 1 deletion(-)
-
-diff --git a/src/glx/Makefile.am b/src/glx/Makefile.am
-index 3ea1b30..3f82285 100644
---- a/src/glx/Makefile.am
-+++ b/src/glx/Makefile.am
-@@ -140,7 +140,10 @@ libglx_la_SOURCES += \
- 	applegl_glx.c
- 
- SUBDIRS += apple
--libglx_la_LIBADD += $(builddir)/apple/libappleglx.la
-+libglx_la_LIBADD += \
-+	$(builddir)/apple/libappleglx.la \
-+	$(top_builddir)/src/mesa/libmesa.la
-+nodist_EXTRA_lib at GL_LIB@_la_SOURCES = dummy.cpp
- endif
- 
- GL_LIBS = \
-diff --git a/src/glx/apple/apple_glapi.c b/src/glx/apple/apple_glapi.c
-index 4d19f7f..849044b 100644
---- a/src/glx/apple/apple_glapi.c
-+++ b/src/glx/apple/apple_glapi.c
-@@ -39,6 +39,7 @@
- #include <GL/gl.h>
- 
- #include "main/glheader.h"
-+#include "main/remap.h"
- #include "glapi.h"
- #include "glapitable.h"
- #include "main/dispatch.h"
-@@ -54,6 +55,8 @@ static void _apple_glapi_create_table(void) {
-     if (__applegl_api)
-         return;
- 
-+    _mesa_init_remap_table();
-+
-     __ogl_framework_api = _glapi_create_table_from_handle(apple_cgl_get_dl_handle(), "gl");
-     assert(__ogl_framework_api);
- 
--- 
-2.6.0
-

Modified: trunk/dports/x11/mesa/files/static-strndup.patch
===================================================================
--- trunk/dports/x11/mesa/files/static-strndup.patch	2016-05-08 06:20:12 UTC (rev 148436)
+++ trunk/dports/x11/mesa/files/static-strndup.patch	2016-05-08 08:35:14 UTC (rev 148437)
@@ -25,33 +25,6 @@
  /** \brief Find an option in an option cache with the name as key */
  static uint32_t findOption (const driOptionCache *cache, const char *name) {
      uint32_t len = strlen (name);
---- a/src/glsl/linker.cpp	2015-12-27 23:31:13.000000000 -0800
-+++ b/src/glsl/linker.cpp	2015-12-27 23:34:01.000000000 -0800
-@@ -81,6 +81,23 @@
- #include "main/shaderobj.h"
- #include "main/enums.h"
- 
-+#undef strndup
-+#define strndup __linker_strndup
-+static char *
-+strndup(const char *str, size_t n)
-+{
-+    size_t len;
-+    char *copy;
-+
-+    for (len = 0; len < n && str[len]; len++)
-+            continue;
-+
-+    if ((copy = (char *)malloc(len + 1)) == NULL)
-+            return (NULL);
-+    memcpy(copy, str, len);
-+    copy[len] = '\0';
-+    return (copy);
-+}
- 
- void linker_error(gl_shader_program *, const char *, ...);
- 
-
 --- a/src/util/ralloc.c      2015-12-28 00:25:30.000000000 -0800
 +++ b/src/util/ralloc.c   2015-12-28 00:26:50.000000000 -0800
 @@ -353,17 +353,17 @@ ralloc_strdup(const void *ctx, const cha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20160508/6fe7eb74/attachment.html>


More information about the macports-changes mailing list