diff options
author | Duck | 2020-04-10 17:12:10 +0400 |
---|---|---|
committer | Duck | 2020-04-10 17:12:10 +0400 |
commit | 08c91b2d16cbef7f4eb2607ecfea8a839fe986a5 (patch) | |
tree | 51ce7dbd603cc74178409047e4b0747b978fc68a | |
parent | e908312c78f23cafee88fe1faa9c749e42ad7eab (diff) | |
download | aur-08c91b2d16cbef7f4eb2607ecfea8a839fe986a5.tar.gz |
pkgrel 2
Slimplified the patch
Added eglew.h
Removed wglew.h
Changed dependencies
-rw-r--r-- | .SRCINFO | 11 | ||||
-rw-r--r-- | PKGBUILD | 9 | ||||
-rw-r--r-- | egl+glx.patch | 148 |
3 files changed, 93 insertions, 75 deletions
@@ -1,7 +1,7 @@ pkgbase = glew-egl-glx pkgdesc = The OpenGL Extension Wrangler Library pkgver = 2.1.0 - pkgrel = 1 + pkgrel = 2 url = http://glew.sourceforge.net arch = aarch64 arch = armv7h @@ -10,16 +10,17 @@ pkgbase = glew-egl-glx license = BSD license = MIT license = GPL - depends = libxmu - depends = libxi - depends = glu + depends = glibc + depends = libegl + depends = libgl + optdepends = libx11: for glxewinfo and visualinfo provides = glew conflicts = glew conflicts = glew-wayland source = https://downloads.sourceforge.net/glew/glew-2.1.0.tgz source = egl+glx.patch sha256sums = 04de91e7e6763039bc11940095cd9c7f880baba82196a7765f727ac05a993c95 - sha256sums = 73ad84f9e69fb5630fda13cd95f420f4c751ab9fbc3ea5b5aadd1184d27e0601 + sha256sums = 971b09095bd4335a1e2813c997f38f162c92b62821896312ee12a23ba2d1f6c2 pkgname = glew-egl-glx @@ -7,18 +7,19 @@ _pkgbase=glew pkgname=glew-egl-glx pkgver=2.1.0 -pkgrel=1 +pkgrel=2 pkgdesc="The OpenGL Extension Wrangler Library" arch=('aarch64' 'armv7h' 'pentium4' 'x86_64') url="http://glew.sourceforge.net" # no https available license=('BSD' 'MIT' 'GPL') -depends=('libxmu' 'libxi' 'glu') +depends=('glibc' 'libegl' 'libgl') +optdepends=('libx11: for glxewinfo and visualinfo') conflicts=('glew' 'glew-wayland') provides=('glew') source=(https://downloads.sourceforge.net/${_pkgbase}/${_pkgbase}-${pkgver}.tgz egl+glx.patch) sha256sums=('04de91e7e6763039bc11940095cd9c7f880baba82196a7765f727ac05a993c95' - '73ad84f9e69fb5630fda13cd95f420f4c751ab9fbc3ea5b5aadd1184d27e0601') + '971b09095bd4335a1e2813c997f38f162c92b62821896312ee12a23ba2d1f6c2') prepare() { cd ${_pkgbase}-${pkgver} @@ -42,6 +43,8 @@ package() { cd ${_pkgbase}-${pkgver} make GLEW_DEST="${pkgdir}/usr" STRIP= SYSTEM=linux-egl install install -D -m755 -t "${pkgdir}/usr/bin" bin/eglewinfo bin/glxewinfo bin/visualinfo + rm ${pkgdir}/usr/include/GL/wglew.h + install -m644 include/GL/eglew.h ${pkgdir}/usr/include/GL ln -s eglewinfo "${pkgdir}/usr/bin/glewinfo" install -D -m644 LICENSE.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" } diff --git a/egl+glx.patch b/egl+glx.patch index 11c44c5672ae..4ff99d1ed70a 100644 --- a/egl+glx.patch +++ b/egl+glx.patch @@ -1,12 +1,13 @@ --- a/src/glew.c +++ b/src/glew.c -@@ -36,11 +36,12 @@ +@@ -36,11 +36,13 @@ #include GLEW_INCLUDE #endif +#if defined(GLEW_EGL) +# include <GL/eglew.h> +#endif ++ #if defined(GLEW_OSMESA) # define GLAPI extern # include <GL/osmesa.h> @@ -15,34 +16,65 @@ #elif defined(_WIN32) /* * If NOGDI is defined, wingdi.h won't be included by windows.h, and thus -@@ -58,6 +59,17 @@ +@@ -57,8 +59,7 @@ + #include <stddef.h> /* For size_t */ - #if defined(GLEW_EGL) -+static GLboolean __EGL_available = GL_FALSE; -+static void (*__EGL_GLX_getProcAddress (const GLubyte *name)) (void) +-#if defined(GLEW_EGL) +-#elif defined(GLEW_REGAL) ++#if defined(GLEW_REGAL) + + /* In GLEW_REGAL mode we call direcly into the linked + libRegal.so glGetProcAddressREGAL for looking up +@@ -159,23 +160,37 @@ + * Define glewGetProcAddress. + */ + #if defined(GLEW_REGAL) +-# define glewGetProcAddress(name) regalGetProcAddress((const GLchar *)name) ++# define _glewGetProcAddress(name) regalGetProcAddress((const GLchar *)name) + #elif defined(GLEW_OSMESA) +-# define glewGetProcAddress(name) OSMesaGetProcAddress((const char *)name) +-#elif defined(GLEW_EGL) +-# define glewGetProcAddress(name) eglGetProcAddress((const char *)name) ++# define _glewGetProcAddress(name) OSMesaGetProcAddress((const char *)name) + #elif defined(_WIN32) +-# define glewGetProcAddress(name) wglGetProcAddress((LPCSTR)name) ++# define _glewGetProcAddress(name) wglGetProcAddress((LPCSTR)name) + #elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX) +-# define glewGetProcAddress(name) NSGLGetProcAddress(name) ++# define _glewGetProcAddress(name) NSGLGetProcAddress(name) + #elif defined(__sgi) || defined(__sun) || defined(__HAIKU__) +-# define glewGetProcAddress(name) dlGetProcAddress(name) ++# define _glewGetProcAddress(name) dlGetProcAddress(name) + #elif defined(__ANDROID__) +-# define glewGetProcAddress(name) NULL /* TODO */ ++# define _glewGetProcAddress(name) NULL /* TODO */ + #elif defined(__native_client__) +-# define glewGetProcAddress(name) NULL /* TODO */ ++# define _glewGetProcAddress(name) NULL /* TODO */ + #else /* __linux */ +-# define glewGetProcAddress(name) (*glXGetProcAddressARB)(name) ++# define _glewGetProcAddress(name) (*glXGetProcAddressARB)(name) ++#endif ++ ++#if defined(GLEW_EGL) ++static GLboolean _EGL_available = GL_FALSE; ++static void (*glewGetProcAddress (const GLubyte *name)) (void) +{ + void (*addr)(void); -+ if (__EGL_available == GL_TRUE) ++ if (_EGL_available) + { + addr = eglGetProcAddress((const char *)name); + if (addr) return addr; + } -+ return (*glXGetProcAddressARB)(name); ++ return _glewGetProcAddress(name); +} - #elif defined(GLEW_REGAL) ++#else ++# define glewGetProcAddress(name) _glewGetProcAddress(name) + #endif - /* In GLEW_REGAL mode we call direcly into the linked -@@ -163,7 +175,7 @@ - #elif defined(GLEW_OSMESA) - # define glewGetProcAddress(name) OSMesaGetProcAddress((const char *)name) - #elif defined(GLEW_EGL) --# define glewGetProcAddress(name) eglGetProcAddress((const char *)name) -+# define glewGetProcAddress(name) __EGL_GLX_getProcAddress(name) - #elif defined(_WIN32) - # define glewGetProcAddress(name) wglGetProcAddress((LPCSTR)name) - #elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX) -@@ -17358,9 +17370,7 @@ + /* +@@ -17358,9 +17373,7 @@ } @@ -53,16 +85,7 @@ PFNEGLCHOOSECONFIGPROC __eglewChooseConfig = NULL; PFNEGLCOPYBUFFERSPROC __eglewCopyBuffers = NULL; -@@ -18343,20 +18353,32 @@ - - GLenum eglewInit (EGLDisplay display) - { -+ GLuint dot; - EGLint major, minor; -+ const GLubyte* version; - const GLubyte* extStart; - const GLubyte* extEnd; - PFNEGLINITIALIZEPROC initialize = NULL; +@@ -18350,8 +18363,8 @@ PFNEGLQUERYSTRINGPROC queryString = NULL; /* Load necessary entry points */ @@ -73,45 +96,22 @@ if (!initialize || !queryString) return 1; - /* query EGK version */ -- if (initialize(display, &major, &minor) != EGL_TRUE) -+ if (display == EGL_NO_DISPLAY) -+ { -+ major = 0; -+ minor = 0; -+ version = (const GLubyte*) queryString(display, EGL_VERSION); -+ dot = _glewStrCLen(version, '.'); -+ if (dot == 0) return 1; -+ major = version[dot-1]-'0'; -+ minor = version[dot+1]-'0'; -+ } -+ else if (initialize(display, &major, &minor) != EGL_TRUE) - return 1; - - EGLEW_VERSION_1_5 = ( major > 1 ) || ( major == 1 && minor >= 5 ) ? GL_TRUE : GL_FALSE; -@@ -18804,6 +18826,10 @@ +@@ -18804,7 +18817,9 @@ return GLEW_OK; } -+#endif /* GLEW_EGL */ -+ -+#if defined(GLEW_OSMESA) +-#elif defined(_WIN32) ++#endif + - #elif defined(_WIN32) ++#if defined(_WIN32) PFNWGLSETSTEREOEMITTERSTATE3DLPROC __wglewSetStereoEmitterState3DL = NULL; -@@ -20862,13 +20888,22 @@ + +@@ -20862,13 +20877,26 @@ GLenum r; #if defined(GLEW_EGL) PFNEGLGETCURRENTDISPLAYPROC getCurrentDisplay = NULL; + EGLDisplay display; -+ getCurrentDisplay = (PFNEGLGETCURRENTDISPLAYPROC) eglGetProcAddress("eglGetCurrentDisplay"); -+ if (getCurrentDisplay) -+ { -+ display = getCurrentDisplay(); -+ if (display != EGL_NO_DISPLAY) __EGL_available = GL_TRUE; -+ } -+ else display = EGL_NO_DISPLAY; #endif r = glewContextInit(); if ( r != 0 ) return r; @@ -119,14 +119,34 @@ - getCurrentDisplay = (PFNEGLGETCURRENTDISPLAYPROC) glewGetProcAddress("eglGetCurrentDisplay"); - return eglewInit(getCurrentDisplay()); -#elif defined(GLEW_OSMESA) || defined(__ANDROID__) || defined(__native_client__) || defined(__HAIKU__) ++ getCurrentDisplay = (PFNEGLGETCURRENTDISPLAYPROC) eglGetProcAddress("eglGetCurrentDisplay"); ++ if (getCurrentDisplay) ++ display = getCurrentDisplay(); ++ else ++ display = EGL_NO_DISPLAY; + if (display != EGL_NO_DISPLAY) -+ return eglewInit(display); ++ { ++ r = eglewInit(display); ++ if ( r == 0 ) { ++ _EGL_available = GL_TRUE; ++ return r; ++ } ++ } +#endif +#if defined(GLEW_OSMESA) || defined(__ANDROID__) || defined(__native_client__) || defined(__HAIKU__) return r; #elif defined(_WIN32) return wglewInit(); -@@ -27059,7 +27094,7 @@ +@@ -26623,7 +26651,7 @@ + return ret; + } + +-#if defined(_WIN32) && !defined(GLEW_EGL) && !defined(GLEW_OSMESA) ++#if defined(_WIN32) && !defined(GLEW_OSMESA) + + GLboolean GLEWAPIENTRY wglewIsSupported (const char* name) + { +@@ -27059,7 +27087,7 @@ return ret; } @@ -135,7 +155,7 @@ GLboolean glxewIsSupported (const char* name) { -@@ -27615,7 +27650,9 @@ +@@ -27615,7 +27643,9 @@ return ret; } @@ -146,9 +166,3 @@ GLboolean eglewIsSupported (const char* name) { -@@ -28578,4 +28615,4 @@ - return ret; - } - --#endif /* _WIN32 */ -+#endif /* GLEW_EGL */ |