glew: adopted port
This commit is contained in:
parent
586ccf2175
commit
45bc2b4ceb
@ -1,4 +1,9 @@
|
|||||||
drwxr-xr-x root/root usr/
|
drwxr-xr-x root/root usr/
|
||||||
|
drwxr-xr-x root/root usr/bin/
|
||||||
|
-rwxr-xr-x root/root usr/bin/eglewinfo
|
||||||
|
lrwxrwxrwx root/root usr/bin/glewinfo -> eglewinfo
|
||||||
|
-rwxr-xr-x root/root usr/bin/glxewinfo
|
||||||
|
-rwxr-xr-x root/root usr/bin/visualinfo
|
||||||
drwxr-xr-x root/root usr/include/
|
drwxr-xr-x root/root usr/include/
|
||||||
drwxr-xr-x root/root usr/include/GL/
|
drwxr-xr-x root/root usr/include/GL/
|
||||||
-rw-r--r-- root/root usr/include/GL/eglew.h
|
-rw-r--r-- root/root usr/include/GL/eglew.h
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
untrusted comment: verify with /etc/ports/opt.pub
|
untrusted comment: verify with /etc/ports/opt.pub
|
||||||
RWSE3ohX2g5d/ViosHH30uJ1dvVgQeS/tCkkZwA/eBFwl1zJ0/1nXeY80nzwrARxpQrtSPpGlTPbxvIa3iN2N4lK3kNr20R8jg8=
|
RWSE3ohX2g5d/cUEHNXhdlsxwuGXtdZoL1AiGB+CDa0ThI+chOzGHvz8bB4e0rNp67f0XvPzkjIcBGFaQrfCp9NDCXjbvl3J+ww=
|
||||||
SHA256 (Pkgfile) = d4d899b30576111d53906541e3d04ab9308cd9f05ff764b0ab2a39905c293057
|
SHA256 (Pkgfile) = ca25772c454c94184903a28d07729c0926ce8b83e10626ec4e3c1db9cbbb3f57
|
||||||
SHA256 (.footprint) = 884b372da479ce249878cf9f3fba7e3010d0b8034e2f51892d9d7e6b966aac5d
|
SHA256 (.footprint) = f84dafc4922c20d92d86662e4ff1ebed914861b7c53f6af128c3cc140f2061cd
|
||||||
SHA256 (glew-2.2.0.tgz) = d4fc82893cfb00109578d0a1a2337fb8ca335b3ceccf97b97e5cc7f08e4353e1
|
SHA256 (glew-2.2.0.tgz) = d4fc82893cfb00109578d0a1a2337fb8ca335b3ceccf97b97e5cc7f08e4353e1
|
||||||
SHA256 (glew-2.0.0-install-headers.patch) = 07633aadfb3ab0bd5470671b74bc4c8770965b817e2dd194d8fc0fde58b88e7c
|
SHA256 (egl+glx.patch) = 206dc53e185aa2bd64b21107dcaafccb3207a8185ccd1c02a87ed9783c25cc61
|
||||||
|
SHA256 (glew-install.patch) = ef864c1e673f6a8fab4d3f5bc3c3eb9596cd225c24765de9dff2064e72f350d5
|
||||||
|
46
glew/Pkgfile
46
glew/Pkgfile
@ -1,27 +1,43 @@
|
|||||||
# Description: The OpenGL Extension Wrangler Library.
|
# Description: The OpenGL Extension Wrangler Library
|
||||||
# URL: https://glew.sourceforge.net
|
# URL: https://glew.sourceforge.net
|
||||||
# Maintainer: Danny Rawlins, crux at romster dot me
|
# Maintainer: Tim Biermann, tbier at posteo dot de
|
||||||
# Depends on: mesa xorg-libxi xorg-libxmu
|
# Depends on: glu xorg-libxi xorg-libxmu
|
||||||
|
|
||||||
name=glew
|
name=glew
|
||||||
version=2.2.0
|
version=2.2.0
|
||||||
release=1
|
release=2
|
||||||
source=(https://downloads.sourceforge.net/project/$name/$name/$version/$name-$version.tgz
|
source=(https://downloads.sourceforge.net/project/$name/$name/$version/$name-$version.tgz
|
||||||
glew-2.0.0-install-headers.patch)
|
egl+glx.patch
|
||||||
|
glew-install.patch)
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
cd $name-$version
|
cd $name-$version
|
||||||
|
|
||||||
patch -p1 -i $SRC/glew-2.0.0-install-headers.patch
|
patch -Np1 -i $SRC/glew-install.patch
|
||||||
|
patch -Np1 -i $SRC/egl+glx.patch
|
||||||
|
|
||||||
sed -i -e "s|lib64|lib|" config/Makefile.linux
|
sed -i -e "s|lib64|lib|" config/Makefile.linux
|
||||||
sed -i -e '/^.PHONY: .*\.pc$/d' -i Makefile
|
sed -i -e '/^.PHONY: .*\.pc$/d' -i Makefile
|
||||||
|
|
||||||
make \
|
make \
|
||||||
CC="${CC:-gcc}" \
|
CC="${CC:-gcc}" \
|
||||||
LD="${CC:-gcc}" \
|
LD="${CC:-gcc}" \
|
||||||
CFLAGS.EXTRA="$CFLAGS -fPIC" \
|
CFLAGS.EXTRA="$CFLAGS -fPIC" \
|
||||||
LDFLAGS.EXTRA="$LDFLAGS"
|
LDFLAGS.EXTRA="$LDFLAGS" \
|
||||||
|
STRIP= \
|
||||||
|
glew.bin
|
||||||
|
|
||||||
make GLEW_DEST="$PKG/usr" install
|
mv bin/glewinfo bin/glxewinfo
|
||||||
|
rm glew.pc
|
||||||
|
|
||||||
|
make SYSTEM=linux-egl \
|
||||||
|
STRIP= \
|
||||||
|
glew.lib.shared bin/glewinfo
|
||||||
|
|
||||||
|
mv bin/glewinfo bin/eglewinfo
|
||||||
|
|
||||||
|
make GLEW_DEST=$PKG/usr STRIP= \
|
||||||
|
SYSTEM=linux-egl install
|
||||||
|
install -D -m755 -t $PKG/usr/bin bin/eglewinfo bin/glxewinfo bin/visualinfo
|
||||||
|
ln -s eglewinfo $PKG/usr/bin/glewinfo
|
||||||
}
|
}
|
||||||
|
168
glew/egl+glx.patch
Normal file
168
glew/egl+glx.patch
Normal file
@ -0,0 +1,168 @@
|
|||||||
|
--- a/src/glew.c
|
||||||
|
+++ b/src/glew.c
|
||||||
|
@@ -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>
|
||||||
|
-#elif defined(GLEW_EGL)
|
||||||
|
-# include <GL/eglew.h>
|
||||||
|
#elif defined(_WIN32)
|
||||||
|
/*
|
||||||
|
* If NOGDI is defined, wingdi.h won't be included by windows.h, and thus
|
||||||
|
@@ -57,8 +59,7 @@
|
||||||
|
|
||||||
|
#include <stddef.h> /* For size_t */
|
||||||
|
|
||||||
|
-#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)
|
||||||
|
+ {
|
||||||
|
+ addr = eglGetProcAddress((const char *)name);
|
||||||
|
+ if (addr) return addr;
|
||||||
|
+ }
|
||||||
|
+ return _glewGetProcAddress(name);
|
||||||
|
+}
|
||||||
|
+#else
|
||||||
|
+# define glewGetProcAddress(name) _glewGetProcAddress(name)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
@@ -19297,9 +19312,7 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
-#if defined(GLEW_OSMESA)
|
||||||
|
-
|
||||||
|
-#elif defined(GLEW_EGL)
|
||||||
|
+#if defined(GLEW_EGL)
|
||||||
|
|
||||||
|
PFNEGLCHOOSECONFIGPROC __eglewChooseConfig = NULL;
|
||||||
|
PFNEGLCOPYBUFFERSPROC __eglewCopyBuffers = NULL;
|
||||||
|
@@ -20490,8 +20503,8 @@
|
||||||
|
PFNEGLQUERYSTRINGPROC queryString = NULL;
|
||||||
|
|
||||||
|
/* Load necessary entry points */
|
||||||
|
- initialize = (PFNEGLINITIALIZEPROC) glewGetProcAddress("eglInitialize");
|
||||||
|
- queryString = (PFNEGLQUERYSTRINGPROC) glewGetProcAddress("eglQueryString");
|
||||||
|
+ initialize = (PFNEGLINITIALIZEPROC) eglGetProcAddress("eglInitialize");
|
||||||
|
+ queryString = (PFNEGLQUERYSTRINGPROC) eglGetProcAddress("eglQueryString");
|
||||||
|
if (!initialize || !queryString)
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
@@ -21029,7 +21042,9 @@
|
||||||
|
return GLEW_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
-#elif defined(_WIN32)
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
+#if defined(_WIN32)
|
||||||
|
|
||||||
|
PFNWGLSETSTEREOEMITTERSTATE3DLPROC __wglewSetStereoEmitterState3DL = NULL;
|
||||||
|
|
||||||
|
@@ -23105,13 +23120,26 @@
|
||||||
|
GLenum r;
|
||||||
|
#if defined(GLEW_EGL)
|
||||||
|
PFNEGLGETCURRENTDISPLAYPROC getCurrentDisplay = NULL;
|
||||||
|
+ EGLDisplay display;
|
||||||
|
#endif
|
||||||
|
r = glewContextInit();
|
||||||
|
if ( r != 0 ) return r;
|
||||||
|
#if defined(GLEW_EGL)
|
||||||
|
- 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)
|
||||||
|
+ {
|
||||||
|
+ 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();
|
||||||
|
@@ -29785,7 +29813,7 @@
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
-#if defined(_WIN32) && !defined(GLEW_EGL) && !defined(GLEW_OSMESA)
|
||||||
|
+#if defined(_WIN32) && !defined(GLEW_OSMESA)
|
||||||
|
|
||||||
|
GLboolean GLEWAPIENTRY wglewIsSupported (const char* name)
|
||||||
|
{
|
||||||
|
@@ -30228,7 +30256,7 @@
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
-#elif !defined(GLEW_OSMESA) && !defined(GLEW_EGL) && !defined(__ANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
|
||||||
|
+#elif !defined(GLEW_OSMESA) && !defined(__ANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
|
||||||
|
|
||||||
|
GLboolean glxewIsSupported (const char* name)
|
||||||
|
{
|
||||||
|
@@ -30805,7 +30833,9 @@
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
-#elif defined(GLEW_EGL)
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
+#if defined(GLEW_EGL)
|
||||||
|
|
||||||
|
GLboolean eglewIsSupported (const char* name)
|
||||||
|
{
|
@ -1,13 +0,0 @@
|
|||||||
--- glew-2.0.0/Makefile
|
|
||||||
+++ glew-2.0.0/Makefile
|
|
||||||
@@ -226,9 +226,7 @@
|
|
||||||
|
|
||||||
install.include:
|
|
||||||
$(INSTALL) -d -m 0755 "$(DESTDIR)$(INCDIR)"
|
|
||||||
- $(INSTALL) -m 0644 include/GL/wglew.h "$(DESTDIR)$(INCDIR)/"
|
|
||||||
- $(INSTALL) -m 0644 include/GL/glew.h "$(DESTDIR)$(INCDIR)/"
|
|
||||||
- $(INSTALL) -m 0644 include/GL/glxew.h "$(DESTDIR)$(INCDIR)/"
|
|
||||||
+ $(INSTALL) -m 0644 include/GL/*.h "$(DESTDIR)$(INCDIR)/"
|
|
||||||
|
|
||||||
install.pkgconfig: glew.pc
|
|
||||||
$(INSTALL) -d -m 0755 "$(DESTDIR)$(PKGDIR)"
|
|
73
glew/glew-install.patch
Normal file
73
glew/glew-install.patch
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
--- glew-2.2.0/Makefile 2020-03-15 12:53:59.000000000 +0100
|
||||||
|
+++ glew-2.2.0/Makefile 2020-04-17 11:51:25.568482195 +0200
|
||||||
|
@@ -120,7 +120,7 @@
|
||||||
|
endif
|
||||||
|
|
||||||
|
$(LIB.SHARED.DIR)/$(LIB.SHARED): $(LIB.SOBJS)
|
||||||
|
- $(LD) $(LDFLAGS.SO) -o $@ $^ $(LIB.LDFLAGS) $(LIB.LIBS)
|
||||||
|
+ $(LD) $(LDFLAGS.SO) $(LDFLAGS) -o $@ $^ $(LIB.LDFLAGS) $(LIB.LIBS)
|
||||||
|
ifneq ($(LN),)
|
||||||
|
$(LN) $(LIB.SHARED) $(LIB.SHARED.DIR)/$(LIB.SONAME)
|
||||||
|
$(LN) $(LIB.SHARED) $(LIB.SHARED.DIR)/$(LIB.DEVLNK)
|
||||||
|
@@ -131,11 +131,11 @@
|
||||||
|
|
||||||
|
tmp/$(SYSTEM)/default/static/glew.o: src/glew.c include/GL/glew.h include/GL/wglew.h include/GL/glxew.h
|
||||||
|
@mkdir -p $(dir $@)
|
||||||
|
- $(CC) -DGLEW_NO_GLU -DGLEW_STATIC $(CFLAGS) $(CFLAGS.SO) -o $@ -c $<
|
||||||
|
+ $(CC) -DGLEW_NO_GLU -DGLEW_STATIC $(CFLAGS) $(CFLAGS.SO) $(LDFLAGS) -o $@ -c $<
|
||||||
|
|
||||||
|
tmp/$(SYSTEM)/default/shared/glew.o: src/glew.c include/GL/glew.h include/GL/wglew.h include/GL/glxew.h
|
||||||
|
@mkdir -p $(dir $@)
|
||||||
|
- $(CC) -DGLEW_NO_GLU -DGLEW_BUILD $(CFLAGS) $(CFLAGS.SO) -o $@ -c $<
|
||||||
|
+ $(CC) -DGLEW_NO_GLU -DGLEW_BUILD $(CFLAGS) $(CFLAGS.SO) $(LDFLAGS) -o $@ -c $<
|
||||||
|
|
||||||
|
# Force re-write of glew.pc, GLEW_DEST can vary
|
||||||
|
|
||||||
|
@@ -180,13 +180,13 @@
|
||||||
|
mkdir bin
|
||||||
|
|
||||||
|
bin/$(GLEWINFO.BIN): $(GLEWINFO.BIN.OBJ) $(LIB.SHARED.DIR)/$(LIB.SHARED)
|
||||||
|
- $(CC) $(CFLAGS) -o $@ $(GLEWINFO.BIN.OBJ) $(BIN.LIBS)
|
||||||
|
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(GLEWINFO.BIN.OBJ) $(BIN.LIBS)
|
||||||
|
ifneq ($(STRIP),)
|
||||||
|
$(STRIP) -x $@
|
||||||
|
endif
|
||||||
|
|
||||||
|
bin/$(VISUALINFO.BIN): $(VISUALINFO.BIN.OBJ) $(LIB.SHARED.DIR)/$(LIB.SHARED)
|
||||||
|
- $(CC) $(CFLAGS) -o $@ $(VISUALINFO.BIN.OBJ) $(BIN.LIBS)
|
||||||
|
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(VISUALINFO.BIN.OBJ) $(BIN.LIBS)
|
||||||
|
ifneq ($(STRIP),)
|
||||||
|
$(STRIP) -x $@
|
||||||
|
endif
|
||||||
|
@@ -193,11 +193,11 @@
|
||||||
|
|
||||||
|
$(GLEWINFO.BIN.OBJ): $(GLEWINFO.BIN.SRC) include/GL/glew.h include/GL/wglew.h include/GL/glxew.h
|
||||||
|
@mkdir -p $(dir $@)
|
||||||
|
- $(CC) -DGLEW_NO_GLU $(CFLAGS) $(CFLAGS.SO) -o $@ -c $<
|
||||||
|
+ $(CC) -DGLEW_NO_GLU $(CFLAGS) $(CFLAGS.SO) $(LDFLAGS) -o $@ -c $<
|
||||||
|
|
||||||
|
$(VISUALINFO.BIN.OBJ): $(VISUALINFO.BIN.SRC) include/GL/glew.h include/GL/wglew.h include/GL/glxew.h
|
||||||
|
@mkdir -p $(dir $@)
|
||||||
|
- $(CC) -DGLEW_NO_GLU $(CFLAGS) $(CFLAGS.SO) -o $@ -c $<
|
||||||
|
+ $(CC) -DGLEW_NO_GLU $(CFLAGS) $(CFLAGS.SO) $(LDFLAGS) -o $@ -c $<
|
||||||
|
|
||||||
|
# Install targets
|
||||||
|
|
||||||
|
--- glew-2.1.0/Makefile.install 2018-08-15 13:51:45.220637107 +0200
|
||||||
|
+++ glew-2.1.0/Makefile 2018-08-15 13:52:02.168740876 +0200
|
||||||
|
@@ -231,6 +231,7 @@ install.bin: glew.bin
|
||||||
|
|
||||||
|
install.include:
|
||||||
|
$(INSTALL) -d -m 0755 "$(DESTDIR)$(INCDIR)"
|
||||||
|
+ $(INSTALL) -m 0644 include/GL/eglew.h "$(DESTDIR)$(INCDIR)/"
|
||||||
|
$(INSTALL) -m 0644 include/GL/wglew.h "$(DESTDIR)$(INCDIR)/"
|
||||||
|
$(INSTALL) -m 0644 include/GL/glew.h "$(DESTDIR)$(INCDIR)/"
|
||||||
|
$(INSTALL) -m 0644 include/GL/glxew.h "$(DESTDIR)$(INCDIR)/"
|
||||||
|
@@ -241,6 +242,7 @@ install.pkgconfig: glew.pc
|
||||||
|
$(INSTALL) -m 0644 glew.pc "$(DESTDIR)$(PKGDIR)/"
|
||||||
|
|
||||||
|
uninstall:
|
||||||
|
+ $(RM) "$(DESTDIR)$(INCDIR)/eglew.h"
|
||||||
|
$(RM) "$(DESTDIR)$(INCDIR)/wglew.h"
|
||||||
|
$(RM) "$(DESTDIR)$(INCDIR)/glew.h"
|
||||||
|
$(RM) "$(DESTDIR)$(INCDIR)/glxew.h"
|
Loading…
x
Reference in New Issue
Block a user