[crux-commits] ports/compat-32 (3.5): freeglut-32: gcc10 fix

crux at crux.nu crux at crux.nu
Wed Aug 5 12:35:49 UTC 2020


commit 02c7df47757a14083be0f7b7dc787c6771ebe1a2
Author: Danny Rawlins <monster.romster at gmail.com>
Date:   Wed Aug 5 22:31:37 2020 +1000

    freeglut-32: gcc10 fix

diff --git a/freeglut-32/.signature b/freeglut-32/.signature
index 2e57d44..40e5b74 100644
--- a/freeglut-32/.signature
+++ b/freeglut-32/.signature
@@ -1,5 +1,6 @@
 untrusted comment: verify with /etc/ports/compat-32.pub
-RWSwxGo/zH7eXZkEz4vwghDjg0orp6Zy4cz7sBnz1K2r+ciaQEw6leb6RfgHjoCkV3Hpf+8WNmMpu0ADhSTVyJgLv1n/Rr94RwU=
-SHA256 (Pkgfile) = aba22e575861e53f44d4184ee1e04fc87042eefc9978175582998009d5b4a089
+RWSwxGo/zH7eXUj7EVc966VHDCur28nWr29EZ7m1aZHQHhwbNMhzlKcS9StmFwbXdf2zNSseOk7I34giBLgIbudPYl4HN1GYrAY=
+SHA256 (Pkgfile) = f019cb99d9fced5f4e707839205da4d47a2b3859d59b792c239307990b5975a2
 SHA256 (.footprint) = 86a5d0ab594286e1a5375ce12648f711c52f1a4d9807a02c8b4936e1563a4e8b
 SHA256 (freeglut-3.2.1.tar.gz) = d4000e02102acaf259998c870e25214739d1f16f67f99cb35e4f46841399da68
+SHA256 (gcc10.patch) = ce2d11ffbffda1872dde5d50198fa5de961c22716e29fb1715648b7b818222c5
diff --git a/freeglut-32/Pkgfile b/freeglut-32/Pkgfile
index 13e3afa..b6aa907 100644
--- a/freeglut-32/Pkgfile
+++ b/freeglut-32/Pkgfile
@@ -5,22 +5,20 @@
 
 name=freeglut-32
 version=3.2.1
-release=1
-source=(https://downloads.sourceforge.net/project/freeglut/freeglut/$version/freeglut-$version.tar.gz)
+release=2
+source=(https://downloads.sourceforge.net/project/freeglut/freeglut/$version/freeglut-$version.tar.gz
+	gcc10.patch)
 
 build() {
-	cd freeglut-$version
+	patch -d freeglut-$version -p1 -i $SRC/gcc10.patch
 
-	install -d build
-	cd build
-
-	cmake .. \
+	cmake -Sfreeglut-$version -Bbuild -GNinja \
 		-DCMAKE_INSTALL_PREFIX=/usr \
 		-DCMAKE_INSTALL_LIBDIR=lib32 \
 		-DCMAKE_BUILD_TYPE=Release
 
-	make
-	make DESTDIR=$PKG install
+	cmake --build build
+	DESTDIR=$PKG cmake --install build
 
 	ln -s glut.pc $PKG/usr/lib32/pkgconfig/freeglut.pc
 
diff --git a/freeglut-32/gcc10.patch b/freeglut-32/gcc10.patch
new file mode 100644
index 0000000..cb85ee1
--- /dev/null
+++ b/freeglut-32/gcc10.patch
@@ -0,0 +1,48 @@
+diff -urN freeglut-3.2.1.orig/src/fg_gl2.c freeglut-3.2.1/src/fg_gl2.c
+--- freeglut-3.2.1.orig/src/fg_gl2.c	2014-06-01 04:24:47.000000000 -0500
++++ freeglut-3.2.1/src/fg_gl2.c	2020-08-04 19:54:14.348875031 -0500
+@@ -27,6 +27,20 @@
+ #include "fg_internal.h"
+ #include "fg_gl2.h"
+ 
++#ifndef GL_ES_VERSION_2_0
++/* GLES2 has the corresponding entry points built-in, and these fgh-prefixed
++ * names are defined in fg_gl2.h header to reference them, for any other case,
++ * define them as function pointers here.
++ */
++FGH_PFNGLGENBUFFERSPROC fghGenBuffers;
++FGH_PFNGLDELETEBUFFERSPROC fghDeleteBuffers;
++FGH_PFNGLBINDBUFFERPROC fghBindBuffer;
++FGH_PFNGLBUFFERDATAPROC fghBufferData;
++FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC fghEnableVertexAttribArray;
++FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC fghDisableVertexAttribArray;
++FGH_PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer;
++#endif
++
+ void FGAPIENTRY glutSetVertexAttribCoord3(GLint attrib) {
+   if (fgStructure.CurrentWindow != NULL)
+     fgStructure.CurrentWindow->Window.attribute_v_coord = attrib;
+diff -urN freeglut-3.2.1.orig/src/fg_gl2.h freeglut-3.2.1/src/fg_gl2.h
+--- freeglut-3.2.1.orig/src/fg_gl2.h	2012-04-21 13:22:24.000000000 -0500
++++ freeglut-3.2.1/src/fg_gl2.h	2020-08-04 19:54:17.075914225 -0500
+@@ -67,13 +67,13 @@
+ typedef void (APIENTRY *FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint);
+ typedef void (APIENTRY *FGH_PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
+ 
+-FGH_PFNGLGENBUFFERSPROC fghGenBuffers;
+-FGH_PFNGLDELETEBUFFERSPROC fghDeleteBuffers;
+-FGH_PFNGLBINDBUFFERPROC fghBindBuffer;
+-FGH_PFNGLBUFFERDATAPROC fghBufferData;
+-FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC fghEnableVertexAttribArray;
+-FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC fghDisableVertexAttribArray;
+-FGH_PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer;
++extern FGH_PFNGLGENBUFFERSPROC fghGenBuffers;
++extern FGH_PFNGLDELETEBUFFERSPROC fghDeleteBuffers;
++extern FGH_PFNGLBINDBUFFERPROC fghBindBuffer;
++extern FGH_PFNGLBUFFERDATAPROC fghBufferData;
++extern FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC fghEnableVertexAttribArray;
++extern FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC fghDisableVertexAttribArray;
++extern FGH_PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer;
+ 
+ #    endif
+ 


More information about the crux-commits mailing list