ports/xorg (3.5): libglvnd: patched for recent upstream gl/egl badness
commit 7b043851cede98f949abd6c3ea495d305eed744d Author: Matt Housh <jaeger@crux.ninja> Date: Mon Oct 28 13:45:31 2019 -0500 libglvnd: patched for recent upstream gl/egl badness diff --git a/libglvnd/.signature b/libglvnd/.signature index 6fc58b04..3a7fdd31 100644 --- a/libglvnd/.signature +++ b/libglvnd/.signature @@ -1,5 +1,7 @@ untrusted comment: verify with /etc/ports/xorg.pub -RWTSGWF5Q7TndDfCqR2FZ+EJ/DtkFceWmt46MWekpECCpkd0/8Gad/Sq0tqfyaVyd2YQgJw/wS789IuYn88jDwaqOiqhC9ltGAY= -SHA256 (Pkgfile) = 555f41f8d22be15b7c187bd35c5ede2af3b785361c77001b1291dcd26fca8213 +RWTSGWF5Q7TndLPAAeFwtMYJIBxy28nptWIzWvCTqQUVoeSHDDoqDQsXY7uz1LkglGp4OzwoktcTGEL3bJper0NeZRx4fADmIAc= +SHA256 (Pkgfile) = 41415263e2543a7045d4c14eb959a03ee11646a42979d32d22182eed4b82b3a8 SHA256 (.footprint) = 6e5412046d01e7bd766b15881b96a863720629161689e0da437fd80659888470 SHA256 (libglvnd-1.2.0.tar.gz) = 37981bd3320261f14140b8aef6e2e6c08c7e75b6a98dcea034670017f3f1312a +SHA256 (update-gl_h-to-match-mesa.patch) = 28b9f0a898702965a09ccee94c38901459571366ae214ce3dda6522edc02b098 +SHA256 (eglplatform.h) = 4573234a78a1f11841bc92f30b9ef62476d2f6937399be929420d8a79d5de423 diff --git a/libglvnd/Pkgfile b/libglvnd/Pkgfile index 1b7dfdbb..924f42f3 100644 --- a/libglvnd/Pkgfile +++ b/libglvnd/Pkgfile @@ -5,13 +5,21 @@ name=libglvnd version=1.2.0 -release=2 -source=(https://github.com/NVIDIA/$name/archive/v$version/$name-$version.tar.gz) +release=3 +source=(https://github.com/NVIDIA/$name/archive/v$version/$name-$version.tar.gz \ + update-gl_h-to-match-mesa.patch eglplatform.h) build() { cd $name-$version - ./autogen.sh + + # https://gitlab.freedesktop.org/glvnd/libglvnd/merge_requests/195 + patch -p1 -i $SRC/update-gl_h-to-match-mesa.patch + + autoreconf -if ./configure --prefix=/usr make make DESTDIR=$PKG install + + # replace EGL/eglplatform.h with the newer mesa version + install -m 0644 $SRC/eglplatform.h $PKG/usr/include/EGL/ } diff --git a/libglvnd/eglplatform.h b/libglvnd/eglplatform.h new file mode 100644 index 00000000..4876dbd4 --- /dev/null +++ b/libglvnd/eglplatform.h @@ -0,0 +1,174 @@ +#ifndef __eglplatform_h_ +#define __eglplatform_h_ + +/* +** Copyright (c) 2007-2016 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +/* Platform-specific types and definitions for egl.h + * $Revision: 30994 $ on $Date: 2015-04-30 13:36:48 -0700 (Thu, 30 Apr 2015) $ + * + * Adopters may modify khrplatform.h and this file to suit their platform. + * You are encouraged to submit all modifications to the Khronos group so that + * they can be included in future versions of this file. Please submit changes + * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla) + * by filing a bug against product "EGL" component "Registry". + */ + +#include <KHR/khrplatform.h> + +/* Macros used in EGL function prototype declarations. + * + * EGL functions should be prototyped as: + * + * EGLAPI return-type EGLAPIENTRY eglFunction(arguments); + * typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments); + * + * KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h + */ + +#ifndef EGLAPI +#define EGLAPI KHRONOS_APICALL +#endif + +#ifndef EGLAPIENTRY +#define EGLAPIENTRY KHRONOS_APIENTRY +#endif +#define EGLAPIENTRYP EGLAPIENTRY* + +/* The types NativeDisplayType, NativeWindowType, and NativePixmapType + * are aliases of window-system-dependent types, such as X Display * or + * Windows Device Context. They must be defined in platform-specific + * code below. The EGL-prefixed versions of Native*Type are the same + * types, renamed in EGL 1.3 so all types in the API start with "EGL". + * + * Khronos STRONGLY RECOMMENDS that you use the default definitions + * provided below, since these changes affect both binary and source + * portability of applications using EGL running on different EGL + * implementations. + */ + +#if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */ +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN 1 +#endif +#include <windows.h> + +typedef HDC EGLNativeDisplayType; +typedef HBITMAP EGLNativePixmapType; +typedef HWND EGLNativeWindowType; + +#elif defined(__EMSCRIPTEN__) + +typedef int EGLNativeDisplayType; +typedef int EGLNativePixmapType; +typedef int EGLNativeWindowType; + +#elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */ + +typedef int EGLNativeDisplayType; +typedef void *EGLNativePixmapType; +typedef void *EGLNativeWindowType; + +#elif defined(WL_EGL_PLATFORM) + +typedef struct wl_display *EGLNativeDisplayType; +typedef struct wl_egl_pixmap *EGLNativePixmapType; +typedef struct wl_egl_window *EGLNativeWindowType; + +#elif defined(__GBM__) + +typedef struct gbm_device *EGLNativeDisplayType; +typedef struct gbm_bo *EGLNativePixmapType; +typedef void *EGLNativeWindowType; + +#elif defined(__ANDROID__) || defined(ANDROID) + +struct ANativeWindow; +struct egl_native_pixmap_t; + +typedef void* EGLNativeDisplayType; +typedef struct egl_native_pixmap_t* EGLNativePixmapType; +typedef struct ANativeWindow* EGLNativeWindowType; + +#elif defined(USE_OZONE) + +typedef intptr_t EGLNativeDisplayType; +typedef intptr_t EGLNativePixmapType; +typedef intptr_t EGLNativeWindowType; + +#elif defined(__unix__) || defined(__APPLE__) + +#if defined(MESA_EGL_NO_X11_HEADERS) + +typedef void *EGLNativeDisplayType; +typedef khronos_uintptr_t EGLNativePixmapType; +typedef khronos_uintptr_t EGLNativeWindowType; + +#else + +/* X11 (tentative) */ +#include <X11/Xlib.h> +#include <X11/Xutil.h> + +typedef Display *EGLNativeDisplayType; +typedef Pixmap EGLNativePixmapType; +typedef Window EGLNativeWindowType; + +#endif /* MESA_EGL_NO_X11_HEADERS */ + +#elif defined(__HAIKU__) + +#include <kernel/image.h> + +typedef void *EGLNativeDisplayType; +typedef khronos_uintptr_t EGLNativePixmapType; +typedef khronos_uintptr_t EGLNativeWindowType; + +#else +#error "Platform not recognized" +#endif + +/* EGL 1.2 types, renamed for consistency in EGL 1.3 */ +typedef EGLNativeDisplayType NativeDisplayType; +typedef EGLNativePixmapType NativePixmapType; +typedef EGLNativeWindowType NativeWindowType; + + +/* Define EGLint. This must be a signed integral type large enough to contain + * all legal attribute names and values passed into and out of EGL, whether + * their type is boolean, bitmask, enumerant (symbolic constant), integer, + * handle, or other. While in general a 32-bit integer will suffice, if + * handles are 64 bit types, then EGLint should be defined as a signed 64-bit + * integer type. + */ +typedef khronos_int32_t EGLint; + + +/* C++ / C typecast macros for special EGL handle values */ +#if defined(__cplusplus) +#define EGL_CAST(type, value) (static_cast<type>(value)) +#else +#define EGL_CAST(type, value) ((type) (value)) +#endif + +#endif /* __eglplatform_h */ diff --git a/libglvnd/update-gl_h-to-match-mesa.patch b/libglvnd/update-gl_h-to-match-mesa.patch new file mode 100644 index 00000000..93936125 --- /dev/null +++ b/libglvnd/update-gl_h-to-match-mesa.patch @@ -0,0 +1,231 @@ +diff --git a/include/GL/gl.h b/include/GL/gl.h +index 3f8cb6259f73962079b893b238f7869d0227f5dd..2518dfbb40deeb26bf1389c115fa293dc13e07fa 100644 +--- a/include/GL/gl.h ++++ b/include/GL/gl.h +@@ -27,40 +27,24 @@ + #ifndef __gl_h_ + #define __gl_h_ + +-#if defined(USE_MGL_NAMESPACE) +-#include "gl_mangle.h" +-#endif +- +- + /********************************************************************** +- * Begin system-specific stuff. Do not do any of this when building +- * for SciTech SNAP, as this is all done before this header file is +- * included. ++ * Begin system-specific stuff. + */ +-#if !defined(__SCITECH_SNAP__) +- +-#if defined(__BEOS__) +-#include <stdlib.h> /* to get some BeOS-isms */ +-#endif +- +-#if !defined(OPENSTEP) && (defined(NeXT) || defined(NeXT_PDO)) +-#define OPENSTEP +-#endif + + #if defined(_WIN32) && !defined(__WIN32__) && !defined(__CYGWIN__) + #define __WIN32__ + #endif + +-#if !defined(OPENSTEP) && (defined(__WIN32__) && !defined(__CYGWIN__)) ++#if defined(__WIN32__) && !defined(__CYGWIN__) + # if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */ + # define GLAPI __declspec(dllexport) + # elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) /* tag specifying we're building for DLL runtime support */ + # define GLAPI __declspec(dllimport) + # else /* for use with static link lib build of Win32 edition only */ + # define GLAPI extern +-# endif /* _STATIC_MESA support */ ++# endif + # if defined(__MINGW32__) && defined(GL_NO_STDCALL) || defined(UNDER_CE) /* The generated DLLs by MingW with STDCALL are not compatible with the ones done by Microsoft's compilers */ +-# define GLAPIENTRY ++# define GLAPIENTRY + # else + # define GLAPIENTRY __stdcall + # endif +@@ -72,10 +56,6 @@ + # define GLAPIENTRY + #endif /* WIN32 && !CYGWIN */ + +-#if (defined(__BEOS__) && defined(__POWERPC__)) || defined(__QUICKDRAW__) +-# define PRAGMA_EXPORT_SUPPORTED 1 +-#endif +- + /* + * WINDOWS: Include windows.h here to define APIENTRY. + * It is also useful when applications include this file by +@@ -91,10 +71,6 @@ + #include <windows.h> + #endif + +-#if defined(macintosh) && PRAGMA_IMPORT_SUPPORTED +-#pragma import on +-#endif +- + #ifndef GLAPI + #define GLAPI extern + #endif +@@ -116,15 +92,6 @@ + #define GLAPIENTRYP GLAPIENTRY * + #endif + +-#ifdef CENTERLINE_CLPP +-#define signed +-#endif +- +-#if defined(PRAGMA_EXPORT_SUPPORTED) +-#pragma export on +-#endif +- +-#endif /* !__SCITECH_SNAP__ */ + /* + * End system-specific stuff. + **********************************************************************/ +@@ -718,7 +685,7 @@ typedef double GLclampd; /* double precision float in [0,1] */ + #define GL_LIST_BIT 0x00020000 + #define GL_TEXTURE_BIT 0x00040000 + #define GL_SCISSOR_BIT 0x00080000 +-#define GL_ALL_ATTRIB_BITS 0x000FFFFF ++#define GL_ALL_ATTRIB_BITS 0xFFFFFFFF + + + /* OpenGL 1.1 */ +@@ -1738,6 +1705,7 @@ GLAPI void GLAPIENTRY glGetSeparableFilter( GLenum target, GLenum format, + + + ++ + /* + * OpenGL 1.3 + */ +@@ -2085,26 +2053,6 @@ typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLsh + + + +-#if GL_ARB_shader_objects +- +-#ifndef GL_MESA_shader_debug +-#define GL_MESA_shader_debug 1 +- +-#define GL_DEBUG_OBJECT_MESA 0x8759 +-#define GL_DEBUG_PRINT_MESA 0x875A +-#define GL_DEBUG_ASSERT_MESA 0x875B +- +-GLAPI GLhandleARB GLAPIENTRY glCreateDebugObjectMESA (void); +-GLAPI void GLAPIENTRY glClearDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType); +-GLAPI void GLAPIENTRY glGetDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType, GLsizei maxLength, +- GLsizei *length, GLcharARB *debugLog); +-GLAPI GLsizei GLAPIENTRY glGetDebugLogLengthMESA (GLhandleARB obj, GLenum logType, GLenum shaderType); +- +-#endif /* GL_MESA_shader_debug */ +- +-#endif /* GL_ARB_shader_objects */ +- +- + /* + * ???. GL_MESA_packed_depth_stencil + * XXX obsolete +@@ -2121,60 +2069,6 @@ GLAPI GLsizei GLAPIENTRY glGetDebugLogLengthMESA (GLhandleARB obj, GLenum logTyp + #endif /* GL_MESA_packed_depth_stencil */ + + +-#ifndef GL_MESA_program_debug +-#define GL_MESA_program_debug 1 +- +-#define GL_FRAGMENT_PROGRAM_POSITION_MESA 0x8bb0 +-#define GL_FRAGMENT_PROGRAM_CALLBACK_MESA 0x8bb1 +-#define GL_FRAGMENT_PROGRAM_CALLBACK_FUNC_MESA 0x8bb2 +-#define GL_FRAGMENT_PROGRAM_CALLBACK_DATA_MESA 0x8bb3 +-#define GL_VERTEX_PROGRAM_POSITION_MESA 0x8bb4 +-#define GL_VERTEX_PROGRAM_CALLBACK_MESA 0x8bb5 +-#define GL_VERTEX_PROGRAM_CALLBACK_FUNC_MESA 0x8bb6 +-#define GL_VERTEX_PROGRAM_CALLBACK_DATA_MESA 0x8bb7 +- +-typedef void (*GLprogramcallbackMESA)(GLenum target, GLvoid *data); +- +-GLAPI void GLAPIENTRY glProgramCallbackMESA(GLenum target, GLprogramcallbackMESA callback, GLvoid *data); +- +-GLAPI void GLAPIENTRY glGetProgramRegisterfvMESA(GLenum target, GLsizei len, const GLubyte *name, GLfloat *v); +- +-#endif /* GL_MESA_program_debug */ +- +- +-#ifndef GL_MESA_texture_array +-#define GL_MESA_texture_array 1 +- +-/* GL_MESA_texture_array uses the same enum values as GL_EXT_texture_array. +- */ +-#ifndef GL_EXT_texture_array +- +-#ifdef GL_GLEXT_PROTOTYPES +-GLAPI void APIENTRY glFramebufferTextureLayerEXT(GLenum target, +- GLenum attachment, GLuint texture, GLint level, GLint layer); +-#endif /* GL_GLEXT_PROTOTYPES */ +- +-#if 0 +-/* (temporarily) disabled because of collision with typedef in glext.h +- * that happens if apps include both gl.h and glext.h +- */ +-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, +- GLenum attachment, GLuint texture, GLint level, GLint layer); +-#endif +- +-#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18 +-#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 +-#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A +-#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B +-#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C +-#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D +-#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF +-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 +-#endif +- +-#endif +- +- + #ifndef GL_ATI_blend_equation_separate + #define GL_ATI_blend_equation_separate 1 + +@@ -2186,27 +2080,20 @@ typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLen + #endif /* GL_ATI_blend_equation_separate */ + + +-/** +- ** NOTE!!!!! If you add new functions to this file, or update +- ** glext.h be sure to regenerate the gl_mangle.h file. See comments +- ** in that file for details. +- **/ +- +- +- +-/********************************************************************** +- * Begin system-specific stuff +- */ +-#if defined(PRAGMA_EXPORT_SUPPORTED) +-#pragma export off ++/* GL_OES_EGL_image */ ++#if !defined(GL_OES_EGL_image) && !defined(GL_EXT_EGL_image_storage) ++typedef void* GLeglImageOES; + #endif + +-#if defined(macintosh) && PRAGMA_IMPORT_SUPPORTED +-#pragma import off ++#ifndef GL_OES_EGL_image ++#define GL_OES_EGL_image 1 ++#ifdef GL_GLEXT_PROTOTYPES ++GLAPI void APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image); ++GLAPI void APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image); ++#endif ++typedef void (APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image); ++typedef void (APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image); + #endif +-/* +- * End system-specific stuff +- **********************************************************************/ + + + #ifdef __cplusplus
participants (1)
-
crux@crux.nu