new package: glew
Requested in https://github.com/termux/x11-packages/issues/159.
This commit is contained in:
parent
8a7d1c755a
commit
54e310eac0
58
x11-packages/glew/Makefile.patch
Normal file
58
x11-packages/glew/Makefile.patch
Normal file
@ -0,0 +1,58 @@
|
||||
diff -uNr glew-2.1.0/config/Makefile.linux glew-2.1.0.mod/config/Makefile.linux
|
||||
--- glew-2.1.0/config/Makefile.linux 2017-07-31 14:25:39.000000000 +0300
|
||||
+++ glew-2.1.0.mod/config/Makefile.linux 2020-02-11 14:53:57.262285563 +0200
|
||||
@@ -1,27 +1,15 @@
|
||||
NAME = $(GLEW_NAME)
|
||||
-CC = cc
|
||||
-LD = cc
|
||||
-M_ARCH ?= $(shell uname -m)
|
||||
-ARCH64 = false
|
||||
-ifeq (x86_64,${M_ARCH})
|
||||
- ARCH64 = true
|
||||
-endif
|
||||
-ifeq (ppc64,${M_ARCH})
|
||||
- ARCH64 = true
|
||||
-endif
|
||||
-ifeq (${ARCH64},true)
|
||||
- LDFLAGS.EXTRA = -L/usr/X11R6/lib64 -L/usr/lib64
|
||||
- LIBDIR = $(GLEW_DEST)/lib64
|
||||
-else
|
||||
- LDFLAGS.EXTRA = -L/usr/X11R6/lib -L/usr/lib
|
||||
- LIBDIR = $(GLEW_DEST)/lib
|
||||
-endif
|
||||
+CC ?= cc
|
||||
+LD ?= cc
|
||||
+LIBDIR = $(GLEW_DEST)/lib
|
||||
+LDFLAGS.EXTRA = -L@TERMUX_PREFIX@/lib
|
||||
LDFLAGS.GL = -lGL -lX11
|
||||
LDFLAGS.STATIC = -Wl,-Bstatic
|
||||
LDFLAGS.DYNAMIC = -Wl,-Bdynamic
|
||||
NAME = GLEW
|
||||
WARN = -Wall -W
|
||||
POPT = -O2
|
||||
+CFLAGS.EXTRA += -I@TERMUX_PREFIX@/include
|
||||
CFLAGS.EXTRA += -fPIC
|
||||
CFLAGS.EXTRA += -Wcast-qual
|
||||
CFLAGS.EXTRA += -ansi -pedantic
|
||||
diff -uNr glew-2.1.0/Makefile glew-2.1.0.mod/Makefile
|
||||
--- glew-2.1.0/Makefile 2017-07-31 14:25:39.000000000 +0300
|
||||
+++ glew-2.1.0.mod/Makefile 2020-02-11 15:43:30.396814451 +0200
|
||||
@@ -40,12 +40,12 @@
|
||||
$(error "Platform '$(SYSTEM)' not supported")
|
||||
endif
|
||||
|
||||
-GLEW_PREFIX ?= /usr
|
||||
-GLEW_DEST ?= /usr
|
||||
-BINDIR ?= $(GLEW_DEST)/bin
|
||||
-LIBDIR ?= $(GLEW_DEST)/lib
|
||||
-INCDIR ?= $(GLEW_DEST)/include/GL
|
||||
-PKGDIR ?= $(GLEW_DEST)/lib/pkgconfig
|
||||
+GLEW_PREFIX = @TERMUX_PREFIX@
|
||||
+GLEW_DEST = @TERMUX_PREFIX@
|
||||
+BINDIR = $(GLEW_DEST)/bin
|
||||
+LIBDIR = $(GLEW_DEST)/lib
|
||||
+INCDIR = $(GLEW_DEST)/include/GL
|
||||
+PKGDIR = $(GLEW_DEST)/lib/pkgconfig
|
||||
|
||||
ifneq ($(GLEW_NO_GLU), -DGLEW_NO_GLU)
|
||||
LIBGLU = glu
|
13
x11-packages/glew/build.sh
Normal file
13
x11-packages/glew/build.sh
Normal file
@ -0,0 +1,13 @@
|
||||
TERMUX_PKG_HOMEPAGE=http://glew.sourceforge.net/
|
||||
TERMUX_PKG_DESCRIPTION="The OpenGL Extension Wrangler Library"
|
||||
TERMUX_PKG_LICENSE="BSD, GPL-2.0, MIT"
|
||||
TERMUX_PKG_MAINTAINER="Leonid Plyushch <leonid.plyushch@gmail.com>"
|
||||
TERMUX_PKG_VERSION=2.1.0
|
||||
TERMUX_PKG_SRCURL=https://downloads.sourceforge.net/glew/glew-${TERMUX_PKG_VERSION}.tgz
|
||||
TERMUX_PKG_SHA256=04de91e7e6763039bc11940095cd9c7f880baba82196a7765f727ac05a993c95
|
||||
TERMUX_PKG_DEPENDS="glu, libxi, libxmu"
|
||||
TERMUX_PKG_BUILD_IN_SRC=true
|
||||
|
||||
termux_step_pre_configure() {
|
||||
LD=$CC
|
||||
}
|
123
x11-packages/glew/termux-glew-support.patch
Normal file
123
x11-packages/glew/termux-glew-support.patch
Normal file
@ -0,0 +1,123 @@
|
||||
diff -uNr glew-2.1.0/auto/Makefile glew-2.1.0.mod/auto/Makefile
|
||||
--- glew-2.1.0/auto/Makefile 2017-07-31 14:25:39.000000000 +0300
|
||||
+++ glew-2.1.0.mod/auto/Makefile 2019-10-15 15:43:41.598890328 +0300
|
||||
@@ -240,7 +240,7 @@
|
||||
cat $(SRC)/glew_init_wgl.c >> $@
|
||||
$(BIN)/make_list.pl $(WGL_EXT_SPEC) >> $@
|
||||
echo -e "\n return GLEW_OK;\n}" >> $@;
|
||||
- echo -e "\n#elif !defined(__ANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX))" >> $@
|
||||
+ echo -e "\n#elif !defined(__NOANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX))" >> $@
|
||||
$(BIN)/make_def_fun.pl GLX $(GLX_CORE_SPEC) >> $@
|
||||
$(BIN)/make_def_fun.pl GLX $(GLX_EXT_SPEC) >> $@
|
||||
echo -e "\nGLboolean __GLXEW_VERSION_1_0 = GL_FALSE;" >> $@
|
||||
@@ -253,7 +253,7 @@
|
||||
$(BIN)/make_list.pl $(CORE)/GLX_VERSION_1_3 | grep -v '\"GLX_VERSION' >> $@
|
||||
$(BIN)/make_list.pl $(GLX_EXT_SPEC) >> $@
|
||||
echo -e "\n return GLEW_OK;\n}" >> $@
|
||||
- echo -e "\n#endif /* !defined(__ANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) */\n" >> $@;
|
||||
+ echo -e "\n#endif /* !defined(__NOANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) */\n" >> $@;
|
||||
cat $(SRC)/glew_init_tail.c >> $@
|
||||
cat $(SRC)/glew_str_head.c >> $@
|
||||
$(BIN)/make_str.pl $(GL_CORE_SPEC) $(GL_EXT_SPEC) >> $@
|
||||
diff -uNr glew-2.1.0/auto/src/glew_head.c glew-2.1.0.mod/auto/src/glew_head.c
|
||||
--- glew-2.1.0/auto/src/glew_head.c 2017-07-31 14:25:39.000000000 +0300
|
||||
+++ glew-2.1.0.mod/auto/src/glew_head.c 2019-10-15 15:44:04.328890312 +0300
|
||||
@@ -19,7 +19,7 @@
|
||||
# undef NOGDI
|
||||
# endif
|
||||
# include <GL/wglew.h>
|
||||
-#elif !defined(__ANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX))
|
||||
+#elif !defined(__NOANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX))
|
||||
# include <GL/glxew.h>
|
||||
#endif
|
||||
|
||||
@@ -138,7 +138,7 @@
|
||||
# define glewGetProcAddress(name) NSGLGetProcAddress(name)
|
||||
#elif defined(__sgi) || defined(__sun) || defined(__HAIKU__)
|
||||
# define glewGetProcAddress(name) dlGetProcAddress(name)
|
||||
-#elif defined(__ANDROID__)
|
||||
+#elif defined(__NOANDROID__)
|
||||
# define glewGetProcAddress(name) NULL /* TODO */
|
||||
#elif defined(__native_client__)
|
||||
# define glewGetProcAddress(name) NULL /* TODO */
|
||||
diff -uNr glew-2.1.0/auto/src/glew_init_tail.c glew-2.1.0.mod/auto/src/glew_init_tail.c
|
||||
--- glew-2.1.0/auto/src/glew_init_tail.c 2017-07-31 14:25:39.000000000 +0300
|
||||
+++ glew-2.1.0.mod/auto/src/glew_init_tail.c 2019-10-15 15:43:48.048890323 +0300
|
||||
@@ -43,7 +43,7 @@
|
||||
#if defined(GLEW_EGL)
|
||||
getCurrentDisplay = (PFNEGLGETCURRENTDISPLAYPROC) glewGetProcAddress("eglGetCurrentDisplay");
|
||||
return eglewInit(getCurrentDisplay());
|
||||
-#elif defined(GLEW_OSMESA) || defined(__ANDROID__) || defined(__native_client__) || defined(__HAIKU__)
|
||||
+#elif defined(GLEW_OSMESA) || defined(__NOANDROID__) || defined(__native_client__) || defined(__HAIKU__)
|
||||
return r;
|
||||
#elif defined(_WIN32)
|
||||
return wglewInit();
|
||||
diff -uNr glew-2.1.0/auto/src/glew_str_glx.c glew-2.1.0.mod/auto/src/glew_str_glx.c
|
||||
--- glew-2.1.0/auto/src/glew_str_glx.c 2017-07-31 14:25:39.000000000 +0300
|
||||
+++ glew-2.1.0.mod/auto/src/glew_str_glx.c 2019-10-15 15:43:59.418890315 +0300
|
||||
@@ -4,7 +4,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(GLEW_EGL) && !defined(__NOANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
|
||||
|
||||
GLboolean glxewIsSupported (const char* name)
|
||||
{
|
||||
diff -uNr glew-2.1.0/src/glew.c glew-2.1.0.mod/src/glew.c
|
||||
--- glew-2.1.0/src/glew.c 2017-07-31 14:25:39.000000000 +0300
|
||||
+++ glew-2.1.0.mod/src/glew.c 2019-10-15 15:43:53.658890319 +0300
|
||||
@@ -51,7 +51,7 @@
|
||||
# undef NOGDI
|
||||
# endif
|
||||
# include <GL/wglew.h>
|
||||
-#elif !defined(__ANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX))
|
||||
+#elif !defined(__NOANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX))
|
||||
# include <GL/glxew.h>
|
||||
#endif
|
||||
|
||||
@@ -170,7 +170,7 @@
|
||||
# define glewGetProcAddress(name) NSGLGetProcAddress(name)
|
||||
#elif defined(__sgi) || defined(__sun) || defined(__HAIKU__)
|
||||
# define glewGetProcAddress(name) dlGetProcAddress(name)
|
||||
-#elif defined(__ANDROID__)
|
||||
+#elif defined(__NOANDROID__)
|
||||
# define glewGetProcAddress(name) NULL /* TODO */
|
||||
#elif defined(__native_client__)
|
||||
# define glewGetProcAddress(name) NULL /* TODO */
|
||||
@@ -19746,7 +19746,7 @@
|
||||
return GLEW_OK;
|
||||
}
|
||||
|
||||
-#elif !defined(__ANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX))
|
||||
+#elif !defined(__NOANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX))
|
||||
|
||||
PFNGLXGETCURRENTDISPLAYPROC __glewXGetCurrentDisplay = NULL;
|
||||
|
||||
@@ -20821,7 +20821,7 @@
|
||||
return GLEW_OK;
|
||||
}
|
||||
|
||||
-#endif /* !defined(__ANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) */
|
||||
+#endif /* !defined(__NOANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) */
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
|
||||
@@ -20868,7 +20868,7 @@
|
||||
#if defined(GLEW_EGL)
|
||||
getCurrentDisplay = (PFNEGLGETCURRENTDISPLAYPROC) glewGetProcAddress("eglGetCurrentDisplay");
|
||||
return eglewInit(getCurrentDisplay());
|
||||
-#elif defined(GLEW_OSMESA) || defined(__ANDROID__) || defined(__native_client__) || defined(__HAIKU__)
|
||||
+#elif defined(GLEW_OSMESA) || defined(__NOANDROID__) || defined(__native_client__) || defined(__HAIKU__)
|
||||
return r;
|
||||
#elif defined(_WIN32)
|
||||
return wglewInit();
|
||||
@@ -27059,7 +27059,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(GLEW_EGL) && !defined(__NOANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
|
||||
|
||||
GLboolean glxewIsSupported (const char* name)
|
||||
{
|
Loading…
Reference in New Issue
Block a user